AIX Open Source

 View Only
  • 1.  PyInstaller does not include a pre-compiled bootloader for your platform on Aix system.

    Posted Fri March 31, 2023 07:51 AM

    Hello Team,

    I am facing this issue while running the pyinstaller command or run  ./setup.py command.
    But still not resolved, I also refereed this document. 
    - How to Install PyInstaller - PyInstaller 5.9.0 documentation

    # /usr/opt/python3/bin/pyinstaller --onefile  data_collector_utility.py

    1014 INFO: PyInstaller: 5.8.0
    1014 INFO: Python: 3.9.14
    1143 INFO: Platform: AIX-3-00F9B5A84C00-powerpc-64bit
    1147 INFO: wrote /Himani/data_collector_utility.spec
    1211 INFO: UPX is not available.
    1216 INFO: Extending PYTHONPATH with paths
    ['/Himani']
    2374 INFO: checking Analysis
    2390 INFO: checking PYZ
    2397 INFO: checking PKG
    2401 INFO: Bootloader /usr/opt/python3/lib/python3.9/site-packages/PyInstaller/bootloader/AIX-64bit/run
    2401 INFO: checking EXE
    2401 INFO: Building EXE because EXE-00.toc is non existent
    2401 INFO: Building EXE from EXE-00.toc
    Fatal error: PyInstaller does not include a pre-compiled bootloader for your
    platform. For more details and instructions how to build the bootloader see
    <https://pyinstaller.readthedocs.io/en/stable/bootloader-building.html>

    when we referred this document which mentioned above and tried to build the bootloader ,
    we are facing this issue -

    #python3 ./setup.py build

    running build
    running build_bootloader
    No precompiled bootloader found. Trying to compile it for you ...
    Setting top to                           : /Package_DC/PyInstallerCustom-3.5/bootloader
    Setting out to                           : /Package_DC/PyInstallerCustom-3.5/bootloader/build
    Python Version                           : 3.9.14 (main, Nov 29 2022, 06:17:15) [IBM XL C/C++ for AIX 13.1.3.7]
    Checking for 'xlc' (C compiler)          : /opt/IBM/xlC/16.1.0/bin/xlc_r
    Checking size of pointer                 : 8
    Platform                                 : AIX-64bit detected based on compiler
    Checking for compiler flags -q64         : yes
    Checking for linker flags -q64           : yes
    Checking for library dl                  : yes
    Checking for library m                   : yes
    Checking for library z                   : yes
    Checking for function unsetenv           : yes
    Checking for function mkdtemp            : yes
    Checking for function dirname            : yes
    Checking for function basename           : yes
    Checking for function strndup            : yes
    Checking for function strnlen            : yes
    Checking for program '/opt/IBM/xlC/16.1.0/bin/xlc_r' : /opt/IBM/xlC/16.1.0/bin/xlc_r
    Checking for program 'strip'                         : /opt/IBM/xlC/16.1.0/bin/xlc_r
    'configure' finished successfully (2.513s)
    'all' finished successfully (0.000s)
    'distclean' finished successfully (0.012s)
    Setting top to                           : /Package_DC/PyInstallerCustom-3.5/bootloader
    Setting out to                           : /Package_DC/PyInstallerCustom-3.5/bootloader/build
    Python Version                           : 3.9.14 (main, Nov 29 2022, 06:17:15) [IBM XL C/C++ for AIX 13.1.3.7]
    Checking for 'xlc' (C compiler)          : /opt/IBM/xlC/16.1.0/bin/xlc_r
    Checking size of pointer                 : 8
    Platform                                 : AIX-64bit detected based on compiler
    Checking for compiler flags -q64         : yes
    Checking for linker flags -q64           : yes
    Checking for library dl                  : yes
    Checking for library m                   : yes
    Checking for library z                   : yes
    Checking for function unsetenv           : yes
    Checking for function mkdtemp            : yes
    Checking for function dirname            : yes
    Checking for function basename           : yes
    Checking for function strndup            : yes
    Checking for function strnlen            : yes
    Checking for program '/opt/IBM/xlC/16.1.0/bin/xlc_r' : /opt/IBM/xlC/16.1.0/bin/xlc_r
    Checking for program 'strip'                         : /opt/IBM/xlC/16.1.0/bin/xlc_r
    'configure' finished successfully (1.983s)
    'make_all' finished successfully (0.009s)
    Waf: Entering directory `/Package_DC/PyInstallerCustom-3.5/bootloader/build/debug'
    [ 1/13] Compiling src/pyi_python.c
    [ 2/13] Compiling src/pyi_global.c
    [ 3/13] Compiling src/pyi_archive.c
    [ 4/13] Compiling src/pyi_python27_compat.c
    [ 5/13] Compiling src/pyi_pythonlib.c
    [ 6/13] Compiling src/pyi_win32_utils.c
    [ 7/13] Compiling src/pyi_path.c
    [ 8/13] Compiling src/pyi_main.c
    [ 9/13] Compiling src/pyi_launch.c
    [10/13] Compiling src/main.c
    [11/13] Compiling src/pyi_utils.c
    "../../src/pyi_win32_utils.c", line 574.21: 1506-356 (W) Compilation unit is empty.
     
    "../../src/pyi_archive.c", line 102.14: 1506-275 (S) Unexpected text zstream encountered.
    "../../src/pyi_archive.c", line 102.5: 1506-045 (S) Undeclared identifier z_stream.
    "../../src/pyi_archive.c", line 113.5: 1506-045 (S) Undeclared identifier zstream.
    "../../src/pyi_archive.c", line 123.34: 1506-045 (S) Undeclared identifier Z_FINISH.
     
    Waf: Leaving directory `/Package_DC/PyInstallerCustom-3.5/bootloader/build/debug'
    Build failed
     -> task in 'run_d' failed with exit status 1 (run with -v to display more information)
    ERROR: Failed compiling the bootloader. Please compile manually and rerun setup.py

    I also tried to build the bootloader with the help of this command -

    (127) root @ curve5: /Package_DC/PyInstallerCustom-3.5/bootloader
    # python3 ./waf configure all CC="xlc"
    Setting top to                           : /Package_DC/PyInstallerCustom-3.5/bootloader
    Setting out to                           : /Package_DC/PyInstallerCustom-3.5/bootloader/build
    Python Version                           : 3.9.14 (main, Nov 29 2022, 06:17:15) [IBM XL C/C++ for AIX 13.1.3.7]
    Checking for 'xlc' (C compiler)          : xlc
    Checking size of pointer                 : 8
    Platform                                 : AIX-64bit detected based on compiler
    Checking for compiler flags -q64         : yes
    Checking for linker flags -q64           : yes
    Checking for library dl                  : yes
    Checking for library m                   : yes
    Checking for library z                   : yes
    Checking for function unsetenv           : yes
    Checking for function mkdtemp            : yes
    Checking for function dirname            : yes
    Checking for function basename           : yes
    Checking for function strndup            : yes
    Checking for function strnlen            : yes
    Checking for program 'xlc'               : /opt/IBM/xlC/16.1.0/bin/xlc
    Checking for program 'strip'             : /opt/IBM/xlC/16.1.0/bin/xlc
    'configure' finished successfully (3.185s)
    'all' finished successfully (0.000s)
    'distclean' finished successfully (0.015s)
    Setting top to                           : /Package_DC/PyInstallerCustom-3.5/bootloader
    Setting out to                           : /Package_DC/PyInstallerCustom-3.5/bootloader/build
    Python Version                           : 3.9.14 (main, Nov 29 2022, 06:17:15) [IBM XL C/C++ for AIX 13.1.3.7]
    Checking for 'xlc' (C compiler)          : xlc
    Checking size of pointer                 : 8
    Platform                                 : AIX-64bit detected based on compiler
    Checking for compiler flags -q64         : yes
    Checking for linker flags -q64           : yes
    Checking for library dl                  : yes
    Checking for library m                   : yes
    Checking for library z                   : yes
    Checking for function unsetenv           : yes
    Checking for function mkdtemp            : yes
    Checking for function dirname            : yes
    Checking for function basename           : yes
    Checking for function strndup            : yes
    Checking for function strnlen            : yes
    Checking for program 'xlc'               : /opt/IBM/xlC/16.1.0/bin/xlc
    Checking for program 'strip'             : /opt/IBM/xlC/16.1.0/bin/xlc
    'configure' finished successfully (3.130s)
    'make_all' finished successfully (0.015s)
    Waf: Entering directory `/Package_DC/PyInstallerCustom-3.5/bootloader/build/debug'
    [ 1/13] Compiling src/pyi_python.c
    [ 2/13] Compiling src/pyi_global.c
    [ 3/13] Compiling src/pyi_archive.c
    [ 4/13] Compiling src/pyi_python27_compat.c
    [ 5/13] Compiling src/pyi_win32_utils.c
    [ 6/13] Compiling src/pyi_path.c
    [ 7/13] Compiling src/pyi_main.c
    [ 8/13] Compiling src/pyi_launch.c
    [ 9/13] Compiling src/main.c
    [10/13] Compiling src/pyi_utils.c
    [11/13] Compiling src/pyi_pythonlib.c
    "../../src/pyi_win32_utils.c", line 574.21: 1506-356 (W) Compilation unit is empty.
     
    "../../src/pyi_archive.c", line 102.14: 1506-275 (S) Unexpected text zstream encountered.
    "../../src/pyi_archive.c", line 102.5: 1506-045 (S) Undeclared identifier z_stream.
    "../../src/pyi_archive.c", line 113.5: 1506-045 (S) Undeclared identifier zstream.
    "../../src/pyi_archive.c", line 123.34: 1506-045 (S) Undeclared identifier Z_FINISH.
     
    Waf: Leaving directory `/Package_DC/PyInstallerCustom-3.5/bootloader/build/debug'
    Build failed
     -> task in 'run_d' failed with exit status 1 (run with -v to display more information

    Please do the needful.

    Thankyou,





    ------------------------------
    Himani Gupta
    ------------------------------


  • 2.  RE: PyInstaller does not include a pre-compiled bootloader for your platform on Aix system.

    Posted Fri March 31, 2023 09:41 AM

    First of all one has to understand that lot of open source packages have dependency on other open source packages. AIX base OS has only limited number of open source packages. And these are customised as well for some different purposes. We recommend the users to use AIX Toolbox infra to install these kind of dependent packages.
    In this case, use Toolbox python3. (/opt/freeware/bin/python3)
    This pyinstaller package configure for AIX is not proper. So you need some hacks. 


    git clone https://github.com/pyinstaller/pyinstaller
    cd pyinstaller 
    Apply below changes.

    diff --git a/bootloader/wscript b/bootloader/wscript
    index ea74e6f1..0c0e8cbc 100644
    --- a/bootloader/wscript
    +++ b/bootloader/wscript
    @@ -850,7 +850,7 @@ def build(ctx):
             ctx.objects(source=ctx.path.ant_glob('zlib/*.c'), target='STATIC_ZLIB', includes='zlib')
     
         # By default strip final executables to make them smaller.
    -    features = 'strip'
    +    features = ''
         if is_msvc_target(ctx):
             # Do not strip bootloaders when using MSVC.
             features = ''

    then
    export OBJECT_MODE=64
    export CC="gcc -maix64"
    export PYINSTALLER_COMPILE_BOOTLOADER=1
    /opt/freeware/bin/python3 setup.py build  ( if it requires wheel , then you need to do python3 -m pip install wheel)
    /opt/freeware/bin/python3 -m pip install .



    ------------------------------
    Ayappan P
    ------------------------------



  • 3.  RE: PyInstaller does not include a pre-compiled bootloader for your platform on Aix system.

    Posted Tue April 11, 2023 06:31 AM

    Hello Team,

    Thankyou for reply.

    As suggested, I tried to install pyinstaller using git , but while trying , I came to know that git is also not installed on my AIX system. 
    with the help of dnf script , I installed git on my system then I followed the same steps which mentioned in earlier post -

    but still, I am facing the same issues-

    Cloning into 'pyinstaller'...
    remote: Enumerating objects: 58538, done.
    remote: Counting objects: 100% (162/162), done.
    remote: Compressing objects: 100% (103/103), done.
    remote: Total 58538 (delta 88), reused 98 (delta 59), pack-reused 58376
    Receiving objects: 100% (58538/58538), 54.94 MiB | 3.90 MiB/s, done.
    Resolving deltas: 100% (43529/43529), done.
     
    (0) root @ curve5: /
    # ls
    .InstallAnywhere             DpDomino                     dsminstr.log                 rat
    .SPOT                        Himani                       dsminstr.log.lock            ratJG
    .TTauthority                 IBM                          etc                          rem
    .Xauthority                  Package_DC                   ftp                          root
    .alias                       TT_DB                        gotInfo                      sbin
    .cache                       ]                            home                         setupIRAT
    .cpan                        _Crontab_Pm                  horatiu                      smit.log
    .dbxhist                     addom10                      how_to.build_net             smit.script
    .dt                          admin                        htx_build_net                smit.transaction
    .dtprofile                   aix64                        htx_syscfg                   svt1
    .exrc                        alpha.html                   image.data                   svt2
    .java                        apirat                       install.dir.29556992         tdp2017.cmd
    .kshhist                     audit                        install.dir.35127728         test
    .kshrc                       auto.bn                      irat                         test.py
    .profile                     automation                   javasharedresources          test.xml
    .profile~0~                  bin                          journaldbs                   testdata1
    .python_history              bosinst.data                 lib                          testdata2
    .rhosts                      bprof                        local_api                    testfsapi
    .rnd                         build                        logs                         tftpboot
    .sh_history                  build_net                    lost+found                   tmp
    .ssh                         build_net_config             lpars                        u
    .toc                         citScanOutput.xml            lpp                          unix
    .topasrecrc                  clean_net                    mircea                       unmap.pl
    .vi_history                  clean_page                   mnt                          usr
    .vnc                         copyopt                      opt                          var
    .xerrors                     data_collector_utility.spec  otherfs                      yum-aix.sh
    AIX73-yum.sh                 dev                          proc
    DPClinet8115                 dist                         pyinstaller
    DpClient                     downloads                    quit
     
    (0) root @ curve5: /
    # cd pyinstaller
     
    (0) root @ curve5: /pyinstaller
    # ls
    .dockerignore      .gitignore         COPYING.txt        bootloader         release
    .editorconfig      .pylintrc          MANIFEST.in        doc                scripts
    .git               .pyup.yml          PyInstaller        icons              setup.cfg
    .gitattributes     .readthedocs.yml   README.rst         news               setup.py
    .github            .yapfignore        alpine.dockerfile  pyproject.toml     tests

    Then , I also changed in wscipt file as mentioned above, then run the command - 
    (0) root @ curve5: /pyinstaller
    # /opt/freeware/bin/python3 setup.py build
    Error: Building wheels requires the 'wheel' package. Please `pip install wheel` then try again.
     
    (1) root @ curve5: /pyinstaller
    # python3 -m pip install wheel
    Requirement already satisfied: wheel in /usr/opt/python3/lib/python3.9/site-packages (0.40.0)
    WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behavior with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
     
    (0) root @ curve5: /pyinstaller
    # /opt/freeware/bin/python3 -m pip install .
    Processing /pyinstaller
      Installing build dependencies ... done
      Getting requirements to build wheel ... done
      Preparing metadata (pyproject.toml) ... done
    Collecting pyinstaller-hooks-contrib>=2021.4
      Downloading pyinstaller_hooks_contrib-2023.2-py2.py3-none-any.whl (261 kB)
         ---------------------------------------- 262.0/262.0 KB 2.7 MB/s eta 0:00:00
    Collecting importlib-metadata>=1.4
      Downloading importlib_metadata-6.3.0-py3-none-any.whl (22 kB)
    Collecting altgraph
      Using cached altgraph-0.17.3-py2.py3-none-any.whl (21 kB)
    Requirement already satisfied: setuptools>=42.0.0 in /opt/freeware/lib/python3.7/site-packages (from pyinstaller==5.9.0) (47.1.0)
    Collecting typing-extensions>=3.6.4
      Downloading typing_extensions-4.5.0-py3-none-any.whl (27 kB)
    Collecting zipp>=0.5
      Downloading zipp-3.15.0-py3-none-any.whl (6.8 kB)
    Building wheels for collected packages: pyinstaller
      Building wheel for pyinstaller (pyproject.toml) ... error
      error: subprocess-exited-with-error
     
      Building wheel for pyinstaller (pyproject.toml) did not run successfully.
      exit code: 1
     
      [13 lines of output]
      running bdist_wheel
      running build
      running build_bootloader
      Setting top to                           : /pyinstaller/bootloader
      Setting out to                           : /pyinstaller/bootloader/build
      Python Version                           : 3.7.15 (default, Dec 15 2022, 03:08:16) [GCC 8.3.0]
      Checking for 'xlc' (C compiler)          : not found
      Checking for 'gcc' (C compiler)          : not found
      Checking for 'clang' (C compiler)        : not found
      could not configure a C compiler!
      (complete log in /pyinstaller/bootloader/build/config.log)
      No precompiled bootloader found or compile forced. Trying to compile the bootloader for you ...
      ERROR: Failed compiling the bootloader. Please compile manually and rerun setup.py
      [end of output]
     
      note: This error originates from a subprocess, and is likely not a problem with pip.
      ERROR: Failed building wheel for pyinstaller
    Failed to build pyinstaller
    ERROR: Could not build wheels for pyinstaller, which is required to install pyproject.toml-based projects
    WARNING: You are using pip version 22.0.4; however, version 23.0.1 is available.
    You should consider upgrading via the '/opt/freeware/bin/python3 -m pip install --upgrade pip' command.

    Then , I again run this same command - 
    1) root @ curve5: /pyinstaller
    # /opt/freeware/bin/python3 -m pip install .
    Processing /pyinstaller
      Installing build dependencies ... done
      Getting requirements to build wheel ... done
      Preparing metadata (pyproject.toml) ... done
    Collecting pyinstaller-hooks-contrib>=2021.4
      Using cached pyinstaller_hooks_contrib-2023.2-py2.py3-none-any.whl (261 kB)
    Requirement already satisfied: setuptools>=42.0.0 in /opt/freeware/lib/python3.7/site-packages (from pyinstaller==5.9.0) (47.1.0)
    Collecting altgraph
      Using cached altgraph-0.17.3-py2.py3-none-any.whl (21 kB)
    Collecting importlib-metadata>=1.4
      Using cached importlib_metadata-6.3.0-py3-none-any.whl (22 kB)
    Collecting typing-extensions>=3.6.4
      Using cached typing_extensions-4.5.0-py3-none-any.whl (27 kB)
    Collecting zipp>=0.5
      Using cached zipp-3.15.0-py3-none-any.whl (6.8 kB)
    Building wheels for collected packages: pyinstaller
      Building wheel for pyinstaller (pyproject.toml) ... error
      error: subprocess-exited-with-error
     
      Building wheel for pyinstaller (pyproject.toml) did not run successfully.
      exit code: 1
     
      [19 lines of output]
      running bdist_wheel
      running build
      running build_bootloader
      Setting top to                           : /pyinstaller/bootloader
      Setting out to                           : /pyinstaller/bootloader/build
      Python Version                           : 3.7.15 (default, Dec 15 2022, 03:08:16) [GCC 8.3.0]
      Checking for 'xlc' (C compiler)          : /opt/IBM/xlC/16.1.0/bin/xlc_r
      Checking size of pointer                 : 4
      Platform                                 : AIX-32bit detected based on compiler
      Checking for compiler flags -q32         : yes
      Checking for linker flags -q32           : yes
      Checking for library dl                  : yes
      Checking for library pthread             : yes
      Checking for library m                   : yes
      Checking for library z                   : no
      The zlib development package is either missing or the shared library cannot be linked against. For security (and marginally better filesize), you should install the zlib-dev or zlib-devel packages with your system package manager, and try again. If you cannot do this (for example, distributions such as OpenWRT use sstrip on libraries, making linking impossible), then either use the --static-zlib option or set the PYI_STATIC_ZLIB=1 environment variable. If you are installing directly with pip, then use the environment variable.
      (complete log in /pyinstaller/bootloader/build/config.log)
      No precompiled bootloader found or compile forced. Trying to compile the bootloader for you ...
      ERROR: Failed compiling the bootloader. Please compile manually and rerun setup.py
      [end of output]
     
      note: This error originates from a subprocess, and is likely not a problem with pip.
      ERROR: Failed building wheel for pyinstaller
    Failed to build pyinstaller
    ERROR: Could not build wheels for pyinstaller, which is required to install pyproject.toml-based projects
     
    (1) root @ curve5: /pyinstaller
    # dnf install zlib
    Last metadata expiration check: 1 day, 0:13:46 ago on Mon Apr 10 03:02:20 CDT 2023.
    Package zlib-1.2.13-1.ppc is already installed.
    Dependencies resolved.
    Nothing to do.
    Complete!
     
    (0) root @ curve5: /pyinstaller
    # dnf install zlib-dev
    Last metadata expiration check: 1 day, 0:14:23 ago on Mon Apr 10 03:02:20 CDT 2023.
    No match for argument: zlib-dev
    Error: Unable to find a match: zlib-dev
     
    (1) root @ curve5: /pyinstaller
    # dnf install zlib-devel
    Last metadata expiration check: 1 day, 0:14:39 ago on Mon Apr 10 03:02:20 CDT 2023.
    Package zlib-devel-1.2.13-1.ppc is already installed.
    Dependencies resolved.
    Nothing to do.
    Complete!

    I also checked zlib and zlib-devel lib , but it is also installed on aix asystem.
    Please suggest, what i missed for this.

    Thankyou, 






    ------------------------------
    Himani Gupta
    ------------------------------



  • 4.  RE: PyInstaller does not include a pre-compiled bootloader for your platform on Aix system.

    Posted Tue April 11, 2023 07:00 AM

    Please make sure gcc rpm is installed and it is available in the PATH. Also export CC & other variables I mentioned earlier in the thread. Try to use gcc rather than xlc compiler. 



    ------------------------------
    Ayappan P
    ------------------------------