AIX Open Source

AIX Open Source

Share your experiences and connect with fellow developers to discover how to build and manage open source software for the AIX operating system

 View Only
  • 1.  Installing llvmlite package on AIX 7.2

    Posted Thu January 18, 2024 05:50 PM

    Hi Ranjit,

    I am trying to compile llvmlite package on AIX 7.2: I untar'ed it to a folder and run the following to install. I got following error (unsupported platform: 'aix'). Can you please help?
    export CC="gcc -maix64 -pthread"
    export CXX="g++ -maix64 -pthread"
    export OBJECT_MODE=64
    run 'python3 -m pip install . --root / -v'

    Thanks

    Mi

    Using pip 22.2.2 from /opt/freeware/lib/python3.9/site-packages/pip (python 3.9)
    Processing /usr/opt/sas/python3a/llvmlite-0.41.1
      Running command python setup.py egg_info
      running egg_info
      creating /tmp/pip-pip-egg-info-zz23t0jx/llvmlite.egg-info
      writing /tmp/pip-pip-egg-info-zz23t0jx/llvmlite.egg-info/PKG-INFO
      writing dependency_links to /tmp/pip-pip-egg-info-zz23t0jx/llvmlite.egg-info/dependency_links.txt
      writing top-level names to /tmp/pip-pip-egg-info-zz23t0jx/llvmlite.egg-info/top_level.txt
      writing manifest file '/tmp/pip-pip-egg-info-zz23t0jx/llvmlite.egg-info/SOURCES.txt'
      reading manifest file '/tmp/pip-pip-egg-info-zz23t0jx/llvmlite.egg-info/SOURCES.txt'
      adding license file 'LICENSE'
      writing manifest file '/tmp/pip-pip-egg-info-zz23t0jx/llvmlite.egg-info/SOURCES.txt'
      Preparing metadata (setup.py) ... done
    Building wheels for collected packages: llvmlite
      Running command python setup.py bdist_wheel
      running bdist_wheel
      /opt/freeware/bin/python3 /usr/opt/sas/python3a/llvmlite-0.41.1/ffi/build.py
      Traceback (most recent call last):
        File "/usr/opt/sas/python3a/llvmlite-0.41.1/ffi/build.py", line 228, in <module>
          main()
        File "/usr/opt/sas/python3a/llvmlite-0.41.1/ffi/build.py", line 224, in main
          raise RuntimeError("unsupported platform: %r" % (sys.platform,))
      RuntimeError: unsupported platform: 'aix'
      error: command '/opt/freeware/bin/python3' failed with exit code 1
      error: subprocess-exited-with-error

     

      × python setup.py bdist_wheel did not run successfully.
      │ exit code: 1
      ╰─> See above for output.

     

      note: This error originates from a subprocess, and is likely not a problem with pip.
      full command: /opt/freeware/bin/python3 -u -c '
      exec(compile('"'"''"'"''"'"'
      # This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
      #
      # - It imports setuptools before invoking setup.py, to enable projects that directly
      #   import from `distutils.core` to work with newer packaging standards.
      # - It provides a clear error message when setuptools is not installed.
      # - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so
      #   setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning:
      #     manifest_maker: standard file '"'"'-c'"'"' not found".
      # - It generates a shim setup.py, for handling setup.cfg-only projects.
      import os, sys, tokenize

     

      try:
          import setuptools
      except ImportError as error:
          print(
              "ERROR: Can not execute `setup.py` since setuptools is not available in "
              "the build environment.",
              file=sys.stderr,
          )
          sys.exit(1)

     

      __file__ = %r
      sys.argv[0] = __file__

     

      if os.path.exists(__file__):
          filename = __file__
          with tokenize.open(__file__) as f:
              setup_py_code = f.read()
      else:
          filename = "<auto-generated setuptools caller>"
          setup_py_code = "from setuptools import setup; setup()"

     

      exec(compile(setup_py_code, filename, "exec"))
      '"'"''"'"''"'"' % ('"'"'/usr/opt/sas/python3a/llvmlite-0.41.1/setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' bdist_wheel -d /tmp/pip-wheel-gtvrf49_
      cwd: /usr/opt/sas/python3a/llvmlite-0.41.1/
      Building wheel for llvmlite (setup.py) ... error
      ERROR: Failed building wheel for llvmlite
      Running setup.py clean for llvmlite
      Running command python setup.py clean
      running clean
      'build/lib.aix-7205-2345-64-cpython-39' does not exist -- can't clean it
      'build/bdist.aix-7205-2345-64' does not exist -- can't clean it
      'build/scripts-3.9' does not exist -- can't clean it
      removing '/usr/opt/sas/python3a/llvmlite-0.41.1/llvmlite/__pycache__' (and everything under it)
      removing '/usr/opt/sas/python3a/llvmlite-0.41.1/__pycache__' (and everything under it)
    Failed to build llvmlite
    Installing collected packages: llvmlite
      Running command Running setup.py install for llvmlite
      running install
      /opt/freeware/lib/python3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      got version from file /usr/opt/sas/python3a/llvmlite-0.41.1/llvmlite/_version.py {'version': '0.41.1', 'full': '42db9b74c8e8ca012cb4394cbf941f2f9e4ae12b'}
      running build_ext
      /opt/freeware/bin/python3 /usr/opt/sas/python3a/llvmlite-0.41.1/ffi/build.py
      Traceback (most recent call last):
        File "/usr/opt/sas/python3a/llvmlite-0.41.1/ffi/build.py", line 228, in <module>
          main()
        File "/usr/opt/sas/python3a/llvmlite-0.41.1/ffi/build.py", line 224, in main
          raise RuntimeError("unsupported platform: %r" % (sys.platform,))
      RuntimeError: unsupported platform: 'aix'
      error: command '/opt/freeware/bin/python3' failed with exit code 1
      error: subprocess-exited-with-error

     

      × Running setup.py install for llvmlite did not run successfully.
      │ exit code: 1
      ╰─> See above for output.

     

      note: This error originates from a subprocess, and is likely not a problem with pip.
      full command: /opt/freeware/bin/python3 -u -c '
      exec(compile('"'"''"'"''"'"'
      # This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
      #
      # - It imports setuptools before invoking setup.py, to enable projects that directly
      #   import from `distutils.core` to work with newer packaging standards.
      # - It provides a clear error message when setuptools is not installed.
      # - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so
      #   setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning:
      #     manifest_maker: standard file '"'"'-c'"'"' not found".
      # - It generates a shim setup.py, for handling setup.cfg-only projects.
      import os, sys, tokenize

     

      try:
          import setuptools
      except ImportError as error:
          print(
              "ERROR: Can not execute `setup.py` since setuptools is not available in "
              "the build environment.",
              file=sys.stderr,
          )
          sys.exit(1)

     

      __file__ = %r
      sys.argv[0] = __file__

     

      if os.path.exists(__file__):
          filename = __file__
          with tokenize.open(__file__) as f:
              setup_py_code = f.read()
      else:
          filename = "<auto-generated setuptools caller>"
          setup_py_code = "from setuptools import setup; setup()"

     

      exec(compile(setup_py_code, filename, "exec"))
      '"'"''"'"''"'"' % ('"'"'/usr/opt/sas/python3a/llvmlite-0.41.1/setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' install --record /tmp/pip-record-zs4l1fhp/install-record.txt --single-version-externally-managed --root / --compile --install-headers /opt/freeware/include/python3.9/llvmlite
      cwd: /usr/opt/sas/python3a/llvmlite-0.41.1/
      Running setup.py install for llvmlite ... error
    error: legacy-install-failure

     

    × Encountered error while trying to install package.
    ╰─> llvmlite

     

    note: This is an issue with the package mentioned above, not pip.
    hint: See above for output from the failure.
    WARNING: There was an error checking the latest version of pip.



    ------------------------------
    Mi Wang
    ------------------------------


  • 2.  RE: Installing llvmlite package on AIX 7.2

    Posted Fri January 19, 2024 07:39 AM

    Hi Wang,

    The above error (unsupported platform: 'aix') can be fixed using below change.
    But I guess , you will encounter next issue mentioned in previous discussion https://community.ibm.com/community/user/power/discussion/install-of-shade-package-llvmlite-package-llvmlite-package-aix-platfrom-error

    ---

    # diff -u ffi/build.py.orig ffi/build.py

    --- ffi/build.py.orig   2024-01-19 06:29:33.649498742 -0600

    +++ ffi/build.py        2024-01-19 06:30:11.517616589 -0600

    @@ -213,7 +213,7 @@

     def main():

         if sys.platform == 'win32':

             main_windows()

    -    elif sys.platform.startswith(('linux', 'gnu')):

    +    elif sys.platform.startswith(('linux', 'gnu', 'aix')):

             # Linux and GNU-based OSes (e.g. GNU/Hurd), using the same Makefile

             main_posix('linux', '.so')

         elif sys.platform.startswith(('freebsd','openbsd')):

     

    Thanks

    Ranjit



    ------------------------------
    Ranjit Ranjan
    ------------------------------



  • 3.  RE: Installing llvmlite package on AIX 7.2

    Posted Fri January 19, 2024 05:07 PM

    Hi Ranjit,

    I have following questions:

    1. If we install "clang+llvm-16.0.4-powerpc64-ibm-aix-7.2.tar" from LLVM official site, will it create the llvm-config file?
    2. We have install llvm-installer and it created following under /opt/freeware/lib/python3.9/site-package. Will this help the installation of llvmlite?
      llvm_installer:
      total 248
      -rw-r--r--    1 root     system            0 Sep 28 10:29 py.typed
      -rw-r--r--    1 root     system        11455 Sep 28 10:29 __init__.py
      -rw-r--r--    1 root     system         5477 Sep 28 10:29 __main__.py
      -rw-r--r--    1 root     system       104786 Sep 28 10:29 release_tags.json
      drwxr-xr-x    2 root     system          256 Sep 28 10:29 __pycache__
       
      llvm_installer-1.3.10.dist-info:
      total 72
      -rw-r--r--    1 root     system           15 Sep 28 10:29 top_level.txt
      -rw-r--r--    1 root     system           64 Sep 28 10:29 entry_points.txt
      -rw-r--r--    1 root     system           92 Sep 28 10:29 WHEEL
      -rw-r--r--    1 root     system         1274 Sep 28 10:29 METADATA
      -rw-r--r--    1 root     system        11358 Sep 28 10:29 LICENSE
      -rw-r--r--    1 root     system            4 Sep 28 10:29 INSTALLER
      -rw-r--r--    1 root     system            0 Sep 28 10:29 REQUESTED
      -rw-r--r--    1 root     system         1259 Sep 28 10:29 RECORD

      Thanks
      Mi


    ------------------------------
    Mi Wang
    ------------------------------



  • 4.  RE: Installing llvmlite package on AIX 7.2

    Posted Mon February 05, 2024 02:17 AM

    Hi Wang,

    I am looking into it and trying to build llvmlite.

    I will provide further update once I get more clarity . 

    Thanks

    Ranjit



    ------------------------------
    Ranjit Ranjan
    ------------------------------



  • 5.  RE: Installing llvmlite package on AIX 7.2

    Posted Thu March 14, 2024 02:25 PM

    Hi Ranjit,

    Package "clang+llvm-16.0.4-powerpc64-ibm-aix-7.2.tar" on LLVM official is specifically created for AIX 7.2 running on 64 bits PowerPC structure and should have all LVM modules like lvmconfig.exe. I am wondering if you can make use of that package to speed up the adoption of llvmlite to AIX?

    Thanks

    Mi



    ------------------------------
    Mi Wang
    ------------------------------



  • 6.  RE: Installing llvmlite package on AIX 7.2

    Posted Sat March 16, 2024 10:49 AM
    Edited by Ranjit Ranjan Sat March 16, 2024 10:49 AM

    HI Wang,

    As mentioned in https://github.com/numba/llvmlite , llvmlilte is having compatibility dependency with llvm 14.
    I had tried to compile llvm14 in AIX but I got stuck and got to know that llvm14 is required some more code change to support XCOFF object files.
    Right. now, me and team is busy with other activities., So this activity is in our bucket list , but not in high priority. 



    ------------------------------
    Ranjit Ranjan
    ------------------------------