cyang-kth / fmm

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

Fix python path in CMakeLists #181

Closed cmpute closed 3 years ago

cmpute commented 3 years ago

Use found python executable instead of the default one in the system to determine the installation path

cyang-kth commented 3 years ago

Why does this test on windows fail? https://ci.appveyor.com/project/cyang-kth/fmm/builds/37878562

%CYG_SH% "cd fmm/example/python;python fmm_test.py"
  File "fmm_test.py", line 4
    print graph.get_num_vertices()
          ^
SyntaxError: invalid syntax
cmpute commented 3 years ago

The python interpreter found, for some reason, has version 3.8: https://ci.appveyor.com/project/cyang-kth/fmm/builds/37878562#L3127

-- Found PythonInterp: /usr/bin/python (found version "3.8.7") 
-- Found PythonLibs: /usr/lib/libpython2.7.dll.a (found version "2.7.18") 
-- Python header found at /usr/include/python2.7
-- Python library found at /usr/lib/libpython2.7.dll.a
-- Python packages /usr/lib/python3.8/site-packages

As for comparison, the interpreter found in previous builds is python 2.7 https://ci.appveyor.com/project/cyang-kth/fmm/builds/37422033#L3177

-- Found PythonInterp: /usr/bin/python (found version "2.7.18") 
-- Found PythonLibs: /usr/lib/libpython2.7.dll.a (found version "2.7.18") 
-- Python header found at /usr/include/python2.7
-- Python library found at /usr/lib/libpython2.7.dll.a
-- Python packages /usr/lib/python2.7/site-packages
cmpute commented 3 years ago

Maybe try running the test again?

cyang-kth commented 3 years ago

The python interpreter found, for some reason, has version 3.8: https://ci.appveyor.com/project/cyang-kth/fmm/builds/37878562#L3127

-- Found PythonInterp: /usr/bin/python (found version "3.8.7") 
-- Found PythonLibs: /usr/lib/libpython2.7.dll.a (found version "2.7.18") 
-- Python header found at /usr/include/python2.7
-- Python library found at /usr/lib/libpython2.7.dll.a
-- Python packages /usr/lib/python3.8/site-packages

As for comparison, the interpreter found in previous builds is python 2.7 https://ci.appveyor.com/project/cyang-kth/fmm/builds/37422033#L3177

-- Found PythonInterp: /usr/bin/python (found version "2.7.18") 
-- Found PythonLibs: /usr/lib/libpython2.7.dll.a (found version "2.7.18") 
-- Python header found at /usr/include/python2.7
-- Python library found at /usr/lib/libpython2.7.dll.a
-- Python packages /usr/lib/python2.7/site-packages

Rerun the test does not work. I think it is better to use the previous code rather than the new version.

cmpute commented 3 years ago

Alright, I will leave the PR open here