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

Installation issue on anaconda #125

Closed rasgaard closed 3 years ago

rasgaard commented 3 years ago

Hi,

I'm trying to install your framework but I'm having issues when running make -j4 when following the guide. cmake ran without issues after I specified the Python position. Do you have an idea as to what is causing the the issues? Thanks in advance!

Here's the output from make -j4:

(ox) s164419@heisenberg:~/fmm/build$ make -j4
[  2%] Built target ALGORITHM
[  7%] Built target IO
[ 15%] Built target CONFIG
[ 18%] Built target CORE
[ 21%] Built target UTIL
[ 39%] Built target FMM_OBJ
[ 44%] Built target MM_OBJ
[ 55%] Built target NETWORK
[ 63%] Built target STMATCH_OBJ
[ 65%] Built target PYTHONSTMATCH_OBJ[ 68%] Linking CXX executable ubodt_gen
[ 76%] Built target PYTHONFMM_OBJ
[ 78%] Linking CXX executable fmm
[ 81%] Built target pyfmmlib
[ 84%] Linking CXX executable stmatch
[ 92%] Built target _fmm
/home/s164419/anaconda3/envs/ox/lib/libtiledb.so.2.0: undefined reference to `__cxa_init_primary_exception@CXXABI_1.3.11'/home/s164419/anaconda3/envs/ox/lib/libtiledb.so.2.0: undefined reference to `std::thread::_State::~_State()@GLIBCXX_3.4.22
'/home/s164419/anaconda3/envs/ox/lib/libtiledb.so.2.0: undefined reference to `std::thread::_M_start_thread(std::unique_ptr<
std::thread::_State, std::default_delete<std::thread::_State> >, void (*)())@GLIBCXX_3.4.22'/home/s164419/anaconda3/envs/ox/lib/libtiledb.so.2.0: undefined reference to `std::__exception_ptr::exception_ptr::exceptio
n_ptr(void*)@CXXABI_1.3.11'/home/s164419/anaconda3/envs/ox/lib/libtiledb.so.2.0: undefined reference to `typeinfo for std::thread::_State@GLIBCXX_3.4.
22'
collect2: error: ld returned 1 exit status
CMakeFiles/stmatch.dir/build.make:132: recipe for target 'stmatch' failed
make[2]: *** [stmatch] Error 1
CMakeFiles/Makefile2:192: recipe for target 'CMakeFiles/stmatch.dir/all' failed
make[1]: *** [CMakeFiles/stmatch.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/home/s164419/anaconda3/envs/ox/lib/libtiledb.so.2.0: undefined reference to `__cxa_init_primary_exception@CXXABI_1.3.11'
/home/s164419/anaconda3/envs/ox/lib/libtiledb.so.2.0: undefined reference to `std::thread::_State::~_State()@GLIBCXX_3.4.22
'
/home/s164419/anaconda3/envs/ox/lib/libtiledb.so.2.0: undefined reference to `std::thread::_M_start_thread(std::unique_ptr<
std::thread::_State, std::default_delete<std::thread::_State> >, void (*)())@GLIBCXX_3.4.22'
/home/s164419/anaconda3/envs/ox/lib/libtiledb.so.2.0: undefined reference to `std::__exception_ptr::exception_ptr::exceptio
n_ptr(void*)@CXXABI_1.3.11'
/home/s164419/anaconda3/envs/ox/lib/libboost_serialization.so.1.74.0: undefined reference to `std::uncaught_exceptions()@GL
IBCXX_3.4.22'
/home/s164419/anaconda3/envs/ox/lib/libtiledb.so.2.0: undefined reference to `typeinfo for std::thread::_State@GLIBCXX_3.4.22'collect2: error: ld returned 1 exit statusCMakeFiles/ubodt_gen.dir/build.make:141: recipe for target 'ubodt_gen' failed
make[2]: *** [ubodt_gen] Error 1
CMakeFiles/Makefile2:111: recipe for target 'CMakeFiles/ubodt_gen.dir/all' failed
make[1]: *** [CMakeFiles/ubodt_gen.dir/all] Error 2
/home/s164419/anaconda3/envs/ox/lib/libtiledb.so.2.0: undefined reference to `__cxa_init_primary_exception@CXXABI_1.3.11'
/home/s164419/anaconda3/envs/ox/lib/libtiledb.so.2.0: undefined reference to `std::thread::_State::~_State()@GLIBCXX_3.4.22
'
/home/s164419/anaconda3/envs/ox/lib/libtiledb.so.2.0: undefined reference to `std::thread::_M_start_thread(std::unique_ptr<
std::thread::_State, std::default_delete<std::thread::_State> >, void (*)())@GLIBCXX_3.4.22'
/home/s164419/anaconda3/envs/ox/lib/libtiledb.so.2.0: undefined reference to `std::__exception_ptr::exception_ptr::exceptio
n_ptr(void*)@CXXABI_1.3.11'
/home/s164419/anaconda3/envs/ox/lib/libboost_serialization.so.1.74.0: undefined reference to `std::uncaught_exceptions()@GL
IBCXX_3.4.22'
/home/s164419/anaconda3/envs/ox/lib/libtiledb.so.2.0: undefined reference to `typeinfo for std::thread::_State@GLIBCXX_3.4.
22'
collect2: error: ld returned 1 exit status
CMakeFiles/fmm.dir/build.make:141: recipe for target 'fmm' failed
make[2]: *** [fmm] Error 1
CMakeFiles/Makefile2:310: recipe for target 'CMakeFiles/fmm.dir/all' failed
make[1]: *** [CMakeFiles/fmm.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
(ox) s164419@heisenberg:~/fmm/build$
cyang-kth commented 3 years ago

@rasgaard

I google this issue it seems to be a problem with gcc/g++ version. Which version are you using?

https://github.com/ros2/examples/issues/233

Maybe you also need to use a higher version.

What is the version information of cmake ..?

rasgaard commented 3 years ago

Running gcc --version gives me

(ox) s164419@heisenberg:~/fmm/build$ gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

and CMake version seems to be 3.5.1

(ox) s164419@heisenberg:~/fmm/build$ cmake .. -DPYTHON_LIBRARY=~/anaconda3/envs/ox/lib/libpython3.8.so -DPYTHON_INCLUDE_DIR=~/anaconda3/envs/ox/include/python3.8/
-- CMAKE version 3.5.1
-- OSMium found at third_party/libosmium/include;/home/s164419/anaconda3/envs/ox/include;third_party/protozero/include-- OSMium library found at /home/s164419/anaconda3/envs/ox/lib/libz.so;-lpthread;/home/s164419/anaconda3/envs/ox/lib/libexpat.so;/home/s164419/anaconda3/envs/ox/lib/libbz2.so
-- GDAL headers found at /home/s164419/anaconda3/envs/ox/include
-- GDAL library found at /home/s164419/anaconda3/envs/ox/lib/libgdal.so
Boost 1.54.0 found.
Found Boost components:
   serialization
-- Boost headers found at
-- Boost library found at Boost::serialization
-- Boost library version
-- OpenMP_HEADERS found at
-- OpenMP_CXX_LIBRARIES found at
-- Swig version is 3.0.8
-- Python header found at /home/s164419/anaconda3/envs/ox/include/python3.8
-- Python library found at /home/s164419/anaconda3/envs/ox/lib/libpython3.8.so
-- Using swig add module
-- Configuring done
-- Generating done
-- Build files have been written to: /home/s164419/fmm/build
cyang-kth commented 3 years ago

I think you need to upgrade you gcc to version 6.

sudo apt-get update && \
sudo apt-get install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
sudo apt-get update && \
sudo apt-get install gcc-6 g++-6 -y && \
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-6 && \
gcc -v
rasgaard commented 3 years ago

After upgrading gcc to version 6 it installs without trouble. Thanks for your time!