2020-07-01 23:58:29 +08:00
|
|
|
{
|
|
|
|
stdenv
|
|
|
|
, gcc
|
|
|
|
, nanos6
|
2020-09-16 18:22:55 +08:00
|
|
|
, iccUnwrapped
|
2020-07-01 23:58:29 +08:00
|
|
|
, wrapCCWith
|
2020-09-16 18:22:55 +08:00
|
|
|
, intelLicense
|
2020-07-01 16:25:33 +08:00
|
|
|
}:
|
|
|
|
|
2020-07-01 23:58:29 +08:00
|
|
|
let
|
|
|
|
targetConfig = stdenv.targetPlatform.config;
|
|
|
|
inherit gcc;
|
|
|
|
in wrapCCWith rec {
|
2020-09-16 18:22:55 +08:00
|
|
|
cc = iccUnwrapped;
|
2020-07-01 23:58:29 +08:00
|
|
|
extraBuildCommands = ''
|
|
|
|
echo "-B${gcc.cc}/lib/gcc/${targetConfig}/${gcc.version}" >> $out/nix-support/cc-cflags
|
2020-09-16 18:22:55 +08:00
|
|
|
echo "-isystem ${iccUnwrapped}/include" >> $out/nix-support/cc-cflags
|
|
|
|
echo "-isystem ${iccUnwrapped}/include/intel64" >> $out/nix-support/cc-cflags
|
2020-07-01 23:58:29 +08: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 16:25:33 +08:00
|
|
|
|
2020-09-16 18:22:55 +08:00
|
|
|
cat "${iccUnwrapped}/nix-support/propagated-build-inputs" >> \
|
2020-07-13 20:07:24 +08:00
|
|
|
$out/nix-support/propagated-build-inputs
|
|
|
|
|
2020-09-16 18:22:55 +08:00
|
|
|
echo "export INTEL_LICENSE_FILE=${intelLicense}" \
|
2020-07-01 23:58:29 +08:00
|
|
|
>> $out/nix-support/setup-hook
|
2020-07-01 19:08:05 +08:00
|
|
|
|
2020-07-01 23:58:29 +08:00
|
|
|
# Create the wrappers for icc and icpc
|
|
|
|
wrap icc $wrapper $ccPath/icc
|
|
|
|
wrap icpc $wrapper $ccPath/icpc
|
2020-07-10 23:04:21 +08:00
|
|
|
wrap ifort $wrapper $ccPath/ifort
|
2020-07-01 19:08:05 +08:00
|
|
|
'';
|
2020-07-01 16:25:33 +08:00
|
|
|
}
|