cyang-kth / fmm

Fast map matching, an open source framework in C++
https://fmm-wiki.github.io/
Apache License 2.0
884 stars 211 forks source link

cmake error when using python3. #160

Closed SUSTC-ChuangYANG closed 3 years ago

SUSTC-ChuangYANG commented 3 years ago

Command:

cmake .. -DPYTHON_LIBRARY=/home/chuang/anaconda3/envs/vis20/lib/libpython3.6m.so -DPYTHON_INCLUDE_DIR=/home/chuang/anaconda3/envs/vis20/include/python3.6m

Output:

-- Found PythonInterp: /usr/bin/python2.7 (found suitable version "2.7.17", minimum required is "2.7")
-- Found PythonLibs: /home/chuang/anaconda3/envs/vis20/lib/libpython3.6m.so (found suitable version "3.6.7", minimum required is "2.7")
-- Python header found at /home/chuang/anaconda3/envs/vis20/include/python3.6m
-- Python library found at /home/chuang/anaconda3/envs/vis20/lib/libpython3.6m.so
  **File "<string>", line 1
    from distutils.sysconfig import get_python_lib;print get_python_lib()
                                                                      ^
SyntaxError: invalid syntax**
-- Python packages
-- Using swig add module
CMake Deprecation Warning at /usr/share/cmake-3.10/Modules/UseSWIG.cmake:231 (message):
  SWIG_ADD_MODULE is deprecated.  Use SWIG_ADD_LIBRARY instead.
Call Stack (most recent call first):
  python/CMakeLists.txt:30 (SWIG_ADD_MODULE)

CMake Error at python/CMakeLists.txt:32 (install):
  install TARGETS given no LIBRARY DESTINATION for module target "_fmm".

CMake Error at python/CMakeLists.txt:43 (install):
  install FILES given no DESTINATION!

-- Configuring incomplete, errors occurred!
See also "/home/chuang/fmm/build/CMakeFiles/CMakeOutput.log".
cyang-kth commented 3 years ago

This is due to the print function must be wrapped with parethesis and I have updated it in the latest commit.