forked from rarias/bscpkgs
ompss: set flags when intel
This commit is contained in:
parent
f3483e8a88
commit
53f556626e
@ -151,6 +151,10 @@ stdenvNoCC.mkDerivation (finalAttrs: {
|
||||
ln -s $out/bin/icpx $out/bin/c++
|
||||
ln -s $out/bin/icx $out/bin/cc
|
||||
|
||||
# Use this to detect when a compiler subprocess is called
|
||||
# from icpx (--fsycl-host-compiler)
|
||||
echo 'export "NIX_CC_WRAPPER_INTEL=1"' >> $out/nix-support/cc-wrapper-hook
|
||||
|
||||
sed -i 's/.*isCxx=0/isCxx=1/' $out/bin/icpx
|
||||
|
||||
ln -s ${finalAttrs.finalPackage.pkgs.compiler}/lib $out/lib
|
||||
|
@ -3,6 +3,7 @@
|
||||
, lib
|
||||
, gcc
|
||||
, clangOmpss2Unwrapped
|
||||
, writeShellScript
|
||||
, openmp ? null
|
||||
, wrapCCWith
|
||||
, llvmPackages_latest
|
||||
@ -37,6 +38,15 @@ let
|
||||
inherit gcc;
|
||||
cc = clangOmpss2Unwrapped;
|
||||
gccVersion = with versions; let v = gcc.version; in concatStringsSep "." [(major v) (minor v) (patch v)];
|
||||
|
||||
resetIntelCCFlags = let tconf = builtins.replaceStrings ["-"] ["_"] targetConfig;
|
||||
in writeShellScript "remove-intel.sh" ''
|
||||
if [ "$NIX_CC_WRAPPER_INTEL" = 1 ]; then
|
||||
unset NIX_CC_WRAPPER_FLAGS_SET_${tconf}
|
||||
unset NIX_BINTOOLS_WRAPPER_FLAGS_${tconf}
|
||||
fi
|
||||
'';
|
||||
|
||||
in wrapCCWith {
|
||||
inherit cc bintools;
|
||||
# extraPackages adds packages to depsTargetTargetPropagated
|
||||
@ -61,6 +71,9 @@ in wrapCCWith {
|
||||
|
||||
wrap clang++ $wrapper $ccPath/clang++
|
||||
|
||||
sed -i 's|# Flirting.*|&\nsource ${resetIntelCCFlags}|' $out/bin/clang
|
||||
sed -i 's|# Flirting.*|&\nsource ${resetIntelCCFlags}|' $out/bin/clang++
|
||||
|
||||
echo "" > $out/nix-support/add-hardening.sh
|
||||
|
||||
'' + lib.optionalString (openmp != null) ''
|
||||
|
Loading…
x
Reference in New Issue
Block a user