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

fmm_test fails with seg fault after seemingly successful install #179

Closed robfitzgerald closed 3 years ago

robfitzgerald commented 3 years ago

i seem to get a successful installation of fmm as a command line tool, but, the python code fails with a seg fault.

fmm @ master branch HEAD Mac OS X 10.15.7 CMake 3.19.4 Python 3.7.6 Boost 1.72

installation logs below:

(base) <user>:build <user>$ cmake .. -DPYTHON_LIBRARY=/Users/<user>/opt/anaconda3/lib/libpython3.7m.dylib -DPYTHON_INCLUDE_DIR=/Users/<user>/opt/anaconda3/include/python3.7m
-- CMAKE version 3.19.4
-- Set CMP0074 state to NEW
-- Set CMP0086 state to NEW
-- Set CMP0078 state to NEW
-- Set CONDA_PREFIX /Users/<user>/opt/anaconda3
-- GDAL headers found at /usr/local/include
-- GDAL library found at /usr/local/Cellar/gdal/3.1.1_2/lib/libgdal.dylib
-- Boost headers found at /usr/local/include
-- Boost library found at Boost::serialization
-- Boost library version 1_72
-- OpenMP_HEADERS found at /usr/local/include
-- OpenMP_CXX_LIBRARIES found at /Users/<user>/opt/anaconda3/lib/libomp.dylib
-- Installation folder /usr/local
-- Not install fmm headers
-- Add python cmake information
-- Swig version is 4.0.2
-- Found PythonInterp: /Users/<user>/opt/anaconda3/bin/python (found version "3.7.6") 
-- Found PythonLibs: /Users/<user>/opt/anaconda3/lib/libpython3.7m.dylib (found version "3.7.6") 
-- Python header found at /Users/<user>/opt/anaconda3/include/python3.7m
-- Python library found at /Users/<user>/opt/anaconda3/lib/libpython3.7m.dylib
-- Python packages /Users/<user>/opt/anaconda3/lib/python3.7/site-packages
-- Using swig add library
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/<user>/dev/fmm/fmm/build

