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

Encountered installation issue for mac #196

Closed Xiaojian-Zhang closed 3 years ago

Xiaojian-Zhang commented 3 years ago

Hi Can,

I tried to install this package from my mac, but I got the following issue: when I tried the 'make -j4', I got a bunch of errors saying like "error: constexpr function's return type 'void' is not a literal type".

I read the Q&A for make error, but I'm not sure if I went wrong from this step. I checked "which python", it shows /Applications/Anaconda/anaconda3/bin/python and also checked "cmake ..", it shows: "-- CMAKE version 3.21.0-rc2 -- Set CMP0074 state to NEW -- Set CMP0086 state to NEW -- Set CMP0078 state to NEW -- Set CONDA_PREFIX /Applications/Anaconda/anaconda3 -- GDAL headers found at /usr/local/include -- GDAL library found at /usr/local/Cellar/gdal/3.3.0_2/lib/libgdal.dylib -- Boost headers found at /usr/local/include -- Boost library found at Boost::serialization -- Boost library version 1_76 -- OpenMP_HEADERS found at /Applications/Anaconda/anaconda3/include -- OpenMP_CXX_LIBRARIES found at /Applications/Anaconda/anaconda3/lib/libomp.dylib -- Installation folder /usr/local -- Not install fmm headers -- Add python cmake information -- Swig version is 4.0.2 -- Python header found at /Applications/Anaconda/anaconda3/include/python3.8 -- Python library found at /Applications/Anaconda/anaconda3/lib/libpython3.8.dylib -- Python packages /Applications/Anaconda/anaconda3/lib/python3.8/site-packages -- Using swig add library -- Configuring done -- Generating done"

I don't know how to figure this out so I need your help :)

Xiaojian-Zhang commented 3 years ago

I'm still stuck with "make -j4", or if that's the problem of my mac os? it's been updated to 11.4

cyang-kth commented 3 years ago

The problem might be related with boost https://github.com/cyang-kth/fmm/issues/162.

Xiaojian-Zhang commented 3 years ago

thanks, but how can I deal with this problem?

cyang-kth commented 3 years ago

It seems to be that the newer version of boost geometry requires c++14.

https://github.com/mapnik/mapnik/issues/4196

You either downgrade the boost library, or you try to set c++14 to the compiler by changing this line in the CMakeLists.txt file.

https://github.com/cyang-kth/fmm/blob/6b43a16ea2b78cbbb03d79eb9fc7a45c4732a8fa/CMakeLists.txt#L30

set(CMAKE_CXX_STANDARD 14)
Xiaojian-Zhang commented 3 years ago

Thanks, Can! That works for me now!

cyang-kth commented 3 years ago

This issue is closed. The C++ 14 support needs to be added to the CMake file perhaps by detecting the boost library version to adjust this parameter.