PSOPT / psopt

PSOPT Optimal Control Software
GNU Lesser General Public License v2.1
201 stars 76 forks source link

Using CMake and Eigen3 (without implementation) #14

Closed schulz0r closed 4 years ago

schulz0r commented 4 years ago

Hello, After we agreed that dmatrix and its dependencies are hard to integrate into a modern build system such as CMake, I removed dmatrix from this project. The PSOPT code has then been moved to the root directory and can now generate a project. Just create a directory build/, then do

cd build/
cmake ..

This will create a Makefile project. Check this site if you want to generate a Visual Studio project (cmake -G "Visual Studio 15 2017" ..) or others. Optionally, you can pass the option -DBUILD_EXAMPLES=ON in the command line. This will create the examples in the examples/ directory. So, here is what I usually do: cmake -G Xcode -DBUILD_EXAMPLES=ON ...

Don't forget to install Eigen3 on your system before generating the project. This should be available in every package manager out there. When you are done, you will have a project file in the build/ directory. Open that with the IDE of your choice and hit the compile button. The generated project won't compile because dmatrix is missing. Now, the bugs must be resolved by changing all dmatrices with Eigen::Matrix and other things to do. The Snopt-interface has not been altered until now, but feel free to ask me whenever it seems necessary. I hope that this work will help you with modernizing PSOPT.

Best regards

Philipp Waxweiler