(base) <user>:build <user>$ make -j4
Scanning dependencies of target STMATCH_OBJ
[  1%] Built target CORE
[  3%] Built target ALGORITHM
[ 34%] Built target H3_OBJ
Scanning dependencies of target FMM_OBJ
Scanning dependencies of target MM_OBJ
Scanning dependencies of target IO
[ 36%] Building CXX object CMakeFiles/STMATCH_OBJ.dir/src/mm/stmatch/stmatch_algorithm.cpp.o
[ 38%] Building CXX object CMakeFiles/MM_OBJ.dir/src/mm/composite_graph.cpp.o
[ 40%] Building CXX object CMakeFiles/IO.dir/src/io/gps_reader.cpp.o
[ 42%] Building CXX object CMakeFiles/FMM_OBJ.dir/src/mm/fmm/fmm_algorithm.cpp.o
[ 44%] Built target MM_OBJ
[ 46%] Building CXX object CMakeFiles/STMATCH_OBJ.dir/src/mm/stmatch/stmatch_app.cpp.o
[ 48%] Building CXX object CMakeFiles/IO.dir/src/io/mm_writer.cpp.o
[ 50%] Building CXX object CMakeFiles/FMM_OBJ.dir/src/mm/fmm/fmm_app.cpp.o
Scanning dependencies of target CONFIG
[ 51%] Building CXX object CMakeFiles/CONFIG.dir/src/config/gps_config.cpp.o
[ 53%] Building CXX object CMakeFiles/STMATCH_OBJ.dir/src/mm/stmatch/stmatch_app_config.cpp.o
[ 53%] Built target IO
[ 55%] Building CXX object CMakeFiles/FMM_OBJ.dir/src/mm/fmm/fmm_app_config.cpp.o
[ 57%] Building CXX object CMakeFiles/CONFIG.dir/src/config/network_config.cpp.o
Scanning dependencies of target NETWORK
[ 59%] Building CXX object CMakeFiles/NETWORK.dir/src/network/bidirectional_network_graph.cpp.o
[ 59%] Built target STMATCH_OBJ
[ 61%] Building CXX object CMakeFiles/FMM_OBJ.dir/src/mm/fmm/ubodt.cpp.o
[ 63%] Building CXX object CMakeFiles/CONFIG.dir/src/config/result_config.cpp.o
Scanning dependencies of target UTIL
[ 65%] Building CXX object CMakeFiles/UTIL.dir/src/util/util.cpp.o
[ 65%] Built target UTIL
Scanning dependencies of target pyfmm_swig_compilation
[ 67%] Swig compile /Users/<user>/dev/fmm/fmm/python/fmm.i for python
/Users/<user>/dev/fmm/fmm/src/mm/h3mm/h3mm.hpp:30: Warning 314: 'print' is a python keyword, renaming to '_print'
[ 69%] Building CXX object CMakeFiles/NETWORK.dir/src/network/network.cpp.o
[ 69%] Built target pyfmm_swig_compilation
[ 71%] Building CXX object CMakeFiles/FMM_OBJ.dir/src/mm/fmm/ubodt_gen_algorithm.cpp.o
[ 73%] Building CXX object CMakeFiles/NETWORK.dir/src/network/network_graph.cpp.o
[ 73%] Built target CONFIG
[ 75%] Building CXX object CMakeFiles/FMM_OBJ.dir/src/mm/fmm/ubodt_gen_app.cpp.o
[ 76%] Building CXX object CMakeFiles/FMM_OBJ.dir/src/mm/fmm/ubodt_gen_app_config.cpp.o
[ 78%] Built target NETWORK
[ 78%] Built target FMM_OBJ
[ 80%] Linking CXX shared library libFMMLIB.dylib
[ 80%] Built target FMMLIB
Scanning dependencies of target h3mm
Scanning dependencies of target fmm
Scanning dependencies of target stmatch
Scanning dependencies of target ubodt_gen
[ 82%] Building CXX object CMakeFiles/h3mm.dir/src/app/h3mm.cpp.o
[ 84%] Building CXX object CMakeFiles/ubodt_gen.dir/src/app/ubodt_gen_app.cpp.o
[ 86%] Building CXX object CMakeFiles/fmm.dir/src/app/fmm.cpp.o
[ 88%] Building CXX object CMakeFiles/stmatch.dir/src/app/stmatch.cpp.o
[ 90%] Linking CXX executable ubodt_gen
[ 90%] Built target ubodt_gen
Scanning dependencies of target pyfmm
[ 92%] Building CXX object python/CMakeFiles/pyfmm.dir/CMakeFiles/pyfmm.dir/fmmPYTHON_wrap.cxx.o
[ 94%] Linking CXX executable fmm
[ 96%] Linking CXX executable stmatch
[ 96%] Built target fmm
[ 96%] Built target stmatch
[ 98%] Linking CXX executable h3mm
[ 98%] Built target h3mm
[100%] Linking CXX shared module _fmm.so
[100%] Built target pyfmm

(base) <user>:build <user>$ sudo make install
[  1%] Built target ALGORITHM
[  3%] Built target CORE
[ 17%] Built target FMM_OBJ
[ 23%] Built target STMATCH_OBJ
[ 26%] Built target MM_OBJ
[ 57%] Built target H3_OBJ
[ 61%] Built target IO
[ 67%] Built target CONFIG
[ 75%] Built target NETWORK
[ 76%] Built target UTIL
[ 78%] Built target FMMLIB
[ 82%] Built target h3mm
[ 86%] Built target stmatch
[ 90%] Built target ubodt_gen
[ 94%] Built target fmm
[ 96%] Built target pyfmm_swig_compilation
[100%] Built target pyfmm
Install the project...
-- Install configuration: "Release"
-- Installing: /usr/local/lib/libFMMLIB.dylib
-- Installing: /usr/local/bin/fmm
-- Installing: /usr/local/bin/ubodt_gen
-- Installing: /usr/local/bin/stmatch
-- Installing: /usr/local/bin/h3mm
-- Installing: /Users/<user>/opt/anaconda3/lib/python3.7/site-packages/_fmm.so
-- Installing: /Users/<user>/opt/anaconda3/lib/python3.7/site-packages/fmm.py

