python-ibmdb: Unable to install v3.1.0 on z/OS

Symptom

Installing v3.1.0 for Python 3 on z/OS fails during the build_ext step. 3.0.4 installs normally.

Logs

3.1.0

2022-01-03T18:40:16,224   running build_ext
2022-01-03T18:40:16,226   creating build/temp.os390-27.00-2964-3.8
2022-01-03T18:40:16,226   /bin/xlc -fno-strict-aliasing -DNDEBUG -O3 -qarch=10 -qlanglvl=extc99 -q64 -Wc,DLL -D_XOPEN_SOURCE_EXTENDED -D_UNIX03_THREADS -D_POSIX_THREADS -D_OPEN_SYS_FILE_EXT -qexportall -qascii -qstrict -qnocsect -Wa,asa,goff -Wa,xplink -qgonumber -qenum=int -I/STLABBA/tmp/pip-install-ht9lx9ow/ibm-db/sdsnc.h -I/u/kenohh1/ibm_db_venv/include -I/SVT/usr/lpp/python38/usr/lpp/IBM/cyp/v3r8/pyz/include/python3.8 -c ibm_db.c -o build/temp.os390-27.00-2964-3.8/ibm_db.o
2022-01-03T18:40:17,716   FSUM3212 xlc: Command option -fno-strict-aliasing is incorrect for z/OS platform - ignored.
2022-01-03T18:40:18,127   WARNING CCN3236 /usr/include/unistd.h:1169  Macro name _POSIX_THREADS has been redefined.
2022-01-03T18:40:20,588   /bin/xlc build/temp.os390-27.00-2964-3.8/ibm_db.o /STLABBA/tmp/pip-install-ht9lx9ow/ibm-db/libdsnao64c.x -L. -L/usr/lpp/IBM/cyp/v3r8/pyz/lib -o build/lib.os390-27.00-2964-3.8/ibm_db.so
2022-01-03T18:40:22,142    IEW2469E 9907 THE ATTRIBUTES OF A REFERENCE TO dlclose FROM SECTION $PRIV000010
2022-01-03T18:40:22,142             DO NOT MATCH THE ATTRIBUTES OF THE TARGET SYMBOL. REASON  2
2022-01-03T18:40:22,173    IEW2469E 9907 THE ATTRIBUTES OF A REFERENCE TO dlclose FROM SECTION $PRIV000010
2022-01-03T18:40:22,174             DO NOT MATCH THE ATTRIBUTES OF THE TARGET SYMBOL. REASON  2
...
2022-01-03T18:40:22,208    IEW2456E 9207 SYMBOL PyCapsule_Import UNRESOLVED.  MEMBER COULD NOT BE INCLUDED
2022-01-03T18:40:22,208             FROM THE DESIGNATED CALL LIBRARY.
2022-01-03T18:40:22,208    IEW2470E 9511 ORDERED SECTION CEESTART NOT FOUND IN MODULE.
2022-01-03T18:40:22,208    IEW2648E 5111 ENTRY CEESTART IS NOT A CSECT OR AN EXTERNAL NAME IN THE MODULE.
2022-01-03T18:40:22,209    IEW2689W 4C40 DEFINITION SIDE FILE IS NOT DEFINED.
2022-01-03T18:40:22,209   FSUM3065 The LINKEDIT step ended with return code 8.
2022-01-03T18:40:22,209   error: command '/bin/xlc' failed with exit code 3
2022-01-03T18:40:22,216   ERROR: Failed building wheel for ibm-db
2022-01-03T18:40:22,216 Failed to build ibm-db

3.0.4

