Commit 32547d82 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit Committed by Kitware Robot
Browse files

Merge topic 'python3-support'

ef6969d9 paraview: add the Python version to the package name
b70dcb96 python: update packaging to support 3.x
5ae20e1b python: support python2 and python3 builds
dcfcfe52

 superbuild: bump for python3 support
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !608
parents 4cd74e25 ef6969d9
......@@ -33,7 +33,9 @@ function (superbuild_find_projects var)
cxx11
paraview
paraviewpluginsexternal
python)
python
python2
python3)
option(USE_NONFREE_COMPONENTS "Enable the non-free parts of the superbuild" OFF)
mark_as_advanced(USE_NONFREE_COMPONENTS)
......
......@@ -94,7 +94,7 @@ endif ()
if (python_enabled)
file(GLOB egg_dirs
"${superbuild_install_location}/lib/python2.7/site-packages/*.egg/")
"${superbuild_install_location}/lib/python${superbuild_python_version}/site-packages/*.egg/")
superbuild_apple_install_python(
"\${CMAKE_INSTALL_PREFIX}"
"${paraview_appname}"
......@@ -104,7 +104,7 @@ if (python_enabled)
${python_modules}
MODULE_DIRECTORIES
"${superbuild_install_location}/Applications/paraview.app/Contents/Python"
"${superbuild_install_location}/lib/python2.7/site-packages"
"${superbuild_install_location}/lib/python${superbuild_python_version}/site-packages"
${egg_dirs}
SEARCH_DIRECTORIES
"${superbuild_install_location}/Applications/paraview.app/Contents/Libraries"
......@@ -112,7 +112,7 @@ if (python_enabled)
if (matplotlib_enabled)
install(
DIRECTORY "${superbuild_install_location}/lib/python2.7/site-packages/matplotlib/mpl-data/"
DIRECTORY "${superbuild_install_location}/lib/python${superbuild_python_version}/site-packages/matplotlib/mpl-data/"
DESTINATION "${paraview_appname}/Contents/Python/matplotlib/mpl-data"
COMPONENT superbuild)
endif ()
......
......@@ -104,7 +104,9 @@ if (USE_NONFREE_COMPONENTS AND (WIN32 OR (UNIX AND NOT APPLE)))
endif ()
set(PARAVIEW_ENABLE_PYTHON ${python_enabled})
if (python_enabled AND USE_SYSTEM_python AND NOT python_FIND_LIBRARIES)
if (python_enabled AND
((USE_SYSTEM_python2 AND NOT python2_FIND_LIBRARIES) OR
(USE_SYSTEM_python3 AND NOT python3_FIND_LIBRARIES)))
set(PARAVIEW_ENABLE_PYTHON OFF)
endif()
......@@ -143,7 +145,7 @@ superbuild_add_project(paraview
hdf5
DEPENDS_OPTIONAL
cuda boost matplotlib mpi numpy png
python qt5 visitbridge zlib silo las
python python2 python3 qt5 visitbridge zlib silo las
xdmf3 ospray vrpn vtkm tbb netcdf
nlohmannjson
paraviewgettingstartedguide
......@@ -163,7 +165,7 @@ superbuild_add_project(paraview
-DPARAVIEW_BUILD_QT_GUI:BOOL=${qt5_enabled}
-DPARAVIEW_ENABLE_FFMPEG:BOOL=${ffmpeg_enabled}
-DPARAVIEW_ENABLE_PYTHON:BOOL=${PARAVIEW_ENABLE_PYTHON}
-DPARAVIEW_PYTHON_VERSION:STRING=2
-DPARAVIEW_PYTHON_VERSION:STRING=${python_version}
-DPARAVIEW_ENABLE_COSMOTOOLS:BOOL=${cosmotools_enabled}
-DPARAVIEW_ENABLE_XDMF3:BOOL=${xdmf3_enabled}
-DPARAVIEW_ENABLE_LAS:BOOL=${las_enabled}
......
......@@ -17,6 +17,11 @@ else ()
"${CMAKE_SYSTEM_NAME}")
endif ()
if (python_enabled)
list(APPEND package_suffix_items
"Python${superbuild_python_version}")
endif ()
# On Windows, we put add MSVC compiler version in the package name
if (WIN32 AND MSVC)
if (MSVC_VERSION LESS 1800) # 1800 == VS2013
......
......@@ -136,12 +136,14 @@ endif ()
if (python_enabled)
file(GLOB egg_dirs
"${superbuild_install_location}/lib/python2.7/site-packages/*.egg/")
include(python.functions)
superbuild_install_superbuild_python(
LIBSUFFIX "/python2.7")
"${superbuild_install_location}/lib/python${superbuild_python_version}/site-packages/*.egg/")
if (python2_built_by_superbuild)
include(python2.functions)
superbuild_install_superbuild_python2(
LIBSUFFIX "/python${superbuild_python_version}")
endif ()
# Add extra paths to MODULE_DIRECTORIES here (.../local/lib/python2.7/dist-packages)
# Add extra paths to MODULE_DIRECTORIES here (.../local/lib/python${superbuild_python_version}/dist-packages)
# is a workaround to an issue when building against system python. When we move to
# Python3, we should make sure all the python modules get installed to the same
# location to begin with.
......@@ -155,14 +157,14 @@ if (python_enabled)
${python_modules}
INCLUDE_REGEXES ${include_regexes}
EXCLUDE_REGEXES ${exclude_regexes}
MODULE_DIRECTORIES "${superbuild_install_location}/lib/python2.7/site-packages"
MODULE_DIRECTORIES "${superbuild_install_location}/lib/python${superbuild_python_version}/site-packages"
${egg_dirs}
LOADER_PATHS "${library_paths}")
if (matplotlib_built_by_superbuild)
install(
DIRECTORY "${superbuild_install_location}/lib/python2.7/site-packages/matplotlib/mpl-data/"
DESTINATION "lib/python2.7/site-packages/matplotlib/mpl-data"
DIRECTORY "${superbuild_install_location}/lib/python${superbuild_python_version}/site-packages/matplotlib/mpl-data/"
DESTINATION "lib/python${superbuild_python_version}/site-packages/matplotlib/mpl-data"
COMPONENT superbuild)
endif ()
endif ()
......
......@@ -31,8 +31,8 @@ endforeach ()
if (python_enabled)
# Install ParaView Python libraries and any non-ParaView Python libraries.
install(
DIRECTORY "${superbuild_install_location}/lib/python2.7/"
DESTINATION "lib/python2.7/"
DIRECTORY "${superbuild_install_location}/lib/python${superbuild_python_version}/"
DESTINATION "lib/python${superbuild_python_version}/"
COMPONENT superbuild
USE_SOURCE_PERMISSIONS
PATTERN "__pycache__" EXCLUDE
......@@ -42,7 +42,7 @@ if (python_enabled)
# Install python binaries and symlinks
if (python_built_by_superbuild)
install(
PROGRAMS "${superbuild_install_location}/bin/python2.7-config"
PROGRAMS "${superbuild_install_location}/bin/python${superbuild_python_version}-config"
"${superbuild_install_location}/bin/python2"
"${superbuild_install_location}/bin/python2-config"
"${superbuild_install_location}/bin/python"
......@@ -50,7 +50,7 @@ if (python_enabled)
DESTINATION bin
COMPONENT superbuild)
list(APPEND binaries_to_install
"${superbuild_install_location}/bin/python2.7")
"${superbuild_install_location}/bin/python${superbuild_python_version}")
endif()
endif()
......@@ -83,9 +83,9 @@ list(REMOVE_DUPLICATES libraries_referenced_by_cmake)
if (python_enabled)
# Now grab extra python SOs
file(GLOB_RECURSE paraview_python_modules
"${real_superbuild_install_location}/lib/python2.7/site-packages/*${CMAKE_SHARED_MODULE_SUFFIX}")
"${real_superbuild_install_location}/lib/python${superbuild_python_version}/site-packages/*${CMAKE_SHARED_MODULE_SUFFIX}")
file(GLOB_RECURSE python_modules
"${real_superbuild_install_location}/lib/python2.7/*${CMAKE_SHARED_MODULE_SUFFIX}")
"${real_superbuild_install_location}/lib/python${superbuild_python_version}/*${CMAKE_SHARED_MODULE_SUFFIX}")
else ()
set(paraview_python_modules)
set(python_modules)
......@@ -174,9 +174,9 @@ include(GetPrerequisites)
set(all_binaries)
set(dependency_search_paths
"${real_superbuild_install_location}/lib"
"${real_superbuild_install_location}/lib/python2.7"
"${real_superbuild_install_location}/lib/python2.7/site-packages"
"${real_superbuild_install_location}/lib/python2.7/lib-dynload")
"${real_superbuild_install_location}/lib/python${superbuild_python_version}"
"${real_superbuild_install_location}/lib/python${superbuild_python_version}/site-packages"
"${real_superbuild_install_location}/lib/python${superbuild_python_version}/lib-dynload")
if(libraries_to_install)
list(SORT libraries_to_install)
endif()
......
......@@ -113,8 +113,8 @@ if (visrtx_enabled)
endif ()
if (python_enabled)
include(python.functions)
superbuild_install_superbuild_python()
include(python2.functions)
superbuild_install_superbuild_python2()
superbuild_windows_install_python(
MODULES paraview
......@@ -123,7 +123,7 @@ if (python_enabled)
${python_modules}
MODULE_DIRECTORIES "${superbuild_install_location}/bin/Lib/site-packages"
"${superbuild_install_location}/lib/site-packages"
"${superbuild_install_location}/lib/python2.7/site-packages"
"${superbuild_install_location}/lib/python${superbuild_python_version}/site-packages"
"${superbuild_install_location}/lib/paraview-${paraview_version_major}.${paraview_version_minor}/site-packages"
SEARCH_DIRECTORIES "${superbuild_install_location}/lib"
"${superbuild_install_location}/bin")
......
Subproject commit dc9cef1b4d56837fdc0f17ffef47b06f490d4453
Subproject commit d213d239966a5e0ef6160d965ad493c3f3e33231
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment