ParaView's cmake code finds `/usr/bin/python` when using Python 3
when we find_package ParaView Python 2 interp is found even though PV uses Python 3.
building SENSEI with
#!/bin/bash
cmake -DCMAKE_CXX_FLAGS="-fPIC -std=c++11 -Wall -Wextra -O3 -march=x86-64 -mtune=generic" \
-DCMAKE_C_FLAGS="-fPIC -Wall -Wextra -O3 -march=x86-64 -mtune=generic" \
-DENABLE_PYTHON=ON -DSENSEI_PYTHON_VERSION=3 -DENABLE_CATALYST=ON -DENABLE_CATALYST_PYTHON=ON \
-DParaView_DIR=/home/in-situ-user/sensei_insitu/software/paraview/5.7.1/lib/cmake/paraview-5.7/ \
-DENABLE_VTK_IO=ON -DENABLE_VTK_MPI=ON -DENABLE_ADIOS1=ON \
-DADIOS1_DIR=/home/sensei/sensei_insitu/software/adios/1.13.1 \
-DENABLE_HDF5=OFF -DHDF5_ROOT=/usr/lib/x86_64-linux-gnu/hdf5/openmpi \
-DCMAKE_INSTALL_PREFIX=/home/sensei/sensei_insitu/software/sensei/3.0.0-catalyst-shared \
$*
output
in-situ-user@sensei-ascent-sc19:~/sensei_insitu/software/sensei/builds/3.0.0-catalyst-shared$ rm -rf *; ../config-sensei-catalyst.sh ../sensei_3.0.0/
-- The C compiler identification is GNU 7.4.0
-- The CXX compiler identification is GNU 7.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- ENABLE_SENSEI=ON
-- ENABLE_PYTHON=ON
-- ENABLE_VTK_GENERIC_ARRAYS=OFF
-- ENABLE_CATALYST=ON
-- ENABLE_CATALYST_PYTHON=ON
-- ENABLE_ADIOS1=ON
-- ENABLE_HDF5=OFF
-- ENABLE_CONDUIT=OFF
-- ENABLE_LIBSIM=OFF
-- ENABLE_VTK_IO=ON
-- ENABLE_VTK_MPI=ON
-- ENABLE_VTK_RENDERING=ON
-- ENABLE_VTK_ACCELERATORS=OFF
-- ENABLE_VTK_FILTERS=OFF
-- ENABLE_VTKM=OFF
-- ENABLE_VTKM_RENDERING=OFF
-- ENABLE_PROFILER=OFF
-- ENABLE_OSCILLATORS=ON
-- ENABLE_CONDUITTEST=OFF
-- ENABLE_KRIPKE=OFF
-- CMAKE_BUILD_TYPE=Release
-- CMAKE_CXX_FLAGS=-fPIC -std=c++11 -Wall -Wextra -O3 -march=x86-64 -mtune=generic
-- BUILD_SHARED_LIBS=OFF
-- BUILD_STATIC_EXECS=OFF
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found MPI_C: /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so (found version "3.1")
-- Found MPI_CXX: /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi_cxx.so (found version "3.1")
-- Found MPI: TRUE (found version "3.1")
-- Found 'adios_config': /home/in-situ-user/sensei_insitu/software/adios/1.13.1/bin/adios_config
-- ADIOS1 linker flags (unparsed): /home/sensei/sensei_insitu/software/adios/1.13.1/lib/libadios.a /home/sensei/sensei_insitu/software/chaos/1.13.1/lib/libevpath.so /home/sensei/sensei_insitu/software/chaos/1.13.1/lib/libatl.so /home/sensei/sensei_insitu/software/chaos/1.13.1/lib/libffs.so /usr/lib/x86_64-linux-gnu/libz.so /usr/lib/x86_64-linux-gnu/libm.so
-- Found ADIOS1: /home/sensei/sensei_insitu/software/adios/1.13.1/lib/libadios.a;/home/sensei/sensei_insitu/software/chaos/1.13.1/lib/libevpath.so;/home/sensei/sensei_insitu/software/chaos/1.13.1/lib/libatl.so;/home/sensei/sensei_insitu/software/chaos/1.13.1/lib/libffs.so;/usr/lib/x86_64-linux-gnu/libz.so;/usr/lib/x86_64-linux-gnu/libm.so (found version "1.13.1")
-- 1. find_package(ParaView CONFIG QUIET) <===========================================
-- 1. PYTHON_EXECUTABLE=/usr/bin/python
-- 1. ===========================================>
-- 2. find_package(ParaView CONFIG COMPONENTS Catalyst;ServerManagerRendering;PythonCatalyst) <===========================================
-- Found mpi4py: /home/in-situ-user/.local/lib/python2.7/site-packages/mpi4py/include
-- Found HDF5: /usr/lib/x86_64-linux-gnu/hdf5/openmpi/lib/libhdf5.so (found version "1.10.0.1") found components: C HL
-- Found Python3: /usr/lib/x86_64-linux-gnu/libpython3.6m.so (found suitable version "3.6.8", minimum required is "3.6") found components: Development
-- Found MPI: TRUE (found version "3.1") found components: C
-- Found X11: /usr/include found components: Xt
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so found components: OpenGL GLX
-- 2. PYTHON_EXECUTABLE=/usr/bin/python
-- 2. ===========================================>
-- 3. find_package(VTK CONFIG QUIET COMPONENTS ) <===========================================
-- 3. PYTHON_EXECUTABLE=/usr/bin/python
-- 3. ===========================================>
-- 1. find_package(PythonInterp 3 REQUIRED) <===========================================
CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find PythonInterp: Found unsuitable version "2.7.15", but
required is at least "3" (found /usr/bin/python)
Call Stack (most recent call first):
/usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:376 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.10/Modules/FindPythonInterp.cmake:152 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMake/python.cmake:5 (find_package)
CMakeLists.txt:21 (include)
-- Configuring incomplete, errors occurred!
See also "/home/in-situ-user/sensei_insitu/software/sensei/builds/3.0.0-catalyst-shared/CMakeFiles/CMakeOutput.log".
See also "/home/in-situ-user/sensei_insitu/software/sensei/builds/3.0.0-catalyst-shared/CMakeFiles/CMakeError.log".
in CMake/catalyst.cmake
we are calling find_package 2x for ParaView, 1x for VTK.
- https://gitlab.kitware.com/sensei/sensei/blob/master/CMake/catalyst.cmake#L10
- https://gitlab.kitware.com/sensei/sensei/blob/master/CMake/catalyst.cmake#L22
- https://gitlab.kitware.com/sensei/sensei/blob/master/CMake/catalyst.cmake#L41
here is the patch I used to help track down who's find_package is failing
diff --git a/CMake/catalyst.cmake b/CMake/catalyst.cmake
index 373a0b2..afdd06d 100644
--- a/CMake/catalyst.cmake
+++ b/CMake/catalyst.cmake
@@ -6,8 +6,10 @@ if (ENABLE_CATALYST)
list(APPEND sensei_pv_components_legacy vtkPVPythonCatalyst)
list(APPEND sensei_pv_components_modern PythonCatalyst)
endif()
-
+ message(STATUS "1. find_package(ParaView CONFIG QUIET) <===========================================")
find_package(ParaView CONFIG QUIET)
+ message(STATUS "1. PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}")
+ message(STATUS "1. ===========================================>")
if(NOT ParaView_FOUND)
message(STATUS ${ParaView_NOT_FOUND_MESSAGE})
message(FATAL_ERROR "Catalyst analysis components require Catalyst build "
@@ -19,7 +21,10 @@ if (ENABLE_CATALYST)
else()
set (SENSEI_PV_COMPONENTS ${sensei_pv_components_modern})
endif()
+ message(STATUS "2. find_package(ParaView CONFIG COMPONENTS ${SENSEI_PV_COMPONENTS}) <===========================================")
find_package(ParaView CONFIG COMPONENTS ${SENSEI_PV_COMPONENTS})
+ message(STATUS "2. PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}")
+ message(STATUS "2. ===========================================>")
# avoid leaking these internal variables
unset(sensei_pv_components_legacy)
@@ -38,7 +43,10 @@ if (ENABLE_CATALYST)
target_compile_definitions(sVTK INTERFACE ${VTK_DEFINITIONS})
else()
# find VTK separately
+ message(STATUS "3. find_package(VTK CONFIG QUIET COMPONENTS ${SENSEI_VTK_COMPONENTS}) <===========================================")
find_package(VTK CONFIG QUIET COMPONENTS ${SENSEI_VTK_COMPONENTS})
+ message(STATUS "3. PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}")
+ message(STATUS "3. ===========================================>")
target_link_libraries(sVTK INTERFACE ${ParaView_LIBRARIES} ${VTK_LIBRARIES})
endif()
diff --git a/CMake/hdf5.cmake b/CMake/hdf5.cmake
index 23dfa20..0ba5221 100644
--- a/CMake/hdf5.cmake
+++ b/CMake/hdf5.cmake
@@ -1,9 +1,11 @@
if (ENABLE_HDF5)
+ message(STATUS "1. find_package(HDF5 REQUIRED COMPONENTS C) ===================>")
find_package(HDF5 REQUIRED COMPONENTS C)
if(NOT HDF5_IS_PARALLEL)
message(SEND_ERROR "Failed to locate parallel hdf5 installation")
endif()
+ message(STATUS "1. find_package(HDF5 REQUIRED COMPONENTS C) <===================")
add_library(sHDF5 INTERFACE)
target_link_libraries(sHDF5 INTERFACE ${HDF5_LIBRARIES})
diff --git a/CMake/python.cmake b/CMake/python.cmake
index 516f2b8..4f18dcc 100644
--- a/CMake/python.cmake
+++ b/CMake/python.cmake
@@ -1,7 +1,9 @@
if (ENABLE_PYTHON)
set(SENSEI_PYTHON_VERSION 2 CACHE STRING "The major version number of Python SENSEI should use.")
set_property(CACHE SENSEI_PYTHON_VERSION PROPERTY STRINGS 2 3)
+ message(STATUS "1. find_package(PythonInterp ${SENSEI_PYTHON_VERSION} REQUIRED) <===========================================")
find_package(PythonInterp ${SENSEI_PYTHON_VERSION} REQUIRED)
+ message(STATUS "1. <===========================================")
find_package(PythonLibs ${SENSEI_PYTHON_VERSION} REQUIRED)
find_package(NUMPY REQUIRED)
find_program(swig_cmd NAMES swig swig3.0)
work around is to force PYTHON_EXECUTABLE on the cmake command line.