bscpkgs/bsc/intel-compiler/default.nix

30 lines
726 B
Nix
Raw Normal View History

2020-07-01 17:58:29 +02:00
{
stdenv
, gcc
, nanos6
, icc-unwrapped
, wrapCCWith
, libstdcxxHook
, 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;
extraPackages = [ libstdcxxHook ];
extraBuildCommands = ''
echo "-B${gcc.cc}/lib/gcc/${targetConfig}/${gcc.version}" >> $out/nix-support/cc-cflags
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
2020-07-01 17:58:29 +02:00
echo "export INTEL_LICENSE_FILE=${intel-license}" \
>> $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-01 13:08:05 +02:00
'';
2020-07-01 10:25:33 +02:00
}