Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions C++/ADCodeGen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ include_directories("..")
#include_directories(.)
include_directories(../External/Eigen)
include_directories(../External/Json/include)
include_directories(../External/lib/include)

add_executable(ADCodeGen
ad_dynamics.cpp
Expand All @@ -16,4 +17,5 @@ add_executable(ADCodeGen
../Params/params.cpp
main.cpp)

target_link_libraries(ADCodeGen ${CMAKE_SOURCE_DIR}/../External/lib/lib/libcppad_lib.so)
#target_link_libraries(ADCodeGen cppad_cg_RK4.so m)
5 changes: 2 additions & 3 deletions C++/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_FLAGS "-O0")

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)
include_directories(External/lib/include)

add_executable(MPCC
main.cpp
Expand Down Expand Up @@ -40,4 +39,4 @@ find_package(Python3 COMPONENTS Interpreter NumPy Development)
target_include_directories(MPCC PRIVATE ${Python3_INCLUDE_DIRS})
target_link_libraries(MPCC ${Python3_LIBRARIES})

target_link_libraries(MPCC ${CMAKE_SOURCE_DIR}/External/hpipm/lib/lib/libhpipm.a ${CMAKE_SOURCE_DIR}/External/blasfeo/lib/lib/libblasfeo.a m)
target_link_libraries(MPCC ${CMAKE_SOURCE_DIR}/External/lib/lib/libhpipm.a ${CMAKE_SOURCE_DIR}/External/lib/lib/libblasfeo.a m dl)
2 changes: 1 addition & 1 deletion C++/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ To install all the dependencies run
```
./install.sh
```
this clones `blasfeo`, `hpipm`, `matplotlip-cpp`, `nlohmann/json`, and `eigen`, from their git repo, and safes them in a folder External. Additionally, it installs `blasfeo` and `hpipm` in the same External folder, thus no admin rights are necessary.
this clones `blasfeo`, `hpipm`, `matplotlip-cpp`, `nlohmann/json`, `eigen`, `cppad`, and `cppad-codegen` from their git repo, and safes them in a folder External. Additionally, it installs `blasfeo`, `hpipm`, `cppad`, and `cppad-codegen` in the same External folder, thus no admin rights are necessary. You may need to install `llvm` and `clang` with admin rights in order for `cppad-codegen` to build properly.

Note that `matplotlib-cpp` does also require `Python-2.7` and `matplotlib`, for more details see (https://github.com/lava/matplotlib-cpp).

Expand Down
35 changes: 29 additions & 6 deletions C++/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,28 +29,51 @@ git clone "$repository_hpipm" "$localFolder_hpipm"
repository_matplotlib="https://github.com/lava/matplotlib-cpp.git"
localFolder_matplotlib="External/matplotlib"
git clone "$repository_matplotlib" "$localFolder_matplotlib"
## clone eigne
## clone eigen
repository_eigen="https://gitlab.com/libeigen/eigen.git"
localFolder_eigen="External/Eigen"
git clone "$repository_eigen" "$localFolder_eigen"
## clone json
repository_json="https://github.com/nlohmann/json.git"
localFolder_json="External/Json"
git clone "$repository_json" "$localFolder_json"

## clone cppad
repository_cppad="https://github.com/coin-or/CppAD.git"
localFolder_cppad="External/CppAD"
git clone "$repository_cppad" "$localFolder_cppad"
## clone cppad codegen
repository_cppadcg="https://github.com/joaoleal/CppADCodeGen.git"
localFolder_cppadcg="External/CppADCodeGen"
git clone "$repository_cppadcg" "$localFolder_cppadcg"

cd External/blasfeo
mkdir -p build
mkdir -p lib
mkdir -p ../lib
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=$(realpath ../lib)
cmake .. -DCMAKE_INSTALL_PREFIX=$(realpath ../../lib)
make
make install

cd ../../hpipm
mkdir -p build
mkdir -p lib
mkdir -p ../lib
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=$(realpath ../../lib) -DBLASFEO_PATH=$(realpath ../../lib)
make
make install

cd ../../CppAD
mkdir -p build
mkdir -p ../lib
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=$(realpath ../../lib)
make
make install

cd ../../CppADCodeGen
mkdir -p build
mkdir -p ../lib
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=$(realpath ../lib) -DBLASFEO_PATH=$(realpath ../../blasfeo/lib)
cmake .. -DCMAKE_INSTALL_PREFIX=$(realpath ../../lib)
make
make install