Menu

#19 v1.7.3 linux - compile error

v1.0_(example)
open
nobody
None
1
2018-03-07
2018-02-26
No

Hi again,
I'm compiling the daetools project itself, however I again get an error.
Ubuntu 16.04, system python 3.5, gcc 5.4.0.

I would try with the newer gcc, however, I don't know how to set it. The usual

export CC=/usr/bin/gcc-7
export CXX=/usr/bin/g++-7

does not seem to work

$ sh compile.sh --with-python-version 3.5 all

[...]

compiling nodes_compute_stack.cpp
nodes_compute_stack.cpp: In function ‘void dae::core::processFCVP(size_t, const dae::core::daeFloatCoefficientVariableProduct&, std::vector<computestack::adComputeStackItem_>&, dae::core::daeBlock*, dae::core::daeDataProxy_t*, const std::map<long unsigned int, long unsigned int>&)’:
nodes_compute_stack.cpp:54:41: error: ‘const class std::map<long unsigned int, long unsigned int>’ has no member named ‘cend’
         if(it == mapAssignedVarsIndexes.cend())
                                         ^
nodes_compute_stack.cpp: In static member function ‘static void dae::core::adNode::CreateComputeStack(dae::core::adNode*, std::vector<computestack::adComputeStackItem_>&, dae::core::daeBlock_t*, double)’:
nodes_compute_stack.cpp:156:45: error: ‘const class std::map<long unsigned int, long unsigned int>’ has no member named ‘cend’
             if(it == mapAssignedVarsIndexes.cend())
                                             ^
Makefile:891: recipe for target 'release/nodes_compute_stack.o' failed
make[1]: *** [release/nodes_compute_stack.o] Error 1
make[1]: Leaving directory '/home/ondrej/repo/daetools-code/Core'
Makefile:125: recipe for target 'sub-Core-make_default-ordered' failed
make: *** [sub-Core-make_default-ordered] Error 2
make: Leaving directory '/home/ondrej/repo/daetools-code'

