[CXX-139] Legacy driver compile error Created: 14/Mar/14  Updated: 10/Apr/14  Resolved: 14/Mar/14

Status: Closed
Project: C++ Driver
Component/s: None
Affects Version/s: legacy-0.0-26compat-2.6.0-rc1
Fix Version/s: None

Type: Bug Priority: Critical - P2
Reporter: Patrick Perroud Assignee: Tyler Brock
Resolution: Done Votes: 0
Labels: legacy-cxx
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

sources: https://github.com/mongodb/mongo-cxx-driver.git
env: macosx 10.9.2 with xcode 5.1 w/ latest command line tools + boots library installed from macports.org



 Description   

boots extrapath is ignored at building time - as follow:

scons --prefix=/opt/local/mongodb/mongo-client-install --full --extrapath=/opt/local/include/boost --use-system-boost install-mongoclient
scons: Reading SConscript files ...
scons version: 2.3.0
python version: 2 7 6 'final' 0
Checking whether the C++ compiler worksyes
Checking whether the C compiler worksyes
Checking if C++ compiler "g++" is GCC... no
Checking if C++ compiler "g++" is clang... yes
Checking if C compiler "gcc" is clang... yes
Checking if C compiler supports -Wno-unused-local-typedefs... no
Checking if C compiler supports -Wno-unused-function... yes
Checking if C compiler supports -Wno-unused-private-field... yes
Checking if C compiler supports -Wno-deprecated-declarations... yes
Checking if C compiler supports -Wno-tautological-constant-out-of-range-compare... yes
Checking if C compiler supports -Wno-unused-const-variable... yes
Checking if C compiler supports -mmacosx-version-min=10.6... yes
Checking for __thread... no
Checking for C++ header file boost/filesystem/operations.hpp... no
can't find boost headers

Where the "missing" boost/filesystem/operations.hpp file does exist: it's actually located @ /opt/local/include/boost/filesystem/operations.hpp

Looks like the build script is not taking notice of my extrapath...

When I am trying without --use-system-boost the extrapath is used but then the script is blocked later on because --use-system-boost was required by C++ compiler...



 Comments   
Comment by Eric Milkie [ 14/Mar/14 ]

Indeed, most boost distributions do not have an 'include' directory within the 'boost' directory, so using --extrapath doesn't work.
Good to hear it's working for you.

Comment by Patrick Perroud [ 14/Mar/14 ]

@Eric Milkie

In my case there is no 'include' directory within the 'boost' directory but a buch of *.hpp files and more directories w/ more *.hpp files.

Anyways - following your latter advice I set it like this:

scons --prefix=/opt/local/mongodb/mongo-client-install --full --extrapath=/opt/local --cpppath=/opt/local/include/boost --use-system-boost install-mongoclient

And got it built! Thank you...

Comment by Eric Milkie [ 14/Mar/14 ]

The "extrapath" option is used to make both an include search path for the compiler and a library search path for the linker. It appends "include/" to the path you provide and uses that for the include path. So in your case, the include path will be "/opt/local/include/boost/include/".
"boost/filesystem/operations.hpp" definitely does not exist in "/opt/local/include/boost/include/".

Your options are either to use "/opt/local" for --extrapath (not sure if that will link properly though), or else use --cpppath which allows you to specify an exact include path.

Generated at Wed Feb 07 21:58:19 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.