FTBFS on CentOS 6.5 in Boost::program_options

Bug #1612315 reported by Alex Valavanis
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Quantum wells, wires and dots
Won't Fix
Critical
Alex Valavanis

Bug Description

Hello,

I'm trying to compile qwwad-1.4.0 from source code on CentOS 6.5 system during the compilation I'm getting the below error
Can you please advise how to debug this issue ?

In file included from /usr/local/gcc/5.3/include/c++/5.3.0/memory:81:0,
                 from /usr/include/boost/ptr_container/detail/reversible_ptr_container.hpp:39,
                 from /usr/include/boost/ptr_container/detail/associative_ptr_container.hpp:20,
                 from /usr/include/boost/ptr_container/ptr_map_adapter.hpp:20,
                 from /usr/include/boost/ptr_container/ptr_map.hpp:20,
                 from ../src/material_library.h:17,
                 from ../src/material_library.cpp:14:
/usr/local/gcc/5.3/include/c++/5.3.0/bits/unique_ptr.h:49:28: note: declared here
   template<typename> class auto_ptr;
                            ^
  CXX src/qwwad-debye.lo
  CXX src/qwwad/donor-energy-minimiser.lo
  CXX src/qwwad/donor-energy-minimiser-linear.lo
  CXX src/qwwad/donor-energy-minimiser-fast.lo
  CXX src/qwwad/mesh.lo
  CXX src/qwwad/file-io.lo
  CXX src/qwwad/file-io-deprecated.lo
  CXX src/qwwad/options.lo
../src/qwwad/options.cpp: In member function ‘std::__cxx11::string QWWAD::Options::name_mapper(std::__cxx11::string) const’:
../src/qwwad/options.cpp:236:66: error: no matching function for call to ‘boost::program_options::options_description::find(std::__cxx11::string&, bool, bool) const’
             option_name = config_options.find(suffix, false, true).long_name();
                                                                  ^
In file included from /usr/include/boost/program_options.hpp:15:0,
                 from ../src/qwwad/options.h:9,
                 from ../src/qwwad/options.cpp:10:
/usr/include/boost/program_options/options_description.hpp:188:35: note: candidate: const boost::program_options::option_description& boost::program_options::options_description::find(const string&, bool) const
         const option_description& find(const std::string& name, bool approx)
                                   ^
/usr/include/boost/program_options/options_description.hpp:188:35: note: candidate expects 2 arguments, 3 provided
make[1]: *** [src/qwwad/options.lo] Error 1
make[1]: Leaving directory `/tmp/devl/qwwad-1.4.0/build'
make: *** [all] Error 2

Thanks in advance,
Badies

Related branches

Changed in qwwad:
importance: Undecided → Critical
tags: added: build
Changed in qwwad:
status: New → Triaged
Revision history for this message
Alex Valavanis (valavanisalex) wrote :

This looks like it was caused by an API change in the Boost::program_options library.

CentOS 6.5 provides Boost 1.41 [1], while I'm currently using Boost 1.53 in CentOS 7 [2].

The change seems to be in the options_description.find() function.

In Boost 1.41 [3]:

const option_description & find(const std::string & name, bool approx) const;

In Boost 1.42 and higher [4]:

const option_description &
find(const std::string & name, bool approx, bool long_ignore_case = false,
     bool short_ignore_case = false) const;

We use the latter form, but only state a requirement for Boost 1.35 or higher.

There are three options for fixing the issue:

1. End support for Boost < 1.42 (but this would kill CentOS 6 support)
2. Stop using the "long_ignore_case" option. This would make the long-option names case-sensitive, which maybe wouldn't be such a bad thing
3. Provide a conditional build that would allow case-insensitive option naming on systems with Boost >= 1.42

I think I prefer Option 2 as it would allow users of older operating systems to carry on using QWWAD and would make the option parsing a bit stricter.

[1] http://mirror.centos.org/centos/6/os/x86_64/Packages/
[2] http://mirror.centos.org/centos/7/os/x86_64/Packages/
[3] http://www.boost.org/doc/libs/1_41_0/doc/html/boost/program_options/options_description.html#id884352-bb
[4] http://www.boost.org/doc/libs/1_42_0/doc/html/boost/program_options/options_description.html#id884352-bb

Changed in qwwad:
assignee: nobody → Alex Valavanis (valavanisalex)
Changed in qwwad:
status: Triaged → In Progress
Changed in qwwad:
status: In Progress → Fix Committed
milestone: none → 1.5
Revision history for this message
Alex Valavanis (valavanisalex) wrote :

Fix committed to lp:qwwad r684

I went with option 3, as this will avoid any change in behaviour for current users, but should allow users with legacy versions of Boost to build QWWAD.

This fix will be released in QWWAD 1.5

@Badie, would you be willing to test the development version of QWWAD? You can either checkout lp:qwwad (if you're using bzr) or you can download the tarball from:

http://bazaar.launchpad.net/~qwwad-dev/qwwad/trunk/revision/684

If it works, I can make a QWWAD 1.4.1 package that contains the patch

Revision history for this message
Alex Valavanis (valavanisalex) wrote :
tags: added: backport-proposed
Revision history for this message
Badie Saliba (badies) wrote :

Hi Alex ,

after testing development version I'm still receiving errors , please find attached file.

Thanks,
Badies

Revision history for this message
Alex Valavanis (valavanisalex) wrote :

Reopening in response to feedback.

@Badie - I've tried explicitly adding the C++ flags for the Boost library in the latest revision (685). If you could try updating, and rebuilding, that would be great.

If that still doesn't work, I'll try to get a CentOS 6.5 Virtual Machine build working and see if I can reproduce the problem.

Could you also, please, attach the config.log file that should have appeared in your build folder?

Finally, could you also, please see if you can find out where Boost is installed on your machine? It's probably somewhere like:

/usr/lib/x86_64-linux-gnu/libboost_program_options.so

Changed in qwwad:
status: Fix Committed → In Progress
Revision history for this message
Badie Saliba (badies) wrote :

Hi Alex,

after rebuilding the latest revision (http://bazaar.launchpad.net/~qwwad-dev/qwwad/trunk/revision/684) now i'm getting errors about pkg-config script:

checking for GSL... configure: error: in `/root/~qwwad-dev/qwwad/trunk/build':
configure: error: The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.

Alternatively, you may set the environment variables GSL_CFLAGS
and GSL_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

my pkg-config --version = 0.23

the Boost installed in /usr/lib64/libboost_program_options.so

Attached my config.log file.

Revision history for this message
Alex Valavanis (valavanisalex) wrote :

Hi Badie,

I've relaxed the pkg-config requirement, so you should be able to retry the build again now.

Can you try re-running configure using:

configure --with-boost-libdir="/usr/lib64"

and then rerun the "make"

Again, if you could provide the config.log, that would be very helpful

Revision history for this message
Alex Valavanis (valavanisalex) wrote :

Unfortunately, it turns out that this is quite complex to fix in a way that simultaneously supports:
(a) versions of Boost before v1.42
(b) versions of Boost >=1.42
(c) the Autotools build system
(d) the CMake build system

As a result, I have bumped the Boost dependency to 1.42, so that it should work correctly for all newer OS installations.

If anyone is prepared to submit a patch for older Boost version, I'll very happily apply it, but I'm afraid the best solution may be to install a newer library!

Changed in qwwad:
milestone: 1.5 → none
status: In Progress → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.