Python Forum
Having Trouble Compiling From Source (3.7.2)
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Having Trouble Compiling From Source (3.7.2)
#1
When it comes to building the _uuid extension I get the following:
Output:
building '_uuid' extension /linopt/gnu/gcc/gcc-5.4.0/bin/gcc -pthread -fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fprofile-generate -I./Include -I. -I/linopt/gnu/gcc/gcc-5.4.0/include/ -I/usr/include/ -I/usr/include/gdbm/ -I/usr/local/include -I/release/buildrepo/python/Python-3.7.2/Include -I/release/buildrepo/python/Python-3.7.2 -c /release/buildrepo/python/Python-3.7.2/Modules/_uuidmodule.c -o build/temp.linux-x86_64-3.7/release/buildrepo/python/Python-3.7.2/Modules/_uuidmodule.o /release/buildrepo/python/Python-3.7.2/Modules/_uuidmodule.c: In function ‘py_uuid_generate_time_safe’: /release/buildrepo/python/Python-3.7.2/Modules/_uuidmodule.c:15:12: error: storage size of ‘uuid’ isn’t known uuid_t uuid; ^ /release/buildrepo/python/Python-3.7.2/Modules/_uuidmodule.c:23:5: error: too many arguments to function ‘uuid_create’ uuid_create(&uuid, &status); ^ In file included from /release/buildrepo/python/Python-3.7.2/Modules/_uuidmodule.c:8:0: /usr/include/uuid.h:97:22: note: declared here extern uuid_rc_t uuid_create ( uuid_t **_uuid); ^ /release/buildrepo/python/Python-3.7.2/Modules/_uuidmodule.c:15:12: warning: unused variable ‘uuid’ [-Wunused-variable] uuid_t uuid; ^ /release/buildrepo/python/Python-3.7.2/Modules/_uuidmodule.c:35:1: warning: control reaches end of non-void function [-Wreturn-type] }
then I get this also:
Output:
The following modules found by detect_modules() in setup.py, have been built by the Makefile instead, as configured by the Setup files: _abc atexit pwd time Failed to build these modules: _uuid Following modules built successfully but were removed because they could not be imported: _dbm _hashlib _ssl Could not build the ssl module! Python requires an OpenSSL 1.0.2 or 1.1 compatible libssl with X509_VERIFY_PARAM_set1_host(). LibreSSL 2.6.4 and earlier do not provide the necessary APIs, https://github.com/libressl-portable/portable/issues/381
For UUID in the configure log I saw this:
Output:
checking uuid/uuid.h usability... no checking uuid/uuid.h presence... no checking for uuid/uuid.h... no checking uuid.h usability... yes checking uuid.h presence... yes checking for uuid.h... yes checking for uuid_generate_time_safe... no checking for uuid_create... yes checking for uuid_enc_be... no
I have OpenSSL 1.0.2j that i'm using to build off of. It says in the configure this:
Output:
checking for openssl/ssl.h in /linopt/openssl/openssl-1.0.2j/... yes checking whether compiling and linking against OpenSSL works... yes checking for X509_VERIFY_PARAM_set1_host in libssl... yes
If you've made it to the end of this, thanks! If you can offer any help, please let me know.

Thanks.

Paolo
Reply
#2
Is there any particular reason why you want to compile from source, rather than just install pre-built version?
Reply
#3
What distro are you using? How did you install openssl? If you installed it from the package manager, you might also need to install a development package, sometimes called openssl-dev, so you've got the headers you need to compile libraries that use it.
Reply
#4
(Feb-04-2019, 09:28 PM)Larz60+ Wrote: Is there any particular reason why you want to compile from source, rather than just install pre-built version?

we make use of system optimizations that are not enabled by default in the pre-built version. Plus this needs to be accessible from multiple servers on NFS.


(Feb-04-2019, 09:50 PM)nilamo Wrote: What distro are you using? How did you install openssl? If you installed it from the package manager, you might also need to install a development package, sometimes called openssl-dev, so you've got the headers you need to compile libraries that use it.

RHEL 6.9 (sorry thought it was CentOS 6/7)