2022-01-03T18:44:39,376     running build_ext
2022-01-03T18:44:39,378     building 'ibm_db' extension
2022-01-03T18:44:39,378     creating build/temp.os390-27.00-2964-3.8
2022-01-03T18:44:39,378     /bin/xlc -fno-strict-aliasing -DNDEBUG -O3 -qarch=10 -qlanglvl=extc99 -q64 -Wc,DLL -D_XOPEN_SOURCE_EXTENDED -D_UNIX03_THREADS -D_POSIX_THREADS -D_OPEN_SYS_FILE_EXT -qexportall -qascii -qstrict -qnocsect -Wa,asa,goff -Wa,xplink -qgonumber -qenum=int -I/STLABBA/tmp/pip-install-1jkwfkp1/ibm-db/sdsnc.h -I/u/kenohh1/ibm_db_venv/include -I/SVT/usr/lpp/python38/usr/lpp/IBM/cyp/v3r8/pyz/include/python3.8 -c ibm_db.c -o build/temp.os390-27.00-2964-3.8/ibm_db.o
2022-01-03T18:44:40,756     FSUM3212 xlc: Command option -fno-strict-aliasing is incorrect for z/OS platform - ignored.
2022-01-03T18:44:41,078     WARNING CCN3236 /usr/include/unistd.h:1169  Macro name _POSIX_THREADS has been redefined.
2022-01-03T18:44:43,284     /bin/xlc build/temp.os390-27.00-2964-3.8/ibm_db.o /STLABBA/tmp/pip-install-1jkwfkp1/ibm-db/libdsnao64c.x -L. -o build/lib.os390-27.00-2964-3.8/ibm_db.so -Wl,dll /SVT/usr/lpp/python38/usr/lpp/IBM/cyp/v3r8/pyz/lib/python3.8/config-3.8/libpython3.8.x -q64
2022-01-03T18:44:44,873     running install_lib
...
# Installs as normal

Info

Our python installation is at /SVT/usr/lpp/python38/usr/lpp/IBM/cyp/v3r8/pyz

export PYTHON_HOME=/SVT/usr/lpp/python38/usr/lpp/IBM/cyp/v3r8/pyz
export PATH=$PYTHON_HOME/bin:$PATH
export LIBPATH=$PYTHON_HOME/lib:$LIBPATH

Python install

The second XLC step is failing for 3.1.0, but not 3.0.4

# 3.1.0
/bin/xlc build/temp.os390-27.00-2964-3.8/ibm_db.o /STLABBA/tmp/pip-install-ht9lx9ow/ibm-db/libdsnao64c.x -L. -L/usr/lpp/IBM/cyp/v3r8/pyz/lib -o build/lib.os390-27.00-2964-3.8/ibm_db.so

# 3.0.4
/bin/xlc build/temp.os390-27.00-2964-3.8/ibm_db.o /STLABBA/tmp/pip-install-1jkwfkp1/ibm-db/libdsnao64c.x -L. -o build/lib.os390-27.00-2964-3.8/ibm_db.so -Wl,dll /SVT/usr/lpp/python38/usr/lpp/IBM/cyp/v3r8/pyz/lib/python3.8/config-3.8/libpython3.8.x -q64

The difference being the options shown below:

# 3.1.0
-L/usr/lpp/IBM/cyp/v3r8/pyz/lib

# 3.0.4
-Wl,dll /SVT/usr/lpp/python38/usr/lpp/IBM/cyp/v3r8/pyz/lib/python3.8/config-3.8/libpython3.8.x
-q64

/usr/lpp/IBM/cyp/v3r8/pyz/lib does not exist on our system, which seems to cause the xlc command to fail.


It seems like the 3.0.4 install was able to use the set LIBPATH (/SVT/usr/lpp/python38/usr/lpp/IBM/cyp/v3r8/pyz/lib:$LIBPATH) during the install, while the 3.1.0 install does not. Is this intended behavior? Any help would be appreciated.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 26 (15 by maintainers)

Most upvoted comments

@kenjaninja I was able to reproduce the issue after updating the python version to 3.9 in my ZOS machine.

Unfortunately this issue is something that all pip packages is having that contains pyproject.toml file. This is not limited to ibm_db package along and can be seen with any package available in pip that uses pyproject.toml file.

I did some research and looks like many people are facing this issue and unfortunately I do not have a immediate resolution to this.

Once I have a resolution on this I will update, Till then may I suggest you to use the source code for installation.

python setup.py install mechanism for now.

Thanks.

Could you try once installing from the code directly. The steps are as follows

  1. Clone the code from https://github.com/ibmdb/python-ibmdb.git
  2. once cloned goto the folder IBM_DB\ibm_db
  3. then run command python setup.py install

You can paste me the complete log that you see while doing this. Then I can compare it against my machine and see what goes wrong.