Python Path Changing after configure

Hi all,
I am trying to compile the paraview 5.8.0.
mkdir build
cd build
ccmake ../
All good till now. Set the flag:
PARAVIEW_USE_PYTHON *ON
[c] configure
All passed. However cmake found
Python3_LIBRARY_RELEASE */usr/lib/libpython3.8.so
This is the python version controlled by the Linux installation.

I want to change it to my custom Intel Python.
So I changed all the following:
Python3_LIBRARY_RELEASE */path_to_intelpython3/lib/libpython3.7.so
_Python3_EXECUTABLE */path_to_intelpython3/bin/python3
_Python3_INCLUDE_DIR */path_to_intelpython3/include/python3.7m
_Python3_LIBRARY_RELEASE */path_to_intelpython3/lib/libpython3.7.so

Press configure and again everything changed back to 3.8.

My Python environment is setup correctly. I am not using any virtual environment.
When I type python in terminal, I get:
Python 3.7.4 (default, Nov 22 2019, 21:31:39) [GCC 7.3.0] :: Intel(R) Corporation on linux

Some global information:
gcc (GCC) 10.1.0
cmake version 3.17.3
linux kernel 4.19.126-1

I successfully compiled the paraview 5.6 with the same Intel Python distribution before updating GCC to the 10.1.0 version. Now the paraview 5.6 complains about somewhere in Exodus module that a function defined multiple times.

Thanks for help,
Mahdi

ParaView now uses the new FindPython module. You can see the documentation for how to use the new module in the CMake docs.

This was fixed more recently. https://gitlab.kitware.com/vtk/vtk/commit/a9079bdccbb2165583d6773a5ed848427e2a38a8

Thank you Ben.
Sorry to ask again.
To force cmake pointing towards the path I want, should I set some bash variables according to the new module, or I need edit the CmakeList and set some variable there?
Thanks again.

You should be able to set the “input variables” listed there with -D arguments to CMake to get it to find the Python you want it to.

1 Like

The @ben.boeckel solution is working.
Here is some dirty hack I did to make it work for someone with similar problem.

  1. mkdir build
  2. cd build
  3. `ccmake …/
  • Change all the flags you want, such as PARAVIEW_USE_PYTHON ON.
  1. Configure, press [c] till you receive the option [g] for Generate.
  2. Do not generate and just quit.

Now

  1. cmake ../ -DPython3_EXECUTABLE=path_to_intelpython3/bin/python3 -DPython3_LIBRARY=path_to_intelpython3/lib/libpython3.7m.so -DPython3_INCLUDE_DIR=path_to_intelpython3/include/python3.7m -D_Python3_EXECUTABLE= path_to_intelpython3/bin/python3 -D_Python3_INCLUDE_DIR=path_to_intelpython3/include/python3.7m
  2. make -j 4

Best,
Mahdi