openssl was compiled from source. I have the devel libraries installed on the server where I'm building python. It even says it finds openssl/ssl.h, it can compile and link against openssl, and it found X509_VERIFY_PARAM_setl_host in libssl.

when compiling ssl extensions it seems to go fine.

Output:
building '_ssl' extension /linopt/gnu/gcc/gcc-5.4.0/bin/gcc -pthread -fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fprofile-generate -I/linopt/openssl/openssl-1.0.2j//include -I./Include -I. -I/linopt/gnu/gcc/gcc-5.4.0/include/ -I/usr/include/ -I/usr/include/gdbm/ -I/usr/local/include -I/release/buildrepo/python/Python-3.7.2/Include -I/release/buildrepo/python/Python-3.7.2 -c /release/buildrepo/python/Python-3.7.2/Modules/_ssl.c -o build/temp.linux-x86_64-3.7/release/buildrepo/python/Python-3.7.2/Modules/_ssl.o /linopt/gnu/gcc/gcc-5.4.0/bin/gcc -pthread -shared -fprofile-generate build/temp.linux-x86_64-3.7/release/buildrepo/python/Python-3.7.2/Modules/_ssl.o -L/linopt/openssl/openssl-1.0.2j//lib -L. -L/usr/local/lib -lssl -lcrypto -lpython3.7m -o build/lib.linux-x86_64-3.7/_ssl.cpython-37m-x86_64-linux-gnu.so
yum list installed | grep uuid
libuuid.i686 2.17.2-12.28.el6_9.2 @rhel-enterprise-6
libuuid.x86_64 2.17.2-12.28.el6_9.2 @rhel-enterprise-6
uuid.x86_64 1.6.1-10.el6 @rhel-enterprise-6
uuid-devel.x86_64 1.6.1-10.el6 @/uuid-devel-1.6.1-10.el6.x86_64

I also saw this:

openssl-devel.i686 1.0.1e-57.el6 @rhel-enterprise-6
openssl-devel.x86_64 1.0.1e-57.el6 @rhel-enterprise-6

but my configure command was this:

CPPFLAGS="-I/linopt/gnu/gcc/gcc-5.4.0/include/ -I/usr/include/ -I/usr/include/gdbm/" ./configure --prefix=/linopt/python/python-3.7.2/rh64 --enable-loadable-sqlite-extensions -with-system-expat --enable-optimizations --enable-shared --with-openssl=/linopt/openssl/openssl-1.0.2j/ --with-system-ffi | tee configure.log
Reply
#5
was able to fix the UUID issue. I had both libuuid-devel and uuid-devel installed. referencing this I found by googling: https://bugs.python.org/issue32627

still have the SSL issue, which I"m working on solving that as well.
Reply
#6
all issues fixed. For SSL,DBM, and Hashlib it seems that there were multiple locations that had different version of the necessary .h files. The system was confused as to which one to use. For SSL, I needed to specify using the LD_LIBRARY_PATH variable which one to use. That solved that. For DBM, in my /usr/include there was gdbm.h and gdbm/gdbm.h. I removed the inclusion of /usr/include/gdbm from my CPPFlags in when running configure. As for Hashlib, i think this is related to fixing SSL, but i'm not entirely sure. As for now it compiles correctly and is working.
Reply
#7
Thanks for letting us know how you fixed it :)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Compiling (PyInstaller issues) TheHolyPyGrenade 1 1,900 Apr-11-2021, 08:30 PM
Last Post: snippsat
  Compiling SlicerCAT flaviu2 1 1,848 Sep-21-2020, 08:38 AM
Last Post: buran
  Compiling Python 3.8.5 source code results in build error Deepan 0 2,175 Sep-14-2020, 04:11 AM
Last Post: Deepan
  Compiling on win10 ebolisa 1 1,748 Sep-04-2020, 04:39 PM
Last Post: ebolisa
  Compiling to windows installer DT2000 1 1,557 May-04-2020, 09:17 PM
Last Post: DT2000
  Compiling python CommanderCody66 7 109,465 Apr-19-2019, 08:12 PM
Last Post: snippsat
  compiling python using pyinstaller sabeesh90 0 2,657 Aug-16-2018, 09:58 AM
Last Post: sabeesh90

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020