coin-or / CoinUtils

COIN-OR Utilities
Other
44 stars 41 forks source link

### Building CoinUtils master error in file included from /usr/include/c++/4.8.2/algorithm:62:0, #128

Open jczazueta opened 4 years ago

jczazueta commented 4 years ago

Hi, I am Building Cbc and when execute:

~/coinbrew-master/coinbrew build Cbc --prefix=/home/jzazueta/lib –test

Appears the following error:

##################################################
### Building CoinUtils master 
##################################################

In file included from /usr/include/c++/4.8.2/algorithm:62:0,
                 from /home/jzazueta/dependencies/CoinUtils/src/CoinBronKerbosch.cpp:2:
/usr/include/c++/4.8.2/bits/stl_algo.h: In instantiation of ‘_RandomAccessIterator std::__unguarded_partition(_RandomAccessIterator, _RandomAccessIterator, const _Tp&, _Compare) [with _RandomAccessIterator = BKVertex*; _Tp = BKVertex; _Compare = bool (*)(BKVertex&, const BKVertex&)]’:
/usr/include/c++/4.8.2/bits/stl_algo.h:2296:78:   required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = BKVertex*; _Compare = bool (*)(BKVertex&, const BKVertex&)]’
/usr/include/c++/4.8.2/bits/stl_algo.h:2337:62:   required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = BKVertex*; _Size = long int; _Compare = bool (*)(BKVertex&, const BKVertex&)]’
/usr/include/c++/4.8.2/bits/stl_algo.h:5499:44:   required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = BKVertex*; _Compare = bool (*)(BKVertex&, const BKVertex&)]’
/home/jzazueta/dependencies/CoinUtils/src/CoinBronKerbosch.cpp:343:70:   required from here
/usr/include/c++/4.8.2/bits/stl_algo.h:2266:34: error: invalid initialization of reference of type ‘BKVertex&’ from expression of type ‘const BKVertex’
    while (__comp(__pivot, *__last))
                                  ^
make[2]: *** [CoinBronKerbosch.lo] Error 1
make[1]: *** [all] Error 2
make: *** [all-recursive] Error 1

Build failed, see error output above

May you help me?

Best Regards Juan Carlos

tkralphs commented 4 years ago

I can't replicate, so you'll have to provide more information. By the way, you still have a wrong character above ("–test"), would be nice to know where that's coming from. --test is now deprecated in favor of --tests which takes arguments 'main, all, or none. The default is "all".

Oh , just saw that you copied from Word. Yes, Word will auto-correct -- to a long dash, you definitely should not copy commands into Word and then back out again.

jczazueta commented 4 years ago

Hi tkralphs,

I am running with Centos 7 over Virtualbox:

As you see from history

284 cd dependencies/ 285 ~/coinbrew-master/coinbrew build Cbc --prefix=/home/jzazueta/lib --test 286 history | tail

The command is typed correctly. As you suggested, I typed: $ ~/coinbrew-master/coinbrew build Cbc --prefix=/home/jzazueta/lib --tests Deploys: Welcome to the COIN-OR fetch and build utility

For help, run script with --help.

No argument specified with --test.

Best Regards Juan Carlos

svigerske commented 4 years ago

Looks like the old stdc++ of GCC 4.8 has some problems with that code. Not sure it's worth to work around issues with such an old compiler.

jczazueta commented 4 years ago

May I upgrade to gcc-8.2.0?

tkralphs commented 4 years ago

You should have no problems with any recent version of gcc.

jczazueta commented 4 years ago

Well I going to try.

tkralphs commented 4 years ago

In response to https://github.com/coin-or/CoinUtils/issues/128#issuecomment-611193221, the new option --tests takes an argument, which is one of main, all, or none. You need to specify one of those. The default is now all. If you want to replicate the old behavior of --test, you do --tests main. I updated the error message for not providing an argument, which was a bit confusing.