Uploaded image for project: 'C++ Driver'
  1. C++ Driver
  2. CXX-128

Sconscript does not respect Boost naming conventions on Windows

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • legacy-0.8.0
    • Affects Version/s: legacy-0.0-26compat-2.6.0-rc1
    • Component/s: None
    • Environment:
      Windows 7, 64-bit, Visual Studio 2012, Visual Studio 2010

      The Boost pre-built binaries include metadata in the library filenames that Scons does not recognize. For example: libboost_system-vc110-mt-sgd-1_53.lib. But the Sconscript looks for boost_system-mt.lib. Needless to say, the Sconscript does not find them:

      Checking for C++ library boost_thread-mt... no
      Checking for C++ library boost_thread... no
      Checking for C++ library boost_filesystem-mt... no
      Checking for C++ library boost_filesystem... no
      Checking for C++ library boost_program_options-mt... no
      Checking for C++ library boost_program_options... no
      Checking for C++ library boost_system-mt... no
      Checking for C++ library boost_system... no

      Yes, the boost libraries can be built in a way that doesn’t include the extra metadata (or they can be manually renamed). However, given that the MongoDB C++ Driver depends on Boost, it would make more sense to conform to the naming that Boost provides. The Boost headers themselves are designed to properly link to the correct lib file with full metadata in the filename. Furthermore, the reduced names can lead to build issues due to simple human error of pointing to a lib file that does not exactly match the build context (debug/release and dynamic/static). The extra metadata in the name ensures the correct lib file is selected.

      While the “sgd” portion of the Boost lib filename can be deduced from options like --static and --dbg:on, the “vc110” and “1_53” portions could be specified as new program options to the Sconscript.

      Furthermore, when the --static flag is specified, the Sconscript still appears to look for boost_system-mt (the dynamic version of the lib) yet it should be looking for, libboost_system-mt (the static version of the lib). That is, fully static should really be fully static.

            Assignee:
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Reporter:
            james.coulter James Coulter
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: