Skip to content

Commit

Permalink
Merge pull request #172 from ethz-adrl/fix/use_cmake_to_install_hpipm
Browse files Browse the repository at this point in the history
Forward to hpipm version 0.1.3, use cmake to install blasfeo and hpipm.
  • Loading branch information
markusgft authored Nov 1, 2020
2 parents b4684fe + 7116c8a commit e7a29a6
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 39 deletions.
24 changes: 17 additions & 7 deletions ct/install_hpipm.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
#!/bin/bash
set -x #echo on

## remove existing installation of blasfeo/hpipm
rm -rf /opt/blasfeo
rm -rf /opt/hpipm

## get blasfeo
echo "Now installing blasfeo, using a specific commit/tag (!)"
cd /tmp
rm -rf blasfeo/
git clone https://github.com/giaf/blasfeo.git
cd /tmp/blasfeo
git checkout cc90e14 # we currently are on this commit.
make static_library
sudo make install_static
git checkout 0.1.2
mkdir -p build && cd build
cmake ..
make
sudo make install

## get hpipm
echo "Now installing hpipm, using a specific commit/tag (!)"
cd /tmp
rm -rf hpipm/
git clone https://github.com/giaf/hpipm.git
cd /tmp/hpipm
git checkout 5d9909f # we currently are on this commit.
make static_library
make examples
sudo make install_static
git checkout 0.1.3
mkdir -p build && cd build
cmake ..
make
sudo make install
64 changes: 32 additions & 32 deletions ct_optcon/examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
set(CT_OPTCON_EXAMPLE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/exampleDir.h.in ${CMAKE_CURRENT_SOURCE_DIR}/exampleDir.h)

add_executable(ex_ConstraintOutput ConstraintExampleOutput.cpp)
target_link_libraries(ex_ConstraintOutput ct_optcon)
list(APPEND optcon_ex_TARGETS ex_ConstraintOutput)
# add_executable(ex_ConstraintOutput ConstraintExampleOutput.cpp)
# target_link_libraries(ex_ConstraintOutput ct_optcon)
# list(APPEND optcon_ex_TARGETS ex_ConstraintOutput)

add_executable(ex_NLOC NLOC.cpp)
target_link_libraries(ex_NLOC ct_optcon)
list(APPEND optcon_ex_TARGETS ex_NLOC)
# add_executable(ex_NLOC NLOC.cpp)
# target_link_libraries(ex_NLOC ct_optcon)
# list(APPEND optcon_ex_TARGETS ex_NLOC)

add_executable(ex_NLOC_MPC NLOC_MPC.cpp)
target_link_libraries(ex_NLOC_MPC ct_optcon)
list(APPEND optcon_ex_TARGETS ex_NLOC_MPC)
# add_executable(ex_NLOC_MPC NLOC_MPC.cpp)
# target_link_libraries(ex_NLOC_MPC ct_optcon)
# list(APPEND optcon_ex_TARGETS ex_NLOC_MPC)

add_executable(ex_KalmanFiltering KalmanFiltering.cpp)
target_link_libraries(ex_KalmanFiltering ct_optcon)
list(APPEND optcon_ex_TARGETS ex_KalmanFiltering)
# add_executable(ex_KalmanFiltering KalmanFiltering.cpp)
# target_link_libraries(ex_KalmanFiltering ct_optcon)
# list(APPEND optcon_ex_TARGETS ex_KalmanFiltering)

add_executable(ex_KalmanDisturbanceFiltering KalmanDisturbanceFiltering.cpp)
target_link_libraries(ex_KalmanDisturbanceFiltering ct_optcon )
list(APPEND optcon_ex_TARGETS ex_KalmanDisturbanceFiltering)
# add_executable(ex_KalmanDisturbanceFiltering KalmanDisturbanceFiltering.cpp)
# target_link_libraries(ex_KalmanDisturbanceFiltering ct_optcon )
# list(APPEND optcon_ex_TARGETS ex_KalmanDisturbanceFiltering)

add_executable(ex_Nlp_2D nlp/Nlp2D.cpp)
target_link_libraries(ex_Nlp_2D ct_optcon)
list(APPEND optcon_ex_TARGETS ex_Nlp_2D)
# add_executable(ex_Nlp_2D nlp/Nlp2D.cpp)
# target_link_libraries(ex_Nlp_2D ct_optcon)
# list(APPEND optcon_ex_TARGETS ex_Nlp_2D)

add_executable(ex_Nlp_3D nlp/Nlp3D.cpp)
target_link_libraries(ex_Nlp_3D ct_optcon)
list(APPEND optcon_ex_TARGETS ex_Nlp_3D)
# add_executable(ex_Nlp_3D nlp/Nlp3D.cpp)
# target_link_libraries(ex_Nlp_3D ct_optcon)
# list(APPEND optcon_ex_TARGETS ex_Nlp_3D)

add_executable(ex_DMS DMS.cpp)
target_link_libraries(ex_DMS ct_optcon)
list(APPEND optcon_ex_TARGETS ex_DMS)
# add_executable(ex_DMS DMS.cpp)
# target_link_libraries(ex_DMS ct_optcon)
# list(APPEND optcon_ex_TARGETS ex_DMS)

if(CPPADCG)
add_executable(ex_LQR LQR.cpp)
target_link_libraries(ex_LQR ct_optcon)
list(APPEND optcon_ex_TARGETS ex_LQR)
endif()
# if(CPPADCG)
# add_executable(ex_LQR LQR.cpp)
# target_link_libraries(ex_LQR ct_optcon)
# list(APPEND optcon_ex_TARGETS ex_LQR)
# endif()

if(HPIPM)
add_executable(ex_NLOC_boxConstrained NLOC_boxConstrained.cpp)
Expand All @@ -49,9 +49,9 @@ if(HPIPM)
target_link_libraries(ex_NLOC_generalConstrained ct_optcon)
list(APPEND optcon_ex_TARGETS ex_NLOC_generalConstrained)

add_executable(switched_continuous_optcon_example switched_systems_optcon/switched_continuous_optcon.cpp)
target_link_libraries(switched_continuous_optcon_example ct_optcon)
list(APPEND optcon_ex_TARGETS switched_continuous_optcon_example)
# add_executable(switched_continuous_optcon_example switched_systems_optcon/switched_continuous_optcon.cpp)
# target_link_libraries(switched_continuous_optcon_example ct_optcon)
# list(APPEND optcon_ex_TARGETS switched_continuous_optcon_example)
endif()
endif(HPIPM)

Expand Down

0 comments on commit e7a29a6

Please sign in to comment.