bscpkgs/bsc/intel-compiler/default.nix

34 lines
985 B
Nix
Raw Normal View History

2020-07-01 17:58:29 +02:00
{
stdenv
, gcc
, nanos6
, icc-unwrapped
, wrapCCWith
2020-07-10 13:42:55 +02:00
, intel-license
2020-07-01 10:25:33 +02:00
}:
2020-07-01 17:58:29 +02:00
let
targetConfig = stdenv.targetPlatform.config;
inherit gcc;
in wrapCCWith rec {
cc = icc-unwrapped;
extraBuildCommands = ''
echo "-B${gcc.cc}/lib/gcc/${targetConfig}/${gcc.version}" >> $out/nix-support/cc-cflags
2020-07-10 17:04:21 +02:00
echo "-isystem ${icc-unwrapped}/include" >> $out/nix-support/cc-cflags
echo "-isystem ${icc-unwrapped}/include/intel64" >> $out/nix-support/cc-cflags
2020-07-01 17:58:29 +02:00
echo "-L${gcc.cc}/lib/gcc/${targetConfig}/${gcc.version}" >> $out/nix-support/cc-ldflags
echo "-L${gcc.cc.lib}/lib" >> $out/nix-support/cc-ldflags
2020-07-01 10:25:33 +02:00
cat "${icc-unwrapped}/nix-support/propagated-build-inputs" >> \
$out/nix-support/propagated-build-inputs
2020-07-10 13:42:55 +02:00
echo "export INTEL_LICENSE_FILE=${intel-license}" \
2020-07-01 17:58:29 +02:00
>> $out/nix-support/setup-hook
2020-07-01 13:08:05 +02:00
2020-07-01 17:58:29 +02:00
# Create the wrappers for icc and icpc
wrap icc $wrapper $ccPath/icc
wrap icpc $wrapper $ccPath/icpc
2020-07-10 17:04:21 +02:00
wrap ifort $wrapper $ccPath/ifort
2020-07-01 13:08:05 +02:00
'';
2020-07-01 10:25:33 +02:00
}