CoinUtils icon indicating copy to clipboard operation
CoinUtils copied to clipboard

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

Open jczazueta opened this issue 5 years ago • 7 comments

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

jczazueta avatar Apr 08 '20 19:04 jczazueta

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.

tkralphs avatar Apr 08 '20 20:04 tkralphs

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

jczazueta avatar Apr 08 '20 21:04 jczazueta

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.

svigerske avatar Apr 08 '20 21:04 svigerske

May I upgrade to gcc-8.2.0?

jczazueta avatar Apr 08 '20 22:04 jczazueta

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

tkralphs avatar Apr 08 '20 23:04 tkralphs

Well I going to try.

jczazueta avatar Apr 09 '20 00:04 jczazueta

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.

tkralphs avatar Apr 09 '20 13:04 tkralphs