(base) <user>:build <user>$ fmm
[info][fmm_app_config.cpp:49 ] Start reading FMM configuration from arguments
fmm argument lists:
--ubodt (required) <string>: Ubodt file name
--network (required) <string>: Network file name
--network_id (optional) <string>: Network id name (id)
--source (optional) <string>: Network source name (source)
--target (optional) <string>: Network target name (target)
--gps (required) <string>: GPS file name
--gps_id (optional) <string>: GPS id name (id)
--gps_x (optional) <string>: GPS x name (x)
--gps_y (optional) <string>: GPS y name (y)
--gps_timestamp (optional) <string>: GPS timestamp name (timestamp)
--gps_geom (optional) <string>: GPS geometry name (geom)
--gps_point (optional): if specified read input data as gps point, otherwise (default) read input data as trajectory
--output (required) <string>: Output file name
--output_fields (optional) <string>: Output fields
  opath,cpath,tpath,mgeom,pgeom,
  offset,error,spdist,tp,ep,length,duration,speed,all
-k/--candidates (optional) <int>: Number of candidates (8)
-r/--radius (optional) <double>: search radius (network data unit) (300)
-e/--error (optional) <double>: GPS error (network data unit) (50)
--reverse_tolerance (optional) <double>: proportion of reverse movement allowed on an edge
-l/--log_level (optional) <int>: log level (2)
-s/--step (optional) <int>: progress report step (100)
--use_omp: use OpenMP for multithreaded map matching
-h/--help:print help information
For xml configuration, check example folder

(base) <user>:python <user>$ python fmm_test.py 
Segmentation fault: 11

