C++ build error
Geonhee-LEE opened this issue · 3 comments
Hi, @alexliniger.
Thanks for your contribution.
I am interested in MPCC and want to run on C++ execution on the Ubuntu 18.04. According to your README, I tried to make the CMakeLists but failed like following:
After failed to make, I changed the CMakeLists and finally succeeded to build. But, I encountered the problem when I launched with './MPCC'. I found that problem is associated with matplotlib-cpp. However, I couldn't find the solution although strive to solve this problem with some modification and trials.
Let me know what is the problem if possible.
the two branches use different approaches for matplotlib-cpp in the CMake file, can you try out the other one as well. I will have a look as soon as possible. But over the years I had also several times issues with matplotlib-cpp.
Best,
Alex
-
Modified CMakeLists:
cmake_minimum_required(VERSION 3.7) project(MPCC) set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_FLAGS "-O2") find_package(PythonLibs REQUIRED) include_directories(${PYTHON_INCLUDE_DIRS}) include_directories(.) include_directories(External/blasfeo/lib/include) include_directories(External/hpipm/lib/include) include_directories(External/matplotlib) include_directories(External/Eigen) include_directories(External/Json/include) add_executable(MPCC main.cpp types.cpp types.h config.h Params/params.cpp Spline/cubic_spline.cpp Spline/arc_length_spline.cpp Interfaces/hpipm_interface.cpp Interfaces/solver_interface.cpp Constraints/constraints.cpp Constraints/bounds.cpp Cost/cost.cpp Model/model.cpp Model/integrator.cpp Tests/spline_test.cpp Tests/cost_test.cpp Tests/model_integrator_test.cpp Tests/constratins_test.cpp MPC/mpc.cpp Params/track.cpp Params/track.h Plotting/plotting.cpp Plotting/plotting.h) #find_package(Python COMPONENTS Development) #target_include_directories(MPCC PRIVATE ${Python_INCLUDE_DIRS} ${Python_INCLUDE_DIRS}) #target_link_libraries(MPCC ${Python_LIBRARIES} ) target_link_libraries(MPCC ${CMAKE_SOURCE_DIR}/External/hpipm/lib/lib/libhpipm.a ${CMAKE_SOURCE_DIR}/External/blasfeo/lib/lib/libblasfeo.a ${PYTHON_LIBRARIES} )