Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion cmake/podioBuild.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,27 @@ endif()
# Setup the python install dir. See the discussion in
# https://github.com/AIDASoft/podio/pull/599 for more details on why this is
# done the way it is
#
# For Python 3.13+ with free-threading (PEP 703), the site-packages directory
# includes a 't' suffix (e.g., python3.14t/site-packages). We use Python's
# own SITEARCH to get the correct path including any ABI suffixes.
#
set(podio_python_lib_dir lib)
if("${Python3_SITEARCH}" MATCHES "/lib64/")
set(podio_python_lib_dir lib64)
endif()

# Extract the python-specific part of the path (e.g., python3.14t/site-packages)
# from Python3_SITEARCH
string(REGEX MATCH "python[0-9]+\\.[0-9]+[a-z]*/site-packages" _python_site_subdir "${Python3_SITEARCH}")
if(NOT _python_site_subdir)
# Fallback to manual construction if regex fails
set(_python_site_subdir "python${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}/site-packages")
message(WARNING "Could not extract site-packages path from Python3_SITEARCH (${Python3_SITEARCH}), using fallback: ${_python_site_subdir}")
endif()

set(podio_PYTHON_INSTALLDIR
"${CMAKE_INSTALL_PREFIX}/${podio_python_lib_dir}/python${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}/site-packages"
"${CMAKE_INSTALL_PREFIX}/${podio_python_lib_dir}/${_python_site_subdir}"
CACHE STRING
"The install prefix for the python bindings and the generator and templates"
)
Expand Down
2 changes: 1 addition & 1 deletion env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ elif [[ "$unamestr" = 'Darwin' ]]; then
fi
fi

python_stem=python3.$(python -c 'import sys; print(sys.version_info[1])')/site-packages
python_stem=python3.$(python -c 'import sys; print(str(sys.version_info[1]) + sys.abiflags )')/site-packages
if [ -d $PODIO/lib64/${python_stem} ]; then
if ! echo $PYTHONPATH | grep -o $PODIO/lib64/${python_stem} > /dev/null 2>&1; then
export PYTHONPATH=$PODIO/lib64/${python_stem}:$PYTHONPATH
Expand Down
Loading