bscpkgs/bsc/intel-compiler/default.nix

32 lines
885 B
Nix
Raw Normal View History

2020-07-01 23:58:29 +08:00
{
stdenv
, gcc
, nanos6
, icc-unwrapped
, wrapCCWith
, libstdcxxHook
2020-07-10 19:42:55 +08:00
, intel-license
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 {
cc = icc-unwrapped;
extraBuildCommands = ''
echo "-B${gcc.cc}/lib/gcc/${targetConfig}/${gcc.version}" >> $out/nix-support/cc-cflags
2020-07-10 23:04:21 +08: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 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-07-10 19:42:55 +08:00
echo "export INTEL_LICENSE_FILE=${intel-license}" \
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
}