Closed alliWong closed 3 years ago
The CMake error message is helpful here:
CMake Warning at wrap/cmake/GtwrapUtils.cmake:68 (find_package):
By not providing "FindPython.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Python", but
CMake did not find one.
Could not find a package configuration file provided by "Python" (requested
version 3.9) with any of the following names:
PythonConfig.cmake
python-config.cmake
Add the installation prefix of "Python" to CMAKE_PREFIX_PATH or set
"Python_DIR" to a directory containing one of the above files. If "Python"
provides a separate development package or SDK, be sure it has been
installed.
Looks like your Anaconda installation is not providing the PythonConfig.cmake
file, or the file is not in the environment path variable which CMake uses. This is a very custom issue since it depends on how your Python interpreter is set up, but my recommendation would be to see how (via Google or StackOverflow) to add that path containing the appropriate CMake files so that CMake can find it.
@alliWong you're in luck. Apparently I encountered a similar issue in the past and I upvoted an answer on SO. Sharing it here for your convenience. https://stackoverflow.com/a/38121972/1236990
If you'd like, you can create a PR that adds this info to the README file and we'll gladly review and accept it (plus you get to be a GTSAM contributor!!). :slightly_smiling_face:
@varunagrawal Thanks for the answer.
I did try to follow the suggestion given the link, but I am still unable to build pybind11. I've also manually set the path to PYTHON_EXECUTABLE, PYTHON_INCLUDE_DIR, and PYTHON_LIBRARY, so I wasn't too sure if it's due to my Anaconda system or the CMakeList.txt problem...
You mean the python interpreter, and not Pybind11?
You can try looking for those specific CMake files (e.g. use locate
on Ubuntu/Linux). If you can't find them, you may want to check what build files you need anaconda to install.
Also, what version of CMake are you using?
Actually, I just reinstalled gtsam and was able to get it compiled working perfectly!
Thanks for the help and I'll also create a PR :)
Huh that's interesting. I wonder what the issue was but I'm glad it works out of the box for you now.
I'm coming across the same issue. I've tried everything mentioned in this thread... no luck.
I confirmed I have cmake version 3.10.2, as well as Python 3.6.9
@varunagrawal @alliWong
alli, what did you mean by 'reinstall GTSAM'? do you just mean you deleted the build folder and started form scratch? 1) delete build folder 2) recreate build folder 3) cd into build folder 4) run: cmake .. -DGTSAM_BUILD_PYTHON=1 -DGTSAM_PYTHON_VERSION=3.x.x
That should be sufficient. Please post the full error message.
Description
I followed the instructions on https://github.com/borglab/gtsam/tree/develop/python but I am unable to successfully
cmake .. -DGTSAM_BUILD_PYTHON=1 -DGTSAM_PYTHON_VERSION=3.x.x
for python 3.9.2, 3.6.10, and 3.8.3. I've also tried building the older version that worked with my acquaintance (4.0.0 and cython)Steps to reproduce
cmake .. -DGTSAM_BUILD_PYTHON=1 -DGTSAM_PYTHON_VERSION=3.9.3
CMake Error at wrap/CMakeLists.txt:36 (install): install PROGRAMS given no DESTINATION!
-- pybind11 v2.6.0 dev1 -- Found PythonInterp: /home/allison/anaconda3/envs/gtsam/bin/python (found suitable version "3.9.2", minimum required is "3.9") -- Found PythonLibs: /home/allison/anaconda3/envs/gtsam/lib/libpython3.9.so -- Performing Test HAS_FLTO -- Performing Test HAS_FLTO - Success -- Building 3rdparty -- Looking for execinfo.h -- Looking for execinfo.h - found -- Looking for getline -- Looking for getline - found -- checking for thread-local storage - found -- Could NOT find GeographicLib (missing: GeographicLib_LIBRARY_DIRS GeographicLib_LIBRARIES GeographicLib_INCLUDE_DIRS) -- Building base -- Building geometry -- Building inference -- Building symbolic -- Building discrete -- Building linear -- Building nonlinear -- Building sam -- Building sfm -- Building slam -- Building navigation -- GTSAM Version: 4.1.0 -- Install prefix: /usr/local -- Building GTSAM - shared: ON -- Building base_unstable -- Building geometry_unstable -- Building linear_unstable -- Building discrete_unstable -- Building dynamics_unstable -- Building nonlinear_unstable -- Building slam_unstable -- Building partition_unstable -- GTSAM_UNSTABLE Version: 4.1.0 -- Install prefix: /usr/local -- Wrote /home/allison/Workspace/gtsam_ws/src/gtsam/build/GTSAMConfig.cmake -- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) -- =============================================================== -- ================ Configuration Options ====================== -- CMAKE_CXX_COMPILER_ID type : GNU -- CMAKE_CXX_COMPILER_VERSION : 7.5.0 -- CMake version : 3.10.2 -- CMake generator : Unix Makefiles -- CMake build tool : /usr/bin/make -- Build flags
-- Build Tests : Enabled -- Build examples with 'make all' : Enabled -- Build timing scripts with 'make all' : Disabled -- Build shared GTSAM libraries : Enabled -- Put build type in library name : Enabled -- Build libgtsam_unstable : Enabled -- Build GTSAM unstable Python : Enabled -- Build MATLAB Toolbox for unstable : Disabled -- Build for native architecture : Enabled -- Build type : Release -- C compilation flags : -O3 -DNDEBUG -- C++ compilation flags : -O3 -DNDEBUG -- GTSAM_COMPILE_FEATURES_PUBLIC : cxx_std_11 -- GTSAM_COMPILE_OPTIONS_PUBLIC : -march=native -- GTSAM_COMPILE_DEFINITIONS_PUBLIC : -- GTSAM_COMPILE_OPTIONS_PUBLIC_DEBUG : -- GTSAM_COMPILE_DEFINITIONS_PUBLIC_DEBUG : -- GTSAM_COMPILE_OPTIONS_PUBLIC_RELEASE : -- GTSAM_COMPILE_DEFINITIONS_PUBLIC_RELEASE : -- GTSAM_COMPILE_OPTIONS_PUBLIC_TIMING : -- GTSAM_COMPILE_DEFINITIONS_PUBLIC_TIMING : -- GTSAM_COMPILE_OPTIONS_PUBLIC_PROFILING : -- GTSAM_COMPILE_DEFINITIONS_PUBLIC_PROFILING : -- GTSAM_COMPILE_OPTIONS_PUBLIC_RELWITHDEBINFO : -- GTSAM_COMPILE_DEFINITIONS_PUBLIC_RELWITHDEBINFO : -- GTSAM_COMPILE_OPTIONS_PUBLIC_MINSIZEREL : -- GTSAM_COMPILE_DEFINITIONS_PUBLIC_MINSIZEREL : -- Use System Eigen : OFF (Using version: 3.3.7) -- Use Intel TBB : Yes (Version: 2017.0) -- Eigen will use MKL : MKL not found -- Eigen will use MKL and OpenMP : OpenMP found but GTSAM_WITH_EIGEN_MKL is disabled -- Default allocator : TBB -- Cheirality exceptions enabled : YES -- Build with ccache : No -- Packaging flags -- CPack Source Generator : TGZ -- CPack Generator : TGZ -- GTSAM flags
-- Quaternions as default Rot3 : Disabled -- Runtime consistency checking : Disabled -- Rot3 retract is full ExpMap : Enabled -- Pose3 retract is full ExpMap : Enabled -- Allow features deprecated in GTSAM 4.1 : Enabled -- Metis-based Nested Dissection : Enabled -- Use tangent-space preintegration : Enabled -- MATLAB toolbox flags -- Install MATLAB toolbox : Disabled -- Python toolbox flags
-- Build Python module with pybind : Enabled -- Python version : 3.9 -- =============================================================== -- Configuring incomplete, errors occurred! See also "/home/allison/Workspace/gtsam_ws/src/gtsam/build/CMakeFiles/CMakeOutput.log". See also "/home/allison/Workspace/gtsam_ws/src/gtsam/build/CMakeFiles/CMakeError.log".
make: *** No rule to make target 'python-install'. Stop.
cmake .. \
-- Build files have been written to: /home/allison/Workspace/gtsam_ws/src/gtsam/build