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

b2 does not compile with clang 11 #90

Closed
3 tasks done
diehlpk opened this issue Sep 24, 2021 · 7 comments
Closed
3 tasks done

b2 does not compile with clang 11 #90

diehlpk opened this issue Sep 24, 2021 · 7 comments
Labels
bug Something isn't working

Comments

@diehlpk
Copy link

diehlpk commented Sep 24, 2021

Make sure you completed the following tasks

Environment and version details

  • Operating System+version: **Linux daint106 4.12.14-197.99-default Versioned Clang automatic configuration #1 SMP Thu Jul 15 13:52:56 UTC 2021 (a15b9f6) x86_64 x86_64 x86_64 GNU/Linux
    **
  • Compiler+version: Clang 11*
  • Shell: Bash,

Brief problem description

./b2 does not compile with clang 11

Steps to reproduce the issue

Install boost with clang 11

Actual behavior summary

> clang++ -x c++ -std=c++11 -O3 -s -DNDEBUG builtins.cpp class.cpp command.cpp compile.cpp constants.cpp cwd.cpp debug.cpp debugger.cpp execcmd.cpp execnt.cpp execunix.cpp filesys.cpp filent.cpp fileunix.cpp frames.cpp function.cpp glob.cpp hash.cpp hcache.cpp hdrmacro.cpp headers.cpp jam_strings.cpp jam.cpp jamgram.cpp lists.cpp make.cpp make1.cpp md5.cpp mem.cpp modules.cpp native.cpp object.cpp option.cpp output.cpp parse.cpp pathnt.cpp pathsys.cpp pathunix.cpp regexp.cpp rules.cpp scan.cpp search.cpp startup.cpp subst.cpp sysinfo.cpp timestamp.cpp variable.cpp w32_getreg.cpp modules/order.cpp modules/path.cpp modules/property-set.cpp modules/regex.cpp modules/sequence.cpp modules/set.cpp -o b2
ld.lld: error: undefined symbol: __cray_sset_detect
>>> referenced by order.cpp
>>>               /tmp/order-677dee.o:(order(frame*, int))
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)

Expected behavior summary

I would like to compile b2 to install boost

@grafikrobot
Copy link
Member

Strange since clang11 is tested continously (ex. https://dev.azure.com/bfgroup/3a4e7a7e-c1b4-4e2f-9199-f52918ea06c6/_apis/build/builds/301/logs/326) and it's fine on Ubuntu. My suspicion would be there's some extra options to use for building on your specific platform. Or that there's something broken about your tools install/setup. Can you give more details on your system. Which variant of Linux? (perhaps share contents of /etc/issue) Can you verify you can compile a simple hello world C++ program directly with a command as what b2 is using to build?

@diehlpk
Copy link
Author

diehlpk commented Sep 25, 2021

I could compile boost 1.75 and 1.70 using the same compiler. I am on a Cray system using the Cray cc and CC combined with clang 11. In addition, I could compile hdf5, silo, hwloc, jemalloc, and cmake using the same compiler.

clang++ --version

Cray clang version 11.0.0  (1563bb12fb3eabb03515d4cc4aeaedd757aea56a)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/cray/pe/cce/11.0.0/cce-clang/x86_64/share/../bin

CC --version

clang++ --version
Cray clang version 11.0.0  (1563bb12fb3eabb03515d4cc4aeaedd757aea56a)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/cray/pe/cce/11.0.0/cce-clang/x86_64/bin

uname -a

Linux daint106 4.12.14-197.99-default #1 SMP Thu Jul 15 13:52:56 UTC 2021 (a15b9f6) x86_64 x86_64 x86_64 GNU/Linux

@diehlpk
Copy link
Author

diehlpk commented Feb 11, 2022

@grafikrobot I found the issue why it does not compile and it is because clang++ is used and not CC as it should be on CRAY.

I have no idea how to tell boost to use CC instead of clang++ to compile b2 on a Cray machine.

@grafikrobot
Copy link
Member

The Cray CC compiler is not one directly supported. It tries to use clang++ by default instead. First you can use whatever compiler you want by building b2 manually and using the --cxx=CC and --cxxflags=... options to the ./src/engine/build.sh script. Second it should be possible to fix using clang++ on Cray. Just need to figure out what additional CLI options are needed to resolve the link error you're seeing.

@grafikrobot
Copy link
Member

Going to assume this is no longer a problem. If otherwise, feel free to reopen.

@markstock
Copy link

@diehlpk , or anyone else who is trying to build boost libraries with Cray compiler wrappers, the following seems to work.

First, edit bootstrap.sh about line 229 (in 1_79_0) with the extra chunk at the end:

CXX= CXXFLAGS= "$my_dir/tools/build/src/engine/build.sh" ${TOOLSET} "--cxx=CC"

Now you can run something like:

./bootstrap.sh --prefix=$MYLIB/boost-amd521 --with-toolset=clang --with-libraries=all

Then before the b2 call, edit tools/build/src/tools/clang-linux.jam about line 52 and replace clang++ with CC. Now you can run:

./b2 --prefix=$MYLIB/boost-amd521 --build-dir=build-amd521 toolset=clang install

@markstock
Copy link

There is also a build script in the following repository, though I have not tried it: https://github.com/Cray/pe-scripts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants