[SyneRBI/SIRF-SuperBuild] Updated modules in find_package command for Python3 (PR #933)

4 views
Skip to first unread message

NicoleJurjew

unread,
Oct 2, 2024, 12:40:57 PM10/2/24
to SyneRBI/SIRF-SuperBuild, Subscribed

You can view, comment on, or merge this pull request online at:

  https://github.com/SyneRBI/SIRF-SuperBuild/pull/933

Commit Summary

  • 5963dbd Updated updated modules in find_package command for Python3

File Changes

(1 file)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933@github.com>

Kris Thielemans

unread,
Oct 3, 2024, 4:35:29 AM10/3/24
to SyneRBI/SIRF-SuperBuild, Subscribed

https://cmake.org/cmake/help/latest/module/FindPythonInterp.html deprecated since 3.12, while we require 3.16.2.

Current change is minimal. We probably should pass Python_EXECUTABLE as opposed to PYTHON_EXECUTABLE to dependencies, but this needs a check which ones we use. Probably easiest to pass both. I think we should no longer attempt to pass include and other paths, and let CMake sort it out.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/c2390836132@github.com>

Kris Thielemans

unread,
Oct 3, 2024, 4:36:52 AM10/3/24
to SyneRBI/SIRF-SuperBuild, Subscribed

@KrisThielemans commented on this pull request.


In SuperBuild.cmake:

> @@ -47,7 +47,7 @@ endif()
 # Find CUDA
 option(DISABLE_CUDA "Disable CUDA" OFF)
 if (NOT DISABLE_CUDA)
-  find_package(CUDA)
+  find_package(CUDAToolkit REQUIRED)
⬇️ Suggested change
-  find_package(CUDAToolkit REQUIRED)
+  find_package(CUDA)

While this is needed, let's do it in another PR, as both of these could create discussions.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/review/2344986067@github.com>

Kris Thielemans

unread,
Oct 3, 2024, 4:37:06 AM10/3/24
to SyneRBI/SIRF-SuperBuild, Push

@KrisThielemans pushed 1 commit.

  • 50805ce revert change in finding CUDA


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/before/5963dbd92ab0a6ef6ed752a21bb34cea9689a2c9/after/50805ce182d3108f20a2623927a7cc6695adacbb@github.com>

Kris Thielemans

unread,
Oct 3, 2024, 4:37:54 AM10/3/24
to SyneRBI/SIRF-SuperBuild, Subscribed

@KrisThielemans commented on this pull request.


In SuperBuild.cmake:

>    if (PYTHONLIBS_FOUND)
     message(STATUS "Found PYTHON_INCLUDE_DIRS=${PYTHON_INCLUDE_DIRS}")
     message(STATUS "Found PYTHON_LIBRARIES=${PYTHON_LIBRARIES}")
   endif()
 
   # Set destinations for Python files
-  set (BUILD_PYTHON ${PYTHONLIBS_FOUND})
+  set (BUILD_PYTHON = ${Python3_FOUND})
⬇️ Suggested change
-  set (BUILD_PYTHON = ${Python3_FOUND})
+  set (BUILD_PYTHON ${Python3_FOUND})


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/review/2344988241@github.com>

Kris Thielemans

unread,
Oct 3, 2024, 4:38:06 AM10/3/24
to SyneRBI/SIRF-SuperBuild, Push

@KrisThielemans pushed 1 commit.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/before/50805ce182d3108f20a2623927a7cc6695adacbb/after/1fabcc0bffa582ff2ff87bafb05718dfb44c65ca@github.com>

Kris Thielemans

unread,
Oct 3, 2024, 5:54:40 AM10/3/24
to SyneRBI/SIRF-SuperBuild, Subscribed

Need to update how we look for cython I guess

[100%] Generating build/timestamp
Traceback (most recent call last):
  File "/home/runner/work/SIRF-SuperBuild/SIRF-SuperBuild/build/builds/TomoPhantom/build/Wrappers/Python/setup.py", line 19, in <module>
    from Cython.Distutils import build_ext
ModuleNotFoundError: No module named 'Cython'
gmake[5]: *** [Wrappers/Python/CMakeFiles/PythonWrapper.dir/build.make:76: Wrappers/Python/build/timestamp] Error 1
gmake[4]: *** [CMakeFiles/Makefile2:157: Wrappers/Python/CMakeFiles/PythonWrapper.dir/all] Error 2
gmake[3]: *** [Makefile:136: all] Error 2
gmake[2]: *** [CMakeFiles/TomoPhantom.dir/build.make:86: builds/TomoPhantom/stamp/TomoPhantom-build] Error 2
gmake[1]: *** [CMakeFiles/Makefile2:755: CMakeFiles/TomoPhantom.dir/all] Error 2

This error is different from why I saw in #932 but it's possible that @NicoleJurjew only saw the Tomophantom error when using this branch I guess.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/c2390995749@github.com>

NicoleJurjew

unread,
Oct 3, 2024, 10:17:00 AM10/3/24
to SyneRBI/SIRF-SuperBuild, Subscribed

With the suggested changes, the PYTHONPATH isn't exported correctly.

I think some changes need to be done here, as well:
https://github.com/SyneRBI/SIRF-SuperBuild/blob/5f1a7f498bf6f41551c19eb53798b5d33af43eec/SuperBuild.cmake#L366C1-L386C8


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/c2391539511@github.com>

Kris Thielemans

unread,
Oct 4, 2024, 5:14:22 AM10/4/24
to SyneRBI/SIRF-SuperBuild, Subscribed

that's a bit strange. What is the content of env_sirf.sh etc then? Can you just do a

message(STATUS "PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}")

before those statement to check what it is?


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/c2393242379@github.com>

NicoleJurjew

unread,
Oct 4, 2024, 6:51:55 AM10/4/24
to SyneRBI/SIRF-SuperBuild, Subscribed

This is the content of env_sirf.sh:
grafik.png (view on web)

Where will that message be written to then? Thanks!


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/c2393420667@github.com>

Edoardo Pasca

unread,
Feb 13, 2025, 5:24:33 AM2/13/25
to SyneRBI/SIRF-SuperBuild, Subscribed

See also #313


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/c2656144979@github.com>

Casper da Costa-Luis

unread,
Mar 20, 2025, 8:34:18 AM3/20/25
to SyneRBI/SIRF-SuperBuild, Push

@casperdcl pushed 4 commits.

  • 30905f4 Updated updated modules in find_package command for Python3
  • ebcc4ac revert change in finding CUDA
  • b6da241 correct typo
  • 3f09077 cmake: FindPython3


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/before/1fabcc0bffa582ff2ff87bafb05718dfb44c65ca/after/3f09077f1aea33c166b4b90bee501576bf2b6e63@github.com>

Casper da Costa-Luis

unread,
Mar 20, 2025, 8:49:50 AM3/20/25
to SyneRBI/SIRF-SuperBuild, Push

@casperdcl pushed 2 commits.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/before/3f09077f1aea33c166b4b90bee501576bf2b6e63/after/f5d9c0c6ce5ad1c389daa4101ec3f528b557505a@github.com>

Casper da Costa-Luis

unread,
Mar 20, 2025, 10:31:38 AM3/20/25
to SyneRBI/SIRF-SuperBuild, Subscribed

Looks like a gadgetron build error related to https://groups.google.com/g/linux.debian.bugs.dist/c/JpHAw3GY0Bk


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/c2740661784@github.com>

casperdclcasperdcl left a comment (SyneRBI/SIRF-SuperBuild#933)

Looks like a gadgetron build error related to https://groups.google.com/g/linux.debian.bugs.dist/c/JpHAw3GY0Bk


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/c2740661784@github.com>

Kris Thielemans

unread,
Mar 20, 2025, 11:13:31 AM3/20/25
to SyneRBI/SIRF-SuperBuild, Subscribed

This was all discussed in #937. I've contributed a PR to Gadgetron. However, moving on with Gadgetron created a lot of other problems. So @paskino and I decided to wait with that, and just fix Ubuntu 22.04. This is done in #943. So suggestion therefore is to finish #943, merge it, and merge that back on here.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/c2740806473@github.com>

KrisThielemansKrisThielemans left a comment (SyneRBI/SIRF-SuperBuild#933)

This was all discussed in #937. I've contributed a PR to Gadgetron. However, moving on with Gadgetron created a lot of other problems. So @paskino and I decided to wait with that, and just fix Ubuntu 22.04. This is done in #943. So suggestion therefore is to finish #943, merge it, and merge that back on here.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/c2740806473@github.com>

Kris Thielemans

unread,
Mar 20, 2025, 11:23:28 AM3/20/25
to SyneRBI/SIRF-SuperBuild, Subscribed

@KrisThielemans commented on this pull request.

Did you check if the dependencies indeed accept Python3_EXECUTABLE. In any case, I'm fairly sure this needs to be Python_EXECUTABLE. Easiest might be to pass both of course, although that's a bit ugly.

Also, in SIRF and STIR, we have a "backwards compatible" line to set Python_EXECUTABLE if PYTHON_EXECUTABLE is set. Maybe no longer need it?


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/review/2703174646@github.com>

Kris Thielemans

unread,
Mar 21, 2025, 5:46:24 AM3/21/25
to SyneRBI/SIRF-SuperBuild, Subscribed

@casperdcl I've merged #943.

Note that we'll also need to update CHANGES.md here.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/c2742845606@github.com>

KrisThielemansKrisThielemans left a comment (SyneRBI/SIRF-SuperBuild#933)

@casperdcl I've merged #943.

Note that we'll also need to update CHANGES.md here.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/c2742845606@github.com>

Casper da Costa-Luis

unread,
Mar 21, 2025, 6:10:47 AM3/21/25
to SyneRBI/SIRF-SuperBuild, Push

@casperdcl pushed 5 commits.

  • 25e7ece Updated updated modules in find_package command for Python3
  • 698cafb revert change in finding CUDA
  • 4f27200 correct typo
  • 5e5aa82 cmake: FindPython3
  • 15b6504 cmake: fix hints


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/before/f5d9c0c6ce5ad1c389daa4101ec3f528b557505a/after/15b6504419a575d4ff6602d143d033d8819212a7@github.com>

Casper da Costa-Luis

unread,
Mar 21, 2025, 6:24:19 AM3/21/25
to SyneRBI/SIRF-SuperBuild, Subscribed

@casperdcl commented on this pull request.


On SuperBuild.cmake:

technically

find_package -D hint
Python3 Python3_EXECUTABLE
Python Python_EXECUTABLE

so perhaps we could just use Python without the 3-suffix everywhere?


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/review/2705434012@github.com>

Casper da Costa-Luis

unread,
Mar 21, 2025, 7:28:31 AM3/21/25
to SyneRBI/SIRF-SuperBuild, Push

@casperdcl pushed 1 commit.

  • 4960efe Python3_EXCUTABLE => Python_EXECUTABLE


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/before/15b6504419a575d4ff6602d143d033d8819212a7/after/4960efee051e4118199396ab48984c04149f0153@github.com>

Kris Thielemans

unread,
Mar 21, 2025, 8:02:21 AM3/21/25
to SyneRBI/SIRF-SuperBuild, Subscribed

@KrisThielemans requested changes on this pull request.


In SuperBuild.cmake:

> @@ -431,7 +431,7 @@ if (WIN32)
   endif()
   if (PYTHONINTERP_FOUND)
⬇️ Suggested change
-  if (PYTHONINTERP_FOUND)
+  if (Python_EXECUTABLE)

In SuperBuild/External_NiftyPET.cmake:

> +      -DPython_EXECUTABLE=${NiftyPET_PYTHON_EXECUTABLE}
+      -DPython3_Executable=${NiftyPET_PYTHON_EXECUTABLE}

note that we are stuck to NiftyPET 2. Are you sure this is ok?


In VirtualBox/scripts/UPDATE_functions.sh:

> @@ -185,7 +185,8 @@ SuperBuild_install(){
         -DDEVEL_BUILD="$DEVEL_BUILD" \
         -DNIFTYREG_USE_CUDA=OFF\
         -DBUILD_CIL=ON\
-        -DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE"\
+        -DPython_EXECUTABLE="$PYTHON_EXECUTABLE"\
+        -DPython3_EXECUTABLE="$PYTHON_EXECUTABLE"\
⬇️ Suggested change
-        -DPython3_EXECUTABLE="$PYTHON_EXECUTABLE"\

This isn't necessary for our own SB.


In SuperBuild/External_ROOT.cmake:

> +      -DPython_EXECUTABLE:FILE=${Python_EXECUTABLE}
+      -DPython3_EXECUTABLE:FILE=${Python_EXECUTABLE}
⬇️ Suggested change
-      -DPython_EXECUTABLE:FILE=${Python_EXECUTABLE}
-      -DPython3_EXECUTABLE:FILE=${Python_EXECUTABLE}
+      ${PYTHONLIBS_CMAKE_ARGS}

In SuperBuild.cmake:

>      message(STATUS "Python version ${PYTHON_VERSION_STRING}")
   endif()
-  
-  find_package(PythonLibs 3)
-  
+
   if (PYTHONLIBS_FOUND)

Python_*, and different conditional


In SuperBuild.cmake:

>        CONDA:      do nothing")
     set_property(CACHE PYTHON_STRATEGY PROPERTY STRINGS PYTHONPATH SETUP_PY CONDA)
   endif()
 
   # set PYTHONLIBS_CMAKE_ARGS to be used in the ExternalProject_add calls
   # note: Find_package(PythonLibs) takes PYTHON_INCLUDE_DIR and PYTHON_LIBRARY as input
-  set (PYTHONLIBS_CMAKE_ARGS -DPYTHON_EXECUTABLE:FILEPATH=${PYTHON_EXECUTABLE})
+  set (PYTHONLIBS_CMAKE_ARGS
+       -DPython_EXECUTABLE:FILEPATH=${Python_EXECUTABLE}
+       -DPython3_EXECUTABLE:FILEPATH=${Python_EXECUTABLE})
   if (EXISTS "${PYTHON_INCLUDE_DIR}")

Python, not PYTHON


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/review/2705632608@github.com>

Casper da Costa-Luis

unread,
Mar 21, 2025, 8:09:35 AM3/21/25
to SyneRBI/SIRF-SuperBuild, Subscribed

@casperdcl commented on this pull request.


In SuperBuild/External_NiftyPET.cmake:

> +      -DPython_EXECUTABLE=${NiftyPET_PYTHON_EXECUTABLE}
+      -DPython3_Executable=${NiftyPET_PYTHON_EXECUTABLE}

Any reason why? Current NiftyPET is Python3 only.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/review/2705722991@github.com>

Casper da Costa-Luis

unread,
Mar 21, 2025, 8:17:45 AM3/21/25
to SyneRBI/SIRF-SuperBuild, Subscribed

@casperdcl commented on this pull request.


In VirtualBox/scripts/UPDATE_functions.sh:

> @@ -185,7 +185,8 @@ SuperBuild_install(){
         -DDEVEL_BUILD="$DEVEL_BUILD" \
         -DNIFTYREG_USE_CUDA=OFF\
         -DBUILD_CIL=ON\
-        -DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE"\
+        -DPython_EXECUTABLE="$PYTHON_EXECUTABLE"\
+        -DPython3_EXECUTABLE="$PYTHON_EXECUTABLE"\

I was hesitant just in case people use the new UPDATE_functions.sh on an old SB version.

Hopefully a niche problem, though, so will remove this line.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/review/2705741473@github.com>

Kris Thielemans

unread,
Mar 21, 2025, 8:20:01 AM3/21/25
to SyneRBI/SIRF-SuperBuild, Subscribed

There seem to be 2 different Python versions used in the CIL install, resulting in the cil not being found at import. There are 2 causes for this.

For the SB, CMake finds a surprising version (which is then passed on)

Found Python: /opt/hostedtoolcache/Python/3.10.12/x64/bin/python3.10 (found version "3.10.12") found components: Interpreter Development Development.Module Development.Embed
Found Python_EXECUTABLE=/opt/hostedtoolcache/Python/3.10.12/x64/bin/python3.10

The CMake strategy for selecting a python version is still far too complicated/error-prone. I suggest therefore to explicitly set
Python_EXECUTABLE=which python` in the Action.

In addition, it looks like the CIL version that is being built (I only checked with DEVEL_BUILD=OFF) uses old-style:

-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.10.so (found version "3.10.12")
-- Found PYTHON_EXECUTABLE=/home/runner/virtualenv/bin/python

I think therefore we need to add PYTHON_EXECUTABLE to the PYTHONLIBS_CMAKE_ARGS variable. That's safest in any case.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/c2743208070@github.com>

KrisThielemansKrisThielemans left a comment (SyneRBI/SIRF-SuperBuild#933)

There seem to be 2 different Python versions used in the CIL install, resulting in the cil not being found at import. There are 2 causes for this.

For the SB, CMake finds a surprising version (which is then passed on)

Found Python: /opt/hostedtoolcache/Python/3.10.12/x64/bin/python3.10 (found version "3.10.12") found components: Interpreter Development Development.Module Development.Embed
Found Python_EXECUTABLE=/opt/hostedtoolcache/Python/3.10.12/x64/bin/python3.10

The CMake strategy for selecting a python version is still far too complicated/error-prone. I suggest therefore to explicitly set
Python_EXECUTABLE=which python` in the Action.

In addition, it looks like the CIL version that is being built (I only checked with DEVEL_BUILD=OFF) uses old-style:

-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.10.so (found version "3.10.12")
-- Found PYTHON_EXECUTABLE=/home/runner/virtualenv/bin/python

I think therefore we need to add PYTHON_EXECUTABLE to the PYTHONLIBS_CMAKE_ARGS variable. That's safest in any case.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/c2743208070@github.com>

Kris Thielemans

unread,
Mar 21, 2025, 8:21:01 AM3/21/25
to SyneRBI/SIRF-SuperBuild, Subscribed

@KrisThielemans commented on this pull request.


In VirtualBox/scripts/UPDATE_functions.sh:

> @@ -185,7 +185,8 @@ SuperBuild_install(){
         -DDEVEL_BUILD="$DEVEL_BUILD" \
         -DNIFTYREG_USE_CUDA=OFF\
         -DBUILD_CIL=ON\
-        -DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE"\
+        -DPython_EXECUTABLE="$PYTHON_EXECUTABLE"\
+        -DPython3_EXECUTABLE="$PYTHON_EXECUTABLE"\

oh, right. This is on the VM. Sorry. Let's leave this in then.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/review/2705748228@github.com>

Kris Thielemans

unread,
Mar 21, 2025, 8:21:33 AM3/21/25
to SyneRBI/SIRF-SuperBuild, Subscribed

@KrisThielemans commented on this pull request.


In VirtualBox/scripts/UPDATE_functions.sh:

> @@ -185,7 +185,8 @@ SuperBuild_install(){
         -DDEVEL_BUILD="$DEVEL_BUILD" \
         -DNIFTYREG_USE_CUDA=OFF\
         -DBUILD_CIL=ON\
-        -DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE"\
+        -DPython_EXECUTABLE="$PYTHON_EXECUTABLE"\
+        -DPython3_EXECUTABLE="$PYTHON_EXECUTABLE"\

Certainly as on GHA, CMake found the wrong python...


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/review/2705749435@github.com>

Kris Thielemans

unread,
Mar 21, 2025, 8:25:27 AM3/21/25
to SyneRBI/SIRF-SuperBuild, Subscribed

@KrisThielemans commented on this pull request.


In SuperBuild/External_NiftyPET.cmake:

> +      -DPython_EXECUTABLE=${NiftyPET_PYTHON_EXECUTABLE}
+      -DPython3_Executable=${NiftyPET_PYTHON_EXECUTABLE}

We currently only use NiftyPET via STIR, but that all happens on the C++ front. NiftyPET3 no longer has the appropriate libraries, and I have no energy for it.

See UCL/STIR#1294 to jog your memory :-)


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/review/2705758723@github.com>

Kris Thielemans

unread,
Mar 21, 2025, 8:26:30 AM3/21/25
to SyneRBI/SIRF-SuperBuild, Subscribed

@KrisThielemans commented on this pull request.


In SuperBuild/External_NiftyPET.cmake:

> +      -DPython_EXECUTABLE=${NiftyPET_PYTHON_EXECUTABLE}
+      -DPython3_Executable=${NiftyPET_PYTHON_EXECUTABLE}

It could be worthwile wrapping NiftyPET in CIL instead, but it's nowhere on my (our?) list of priorities.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/review/2705761305@github.com>

Casper da Costa-Luis

unread,
Mar 21, 2025, 8:34:55 AM3/21/25
to SyneRBI/SIRF-SuperBuild, Push

@casperdcl pushed 1 commit.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/before/4960efee051e4118199396ab48984c04149f0153/after/9e2e844e1efed78cabf9cccd08ce5d02f06222d1@github.com>

Casper da Costa-Luis

unread,
Mar 21, 2025, 8:36:43 AM3/21/25
to SyneRBI/SIRF-SuperBuild, Push

@casperdcl pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/before/9e2e844e1efed78cabf9cccd08ce5d02f06222d1/after/c4bacd64a7a7cd6e136c0ee7608c45f1e45c7603@github.com>

Kris Thielemans

unread,
Mar 21, 2025, 2:04:22 PM3/21/25
to SyneRBI/SIRF-SuperBuild, Subscribed
ModuleNotFoundError: No module named 'Cython'

when building TomoPhantom. Not sure why this happens now? Wrong python used? TBH, We shouldn't really build TomoPhantom as part of our CI I think. @paskino ?

Run actions/upload-artifact@v4
  with:
    name: build_log_files-ubuntu-22.04-gcc9-Release-DEVEL=OFF
...
Error: Failed to CreateArtifact: Received non-retryable error: Failed request: (409) Conflict: an artifact with this name already exists on the workflow run

I guess we have a problem with the naming somewhere.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/c2744090037@github.com>

KrisThielemansKrisThielemans left a comment (SyneRBI/SIRF-SuperBuild#933)
ModuleNotFoundError: No module named 'Cython'

when building TomoPhantom. Not sure why this happens now? Wrong python used? TBH, We shouldn't really build TomoPhantom as part of our CI I think. @paskino ?

Run actions/upload-artifact@v4
  with:
    name: build_log_files-ubuntu-22.04-gcc9-Release-DEVEL=OFF
...
Error: Failed to CreateArtifact: Received non-retryable error: Failed request: (409) Conflict: an artifact with this name already exists on the workflow run

I guess we have a problem with the naming somewhere.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/c2744090037@github.com>

Casper da Costa-Luis

unread,
Mar 24, 2025, 7:47:12 AM3/24/25
to SyneRBI/SIRF-SuperBuild, Push

@casperdcl pushed 1 commit.

  • f5489e6 potential TomoPhantom build fix


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/before/c4bacd64a7a7cd6e136c0ee7608c45f1e45c7603/after/f5489e6d1a4c9b1824814dc6e8b603c9b79a7f4b@github.com>

Casper da Costa-Luis

unread,
Mar 24, 2025, 8:09:18 AM3/24/25
to SyneRBI/SIRF-SuperBuild, Push

@casperdcl pushed 1 commit.

  • 2e56611 potential TomoPhantom build fix

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/before/f5489e6d1a4c9b1824814dc6e8b603c9b79a7f4b/after/2e56611e26eefa8cd03c7e11cb58ba55b8d6521e@github.com>

Casper da Costa-Luis

unread,
Mar 24, 2025, 8:20:03 AM3/24/25
to SyneRBI/SIRF-SuperBuild, Push

@casperdcl pushed 1 commit.

  • 9fa54cf fix TomoPhantom build deps

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/before/2e56611e26eefa8cd03c7e11cb58ba55b8d6521e/after/9fa54cf3fa0f4917e298b85404e163e97a36a127@github.com>

Casper da Costa-Luis

unread,
Mar 24, 2025, 8:49:11 AM3/24/25
to SyneRBI/SIRF-SuperBuild, Subscribed

TomoPhantom v2.0.0 (and also the slightly more recent v3.0) doesn't specify build deps. Its setup.py needs Cython & numpy. Adding them to the build step works.

Current test failures due to lack of CIL deps... CIL:scripts/requirements-test.yml are not included in CIL:pyproject.toml and I think they should be.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/c2748023203@github.com>

casperdclcasperdcl left a comment (SyneRBI/SIRF-SuperBuild#933)

TomoPhantom v2.0.0 (and also the slightly more recent v3.0) doesn't specify build deps. Its setup.py needs Cython & numpy. Adding them to the build step works.

Current test failures due to lack of CIL deps... CIL:scripts/requirements-test.yml are not included in CIL:pyproject.toml and I think they should be.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/c2748023203@github.com>

Casper da Costa-Luis

unread,
Mar 24, 2025, 11:58:13 AM3/24/25
to SyneRBI/SIRF-SuperBuild, Push

@casperdcl pushed 1 commit.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/before/9fa54cf3fa0f4917e298b85404e163e97a36a127/after/3d3fc3f4c20e23ba9ef2b097cd3183fa048b2d9b@github.com>

Kris Thielemans

unread,
Mar 24, 2025, 12:06:00 PM3/24/25
to SyneRBI/SIRF-SuperBuild, Subscribed

@KrisThielemans commented on this pull request.


In SuperBuild.cmake:

>        CONDA:      do nothing")
     set_property(CACHE PYTHON_STRATEGY PROPERTY STRINGS PYTHONPATH SETUP_PY CONDA)
   endif()
 
   # set PYTHONLIBS_CMAKE_ARGS to be used in the ExternalProject_add calls
-  # note: Find_package(PythonLibs) takes PYTHON_INCLUDE_DIR and PYTHON_LIBRARY as input
-  set (PYTHONLIBS_CMAKE_ARGS -DPYTHON_EXECUTABLE:FILEPATH=${PYTHON_EXECUTABLE})
-  if (EXISTS "${PYTHON_INCLUDE_DIR}")
-    set (PYTHONLIBS_CMAKE_ARGS ${PYTHONLIBS_CMAKE_ARGS}
-      -DPYTHON_INCLUDE_DIR:PATH=${PYTHON_INCLUDE_DIR})
-  endif()
-  if (EXISTS "${PYTHON_LIBRARY}")
+  set (PYTHONLIBS_CMAKE_ARGS
+    -DPython_EXECUTABLE:FILEPATH=${Python_EXECUTABLE}
+    -DPython3_EXECUTABLE:FILEPATH=${Python_EXECUTABLE}
+    -DPYTHON_EXECUTABLE:FILEPATH=${Python_EXECUTABLE})
+  if (Python_Development_FOUND)

we require it, so no extra if


In SuperBuild.cmake:

> +      -DPython_INCLUDE_DIRS=${Python_INCLUDE_DIRS}
+      -DPython_LIBRARIES=${Python_LIBRARIES}
+      -DPYTHON_INCLUDE_DIR=${Python_INCLUDE_DIRS}
+      -DPYTHON_LIBRARY=${Python_LIBRARIES})

I don't think we should be setting the *DIRS and *LIBRARIES variables, only the "singular" ones, as they are the input ones, while the "plural" variables are the output. (It could go wrong when there are multiple directories in the "plural" variables).

That means though that we should only set those if the input ones are set.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/review/2710909071@github.com>

Casper da Costa-Luis

unread,
Mar 24, 2025, 12:06:02 PM3/24/25
to SyneRBI/SIRF-SuperBuild, Push

@casperdcl pushed 1 commit.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/before/3d3fc3f4c20e23ba9ef2b097cd3183fa048b2d9b/after/ed81a12cbef2d5aed2a76ef49129b807b44d07bf@github.com>

Casper da Costa-Luis

unread,
Mar 24, 2025, 12:21:15 PM3/24/25
to SyneRBI/SIRF-SuperBuild, Push

@casperdcl pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/before/ed81a12cbef2d5aed2a76ef49129b807b44d07bf/after/74fd9cbfa5e30823be21a72e24c8afc66262013a@github.com>

Kris Thielemans

unread,
Mar 24, 2025, 2:34:00 PM3/24/25
to SyneRBI/SIRF-SuperBuild, Subscribed

For the SB, CMake finds a surprising version (which is then passed on)

Found Python: /opt/hostedtoolcache/Python/3.10.12/x64/bin/python3.10 (found version "3.10.12") found components: Interpreter Development Development.Module Development.Embed
Found Python_EXECUTABLE=/opt/hostedtoolcache/Python/3.10.12/x64/bin/python3.10

The CMake strategy for selecting a python version is still far too complicated/error-prone. I suggest therefore to explicitly set Python_EXECUTABLE=${which python} in the Action.

This is still the case, hence the failures.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/c2749067389@github.com>

KrisThielemansKrisThielemans left a comment (SyneRBI/SIRF-SuperBuild#933)

For the SB, CMake finds a surprising version (which is then passed on)

Found Python: /opt/hostedtoolcache/Python/3.10.12/x64/bin/python3.10 (found version "3.10.12") found components: Interpreter Development Development.Module Development.Embed
Found Python_EXECUTABLE=/opt/hostedtoolcache/Python/3.10.12/x64/bin/python3.10

The CMake strategy for selecting a python version is still far too complicated/error-prone. I suggest therefore to explicitly set Python_EXECUTABLE=${which python} in the Action.

This is still the case, hence the failures.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/c2749067389@github.com>

Casper da Costa-Luis

unread,
Mar 25, 2025, 7:46:46 AM3/25/25
to SyneRBI/SIRF-SuperBuild, Push

@casperdcl pushed 1 commit.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/before/74fd9cbfa5e30823be21a72e24c8afc66262013a/after/2fc3591d0cf0201b85c5e6ac21a4a7023bd4a46d@github.com>

Casper da Costa-Luis

unread,
Mar 25, 2025, 7:47:44 AM3/25/25
to SyneRBI/SIRF-SuperBuild, Push

@casperdcl pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/before/2fc3591d0cf0201b85c5e6ac21a4a7023bd4a46d/after/356945533d2b610badc659f5c8e0dc3db2d3057d@github.com>

Casper da Costa-Luis

unread,
Mar 25, 2025, 7:57:34 AM3/25/25
to SyneRBI/SIRF-SuperBuild, Push

@casperdcl pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/before/356945533d2b610badc659f5c8e0dc3db2d3057d/after/72b5111955412ed1ab7b1a38665c1137f032d1cb@github.com>

Casper da Costa-Luis

unread,
Mar 25, 2025, 8:06:32 AM3/25/25
to SyneRBI/SIRF-SuperBuild, Push

@casperdcl pushed 1 commit.

  • cd45e61 fix env vars for cmake FindPython

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/before/72b5111955412ed1ab7b1a38665c1137f032d1cb/after/cd45e617acfdd3e4ad4ad9fe08ad6e6cf2fd8810@github.com>

Casper da Costa-Luis

unread,
Mar 25, 2025, 8:16:24 AM3/25/25
to SyneRBI/SIRF-SuperBuild, Subscribed

Ah I finally understood; you don't want to use the system Python.

TL;DR we need to unset the cmake helpers defined by https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#environment-variables


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/c2751065695@github.com>

casperdclcasperdcl left a comment (SyneRBI/SIRF-SuperBuild#933)

Ah I finally understood; you don't want to use the system Python.

TL;DR we need to unset the cmake helpers defined by https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#environment-variables


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/c2751065695@github.com>

Kris Thielemans

unread,
Mar 25, 2025, 8:48:00 AM3/25/25
to SyneRBI/SIRF-SuperBuild, Subscribed

Ah I finally understood; you don't want to use the system Python.

TL;DR we need to unset the cmake helpers defined by actions/setup-python.

pretty confusing... I don't care which python is being used here, but obviously we should always use the same. As we seem to be using setup-python with pip, and then create a venv, we should be using that one. I guess that's what you did now, so ... great.

Sadly, some zenodo download issues ATM.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/c2751147624@github.com>

KrisThielemansKrisThielemans left a comment (SyneRBI/SIRF-SuperBuild#933)

Ah I finally understood; you don't want to use the system Python.

TL;DR we need to unset the cmake helpers defined by actions/setup-python.

pretty confusing... I don't care which python is being used here, but obviously we should always use the same. As we seem to be using setup-python with pip, and then create a venv, we should be using that one. I guess that's what you did now, so ... great.

Sadly, some zenodo download issues ATM.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/c2751147624@github.com>

Kris Thielemans

unread,
Mar 25, 2025, 8:48:32 AM3/25/25
to SyneRBI/SIRF-SuperBuild, Subscribed

@KrisThielemans approved this pull request.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/review/2713609525@github.com>

Kris Thielemans

unread,
Mar 25, 2025, 8:49:23 AM3/25/25
to SyneRBI/SIRF-SuperBuild, Subscribed

@KrisThielemans commented on this pull request.

oh. still need to update CHANGES.md!


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/review/2713611933@github.com>

Casper da Costa-Luis

unread,
Mar 25, 2025, 1:20:10 PM3/25/25
to SyneRBI/SIRF-SuperBuild, Subscribed

Merged #933 into master.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/issue_event/16978906856@github.com>

Kris Thielemans

unread,
Mar 25, 2025, 1:46:59 PM3/25/25
to SyneRBI/SIRF-SuperBuild, Subscribed

Success! Thanks @casperdcl . however, can you now have a different PR to update CHANGES.md, saying that we've switched to FindPython (maybe a link), and that they should use Python_EXECUTABLE or any other variables as indicated in the CMake doc? (Sorry, I shouldn't have approved the PR :-))


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/c2752069092@github.com>

KrisThielemansKrisThielemans left a comment (SyneRBI/SIRF-SuperBuild#933)

Success! Thanks @casperdcl . however, can you now have a different PR to update CHANGES.md, saying that we've switched to FindPython (maybe a link), and that they should use Python_EXECUTABLE or any other variables as indicated in the CMake doc? (Sorry, I shouldn't have approved the PR :-))


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/c2752069092@github.com>

Casper da Costa-Luis

unread,
Mar 25, 2025, 2:31:35 PM3/25/25
to SyneRBI/SIRF-SuperBuild, Subscribed

Already updated the changelog; feel free to update further


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/c2752183260@github.com>

casperdclcasperdcl left a comment (SyneRBI/SIRF-SuperBuild#933)

Already updated the changelog; feel free to update further


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/c2752183260@github.com>

Kris Thielemans

unread,
Mar 25, 2025, 3:27:00 PM3/25/25
to SyneRBI/SIRF-SuperBuild, Subscribed

Sorry. Confused. Which changelog?


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/c2752310331@github.com>

KrisThielemansKrisThielemans left a comment (SyneRBI/SIRF-SuperBuild#933)

Sorry. Confused. Which changelog?


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/c2752310331@github.com>

Casper da Costa-Luis

unread,
Mar 25, 2025, 3:34:01 PM3/25/25
to SyneRBI/SIRF-SuperBuild, Subscribed

https://github.com/SyneRBI/SIRF-SuperBuild/blob/master/CHANGES.md


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/c2752324445@github.com>

casperdclcasperdcl left a comment (SyneRBI/SIRF-SuperBuild#933)

https://github.com/SyneRBI/SIRF-SuperBuild/blob/master/CHANGES.md


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-SuperBuild/pull/933/c2752324445@github.com>

Reply all
Reply to author
Forward
0 new messages