New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Exp PyROOT] Build PyROOT with multiple Python versions #4279
Conversation
Starting build on |
Build failed on ROOT-fedora29/python3. Warnings:
Failing tests: |
Build failed on ROOT-performance-centos7-multicore/default. Warnings:
Failing tests: |
Build failed on ROOT-ubuntu16/rtcxxmod. Warnings:
Failing tests: |
Build failed on mac1014/cxx17. Warnings:
Failing tests: |
Build failed on ROOT-fedora27/noimt. Warnings:
Failing tests: |
@phsft-bot build |
Starting build on |
Build failed on windows10/default. |
bb5c723
to
61a8b82
Compare
Starting build on |
Build failed on windows10/default. |
61a8b82
to
b8c753e
Compare
Starting build on |
Build failed on windows10/default. |
@@ -94,6 +94,10 @@ foreach(py_source ${py_sources}) | |||
install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -O -m py_compile ${d}/${py_source})") | |||
endforeach() | |||
|
|||
if (NOT EXISTS ${localruntimedir}/python_default) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check how to make this portable for Windows
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is create_symlink portable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
config/thisroot.sh
Outdated
fi | ||
|
||
if [ -n "${old_rootsys}" ] ; then | ||
drop_from_all_libs() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clean _environment
@@ -86,81 +87,162 @@ if [ -n "${old_rootsys}" ] ; then | |||
drop_from_path "$JUPYTER_PATH" "${old_rootsys}/etc/notebook" | |||
JUPYTER_PATH=$newpath | |||
fi | |||
if [ -z "${MANPATH}" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
put outside and not protected by if
config/thisroot.sh
Outdated
if [ -z "${JUPYTER_PATH}" ]; then | ||
JUPYTER_PATH=$ROOTSYS/etc/notebook; export JUPYTER_PATH # Linux, ELF HP-UX | ||
|
||
if [ -z "${PYTHON_VERSION}" ] ; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this shold not protect the clean
config/thisroot.sh
Outdated
{ | ||
# Assert that we got enough arguments | ||
if test $# -ne 1 ; then | ||
echo "drop_from_path: needs 1 argument" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change drop_from_path
|
||
if [ -z "${MANPATH}" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
put inside main
config/thisroot.sh
Outdated
SHLIB_PATH=@libdir@:@libdir@/python${version} | ||
export SHLIB_PATH # Linux, ELF HP-UX | ||
else | ||
SHLIB_PATH=@libdir@:@libdir@/python${version}:$SHLIBR_PATH |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SHLIB_PATH
Changed CMake variables in tutorials and pyunittests to make tests pass with multiple Python versions.
Installation: a new CMake variable CMAKE_INSTALL_PYROOTDIR was introduced in order to install the PyROOT and cppyy packages in a directory which can be automatically found by the Python interpreter the user keeps the default value of CMAKE_INSTALL_PREFIX. This value default to: CMAKE_INSTALL_PREFIX/CMAKE_INSTALL_LIBDIR/pythonX.Y/site-packages for standard Unix distributions and to: CMAKE_INSTALL_PREFIX/CMAKE_INSTALL_LIBDIR/pythonX.Y/dist-packages for Debian and Ubuntu.
. ├── CMakeLists.txt ├── JsMVA │ └── python ├── JupyROOT │ ├── python │ ├── README.md │ └── src └── PyROOT ├── inc ├── python ├── src └── test
This is done to avoid changes to the macros that would be necessary due to linking errors caused if we keep only one CMakeLists.txt file inside PyROOT directory. . ├── CMakeLists.txt ├── JsMVA │ ├── CMakeLists.txt │ └── python ├── JupyROOT │ ├── CMakeLists.txt │ ├── python │ ├── README.md │ └── src └── PyROOT ├── CMakeLists.txt ├── inc ├── python ├── src └── test
… layout Change of directory layout prevented makepchinput.py to construct the correct path to PyROOT Experimental directories and for this reason TPython related headers were not added to the PCH. Deprecated, since with modules we do not have a PCH anymore. Keep it just in case.
…up script A python egg is created for the cppyy package. For doing this, we use the usual "python setup.py install_egg_info" syntax.
…ipt specifically created A setup script is added for PyROOT in order to access the information to put in the python egg.
Here we make all the changes necessary to enable the pyroot experimental related variables and paths only when we are in pyroot experimental. This can easily be reverted once PyROOT experimental will be the default.
…tisfied Python eggs for PyROOT and Cppyy cannot be created in a complete and pythonic way if setuptools is not installed and version is > 3.3. The absence of this conditions actually also make the entire build fail. If the requisites are not satisfied, eggs are created in a simpler way (with less information).
The following CMake variables: PYTHON_INCLUDE_DIR PYTHON_LIBRARY are unset in order to allow the use to specify only -DPYTHON_EXECUTABLE at configure time. The following variable: CMAKE_INSTALL_PYROOTIR is unset in order to install the package in the correct path.
161a031
to
c1ef82e
Compare
Starting build on |
Build failed on ROOT-ubuntu18.04-i386/cxx14. Errors:
Warnings:
|
Build failed on mac1014/cxx17. Errors:
And 46 more |
Build failed on ROOT-fedora30/cxx14. Failing tests: |
Build failed on ROOT-fedora27/noimt. Failing tests: |
Build failed on ROOT-ubuntu16/rtcxxmod. Failing tests: |
Build failed on ROOT-fedora29/python3. Failing tests: |
Build failed on windows10/cxx14. Errors:
|
New version coming |
When PR root-project#4279 was initially sent on Aug 25th, the search for Python was moved to RootBuildMacros in order to avoid a build failure due ot the search for another package and the declaration of one of the new CMake variables. This seem not to be a problem anymore (something changed in the meantime?), so the search for Python can be put back to the original place. This could also fix the tests failing with cxx17 due to a mismatch between Python executable and libraries.
When PR root-project#4279 was initially sent on Aug 25th, the search for Python was moved to RootBuildMacros in order to avoid a build failure due ot the search for another package and the declaration of one of the new CMake variables. This seem not to be a problem anymore (something changed in the meantime?), so the search for Python can be put back to the original place. This could also fix the tests failing with cxx17 due to a mismatch between Python executable and libraries.
When PR #4279 was initially sent on Aug 25th, the search for Python was moved to RootBuildMacros in order to avoid a build failure due ot the search for another package and the declaration of one of the new CMake variables. This seem not to be a problem anymore (something changed in the meantime?), so the search for Python can be put back to the original place. This could also fix the tests failing with cxx17 due to a mismatch between Python executable and libraries.
When PR root-project#4279 was initially sent on Aug 25th, the search for Python was moved to RootBuildMacros in order to avoid a build failure due ot the search for another package and the declaration of one of the new CMake variables. This seem not to be a problem anymore (something changed in the meantime?), so the search for Python can be put back to the original place. This could also fix the tests failing with cxx17 due to a mismatch between Python executable and libraries.
When PR root-project#4279 was initially sent on Aug 25th, the search for Python was moved to RootBuildMacros in order to avoid a build failure due ot the search for another package and the declaration of one of the new CMake variables. This seem not to be a problem anymore (something changed in the meantime?), so the search for Python can be put back to the original place. This could also fix the tests failing with cxx17 due to a mismatch between Python executable and libraries.
The commits in this PR contain the necessary steps performed in order to allow the user to build PyROOT with more than one versions of Python. The version in use can be changed with the usual
source thisroot.sh
preceded by the specific Python version, e.g.:ROOT_PYTHON_VERSION=3.6 source bin/thisroot.sh
performed inside the build directory.
Quick summary of the commits:
(1) set the necessary CMake variables to build the PyROOT libraries in lib/pythonX.Y
(2) modify thisroot.sh to allow the user to select the Python version
(3) necessary changes to pyunittests and tutorials CMake variables
(4) installation