Archived
1
0
forked from rarias/bscpkgs

5 Commits

Author SHA1 Message Date
3e0473d75e fix gcc icc 2025-04-11 15:17:55 +02:00
ae59902fcc Add SYCL test compilation 2025-04-11 15:06:11 +02:00
60a17565ea Add alias intelPackages -> intelPackages_2023 2025-04-11 15:02:27 +02:00
3f26a7e4fa Fix sycl intel-oneapi-compiler 2025-03-18 18:19:48 +01:00
f962816eab Update PM gitlab URL to new server bscpm04.bsc.es
The old server has died, so we move to the new URL at bscpm04.bsc.es.

Reviewed-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
Tested-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
2025-03-07 15:21:11 +01:00
6 changed files with 88 additions and 22 deletions

View File

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

View File

@@ -13,9 +13,5 @@
bscOverlay = import ./overlay.nix; bscOverlay = import ./overlay.nix;
overlays.default = self.bscOverlay; overlays.default = self.bscOverlay;
legacyPackages.x86_64-linux = pkgs; legacyPackages.x86_64-linux = pkgs;
hydraJobs = {
inherit (pkgs) bsc-ci;
};
}; };
} }

9
nixpkgs.nix Normal file
View File

@@ -0,0 +1,9 @@
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

@@ -20,6 +20,7 @@ let
#extrae = callPackage ./pkgs/extrae/default.nix { }; # Broken and outdated #extrae = callPackage ./pkgs/extrae/default.nix { }; # Broken and outdated
gpi-2 = callPackage ./pkgs/gpi-2/default.nix { }; gpi-2 = callPackage ./pkgs/gpi-2/default.nix { };
intelPackages_2023 = callPackage ./pkgs/intel-oneapi/2023.nix { }; intelPackages_2023 = callPackage ./pkgs/intel-oneapi/2023.nix { };
intelPackages = final.intelPackages_2023;
jemallocNanos6 = callPackage ./pkgs/nanos6/jemalloc.nix { }; jemallocNanos6 = callPackage ./pkgs/nanos6/jemalloc.nix { };
#lmbench = callPackage ./pkgs/lmbench/default.nix { }; # Broken #lmbench = callPackage ./pkgs/lmbench/default.nix { }; # Broken
mcxx = callPackage ./pkgs/mcxx/default.nix { }; mcxx = callPackage ./pkgs/mcxx/default.nix { };
@@ -60,6 +61,7 @@ in bscPkgs // {
#sigsegv = callPackage ./test/reproducers/sigsegv.nix { }; #sigsegv = callPackage ./test/reproducers/sigsegv.nix { };
hello-c = callPackage ./test/compilers/hello-c.nix { }; hello-c = callPackage ./test/compilers/hello-c.nix { };
hello-cpp = callPackage ./test/compilers/hello-cpp.nix { }; hello-cpp = callPackage ./test/compilers/hello-cpp.nix { };
hello-sycl = callPackage ./test/compilers/hello-sycl.nix { };
lto = callPackage ./test/compilers/lto.nix { }; lto = callPackage ./test/compilers/lto.nix { };
asan = callPackage ./test/compilers/asan.nix { }; asan = callPackage ./test/compilers/asan.nix { };
intel2023-icx-c = hello-c.override { stdenv = final.intelPackages_2023.stdenv; }; intel2023-icx-c = hello-c.override { stdenv = final.intelPackages_2023.stdenv; };

View File

