Leap 15.5 compiler error
Hi, I'm trying to compile the new OHIF-plugin for Orthanc and run into the following problem (Leap only, TW is fine): [ 26s] make[2]: Entering directory '/home/abuild/rpmbuild/BUILD/OrthancOHIF-1.1/build' [ 26s] [ 3%] Generating AUTOGENERATED/StaticAssets.cpp [ 26s] /usr/bin/python3.6 /home/abuild/rpmbuild/BUILD/OrthancOHIF-1.1/Resources/EmbedStaticAssets.py /home/abuild/rpmbuild/BUILD/OrthancOHIF-1.1/OHIF/dist /home/abuild/rpmbuild/BUILD/OrthancOHIF-1.1/build/AUTOGENERATED/StaticAssets.cpp [ 26s] Traceback (most recent call last): [ 26s] File "/home/abuild/rpmbuild/BUILD/OrthancOHIF-1.1/Resources/EmbedStaticAssets.py", line 116, in <module> [ 26s] compressed = gzip.compress(content, mtime=0) Is this an issue of make, or of the ancient python version? Thanks Axel https://build.opensuse.org/package/show/home:DocB:Orthanc/orthanc-ohif[1] -------- [1] https://build.opensuse.org/package/show/home:DocB:Orthanc/orthanc-ohif
Hi, On lun, 2023-12-04 at 14:20 +0100, Axel Braun wrote:
Hi,
I'm trying to compile the new OHIF-plugin for Orthanc and run into the following problem (Leap only, TW is fine):
[ 26s] make[2]: Entering directory '/home/abuild/rpmbuild/BUILD/OrthancOHIF-1.1/build' [ 26s] [ 3%] Generating AUTOGENERATED/StaticAssets.cpp [ 26s] /usr/bin/python3.6 /home/abuild/rpmbuild/BUILD/OrthancOHIF- 1.1/Resources/EmbedStaticAssets.py /home/abuild/rpmbuild/BUILD/OrthancOHIF-1.1/OHIF/dist /home/abuild/rpmbuild/BUILD/OrthancOHIF- 1.1/build/AUTOGENERATED/StaticAssets.cpp [ 26s] Traceback (most recent call last): [ 26s] File "/home/abuild/rpmbuild/BUILD/OrthancOHIF- 1.1/Resources/EmbedStaticAssets.py", line 116, in <module> [ 26s] compressed = gzip.compress(content, mtime=0)
Is this an issue of make, or of the ancient python version?
Yes, the problem is exactly that, the gzip.compress mtime parameter was added in 3.8 [1]. I would recommend to try to use python3.11 for leap, it should be available there for leap 15.4 and greater. In other case you'll need to patch that script just for leap to be able to run it with python 3.6. The python311 package doesn't override the /usr/bin/python3, so in any case you'll need to configure the cmake scripts to use the /usr/bin/python3.11 binary instead of the current /usr/bin/python3. [1] https://docs.python.org/3/library/gzip.html#gzip.compress
Am Montag, 4. Dezember 2023, 15:15:43 CET schrieb daniel.garcia@suse.com: ....
Is this an issue of make, or of the ancient python version?
Yes, the problem is exactly that, the gzip.compress mtime parameter was added in 3.8 [1].
I would recommend to try to use python3.11 for leap, it should be available there for leap 15.4 and greater. In other case you'll need to patch that script just for leap to be able to run it with python 3.6.
The python311 package doesn't override the /usr/bin/python3, so in any case you'll need to configure the cmake scripts to use the /usr/bin/python3.11 binary instead of the current /usr/bin/python3.
OK, will look into that, thanks In that context, to force py 3.11 the macro %{?sle15_python_module_pythons} can be used, IIRR. Is the configuration around it documented somewhere? Search for the macro in the oS wiki returned no result Thanks Axel
Am Montag, 4. Dezember 2023, 15:15:43 CET schrieb daniel.garcia@suse.com:
The python311 package doesn't override the /usr/bin/python3, so in any case you'll need to configure the cmake scripts to use the /usr/bin/python3.11 binary instead of the current /usr/bin/python3.
As I'm not a C++ programmer, how to convince cmake to use python 3.11? Thanks Axel
Hi Axel, Am 06.12.23 um 18:04 schrieb Axel Braun:
Am Montag, 4. Dezember 2023, 15:15:43 CET schrieb daniel.garcia@suse.com:
The python311 package doesn't override the /usr/bin/python3, so in any case you'll need to configure the cmake scripts to use the /usr/bin/python3.11 binary instead of the current /usr/bin/python3. As I'm not a C++ programmer, how to convince cmake to use python 3.11?
Thanks Axel
Upstream uses deprecated [1] $PYTHON_EXECUTABLE in its CMakeLists.txt (without ever properly asking for it through find_package()), so you can give cmake the `-DPYTHON_EXECUTABLE=$mypython` flag. The problem is to elegantly create the $mypython path without hardcoding to python311. My not so elegant solution: https://build.opensuse.org/request/show/1131579 - Ben [1] https://cmake.org/cmake/help/latest/module/FindPythonInterp.html
participants (3)
-
Axel Braun
-
Ben Greiner
-
daniel.garcia@suse.com