(base) <user>:python <user>$ python
Python 3.7.6 (default, Jan  8 2020, 13:42:34) 
[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from fmm import Network,NetworkGraph,STMATCH,STMATCHConfig
Segmentation fault: 11
(base) <user>:python <user>$ 
temetski commented 3 years ago

It seems I'm encountering the same issues with a similar setup. I installed a fresh conda environment using python 2.7, and fmm now works on python.

Creating fresh python environments for different versions of python 3 (3.6, 3.7, 3.8) all result in seg faulting, while the compiled c++ binaries do work when tested against example/command_line_example/

I believe there is an issue with the compilation for the python 3 wrapper.

NicklasXYZ commented 3 years ago

Everything seems to work fine in docker. I thus believe it is a problem with your setup/environment.

Logs building and running Docker

Removing intermediate container 87925bb73e66
 ---> 26b930cb291c
Step 3/8 : ARG user=fmm
 ---> Running in d4f5ed2fbbfa
Removing intermediate container d4f5ed2fbbfa
 ---> 605b34a46b74
Step 4/8 : ARG home=/usr/src/$user
 ---> Running in 8769b5963b57
Removing intermediate container 8769b5963b57
 ---> aea5b6ac275b
Step 5/8 : RUN mkdir -p $home
 ---> Running in 12d786570e42
Removing intermediate container 12d786570e42
 ---> ab823fa7277f
Step 6/8 : WORKDIR $home
 ---> Running in 0b87e890f887
Removing intermediate container 0b87e890f887
 ---> 76c05c428d54
Step 7/8 : RUN ln -s /usr/bin/python3 /usr/bin/python &&     ln -s /usr/bin/pip3 /usr/bin/pip
 ---> Running in 55aad2dcc64e
Removing intermediate container 55aad2dcc64e
 ---> a00092dfabd3
Step 8/8 : RUN git clone https://github.com/cyang-kth/fmm.git &&     cd fmm &&     mkdir build &&     cd build &&     cmake .. -DPYTHON_LIBRARY=/usr/lib/libpython3.8.so -DPYTHON_INCLUDE_DIR=/usr/include/python3.8 &&     make -j4 &&     make install &&     make clean
 ---> Running in 465fb1472990
Cloning into 'fmm'...
-- CMAKE version 3.17.2
-- Set CMP0074 state to NEW
-- Set CMP0086 state to NEW
-- Set CMP0078 state to NEW
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- 
No conda environment found in PATH!
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

-- Could NOT find Conda (missing: CONDA_PREFIX) 
-- Non conda exist, search library in default path
-- Found GDAL: /usr/lib/libgdal.so (found suitable version "3.1.4", minimum required is "2.2") 
-- GDAL headers found at /usr/include
-- GDAL library found at /usr/lib/libgdal.so
-- Found Boost: /usr/lib/cmake/Boost-1.72.0/BoostConfig.cmake (found suitable version "1.72.0", minimum required is "1.56.0") found components: serialization 
-- Boost headers found at /usr/include
-- Boost library found at Boost::serialization
-- Boost library version 1_72
-- Found OpenMP_C: -fopenmp (found version "4.5") 
-- Found OpenMP_CXX: -fopenmp (found version "4.5") 
-- Found OpenMP: TRUE (found version "4.5")  
-- OpenMP_HEADERS found at 
-- OpenMP_CXX_LIBRARIES found at /usr/lib/libgomp.so;/usr/lib/libpthread.a
-- Installation folder /usr/local
-- Not install fmm headers
-- Add python cmake information
-- Found SWIG: /usr/bin/swig (found version "4.0.1") 
-- Swig version is 4.0.1
-- Found PythonInterp: /usr/bin/python (found version "3.8.8") 
-- Found PythonLibs: /usr/lib/libpython3.8.so (found version "3.8.8") 
-- Python header found at /usr/include/python3.8
-- Python library found at /usr/lib/libpython3.8.so
-- Python packages /usr/lib/python3.8/site-packages
-- Using swig add library
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/src/fmm/fmm/build
Scanning dependencies of target UTIL
Scanning dependencies of target IO
Scanning dependencies of target STMATCH_OBJ
Scanning dependencies of target CONFIG
[  1%] Building CXX object CMakeFiles/UTIL.dir/src/util/util.cpp.o
[  3%] Building CXX object CMakeFiles/IO.dir/src/io/gps_reader.cpp.o
[  5%] Building CXX object CMakeFiles/CONFIG.dir/src/config/gps_config.cpp.o
[  7%] Building CXX object CMakeFiles/STMATCH_OBJ.dir/src/mm/stmatch/stmatch_algorithm.cpp.o
[  7%] Built target UTIL
Scanning dependencies of target CORE
[  9%] Building CXX object CMakeFiles/CORE.dir/src/core/geometry.cpp.o
[  9%] Built target CORE
[ 11%] Building CXX object CMakeFiles/IO.dir/src/io/mm_writer.cpp.o
[ 13%] Building CXX object CMakeFiles/CONFIG.dir/src/config/network_config.cpp.o
Scanning dependencies of target ALGORITHM
[ 15%] Building CXX object CMakeFiles/ALGORITHM.dir/src/algorithm/geom_algorithm.cpp.o
[ 17%] Building CXX object CMakeFiles/STMATCH_OBJ.dir/src/mm/stmatch/stmatch_app.cpp.o
[ 17%] Built target IO
Scanning dependencies of target NETWORK
[ 19%] Building CXX object CMakeFiles/NETWORK.dir/src/network/bidirectional_network_graph.cpp.o
[ 19%] Built target ALGORITHM
[ 21%] Building CXX object CMakeFiles/NETWORK.dir/src/network/network.cpp.o
[ 23%] Building CXX object CMakeFiles/CONFIG.dir/src/config/result_config.cpp.o
[ 25%] Building CXX object CMakeFiles/STMATCH_OBJ.dir/src/mm/stmatch/stmatch_app_config.cpp.o
[ 26%] Building CXX object CMakeFiles/NETWORK.dir/src/network/network_graph.cpp.o
[ 28%] Building CXX object CMakeFiles/NETWORK.dir/src/network/rtree.cpp.o
[ 28%] Built target CONFIG
Scanning dependencies of target H3_OBJ
[ 30%] Building C object CMakeFiles/H3_OBJ.dir/third_party/h3/lib/algos.c.o
[ 32%] Building C object CMakeFiles/H3_OBJ.dir/third_party/h3/lib/baseCells.c.o
[ 34%] Building C object CMakeFiles/H3_OBJ.dir/third_party/h3/lib/bbox.c.o
[ 36%] Building C object CMakeFiles/H3_OBJ.dir/third_party/h3/lib/coordijk.c.o
[ 38%] Building C object CMakeFiles/H3_OBJ.dir/third_party/h3/lib/faceijk.c.o
[ 40%] Building C object CMakeFiles/H3_OBJ.dir/third_party/h3/lib/geoCoord.c.o
[ 42%] Building C object CMakeFiles/H3_OBJ.dir/third_party/h3/lib/h3Index.c.o
[ 44%] Building C object CMakeFiles/H3_OBJ.dir/third_party/h3/lib/h3UniEdge.c.o
[ 46%] Building C object CMakeFiles/H3_OBJ.dir/third_party/h3/lib/linkedGeo.c.o
[ 48%] Building C object CMakeFiles/H3_OBJ.dir/third_party/h3/lib/localij.c.o
[ 50%] Building C object CMakeFiles/H3_OBJ.dir/third_party/h3/lib/mathExtensions.c.o
[ 51%] Building C object CMakeFiles/H3_OBJ.dir/third_party/h3/lib/polygon.c.o
[ 53%] Building C object CMakeFiles/H3_OBJ.dir/third_party/h3/lib/vec2d.c.o
[ 55%] Building C object CMakeFiles/H3_OBJ.dir/third_party/h3/lib/vec3d.c.o
[ 57%] Building C object CMakeFiles/H3_OBJ.dir/third_party/h3/lib/vertex.c.o
[ 59%] Building C object CMakeFiles/H3_OBJ.dir/third_party/h3/lib/vertexGraph.c.o
Scanning dependencies of target MM_OBJ
[ 59%] Built target H3_OBJ
Scanning dependencies of target FMM_OBJ
[ 61%] Building CXX object CMakeFiles/MM_OBJ.dir/src/mm/composite_graph.cpp.o
[ 63%] Building CXX object CMakeFiles/FMM_OBJ.dir/src/mm/fmm/fmm_algorithm.cpp.o
[ 63%] Built target STMATCH_OBJ
Scanning dependencies of target pyfmm_swig_compilation
[ 65%] Swig compile /usr/src/fmm/fmm/python/fmm.i for python
/usr/src/fmm/fmm/src/mm/h3mm/h3mm.hpp:30: Warning 314: 'print' is a python keyword, renaming to '_print'
[ 65%] Built target NETWORK
[ 67%] Building CXX object CMakeFiles/FMM_OBJ.dir/src/mm/fmm/fmm_app.cpp.o
[ 67%] Built target pyfmm_swig_compilation
[ 69%] Building CXX object CMakeFiles/MM_OBJ.dir/src/mm/transition_graph.cpp.o
[ 71%] Building CXX object CMakeFiles/FMM_OBJ.dir/src/mm/fmm/fmm_app_config.cpp.o
[ 71%] Built target MM_OBJ
[ 73%] Building CXX object CMakeFiles/FMM_OBJ.dir/src/mm/fmm/ubodt.cpp.o
[ 75%] Building CXX object CMakeFiles/FMM_OBJ.dir/src/mm/fmm/ubodt_gen_algorithm.cpp.o
[ 76%] Building CXX object CMakeFiles/FMM_OBJ.dir/src/mm/fmm/ubodt_gen_app.cpp.o
[ 78%] Building CXX object CMakeFiles/FMM_OBJ.dir/src/mm/fmm/ubodt_gen_app_config.cpp.o
[ 78%] Built target FMM_OBJ
Scanning dependencies of target FMMLIB
[ 80%] Linking CXX shared library libFMMLIB.so
[ 80%] Built target FMMLIB
Scanning dependencies of target stmatch
Scanning dependencies of target fmm
Scanning dependencies of target ubodt_gen
Scanning dependencies of target h3mm
[ 82%] Building CXX object CMakeFiles/ubodt_gen.dir/src/app/ubodt_gen_app.cpp.o
[ 88%] Building CXX object CMakeFiles/stmatch.dir/src/app/stmatch.cpp.o
[ 88%] Building CXX object CMakeFiles/h3mm.dir/src/app/h3mm.cpp.o
[ 88%] Building CXX object CMakeFiles/fmm.dir/src/app/fmm.cpp.o
[ 90%] Linking CXX executable ubodt_gen
[ 90%] Built target ubodt_gen
Scanning dependencies of target pyfmm
[ 92%] Building CXX object python/CMakeFiles/pyfmm.dir/CMakeFiles/pyfmm.dir/fmmPYTHON_wrap.cxx.o
[ 94%] Linking CXX executable fmm
[ 96%] Linking CXX executable stmatch
[ 96%] Built target fmm
[ 96%] Built target stmatch
[ 98%] Linking CXX executable h3mm
[ 98%] Built target h3mm
[100%] Linking CXX shared module _fmm.so
[100%] Built target pyfmm
[  5%] Built target STMATCH_OBJ
[  7%] Built target UTIL
[ 11%] Built target IO
[ 17%] Built target CONFIG
[ 19%] Built target CORE
[ 21%] Built target ALGORITHM
[ 28%] Built target NETWORK
[ 59%] Built target H3_OBJ
[ 63%] Built target MM_OBJ
[ 76%] Built target FMM_OBJ
[ 78%] Built target FMMLIB
[ 82%] Built target h3mm
[ 86%] Built target fmm
[ 90%] Built target ubodt_gen
[ 94%] Built target stmatch
[ 96%] Built target pyfmm_swig_compilation
[100%] Built target pyfmm
Install the project...
-- Install configuration: "Release"
-- Installing: /usr/local/lib/libFMMLIB.so
-- Set runtime path of "/usr/local/lib/libFMMLIB.so" to "/usr/local/lib"
-- Installing: /usr/local/bin/fmm
-- Set runtime path of "/usr/local/bin/fmm" to "/usr/local/lib"
-- Installing: /usr/local/bin/ubodt_gen
-- Set runtime path of "/usr/local/bin/ubodt_gen" to "/usr/local/lib"
-- Installing: /usr/local/bin/stmatch
-- Set runtime path of "/usr/local/bin/stmatch" to "/usr/local/lib"
-- Installing: /usr/local/bin/h3mm
-- Set runtime path of "/usr/local/bin/h3mm" to "/usr/local/lib"
-- Installing: /usr/lib/python3.8/site-packages/_fmm.so
-- Set runtime path of "/usr/lib/python3.8/site-packages/_fmm.so" to "/usr/local/lib"
-- Installing: /usr/lib/python3.8/site-packages/fmm.py
Removing intermediate container 465fb1472990
 ---> aa7480a0adad
Successfully built aa7480a0adad
Successfully tagged fmm:latest
(base) [nicklasxyz@nicklasxyz]$ sudo docker run -i -t fmm:latest /bin/sh
/usr/src/fmm # python
Python 3.8.8 (default, Mar 15 2021, 13:12:20) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from fmm import Network,NetworkGraph,STMATCH,STMATCHConfig

Using dockerfile: https://github.com/cyang-kth/fmm/issues/171#issuecomment-771866715

temetski commented 3 years ago

@NicklasXYZ Thanks for taking some time to look into this! Your docker build is based of alpine linux though, and I myself have been able to build fmm fine on an ubuntu machine (using python 2 and 3). The problem seems to be specifically Python 3 based builds on MacOS, as I've been able to properly build fmm on MacOS using python 2, but not python 3.

temetski commented 2 years ago

@robfitzgerald I don't know if this still helps you: I found out that seg fault issues on python3 MacOS can be avoided by using python 3.6.1. I was finally able to run fmm on python3 for MacOS: image

I found this issue in the cmake gitlab: https://gitlab.kitware.com/cmake/cmake/-/issues/17664#note_367234 It seems cmake swig has some issues building python bindings on MacOS for versions above 3.6.1. However, testing the fix suggested above doesn't appear to resolve segfault issues for higher python versions. This does pose problems for python3 support #203.

temetski commented 2 years ago

After some digging, I think I may have resolved the segfault issue on Python>3.6.1 on MacOS. It has to do with

  1. Linking of necessary python libraries to swig
  2. Deprecated swig_link_libraries (see https://cmake.org/cmake/help/latest/module/UseSWIG.html in conjunction with https://cmake.org/cmake/help/latest/policy/CMP0078.html)
  3. Deprecated PythonInterp and PyhtonLibs. Best way to pass libraries to target_link_libraries is using Python::Module of FindPython

Will be creating a PR addressing these problems.