@@ -313,6 +313,9 @@ let
"intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic-common-${version}" "intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic-common-${version}"
"intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic-runtime-${version}" "intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic-runtime-${version}"
"intel-oneapi-compiler-dpcpp-cpp-classic-fortran-shared-runtime-${version}" "intel-oneapi-compiler-dpcpp-cpp-classic-fortran-shared-runtime-${version}"
"intel-oneapi-compiler-shared-${version}"
"intel-oneapi-compiler-shared-common-${version}"
"intel-oneapi-compiler-shared-runtime-${version}"
]; ];
# From https://aur.archlinux.org/packages/intel-oneapi-compiler: # From https://aur.archlinux.org/packages/intel-oneapi-compiler:
# - intel-oneapi-compiler-cpp-eclipse-cfg-2023.0.0-25370_all.deb # - intel-oneapi-compiler-cpp-eclipse-cfg-2023.0.0-25370_all.deb
@@ -329,9 +332,9 @@ let
# - intel-oneapi-compiler-fortran-common-2023.0.0-2023.0.0-25370_all.deb # - intel-oneapi-compiler-fortran-common-2023.0.0-2023.0.0-25370_all.deb
# - intel-oneapi-compiler-fortran-runtime-2023.0.0-2023.0.0-25370_amd64.deb # - intel-oneapi-compiler-fortran-runtime-2023.0.0-2023.0.0-25370_amd64.deb
# - intel-oneapi-compiler-fortran-runtime-2023.0.0-25370_amd64.deb # - intel-oneapi-compiler-fortran-runtime-2023.0.0-25370_amd64.deb
# - intel-oneapi-compiler-shared-2023.0.0-2023.0.0-25370_amd64.deb # + intel-oneapi-compiler-shared-2023.0.0-2023.0.0-25370_amd64.deb
# - intel-oneapi-compiler-shared-common-2023.0.0-2023.0.0-25370_all.deb # + intel-oneapi-compiler-shared-common-2023.0.0-2023.0.0-25370_all.deb
# - intel-oneapi-compiler-shared-runtime-2023.0.0-2023.0.0-25370_amd64.deb # + intel-oneapi-compiler-shared-runtime-2023.0.0-2023.0.0-25370_amd64.deb
# - intel-oneapi-dpcpp-cpp-2023.0.0-2023.0.0-25370_amd64.deb # - intel-oneapi-dpcpp-cpp-2023.0.0-2023.0.0-25370_amd64.deb
# - intel-oneapi-openmp-2023.0.0-2023.0.0-25370_amd64.deb # - intel-oneapi-openmp-2023.0.0-2023.0.0-25370_amd64.deb
# - intel-oneapi-openmp-common-2023.0.0-2023.0.0-25370_all.deb # - intel-oneapi-openmp-common-2023.0.0-2023.0.0-25370_all.deb
@@ -398,6 +401,15 @@ let
echo "-L${intel-compiler-shared}/lib" >> $out/nix-support/cc-ldflags echo "-L${intel-compiler-shared}/lib" >> $out/nix-support/cc-ldflags
echo "-L${cc}/lib" >> $out/nix-support/cc-ldflags echo "-L${cc}/lib" >> $out/nix-support/cc-ldflags
echo "--gcc-toolchain=${mygcc.cc}" >> $out/nix-support/libcxx-cxxflags
for dir in ${mygcc.cc}/include/c++/*; do
echo "-isystem $dir" >> $out/nix-support/libcxx-cxxflags
done
for dir in ${mygcc.cc}/include/c++/*/${targetConfig}; do
echo "-isystem $dir" >> $out/nix-support/libcxx-cxxflags
done
# Need the gcc in the path # Need the gcc in the path
echo 'export "PATH=${mygcc}/bin:$PATH"' >> $out/nix-support/cc-wrapper-hook echo 'export "PATH=${mygcc}/bin:$PATH"' >> $out/nix-support/cc-wrapper-hook

View File

@@ -0,0 +1,55 @@
{ intelPackages, writeText, strace }:
let
stdenv = intelPackages.stdenv;
hello_sycl = writeText "hello.cpp" ''
#include <sycl/sycl.hpp>
class hello_world;
int main(int argc, char** argv) try {
auto device_selector = sycl::default_selector_v;
sycl::queue queue(device_selector);
std::cout << "Running on: "
<< queue.get_device().get_info<sycl::info::device::name>()
<< std::endl;
queue.submit([&] (sycl::handler& cgh) {
auto os = sycl::stream{128, 128, cgh};
cgh.single_task<hello_world>([=]() {
os << "Hello World! (on device)\n";
});
});
return 0;
} catch (sycl::exception &e) {
std::cout << "SYCL exception: " << e.what() << std::endl;
return 0; // we excpect to fail since no devices should be available;
}
'';
in
stdenv.mkDerivation {
version = "0.0.1";
name = "hello-sycl";
buildInputs = [ stdenv strace ];
src = hello_sycl;
dontUnpack = true;
dontConfigure = true;
NIX_DEBUG = 0;
buildPhase = ''
cp $src hello.cpp
set -x
echo CXX=$CXX
command -v $CXX
$CXX -fsycl hello.cpp -o hello
./hello
set +x
'';
installPhase = ''
touch $out
'';
}