Remove wrapper flags when clang called from intel
This commit is contained in:
parent
08ca2ed5bf
commit
cd0dd65455
@ -147,6 +147,10 @@ stdenvNoCC.mkDerivation (finalAttrs: {
|
|||||||
ln -s $out/bin/icpx $out/bin/c++
|
ln -s $out/bin/icpx $out/bin/c++
|
||||||
ln -s $out/bin/icx $out/bin/cc
|
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
|
sed -i 's/.*isCxx=0/isCxx=1/' $out/bin/icpx
|
||||||
|
|
||||||
# oneMath looks for sycl libraries in bin/../lib
|
# oneMath looks for sycl libraries in bin/../lib
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
, lib
|
, lib
|
||||||
, gcc
|
, gcc
|
||||||
, clangOmpss2Unwrapped
|
, clangOmpss2Unwrapped
|
||||||
|
, writeShellScript
|
||||||
, openmp ? null
|
, openmp ? null
|
||||||
, wrapCCWith
|
, wrapCCWith
|
||||||
, llvmPackages_latest
|
, llvmPackages_latest
|
||||||
@ -37,6 +38,19 @@ let
|
|||||||
inherit gcc;
|
inherit gcc;
|
||||||
cc = clangOmpss2Unwrapped;
|
cc = clangOmpss2Unwrapped;
|
||||||
gccVersion = with versions; let v = gcc.version; in concatStringsSep "." [(major v) (minor v) (patch v)];
|
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:-0}" = 1 ]; then
|
||||||
|
unset NIX_CFLAGS_COMPILE_${tconf}
|
||||||
|
unset NIX_CC_WRAPPER_FLAGS_SET_${tconf}
|
||||||
|
|
||||||
|
if (( "${NIX_DEBUG:-0}" >= 1 )); then
|
||||||
|
echo "ompss2: cleaned NIX_CFLAGS_COMPILE_${tconf} (invokation from intel compiler detected)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
|
||||||
in wrapCCWith {
|
in wrapCCWith {
|
||||||
inherit cc bintools;
|
inherit cc bintools;
|
||||||
# extraPackages adds packages to depsTargetTargetPropagated
|
# extraPackages adds packages to depsTargetTargetPropagated
|
||||||
@ -58,7 +72,10 @@ in wrapCCWith {
|
|||||||
|
|
||||||
wrap clang++ $wrapper $ccPath/clang++
|
wrap clang++ $wrapper $ccPath/clang++
|
||||||
|
|
||||||
'' + optionalString (openmp != null) ''
|
sed -i 's|# Flirting.*|source ${resetIntelCCFlags}\n\n&|' $out/bin/clang
|
||||||
|
sed -i 's|# Flirting.*|&\nsource ${resetIntelCCFlags}\n\n&|' $out/bin/clang++
|
||||||
|
|
||||||
|
'' + lib.optionalString (openmp != null) ''
|
||||||
echo "export OPENMP_RUNTIME=${ompname}" >> $out/nix-support/cc-wrapper-hook
|
echo "export OPENMP_RUNTIME=${ompname}" >> $out/nix-support/cc-wrapper-hook
|
||||||
'' + optionalString (ompss2rt != null) ''
|
'' + optionalString (ompss2rt != null) ''
|
||||||
echo "export OMPSS2_RUNTIME=${rtname}" >> $out/nix-support/cc-wrapper-hook
|
echo "export OMPSS2_RUNTIME=${rtname}" >> $out/nix-support/cc-wrapper-hook
|
||||||
|
Loading…
x
Reference in New Issue
Block a user