Code Monkey home page Code Monkey logo

Comments (13)

jwdinius avatar jwdinius commented on May 27, 2024 2

I will submit a pr that you can look at in the next few days.

from ifopt.

jwdinius avatar jwdinius commented on May 27, 2024 1

@shoshievass I have a similar need, so I'll have a crack at this tomorrow.

from ifopt.

jwdinius avatar jwdinius commented on May 27, 2024 1

No worries. I actually thought that I had updated the PR with other work I had done, but I guess I was mistaken. For your reference, https://github.com/jwdinius/ifopt/tree/pure_cmake.

I followed the outline provided by kindr in most places, including setting up package exporting. Now, ifopt_ipopt(snopt) can use find_package() to find ifopt_core during the local superbuild or via an external cmake project. Please have a look if you are interested in exporting these projects, which might be handy when trying to install ifopt from within another project (like how kindr is built within https://bitbucket.org/adrlab/ct).

I was able to verify that the packages were able to found from an external cmake project built with unit tests. Hopefully something in my repo will be of use to you. Cheers!

from ifopt.

awinkler avatar awinkler commented on May 27, 2024

Since catkin is not installed in you system, you will have to remove the "find_package(catkin REQUIRED)" line and all others involving "catkin". Then you will need to ensure that when building "ifopt_ipopt", this project finds "ifopt_core", possibly through cmake's "add_subdirectory()" command and others. This linking of projects is where catkin is most handy.

from ifopt.

shoshievass avatar shoshievass commented on May 27, 2024

@jwdinius Awesome! Please let me know how it goes!

from ifopt.

jwdinius avatar jwdinius commented on May 27, 2024

I have submitted a PR for this: #15. Please review and provide feedback when you get the chance.

from ifopt.

awinkler avatar awinkler commented on May 27, 2024

Great, thanks @jwdinius !
I'll have a look at it in the next few days.

from ifopt.

jwdinius avatar jwdinius commented on May 27, 2024

I'm changing the pr to work-in-progress so you all can have a look at it and make comments. I would like to clean up the implementation a little more before it's merged.

from ifopt.

awinkler avatar awinkler commented on May 27, 2024

Hi @jwdinius, @shoshievass
Building with pure cmake works now (see #17), please let me know if you experience any problems.

Thanks for your help on this @jwdinius, sorry I couldn't merge your PR, I decided to do some beneficial structural code improvements as well while adding the cmake features.

from ifopt.

sapan-ostic avatar sapan-ostic commented on May 27, 2024

Hi,
I am trying to build using CMake. I have made changes according to instructions in the CmakeLists.txt. But I am getting the following error.

~/MyProject$ ls
bin build CMakeLists.txt example.cpp libipopt2.so

$cmake --build build -- -j3
[ 50%] Linking CXX executable ../bin/example
//usr/local/lib/libipopt.so.1: undefined reference to dpotrf_' //usr/local/lib/libipopt.so.1: undefined reference to dgemm_'
//usr/local/lib/libipopt.so.1: undefined reference to dnrm2_' //usr/local/lib/libipopt.so.1: undefined reference to dscal_'
//usr/local/lib/libipopt.so.1: undefined reference to dpotrs_' //usr/local/lib/libipopt.so.1: undefined reference to dtrsm_'
//usr/local/lib/libipopt.so.1: undefined reference to dlopen' //usr/local/lib/libipopt.so.1: undefined reference to daxpy_'
//usr/local/lib/libipopt.so.1: undefined reference to dgetrf_' //usr/local/lib/libipopt.so.1: undefined reference to dcopy_'
//usr/local/lib/libipopt.so.1: undefined reference to idamax_' //usr/local/lib/libipopt.so.1: undefined reference to dlclose'
//usr/local/lib/libipopt.so.1: undefined reference to dlerror' //usr/local/lib/libipopt.so.1: undefined reference to dlsym'
//usr/local/lib/libipopt.so.1: undefined reference to dsyrk_' //usr/local/lib/libipopt.so.1: undefined reference to dasum_'
//usr/local/lib/libipopt.so.1: undefined reference to dsyev_' //usr/local/lib/libipopt.so.1: undefined reference to dmumps_c'
//usr/local/lib/libipopt.so.1: undefined reference to dgetrs_' //usr/local/lib/libipopt.so.1: undefined reference to ddot_'

collect2: error: ld returned 1 exit status
CMakeFiles/example.dir/build.make:96: recipe for target '../bin/example' failed
make[2]: *** [../bin/example] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/example.dir/all' failed
make[1]: *** [CMakeFiles/example.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

from ifopt.

jwdinius avatar jwdinius commented on May 27, 2024

@sapan-ostic It looks like ipopt can't find blas. Are you sure that your libipopt.so works as expected? Did you follow the build stages at https://www.coin-or.org/Ipopt/documentation/node10.html? Are you working on linux? You could just apt install ipopt and it will handle the dependencies for you. If you run into other problems, you could look at my fork https://github.com/jwdinius/ifopt. I also wrote a blog post about the conversion process https://jwdinius.github.io/blog/2018/cmake/. Hopefully one of these references will help. Good luck!

from ifopt.

guzhaoyuan avatar guzhaoyuan commented on May 27, 2024

I am having the same issue as @sapan-ostic.
I try to compile the ex_test_ipopt.cc using cmake.

find_package(IPOPT 3.11.10 REQUIRED)
find_package(ifopt 2.0.1 REQUIRED)
set(LIB_IPOPT ifopt_ipopt)
add_executable(${LIB_IPOPT}-example ex_test_ipopt.cc)
target_link_libraries(${LIB_IPOPT}-example
  PUBLIC 
    ifopt::ifopt_core
    ifopt::ifopt_ipopt
)

And it gives me:

[ 20%] Linking CXX executable ifopt_ipopt-example
//usr/local/lib/libipopt.so.1: undefined reference to `dpotrf_'
//usr/local/lib/libipopt.so.1: undefined reference to `dgemm_'
//usr/local/lib/libipopt.so.1: undefined reference to `dnrm2_'
//usr/local/lib/libipopt.so.1: undefined reference to `dscal_'
//usr/local/lib/libipopt.so.1: undefined reference to `dpotrs_'
//usr/local/lib/libipopt.so.1: undefined reference to `dtrsm_'
//usr/local/lib/libipopt.so.1: undefined reference to `dlopen'
//usr/local/lib/libipopt.so.1: undefined reference to `daxpy_'
//usr/local/lib/libipopt.so.1: undefined reference to `dgetrf_'
//usr/local/lib/libipopt.so.1: undefined reference to `dcopy_'
//usr/local/lib/libipopt.so.1: undefined reference to `idamax_'
//usr/local/lib/libipopt.so.1: undefined reference to `dlclose'
//usr/local/lib/libipopt.so.1: undefined reference to `dlerror'
//usr/local/lib/libipopt.so.1: undefined reference to `dlsym'
//usr/local/lib/libipopt.so.1: undefined reference to `dsyrk_'
//usr/local/lib/libipopt.so.1: undefined reference to `dasum_'
//usr/local/lib/libipopt.so.1: undefined reference to `dsyev_'
//usr/local/lib/libipopt.so.1: undefined reference to `dmumps_c'
//usr/local/lib/libipopt.so.1: undefined reference to `dgetrs_'
//usr/local/lib/libipopt.so.1: undefined reference to `ddot_'
//usr/local/lib/libipopt.so.1: undefined reference to `dsymv_'
//usr/local/lib/libipopt.so.1: undefined reference to `dgemv_'
collect2: error: ld returned 1 exit status
CMakeFiles/ifopt_ipopt-example.dir/build.make:96: recipe for target 'ifopt_ipopt-example' failed
make[2]: *** [ifopt_ipopt-example] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/ifopt_ipopt-example.dir/all' failed
make[1]: *** [CMakeFiles/ifopt_ipopt-example.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

from ifopt.

guzhaoyuan avatar guzhaoyuan commented on May 27, 2024

I solved this by reinstall the ipopt with BLAS. Aka, remove the coinor-libipopt-dev, and compile ipopt from source after get the Thirdparty solver BLAS.

from ifopt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.