Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local installs of Boost 1.70+ can take precedence over USD builds of boost #1071

Closed
robpieke opened this issue Dec 26, 2019 · 5 comments
Closed

Comments

@robpieke
Copy link
Contributor

robpieke commented Dec 26, 2019

(all the below is based on OSX - it might or might not also apply to Linux&Windows)

As per https://github.com/Kitware/CMake/blob/master/Modules/FindBoost.cmake#L230 if you have Boost 1.70+ installed locally, CMake can pick it up instead of the version of Boost built by the build script.

-- Found Boost: /usr/local/lib/cmake/Boost-1.71.0/BoostConfig.cmake (found version "1.71.0") found components: program_options python 

This is a problem if your local installation of boost python is for Python 3, and you can end up with nasty errors like:

[ 46%] Linking CXX shared library _garch.so
Undefined symbols for architecture x86_64:
  "boost::python::detail::init_module(char const*, void (*)())", referenced from:
      _init_garch in module.cpp.o
      _initlibgarch in module.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [pxr/imaging/lib/garch/_garch.so] Error 1
make[1]: *** [pxr/imaging/lib/garch/CMakeFiles/_garch.dir/all] Error 2

Thankfully, a few lines down, the solution is given (https://github.com/Kitware/CMake/blob/master/Modules/FindBoost.cmake#L241)

When I make the following change, I'm back up and running again

diff --git a/build_scripts/build_usd.py b/build_scripts/build_usd.py
index c844e9dd5..688773063 100644
--- a/build_scripts/build_usd.py
+++ b/build_scripts/build_usd.py
@@ -299,6 +299,7 @@ def RunCMake(context, force, extraArgs = None):
             '-DCMAKE_INSTALL_PREFIX="{instDir}" '
             '-DCMAKE_PREFIX_PATH="{depsInstDir}" '
             '-DCMAKE_BUILD_TYPE={config} '
+            '-DBoost_NO_BOOST_CMAKE=ON '
             '{osx_rpath} '
             '{generator} '
             '{extraArgs} '
@jilliene
Copy link

jilliene commented Jan 6, 2020

Filed as internal issue #USD-5771

@c64kernal
Copy link
Contributor

Thanks for reporting this @robpieke -- we ran into the same issue when our CI was updated, and here is how Varun fixed it: commit We're discussing now making that the default behavior of the build script.

@tototuo
Copy link

tototuo commented Jan 17, 2020

Thank you @robpieke , I add this configuration and it works well !

@robpieke
Copy link
Contributor Author

We're discussing now making that the default behavior of the build script.

Looks like this didn't make it for 20.02 ... hopefully 20.05?

@spiffmon
Copy link
Member

spiffmon commented Jan 27, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants