PSOPT / psopt

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

Cannot build individual examples #46

Closed gabrieldlm closed 1 year ago

gabrieldlm commented 1 year ago

Greatings,

Following the instructions for the Ubuntu 22.04 it generates binaries for all examples ( in the psopt/build/examples folder ) but when I try to build the examples in the folder psopt/examples/ using cmake . I receive the error message

-- Configuring done
CMake Error at CMakeLists.txt:4 (add_executable):
  Target "goddard" links to target "PkgConfig::ipopt" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?

CMake Error at CMakeLists.txt:4 (add_executable):
  Target "goddard" links to target "Eigen3::Eigen" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?

CMake Error at CMakeLists.txt:5 (add_dependencies):
  The dependency target "PSOPT" of target "goddard" does not exist.
vmbecerra commented 1 year ago

You indicated that the binaries for all examples are generated. Did you test any of them and if so, do they run correctly?

If you modify any of the examples, you can run 'make' from within the respective folder. For example, to rebuild the 'user' example after you modify its source code, you should cd to psopt/build/examples/user and then from a terminal run the command 'make' or 'make user'. If you wish to create your own example, I suggest that as a first step you modify the 'user' example code in 'psopt/examples/user'. If there are additional dependencies, then you need to modify the necessary CMakeLists.txt files (e.g in '/psopt/examples/user', and if necessary in 'psopt/'), then run cmake again.

gabrieldlm commented 1 year ago

Thank you, it worked !