v1.7.3 linux - compile error
Object-oriented equation-based modelling and optimisation software
Brought to you by:
ciroki
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'
Anonymous
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
I committed a new version with the fixes. Please try and let me know if t works.
Dragan
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.
Last edit: Ondřej Ticháček 2018-02-27
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):
Dragan
Thank you, it worked! (I couldn't reply sooner, the sourceforge site was down)