Discussion

  • ciroki

    ciroki - 2018-02-26

    Yes, I noticed that too. It is not a compiler issue. cend is available only in c++11 and a couple of projects miss the -std=c++11 flag since they do not use any other features from it.
    I already fixed it and planned to commit with the new release. I could do it now so you can proceed.
    Dragan

     
  • ciroki

    ciroki - 2018-02-26

    I committed a new version with the fixes. Please try and let me know if t works.
    Dragan

     
  • Ondřej Ticháček

    Hi, I updated the repo, recompiled all libraries and now nodes_compute_stack.cpp compiled fine.
    However, I encountered other errors - possibly due to missing -std=c++11 flags when compiling some libraries.

    $ sh compile.sh --with-python-version 3.5 all
    
    [...]
    
    make[1]: Entering directory '/home/ondrej/repo/daetools-code/DataReporting'
    compiling stdafx.cpp
    compiling html_file_reporter.cpp
    compiling text_file_reporter.cpp
    compiling filereporter.cpp
    compiling dllmain.cpp
    compiling data_reporter_local.cpp
    compiling class_factory.cpp
    compiling base_data_reporters_receivers.cpp
    compiling hybrid_data_reporter_receiver.cpp
    compiling delegate_data_reporter.cpp
    compiling tcpip_data_reporter.cpp
    compiling data_reporter_remote.cpp
    In file included from /usr/include/c++/5/system_error:35:0,
                     from ../boost3.5/boost/process/detail/config.hpp:21,
                     from ../boost3.5/boost/process/spawn.hpp:20,
                     from tcpip_data_reporter.cpp:9:
    /usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
     #error This file requires compiler and library support \
      ^
    compiling tcpip_data_receiver.cpp
    In file included from ../boost3.5/boost/process/detail/config.hpp:24:0,
                     from ../boost3.5/boost/process/spawn.hpp:20,
                     from tcpip_data_reporter.cpp:9:
    ../boost3.5/boost/process/exception.hpp:21:1: error: expected class-name before { token
     {
     ^
    ../boost3.5/boost/process/exception.hpp:22:16: error: ‘std::system_error’ has not been declared
         using std::system_error::system_error;
                    ^
    In file included from ../boost3.5/boost/process/spawn.hpp:20:0,
                     from tcpip_data_reporter.cpp:9:
    ../boost3.5/boost/process/detail/config.hpp:50:13: error: ‘error_code’ in namespace ‘std’ does not name a type
     inline std::error_code get_last_error() noexcept
                 ^
    ../boost3.5/boost/process/detail/config.hpp: In function ‘void boost::process::detail::throw_last_error(const string&)’:
    ../boost3.5/boost/process/detail/config.hpp:72:40: error: ‘get_last_error’ was not declared in this scope
         throw process_error(get_last_error(), msg);
                                            ^
    ../boost3.5/boost/process/detail/config.hpp: In function ‘void boost::process::detail::throw_last_error()’:
    ../boost3.5/boost/process/detail/config.hpp:77:40: error: ‘get_last_error’ was not declared in this scope
         throw process_error(get_last_error());
                                            ^
    ../boost3.5/boost/process/detail/config.hpp: At global scope:
    ../boost3.5/boost/process/detail/config.hpp:81:25: error: ‘constexpr’ does not name a type
     template<typename Char> constexpr Char null_char();
                             ^
    ../boost3.5/boost/process/detail/config.hpp:81:25: note: C++11 ‘constexpr’ only available with -std=c++11 or -std=gnu++11
    ../boost3.5/boost/process/detail/config.hpp:82:12: error: ‘constexpr’ does not name a type
     template<> constexpr char     null_char<char>     (){return   '\0';}
                ^
    ../boost3.5/boost/process/detail/config.hpp:82:12: note: C++11 ‘constexpr’ only available with -std=c++11 or -std=gnu++11
    ../boost3.5/boost/process/detail/config.hpp:83:12: error: ‘constexpr’ does not name a type
     template<> constexpr wchar_t  null_char<wchar_t>  (){return  L'\0';}
                ^
    ../boost3.5/boost/process/detail/config.hpp:83:12: note: C++11 ‘constexpr’ only available with -std=c++11 or -std=gnu++11
    ../boost3.5/boost/process/detail/config.hpp:85:25: error: ‘constexpr’ does not name a type
     template<typename Char> constexpr Char equal_sign();
                             ^
    ../boost3.5/boost/process/detail/config.hpp:85:25: note: C++11 ‘constexpr’ only available with -std=c++11 or -std=gnu++11
    ../boost3.5/boost/process/detail/config.hpp:86:12: error: ‘constexpr’ does not name a type
     template<> constexpr char     equal_sign<char>    () {return  '='; }
                ^
    ../boost3.5/boost/process/detail/config.hpp:86:12: note: C++11 ‘constexpr’ only available with -std=c++11 or -std=gnu++11
    ../boost3.5/boost/process/detail/config.hpp:87:12: error: ‘constexpr’ does not name a type
     template<> constexpr wchar_t  equal_sign<wchar_t> () {return L'='; }
                ^
    ../boost3.5/boost/process/detail/config.hpp:87:12: note: C++11 ‘constexpr’ only available with -std=c++11 or -std=gnu++11
    ../boost3.5/boost/process/detail/config.hpp:89:25: error: ‘constexpr’ does not name a type
     template<typename Char> constexpr Char quote_sign();
                             ^
    ../boost3.5/boost/process/detail/config.hpp:89:25: note: C++11 ‘constexpr’ only available with -std=c++11 or -std=gnu++11
    ../boost3.5/boost/process/detail/config.hpp:90:12: error: ‘constexpr’ does not name a type
     template<> constexpr char     quote_sign<char>    () {return  '"'; }
                ^
    ../boost3.5/boost/process/detail/config.hpp:90:12: note: C++11 ‘constexpr’ only available with -std=c++11 or -std=gnu++11
    ../boost3.5/boost/process/detail/config.hpp:91:12: error: ‘constexpr’ does not name a type
     template<> constexpr wchar_t  quote_sign<wchar_t> () {return L'"'; }
                ^
    ../boost3.5/boost/process/detail/config.hpp:91:12: note: C++11 ‘constexpr’ only available with -std=c++11 or -std=gnu++11
    ../boost3.5/boost/process/detail/config.hpp:93:25: error: ‘constexpr’ does not name a type
     template<typename Char> constexpr Char space_sign();
                             ^
    ../boost3.5/boost/process/detail/config.hpp:93:25: note: C++11 ‘constexpr’ only available with -std=c++11 or -std=gnu++11
    ../boost3.5/boost/process/detail/config.hpp:94:12: error: ‘constexpr’ does not name a type
     template<> constexpr char     space_sign<char>    () {return  ' '; }
                ^
    ../boost3.5/boost/process/detail/config.hpp:94:12: note: C++11 ‘constexpr’ only available with -std=c++11 or -std=gnu++11
    ../boost3.5/boost/process/detail/config.hpp:95:12: error: ‘constexpr’ does not name a type
     template<> constexpr wchar_t  space_sign<wchar_t> () {return L' '; }
                ^
    ../boost3.5/boost/process/detail/config.hpp:95:12: note: C++11 ‘constexpr’ only available with -std=c++11 or -std=gnu++11
    In file included from ../boost3.5/boost/process/detail/child_decl.hpp:28:0,
                     from ../boost3.5/boost/process/spawn.hpp:21,
                     from tcpip_data_reporter.cpp:9:
    ../boost3.5/boost/process/detail/posix/child_handle.hpp:30:31: error: expected ‘,’ or ‘...’ before && token
         child_handle(child_handle && c) : pid(c.pid)
                                   ^
    ../boost3.5/boost/process/detail/posix/child_handle.hpp:30:35: error: invalid constructor; you probably meant ‘boost::process::detail::posix::child_handle (const boost::process::detail::posix::child_handle&)     child_handle(child_handle && c) : pid(c.pid)
                                       ^
    ../boost3.5/boost/process/detail/posix/child_handle.hpp:35:42: error: expected ‘,’ or ‘...’ before && token
         child_handle &operator=(child_handle && c)
                                              ^
    ../boost3.5/boost/process/detail/posix/child_handle.hpp:47:24: error: ‘std::error_code’ has not been declared
         bool in_group(std::error_code &ec) const noexcept {return true;}
                            ^
    ../boost3.5/boost/process/detail/posix/child_handle.hpp:47:40: error: expected ; at end of member declaration
         bool in_group(std::error_code &ec) const noexcept {return true;}
                                            ^
    ../boost3.5/boost/process/detail/posix/child_handle.hpp:47:46: error: ‘noexcept’ does not name a type
         bool in_group(std::error_code &ec) const noexcept {return true;}
                                                  ^
    ../boost3.5/boost/process/detail/posix/child_handle.hpp:47:46: note: C++11 ‘noexcept’ only available with -std=c++11 or -std=gnu++11
    ../boost3.5/boost/process/detail/posix/child_handle.hpp:20:8: error: constructor required before non-static data member for ‘boost::process::detail::posix::child_handle::pid’ has been parsed
     struct child_handle
            ^
    ../boost3.5/boost/process/detail/posix/child_handle.hpp: In member function ‘boost::process::detail::posix::child_handle& boost::process::detail::posix::child_handle::operator=(boost::process::detail::posix::child_handle)’:
    ../boost3.5/boost/process/detail/posix/child_handle.hpp:37:15: error: ‘c’ was not declared in this scope
             pid = c.pid;
                   ^
    In file included from ../boost3.5/boost/process/detail/child_decl.hpp:29:0,
                     from ../boost3.5/boost/process/spawn.hpp:21,
                     from tcpip_data_reporter.cpp:9:
    ../boost3.5/boost/process/detail/posix/terminate.hpp: At global scope:
    ../boost3.5/boost/process/detail/posix/terminate.hpp:31:51: error: ‘std::error_code’ has not been declared
     inline void terminate(const child_handle &p, std::error_code &ec) noexcept
                                                       ^
    ../boost3.5/boost/process/detail/posix/terminate.hpp:31:67: error: expected initializer before ‘noexcept’
     inline void terminate(const child_handle &p, std::error_code &ec) noexcept
                                                                       ^
    In file included from ../boost3.5/boost/process/detail/child_decl.hpp:30:0,
                     from ../boost3.5/boost/process/spawn.hpp:21,
                     from tcpip_data_reporter.cpp:9:
    ../boost3.5/boost/process/detail/posix/wait_for_exit.hpp:35:63: error: ‘std::error_code’ has not been declared
     inline void wait(const child_handle &p, int & exit_code, std::error_code &ec) noexcept
                                                                   ^
    ../boost3.5/boost/process/detail/posix/wait_for_exit.hpp:35:79: error: expected initializer before ‘noexcept’
     inline void wait(const child_handle &p, int & exit_code, std::error_code &ec) noexcept
                                                                                   ^
    tcpip_data_reporter.cpp:169:1: error: expected } at end of input
     }
     ^
    tcpip_data_reporter.cpp:169:1: error: expected } at end of input
    tcpip_data_reporter.cpp:169:1: error: expected } at end of input
    tcpip_data_reporter.cpp:169:1: error: expected } at end of input
    Makefile:357: recipe for target 'release/tcpip_data_reporter.o' failed
    make[1]: *** [release/tcpip_data_reporter.o] Error 1
    make[1]: *** Waiting for unfinished jobs....
    make[1]: Leaving directory '/home/ondrej/repo/daetools-code/DataReporting'
    Makefile:161: recipe for target 'sub-DataReporting-make_default-ordered' failed
    make: *** [sub-DataReporting-make_default-ordered] Error 2
    make: Leaving directory '/home/ondrej/repo/daetools-code'
    
     

    Last edit: Ondřej Ticháček 2018-02-27
  • ciroki

    ciroki - 2018-02-28

    Right, that is the reason. It seems that new gcc versions have the features from the std library available in c++11 switched on by default.
    You can fix it yourself, just add to trunk/dae.pri file (somewhere around line 200 where the other compiler flags are specified):

    QMAKE_CXXFLAGS += -std=c++11
    QMAKE_LFLAGS += -std=c++11
    

    Dragan

     
  • Ondřej Ticháček

    Thank you, it worked! (I couldn't reply sooner, the sourceforge site was down)

     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB