Archived
1
0
forked from rarias/bscpkgs

17 Commits

Author SHA1 Message Date
9aa866ee76 ompss: no bintools intel 2025-06-16 15:54:55 +02:00
3f6950c1f0 ompss: unset flags when intel for real this time 2025-06-16 15:54:55 +02:00
53f556626e ompss: set flags when intel 2025-06-16 15:54:55 +02:00
f3483e8a88 llvm: add include cc 2025-06-16 15:54:55 +02:00
2d637cc88c llvm: disable hardening 2025-06-16 15:54:55 +02:00
8836ca4359 intel: more messing around 2025-06-16 15:54:55 +02:00
8ffb971348 intel: reorder wrapper isystems 2025-06-16 15:54:54 +02:00
bdbfd77446 Simplify findMatch in intel-oneapi 2023
This should be a noop
2025-06-16 13:54:25 +02:00
83ae2f489d Fix parsing of new apt package list for oneapi 2023
New apt list does not have Package: as the first entry for all packages
2025-06-16 13:54:24 +02:00
39157ea318 Add oneMath
With support for MKL and CUDA enabled by default
2025-06-16 13:54:24 +02:00
f2f33fd0b4 Introduce intel oneapi 202{4,5} and make 2025 the default intelPackages 2025-06-16 13:54:24 +02:00
c223d205c5 tasycl: init at 2.1.0 2025-06-16 13:54:24 +02:00
ff775ad725 Add test for icpx with ompss-2 as host compiler 2025-06-16 13:54:24 +02:00
858976b37b Add SYCL test compilation 2025-06-16 13:54:24 +02:00
9f0ec54033 Add alias intelPackages -> intelPackages_2023 2025-06-16 13:54:23 +02:00
0399ae5481 Fix sycl intel-oneapi-compiler 2025-06-16 13:54:23 +02:00
43d32ac16d Use nixpkgs from flake.lock and support attrs when importing bscpkgs
This makes `nix-build` and friends use the current flake lock instead of
the outdated pinned version we had in `./nixpkgs.nix`

With this, `nix-build -A ovni` and `nix build .#ovni` should produce the
same result.

This will fail if the flake nixpkgs input does not come from NixOS/nixpkgs.
We could use edolstra/flake-compat instead, but it's overkill imho.

Additionally, I made default.nix behave like nixpkgs, so that we can
import bscpkgs à la nixpkgs (Apply overlays and other options that nixpkgs
accepts):

```nix
let pkgs = import bscpkgs { inherit system; }; in <...>
```

Reviewed-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
2025-06-16 12:29:55 +02:00
5 changed files with 65 additions and 33 deletions

View File

@@ -1,11 +1,19 @@
let
bscOverlay = import ./overlay.nix;
# Pin the nixpkgs
nixpkgsPath = import ./nixpkgs.nix;
pkgs = import nixpkgsPath {
overlays = [ bscOverlay ];
# read flake.lock and determine revision from there
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
inherit (lock.nodes.nixpkgs.locked) rev narHash;
fetchedNixpkgs = builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz";
sha256 = narHash;
};
in pkgs
in
{ overlays ? [ ]
, nixpkgs ? fetchedNixpkgs
, ...
}@attrs:
import nixpkgs (
(builtins.removeAttrs attrs [ "overlays" "nixpkgs" ]) //
{ overlays = [ bscOverlay ] ++ overlays; }
)

View File

@@ -1,9 +0,0 @@
let
commit = "e4ad989506ec7d71f7302cc3067abd82730a4beb";
in builtins.fetchTarball {
# Descriptive name to make the store path easier to identify
name = "nixpkgs-${commit}";
url = "https://github.com/nixos/nixpkgs/archive/${commit}.tar.gz";
# Hash obtained using `nix-prefetch-url --unpack <url>`
sha256 = "sha256-de9KYi8rSJpqvBfNwscWdalIJXPo8NjdIZcEJum1mH0=";
}

View File

@@ -46,14 +46,24 @@ let
in (wrapCCWith {
inherit cc;
extraBuildCommands = ''
echo "-isystem ${cc}/include" >> $out/nix-support/cc-cflags
echo "-isystem ${cc}/include/intel64" >> $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
echo "-L${cc}/lib" >> $out/nix-support/cc-ldflags
echo "--gcc-toolchain=${gcc.cc}" >> $out/nix-support/libcxx-cxxflags
echo "--gcc-toolchain=${gcc.cc}" >> $out/nix-support/cc-cflags
# For some reason, If we don't resolve the realpath things go wrong
for stddef in ${cc}/lib/clang/*/include/stddef.h ; do
dir=$(dirname $(realpath "$stddef"))
echo "-isystem $dir" >> $out/nix-support/cc-cflags
done
echo "-isystem ${cc}/include" >> $out/nix-support/cc-cflags
echo "-isystem ${cc}/include/intel64" >> $out/nix-support/cc-cflags
for dir in ${gcc.cc}/lib/gcc/${targetConfig}/*/include; do
echo "-isystem $dir" >> $out/nix-support/cc-cflags
done
for dir in ${gcc.cc}/include/c++/*; do
echo "-isystem $dir" >> $out/nix-support/libcxx-cxxflags
@@ -68,12 +78,6 @@ let
# Disable hardening by default
echo "" > $out/nix-support/add-hardening.sh
# For some reason, If we don't resolve the realpath things go wrong
for stddef in ${cc}/lib/clang/*/include/stddef.h ; do
dir=$(dirname $(realpath "$stddef"))
echo "-isystem $dir" >> $out/nix-support/cc-cflags
done
'' + extraBuildCommands;
} // (removeAttrs args ["cc" "extraBuildCommands" "extraInstall"])
).overrideAttrs (old: {
@@ -147,6 +151,10 @@ stdenvNoCC.mkDerivation (finalAttrs: {
ln -s $out/bin/icpx $out/bin/c++
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
ln -s ${finalAttrs.finalPackage.pkgs.compiler}/lib $out/lib

View File

@@ -3,6 +3,7 @@
, lib
, gcc
, clangOmpss2Unwrapped
, writeShellScript
, openmp ? null
, wrapCCWith
, llvmPackages_latest
@@ -37,6 +38,22 @@ let
inherit gcc;
cc = clangOmpss2Unwrapped;
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" = 1 ]; then
unset NIX_CFLAGS_COMPILE_${tconf}
unset NIX_CFLAGS_COMPILE_BEFORE_${tconf}
unset NIX_CFLAGS_LINK_${tconf}
unset NIX_CXXSTDLIB_COMPILE_${tconf}
unset NIX_CXXSTDLIB_LINK_${tconf}
unset NIX_GNATFLAGS_COMPILE_${tconf}
unset NIX_CC_WRAPPER_FLAGS_SET_${tconf}
# unset NIX_BINTOOLS_WRAPPER_FLAGS_${tconf}
fi
'';
in wrapCCWith {
inherit cc bintools;
# extraPackages adds packages to depsTargetTargetPropagated
@@ -47,6 +64,9 @@ in wrapCCWith {
echo "-L${gcc.cc}/lib/gcc/${targetConfig}/${gccVersion}" >> $out/nix-support/cc-ldflags
echo "-L${gcc.cc.lib}/lib" >> $out/nix-support/cc-ldflags
for dir in ${gcc.cc}/lib/gcc/${targetConfig}/*/include; do
echo "-isystem $dir" >> $out/nix-support/cc-cflags
done
for dir in ${gcc.cc}/include/c++/*; do
echo "-isystem $dir" >> $out/nix-support/libcxx-cxxflags
done
@@ -58,7 +78,12 @@ in wrapCCWith {
wrap clang++ $wrapper $ccPath/clang++
'' + optionalString (openmp != null) ''
sed -i 's|# Flirting.*|&\nsource ${resetIntelCCFlags}|' $out/bin/clang
sed -i 's|# Flirting.*|&\nsource ${resetIntelCCFlags}|' $out/bin/clang++
echo "" > $out/nix-support/add-hardening.sh
'' + lib.optionalString (openmp != null) ''
echo "export OPENMP_RUNTIME=${ompname}" >> $out/nix-support/cc-wrapper-hook
'' + optionalString (ompss2rt != null) ''
echo "export OMPSS2_RUNTIME=${rtname}" >> $out/nix-support/cc-wrapper-hook

View File

@@ -12,11 +12,11 @@
, opensycl ? null
, adaptivecpp ? null
, useIntel ? true
# TODO: move back to main branch and release
, useGit ? true
, useGit ? false
, gitUrl ? "git@gitlab-internal.bsc.es:task-awareness/tasycl/tasycl.git"
, gitBranch ? "fix/various"
, gitCommit ? "8be4729ded0ef64f028e98eb2b2baf2ccba7ff42"
, gitBranch ? "main"
, gitCommit ? "78f98dcf60a66e0eaa3b4ebcf55be076bec64825"
}:
assert (useIntel || opensycl != null || adaptivecpp != null);
@@ -42,12 +42,12 @@ let
;
release = rec {
version = "2.0.0";
version = "2.1.0";
src = fetchFromGitHub {
owner = "bsc-pm";
repo = "tasycl";
rev = version;
hash = "sha256-Z4d45baVBhE9NW8Ww948M78TJx7BpxTr9pGJvJO9hdI=";
hash = "sha256-0kXnb0lHeQNHR27GTLbJ8xbiICLU8k2+FqEnnFSrzzo=";
};
};