Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

trouble building casadi on Debian wheezy

2012-07-04
2013-04-11
  • Hi,
            I am trying to package casadi for Debian wheezy.
            I run into several problems:
            * cmake do no find sundials 2.5.0 : FindSUNDIALS.cmake
            is "broken" for Debian. I tried to change it but it seems
            that LINK_LIBRARIES is ignored
            * modify FindOCTAVE.cmake to find include_dir
            * compilation error with latest octave 3.6:
           
            make: Entering directory
            `/tmp/buildd/casadi-1.3.0~beta~svn2830/debian/build'
            /usr/bin/cmake -E cmake_progress_report
            "/tmp/buildd/casadi-1.3.0~beta~svn2830/debian/build/CMakeFiles"
             Building CXX object
            swig/CMakeFiles/casadi_octave.dir/casadiOCTAVE_wrap.o
            cd "/tmp/buildd/casadi-1.3.0~beta~svn2830/debian/build/swig"
            && /usr/lib/ccache/c++   -Dcasadi_octave_EXPORTS -DHAVE_CSTDDEF
            -D_USE_MATH_DEFINES -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS
            -DHAVE_UNORDERED_MAP -DWITH_SUNDIALS_2_5 -DWITH_SUNDIALS_2_5 -std=gnu
            ++0x -fPIC -O3 -DNDEBUG -fPIC
            -I"/tmp/buildd/casadi-1.3.0~beta~svn2830/." -I/usr/lib/openmpi/include
            -I/usr/lib/openmpi/include/openmpi -I/usr/include/python2.7
            -I"/tmp/buildd/casadi-1.3.0~beta~svn2830/swig"
            -I/usr/include/python2.7/numpy
            -I"/tmp/buildd/casadi-1.3.0~beta~svn2830/swig/.."
            -I/usr/include/octave-3.6.2    -o
            CMakeFiles/casadi_octave.dir/casadiOCTAVE_wrap.o -c
            "/tmp/buildd/casadi-1.3.0~beta~svn2830/debian/build/swig/casadiOCTAVE_wrap.cxx"
            /tmp/buildd/casadi-1.3.0~beta~svn2830/debian/build/swig/casadiOCTAVE_wrap.cxx:1532:18: error: 'virtual bool octave_swig_type::is_object() const' cannot be overloaded
            /tmp/buildd/casadi-1.3.0~beta~svn2830/debian/build/swig/casadiOCTAVE_wrap.cxx:1527:18: error: with 'virtual bool octave_swig_type::is_object() const'
            /tmp/buildd/casadi-1.3.0~beta~svn2830/debian/build/swig/casadiOCTAVE_wrap.cxx: In member function 'virtual dim_vector octave_swig_type::dims() const':
            /tmp/buildd/casadi-1.3.0~beta~svn2830/debian/build/swig/casadiOCTAVE_wrap.cxx:1162:25: error: redeclaration of 'octave_swig_type* nc_this'
            /tmp/buildd/casadi-1.3.0~beta~svn2830/debian/build/swig/casadiOCTAVE_wrap.cxx:1157:25: error: 'octave_swig_type* nc_this' previously declared here
            /tmp/buildd/casadi-1.3.0~beta~svn2830/debian/build/swig/casadiOCTAVE_wrap.cxx:1165:26: error: redeclaration of 'octave_swig_type::member_value_pair* m'
            /tmp/buildd/casadi-1.3.0~beta~svn2830/debian/build/swig/casadiOCTAVE_wrap.cxx:1160:26: error: 'octave_swig_type::member_value_pair* m' previously declared here
            /tmp/buildd/casadi-1.3.0~beta~svn2830/debian/build/swig/casadiOCTAVE_wrap.cxx:1204:25: error: redeclaration of 'octave_value_list inarg'
            /tmp/buildd/casadi-1.3.0~beta~svn2830/debian/build/swig/casadiOCTAVE_wrap.cxx:1172:25: error: 'octave_value_list inarg' previously declared here
            /tmp/buildd/casadi-1.3.0~beta~svn2830/debian/build/swig/casadiOCTAVE_wrap.cxx:1206:25: error: redeclaration of 'octave_value_list outarg'
            /tmp/buildd/casadi-1.3.0~beta~svn2830/debian/build/swig/casadiOCTAVE_wrap.cxx:1174:25: error: 'octave_value_list outarg' previously declared here
            /tmp/buildd/casadi-1.3.0~beta~svn2830/debian/build/swig/casadiOCTAVE_wrap.cxx: At global scope:
            /tmp/buildd/casadi-1.3.0~beta~svn2830/debian/build/swig/casadiOCTAVE_wrap.cxx:1783:18: error: 'virtual bool octave_swig_ref::is_object() const' cannot be overloaded
            /tmp/buildd/casadi-1.3.0~beta~svn2830/debian/build/swig/casadiOCTAVE_wrap.cxx:1780:18: error: with 'virtual bool octave_swig_ref::is_object() const'
            /tmp/buildd/casadi-1.3.0~beta~svn2830/debian/build/swig/casadiOCTAVE_wrap.cxx: In function 'octave_value CasADi_Matrix_Sl_double_Sg__toSparse(CasADi::Matrix<double>*)':
            /tmp/buildd/casadi-1.3.0~beta~svn2830/debian/build/swig/casadiOCTAVE_wrap.cxx:5461:19: warning: 'Array<T>::Array(octave_idx_type) ' is deprecated (declared at /usr/include/octave-3.6.2/octave/Array.h:179)
            /tmp/buildd/casadi-1.3.0~beta~svn2830/debian/build/swig/casadiOCTAVE_wrap.cxx:5462:19: warning: 'Array<T>::Array(octave_idx_type) ' is deprecated (declared at /usr/include/octave-3.6.2/octave/Array.h:179)
            /tmp/buildd/casadi-1.3.0~beta~svn2830/debian/build/swig/casadiOCTAVE_wrap.cxx:5465:26: warning: 'Array<T>::Array(octave_idx_type) ' is deprecated (declared at /usr/include/octave-3.6.2/octave/Array.h:179)
            make: ***
            Error 1
            make: Leaving directory
            `/tmp/buildd/casadi-1.3.0~beta~svn2830/debian/build'
            make: ***  Error 2
            make: Leaving directory
            `/tmp/buildd/casadi-1.3.0~beta~svn2830/debian/build'
            make: ***  Error 2
            make: Leaving directory
            `/tmp/buildd/casadi-1.3.0~beta~svn2830/debian/build'
            make: ***  Error 2
            make: Leaving directory
            `/tmp/buildd/casadi-1.3.0~beta~svn2830/debian/build'
            make: ***  Error 2
            make: Leaving directory `/tmp/buildd/casadi-1.3.0~beta~svn2830'
            make: ***  Error 2
           
            Could you also provide some shared libraries?
           
            Best regards
            C. Trophime

    # TRY TO FIND THE INCLUDE DIRECTORY
    FIND_PROGRAM(OCTAVE_EXECUTABLE octave
    PATHS /usr/bin
    )

    IF(OCTAVE_EXECUTABLE)
      SET(OCTAVE_FOUND TRUE)
    ELSE(OCTAVE_EXECUTABLE)
      SET(OCTAVE_FOUND FALSE)
    ENDIF(OCTAVE_EXECUTABLE)

    # use octave_config
    FIND_PROGRAM(OCTAVE_CONFIG_EXECUTABLE octave-config
      PATHS /usr/bin
    )

    IF(OCTAVE_CONFIG_EXECUTABLE)
       execute_process(
       COMMAND ${OCTAVE_CONFIG_EXECUTABLE} -v
       OUTPUT_VARIABLE _octave_config_version
       RESULT_VARIABLE _octave_config_failed)
       string(REGEX REPLACE """" _octave_config_version "${_octave_config_version}")
    ENDIF(OCTAVE_CONFIG_EXECUTABLE)

    IF(OCTAVE_FOUND)
       FIND_PATH(OCTAVE_INCLUDE_DIR
       octave/oct.h
       PATHS
       /usr/include/octave-${_octave_config_version}
       )

       include_directories(${OCTAVE_INCLUDE_DIR})

       MESSAGE( STATUS "OCTAVE found: version(${_octave_config_version}) header(${OCTAVE_INCLUDE_DIR}) executable(${OCTAVE_EXECUTABLE})" )
      
    ENDIF(OCTAVE_FOUND)

     
  • Joel Andersson
    Joel Andersson
    2012-07-04

    Hello!

    I see you are using the 1.3.0 tag. It is quite old and we will make a new tag (1.4.0) later this week. In the new tag (and in the current tag version), the Sundials interface has been updated and support for Sundials 2.5.0 has been added (2.4.0 is still supported). So I would recommend you to use the current trunk version or wait a few days for the tag. If you're able to package it, we could maybe upload the binary as well. I am not 100 % sure that this will solve your Sundials compilation problem, but I think it will.

    Thank you for your suggested modification of FindOCTAVE.cmake. I will check if it works for our systems as well, and if so include it in the trunk.

    Your compilation problem with Octave looks strange. I have not seen it before. Could you check if it remains on the current trunk version?

    Finally, note that the Octave front-end is not nearly as mature as the Python front-end (or the native C++ front-end). So prepare for some more bugs to appear along the way if you want use it. We will try to fix them as fast as we can.

    Best,
    Joel

     
  • jgillis
    jgillis
    2012-07-09

    Hi there,

    I will take a look at the octave compilation problem somewhere this week.
    It does not surprise me that it breaks for a recent octave version.
    At the moment,  we apply octave patches on the fly, and this system is doomed to break for every new octave release.

    Best regards,
       Joris GIllis

     
  • Joel Andersson
    Joel Andersson
    2012-07-09

    Hello!

    Great that you'll have a look at it, Joris. I will just add two things:

        * The Octave version that you can get by apt-get, also with the newest Ubuntu (12.04) is Octave 3.2. I am not sure that we will be able to support other Octave versions than the latest one in apt-get, if they differ a lot from each other.
        * I have now created a tag for CasADi v1.4.0beta. Try using that one instead of v1.3.0beta.

    Regards,
    Joel