File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -214,13 +214,27 @@ endif()
214214# Setup the python install dir. See the discussion in
215215# https://github.com/AIDASoft/podio/pull/599 for more details on why this is
216216# done the way it is
217+ #
218+ # For Python 3.13+ with free-threading (PEP 703), the site-packages directory
219+ # includes a 't' suffix (e.g., python3.14t/site-packages). We use Python's
220+ # own SITEARCH to get the correct path including any ABI suffixes.
221+ #
217222set (podio_python_lib_dir lib)
218223if ("${Python3_SITEARCH} " MATCHES "/lib64/" )
219224 set (podio_python_lib_dir lib64)
220225endif ()
221226
227+ # Extract the python-specific part of the path (e.g., python3.14t/site-packages)
228+ # from Python3_SITEARCH
229+ string (REGEX MATCH "python[0-9]+\\ .[0-9]+[a-z]*/site-packages" _python_site_subdir "${Python3_SITEARCH} " )
230+ if (NOT _python_site_subdir)
231+ # Fallback to manual construction if regex fails
232+ set (_python_site_subdir "python${Python3_VERSION_MAJOR} .${Python3_VERSION_MINOR} /site-packages" )
233+ message (WARNING "Could not extract site-packages path from Python3_SITEARCH (${Python3_SITEARCH} ), using fallback: ${_python_site_subdir} " )
234+ endif ()
235+
222236set (podio_PYTHON_INSTALLDIR
223- "${CMAKE_INSTALL_PREFIX} /${podio_python_lib_dir} /python ${Python3_VERSION_MAJOR} . ${Python3_VERSION_MINOR} /site-packages "
237+ "${CMAKE_INSTALL_PREFIX} /${podio_python_lib_dir} /${_python_site_subdir} "
224238 CACHE STRING
225239 "The install prefix for the python bindings and the generator and templates"
226240)
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ elif [[ "$unamestr" = 'Darwin' ]]; then
2525 fi
2626fi
2727
28- python_stem=python3.$( python -c ' import sys; print(sys.version_info[1])' ) /site-packages
28+ python_stem=python3.$( python -c ' import sys; print(str( sys.version_info[1]) + sys.abiflags )' ) /site-packages
2929if [ -d $PODIO /lib64/${python_stem} ]; then
3030 if ! echo $PYTHONPATH | grep -o $PODIO /lib64/${python_stem} > /dev/null 2>&1 ; then
3131 export PYTHONPATH=$PODIO /lib64/${python_stem} :$PYTHONPATH
You can’t perform that action at this time.
0 commit comments