I’m trying to build this piece of code using cmake, but I keep getting an error that it can’t find python, or I have the wrong version. I only have one python distribution. 3.10, it is in my path. I highlighted below where it says I have version “…” installed, but not 3. I’m not sure what is causing all these errors. I also have a thread failure highlighted, I’m not even sure what that is. Sorry, I don’t typically use cmake. Any help would be greatly appreciated.
Thank you
C:\COMP167\mcnptools>cmake -D CMAKE_INSTAL_PREFIX=D:\MY_MCNP\MCNPTOOLS -D mcnptools.python_install=User C:\COMP167\mcnptools -D Python_EXECUTABLE=C:\Users\Teancum\AppData\Local\Programs\Python\Python310 -D Python_LIBRARY=C:\Users\Teancum\AppData\Local\Programs\Python\Python310\Lib -D Python_INCLUDE_DIR=C:\Users\Teancum\AppData\Local\Programs\Python\Python310
– Building for: Visual Studio 15 2017
CMake Deprecation Warning at CMakeLists.txt:3 (cmake_policy):
The OLD behavior for policy CMP0076 will be removed from a future version
of CMake.
The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
– The C compiler identification is MSVC 19.16.27031.1
– The CXX compiler identification is MSVC 19.16.27031.1
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe - skipped
– Detecting C compile features
– Detecting C compile features - done
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe - skipped
– Detecting CXX compile features
– Detecting CXX compile features - done
– Could NOT find Python (missing: Interpreter)
– Performing Test CMAKE_HAVE_LIBC_PTHREAD
– Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
– 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 - not found
– Found Threads: TRUE
– Found Git: C:/Program Files/Git/cmd/git.exe (found version “2.26.0.windows.1”)
– Attempting to find CMake-built HDF5
CMake Warning at dependencies/shacl-F5_CXX/indirection_.cmake:1 (_find_package):
Could not find a configuration file for package “HDF5” that is compatible
with requested version “”.
The following configuration files were considered but not accepted:
C:/Program Files/HDF_Group/HDF5/1.14.0/cmake/hdf5-config.cmake, version: 1.14.0 (64bit)
Call Stack (most recent call first):
dependencies/shacl-F5_CXX/.cmake/FunctionExtension/call.cmake:9 (include)
dependencies/shacl-F5_CXX/.cmake/FunctionExtension/find_package.cmake:21 (call)
dependencies/shacl-F5_CXX/.cmake/Git/Submodule/Packages/find_package.cmake:20 (previous_find_package)
dependencies/shacl-F5_CXX/indirection.cmake:1 (find_package)
dependencies/shacl-F5_CXX/.cmake/FunctionExtension/call.cmake:9 (include)
dependencies/shacl-F5_CXX/.cmake/FunctionExtension/find_package.cmake:21 (call)
dependencies/shacl-F5_CXX/.cmake/Git/Submodule/Packages/find_package.cmake:20 (previous_find_package)
dependencies/shacl-F5_CXX/CMakeLists.txt:63 (find_package)
– Attempting to find makefile-built HDF5
– Found HDF5: C:/Program Files/HDF_Group/HDF5/1.14.0/lib/hdf5.lib (found version “1.14.0”) found components: C
– Found HDF5. Version = 1.14.0, Is Parallel? = FALSE
– No MPI parallel HDF5 found. Building serial library
CMake Warning at utils/CMakeLists.txt:19 (message):
libtiff not found…not building mctal2rad
CMake Error at C:/Program Files/CMake/share/cmake-3.26/Modules/FindPython/Support.cmake:706 (file):
file STRINGS file
“C:\Users\Teancum\AppData\Local\Programs\Python\Python310/patchlevel.h”
cannot be read.
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.26/Modules/FindPython/Support.cmake:3468 (python_get_version)
C:/Program Files/CMake/share/cmake-3.26/Modules/FindPython.cmake:601 (include)
python/indirection____________.cmake:1 (find_package)
dependencies/shacl-F5_CXX/.cmake/FunctionExtension/call.cmake:9 (include)
dependencies/shacl-F5_CXX/.cmake/FunctionExtension/find_package.cmake:21 (call)
dependencies/shacl-F5_CXX/.cmake/Git/Submodule/Packages/find_package.cmake:20 (previous_find_package)
python/indirection___________.cmake:1 (find_package)
dependencies/shacl-F5_CXX/.cmake/FunctionExtension/call.cmake:9 (include)
dependencies/shacl-F5_CXX/.cmake/FunctionExtension/find_package.cmake:21 (call)
dependencies/shacl-F5_CXX/.cmake/Git/Submodule/Packages/find_package.cmake:20 (previous_find_package)
python/CMakeLists.txt:7 (find_package)
CMake Error at C:/Program Files/CMake/share/cmake-3.26/Modules/FindPython/Support.cmake:711 (list):
list GET given empty list
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.26/Modules/FindPython/Support.cmake:3468 (python_get_version)
C:/Program Files/CMake/share/cmake-3.26/Modules/FindPython.cmake:601 (include)
python/indirection____________.cmake:1 (find_package)
dependencies/shacl-F5_CXX/.cmake/FunctionExtension/call.cmake:9 (include)
dependencies/shacl-F5_CXX/.cmake/FunctionExtension/find_package.cmake:21 (call)
dependencies/shacl-F5_CXX/.cmake/Git/Submodule/Packages/find_package.cmake:20 (previous_find_package)
python/indirection___________.cmake:1 (find_package)
dependencies/shacl-F5_CXX/.cmake/FunctionExtension/call.cmake:9 (include)
dependencies/shacl-F5_CXX/.cmake/FunctionExtension/find_package.cmake:21 (call)
dependencies/shacl-F5_CXX/.cmake/Git/Submodule/Packages/find_package.cmake:20 (previous_find_package)
python/CMakeLists.txt:7 (find_package)
CMake Error at C:/Program Files/CMake/share/cmake-3.26/Modules/FindPython/Support.cmake:712 (list):
list GET given empty list
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.26/Modules/FindPython/Support.cmake:3468 (python_get_version)
C:/Program Files/CMake/share/cmake-3.26/Modules/FindPython.cmake:601 (include)
python/indirection____________.cmake:1 (find_package)
dependencies/shacl-F5_CXX/.cmake/FunctionExtension/call.cmake:9 (include)
dependencies/shacl-F5_CXX/.cmake/FunctionExtension/find_package.cmake:21 (call)
dependencies/shacl-F5_CXX/.cmake/Git/Submodule/Packages/find_package.cmake:20 (previous_find_package)
python/indirection___________.cmake:1 (find_package)
dependencies/shacl-F5_CXX/.cmake/FunctionExtension/call.cmake:9 (include)
dependencies/shacl-F5_CXX/.cmake/FunctionExtension/find_package.cmake:21 (call)
dependencies/shacl-F5_CXX/.cmake/Git/Submodule/Packages/find_package.cmake:20 (previous_find_package)
python/CMakeLists.txt:7 (find_package)
CMake Error at C:/Program Files/CMake/share/cmake-3.26/Modules/FindPython/Support.cmake:713 (list):
list GET given empty list
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.26/Modules/FindPython/Support.cmake:3468 (python_get_version)
C:/Program Files/CMake/share/cmake-3.26/Modules/FindPython.cmake:601 (include)
python/indirection____________.cmake:1 (find_package)
dependencies/shacl-F5_CXX/.cmake/FunctionExtension/call.cmake:9 (include)
dependencies/shacl-F5_CXX/.cmake/FunctionExtension/find_package.cmake:21 (call)
dependencies/shacl-F5_CXX/.cmake/Git/Submodule/Packages/find_package.cmake:20 (previous_find_package)
python/indirection___________.cmake:1 (find_package)
dependencies/shacl-F5_CXX/.cmake/FunctionExtension/call.cmake:9 (include)
dependencies/shacl-F5_CXX/.cmake/FunctionExtension/find_package.cmake:21 (call)
dependencies/shacl-F5_CXX/.cmake/Git/Submodule/Packages/find_package.cmake:20 (previous_find_package)
python/CMakeLists.txt:7 (find_package)
CMake Error at C:/Program Files/CMake/share/cmake-3.26/Modules/FindPackageHandleStandardArgs.cmake:225 (set):
Syntax error in cmake code at
C:/Program Files/CMake/share/cmake-3.26/Modules/FindPackageHandleStandardArgs.cmake:225
when parsing string
Could NOT find Python: ***Found unsuitable version "..", but required is at least "3**"* (found C:\Users\Teancum\AppData\Local\Programs\Python\Python310, )
Invalid character escape ‘\U’.
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.26/Modules/FindPackageHandleStandardArgs.cmake:598 (FPHSA_FAILURE_MESSAGE)
C:/Program Files/CMake/share/cmake-3.26/Modules/FindPython/Support.cmake:3766 (find_package_handle_standard_args)
C:/Program Files/CMake/share/cmake-3.26/Modules/FindPython.cmake:601 (include)
python/indirection____________.cmake:1 (find_package)
dependencies/shacl-F5_CXX/.cmake/FunctionExtension/call.cmake:9 (include)
dependencies/shacl-F5_CXX/.cmake/FunctionExtension/find_package.cmake:21 (call)
dependencies/shacl-F5_CXX/.cmake/Git/Submodule/Packages/find_package.cmake:20 (previous_find_package)
python/indirection___________.cmake:1 (find_package)
dependencies/shacl-F5_CXX/.cmake/FunctionExtension/call.cmake:9 (include)
dependencies/shacl-F5_CXX/.cmake/FunctionExtension/find_package.cmake:21 (call)
dependencies/shacl-F5_CXX/.cmake/Git/Submodule/Packages/find_package.cmake:20 (previous_find_package)
python/CMakeLists.txt:7 (find_package)
– Configuring incomplete, errors occurred!