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

tbb: clang support #30918

Merged
merged 1 commit into from Oct 29, 2017
Merged

tbb: clang support #30918

merged 1 commit into from Oct 29, 2017

Conversation

Mankarse
Copy link
Contributor

@Mankarse Mankarse commented Oct 29, 2017

Added compiler and stdver parameters, to support non-gcc compilers, and enable
perfect exception forwarding (std::exception_ptr) on platforms where C++11 is not enabled by default

Motivation for this change

Add support for compiling tbb with clang. Support building tbb with std::exception_ptr enabled on platforms that don't support it by default.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

Added compiler and stdver parameters, to support non-gcc compilers, and enable
perfect exception forwarding (std::exception_ptr) on platforms where C++11 is not enabled by default
@@ -11,6 +11,11 @@ stdenv.mkDerivation rec {
sha256 = "1lygz07va6hsv2vlx9zwz5d2n81rxsdhmh0pqxgj8n1bvb1rp0qw";
};

makeFlags = concatStringsSep " " (
optional (compiler != null) "compiler=${compiler}" ++
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is that used by the build? If it's just for the binary $CC or cc can be used.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is used to select a makefile (which then determines the binary). It needs to have a specific name in ["gcc", "clang", "icc", "suncc", etc]. I'm not sure how to do this with $CC or cc as you suggested.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was just wondering if we could get rid of the conditional, it seems to work fine on darwin at the moment tho (that uses clang by default)

Copy link
Contributor Author

@Mankarse Mankarse Oct 29, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works fine on darwin because the macos makefile sets the compiler to clang by default:
https://github.com/01org/tbb/blob/2018_U1/build/macos.inc#L60
whereas on linux the compilier is set to gcc by default:
https://github.com/01org/tbb/blob/2018_U1/build/linux.inc#L71

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, nevermind the comment then.

@LnL7 LnL7 merged commit d39b7ce into NixOS:master Oct 29, 2017
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

Successfully merging this pull request may close these issues.

None yet

2 participants