forked from rarias/bscpkgs
Compare commits
8 Commits
fix/sycl
...
77ddd1c9c1
| Author | SHA1 | Date | |
|---|---|---|---|
|
77ddd1c9c1
|
|||
|
96661ca763
|
|||
|
75c2331d5d
|
|||
| a87b99d0a4 | |||
| 43d32ac16d | |||
| 9d1944c658 | |||
| 8e5b2dc5cc | |||
| f89cd4d7e2 |
22
default.nix
22
default.nix
@@ -1,11 +1,19 @@
|
|||||||
let
|
let
|
||||||
bscOverlay = import ./overlay.nix;
|
bscOverlay = import ./overlay.nix;
|
||||||
|
|
||||||
# Pin the nixpkgs
|
# read flake.lock and determine revision from there
|
||||||
nixpkgsPath = import ./nixpkgs.nix;
|
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
|
||||||
|
inherit (lock.nodes.nixpkgs.locked) rev narHash;
|
||||||
pkgs = import nixpkgsPath {
|
fetchedNixpkgs = builtins.fetchTarball {
|
||||||
overlays = [ bscOverlay ];
|
url = "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz";
|
||||||
|
sha256 = narHash;
|
||||||
};
|
};
|
||||||
|
in
|
||||||
in pkgs
|
{ overlays ? [ ]
|
||||||
|
, nixpkgs ? fetchedNixpkgs
|
||||||
|
, ...
|
||||||
|
}@attrs:
|
||||||
|
import nixpkgs (
|
||||||
|
(builtins.removeAttrs attrs [ "overlays" "nixpkgs" ]) //
|
||||||
|
{ overlays = [ bscOverlay ] ++ overlays; }
|
||||||
|
)
|
||||||
|
|||||||
@@ -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=";
|
|
||||||
}
|
|
||||||
@@ -10,6 +10,9 @@ let
|
|||||||
"printf '%s\n' ${toString (collect (x: x ? outPath) pkgs)} > $out";
|
"printf '%s\n' ${toString (collect (x: x ? outPath) pkgs)} > $out";
|
||||||
|
|
||||||
bscPkgs = {
|
bscPkgs = {
|
||||||
|
aoccUnwrapped = callPackage ./pkgs/aocc/unwrapped.nix { };
|
||||||
|
aocc = callPackage ./pkgs/aocc/default.nix { };
|
||||||
|
stdenvAocc = final.overrideCC final.stdenv final.aocc;
|
||||||
bench6 = callPackage ./pkgs/bench6/default.nix { };
|
bench6 = callPackage ./pkgs/bench6/default.nix { };
|
||||||
bigotes = callPackage ./pkgs/bigotes/default.nix { };
|
bigotes = callPackage ./pkgs/bigotes/default.nix { };
|
||||||
clangOmpss2 = callPackage ./pkgs/llvm-ompss2/default.nix { };
|
clangOmpss2 = callPackage ./pkgs/llvm-ompss2/default.nix { };
|
||||||
@@ -21,7 +24,7 @@ let
|
|||||||
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 { };
|
||||||
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 { };
|
||||||
mcxx = callPackage ./pkgs/mcxx/default.nix { };
|
mcxx = callPackage ./pkgs/mcxx/default.nix { };
|
||||||
nanos6 = callPackage ./pkgs/nanos6/default.nix { };
|
nanos6 = callPackage ./pkgs/nanos6/default.nix { };
|
||||||
nanos6Debug = final.nanos6.override { enableDebug = true; };
|
nanos6Debug = final.nanos6.override { enableDebug = true; };
|
||||||
|
|||||||
29
pkgs/aocc/default.nix
Normal file
29
pkgs/aocc/default.nix
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
{ lib
|
||||||
|
, aoccUnwrapped
|
||||||
|
, wrapCCWith
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
cc = aoccUnwrapped;
|
||||||
|
stdenv = aoccUnwrapped.stdenv;
|
||||||
|
targetConfig = stdenv.targetPlatform.config;
|
||||||
|
|
||||||
|
gcc = stdenv.cc;
|
||||||
|
|
||||||
|
in wrapCCWith {
|
||||||
|
inherit cc;
|
||||||
|
|
||||||
|
extraBuildCommands = ''
|
||||||
|
echo "-isystem ${cc}/include" >> $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
|
||||||
|
|
||||||
|
# Need the gcc in the path
|
||||||
|
echo 'export "PATH=${gcc}/bin:$PATH"' >> $out/nix-support/cc-wrapper-hook
|
||||||
|
|
||||||
|
# Disable hardening by default
|
||||||
|
echo "" > $out/nix-support/add-hardening.sh
|
||||||
|
'';
|
||||||
|
}
|
||||||
47
pkgs/aocc/unwrapped.nix
Normal file
47
pkgs/aocc/unwrapped.nix
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
{ lib
|
||||||
|
, fetchurl
|
||||||
|
, stdenv
|
||||||
|
, autoPatchelfHook
|
||||||
|
, rocmPackages
|
||||||
|
, zlib
|
||||||
|
, libffi
|
||||||
|
, elfutils
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
# in newer nixpkgs the runtime is hsakmt
|
||||||
|
rocmRuntime = if rocmPackages ? hsakmt then
|
||||||
|
rocmPackages.hsakmt
|
||||||
|
else
|
||||||
|
rocmPackages.rocm-runtime;
|
||||||
|
in
|
||||||
|
stdenv.mkDerivation (finalAttrs: {
|
||||||
|
pname = "aocc-compiler";
|
||||||
|
version = "5.0.0";
|
||||||
|
|
||||||
|
src = fetchurl {
|
||||||
|
url = "https://download.amd.com/developer/eula/aocc/aocc-5-0/aocc-compiler-5.0.0.tar";
|
||||||
|
sha256 = "sha256-lm+sLSx1np3m6WnBCtp6ezBsET9/HgfqN2gp7IY4Dao=";
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [ autoPatchelfHook ];
|
||||||
|
buildInputs = [
|
||||||
|
elfutils
|
||||||
|
zlib
|
||||||
|
rocmRuntime
|
||||||
|
stdenv.cc.cc.lib
|
||||||
|
];
|
||||||
|
phases = [ "unpackPhase" "installPhase" "fixupPhase" ];
|
||||||
|
dontStrip = true;
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out
|
||||||
|
cp -a . $out/
|
||||||
|
|
||||||
|
ln -s ${lib.getLib libffi}/lib/libffi.so $out/lib/libffi.so.6
|
||||||
|
'';
|
||||||
|
|
||||||
|
passthru = {
|
||||||
|
isClang = true;
|
||||||
|
};
|
||||||
|
})
|
||||||
@@ -1,14 +1,22 @@
|
|||||||
{
|
{
|
||||||
stdenv
|
stdenv
|
||||||
|
, bigotes
|
||||||
, cmake
|
, cmake
|
||||||
, clangOmpss2
|
, clangOmpss2
|
||||||
|
, openmp
|
||||||
|
, openmpv
|
||||||
, nanos6
|
, nanos6
|
||||||
, nodes
|
, nodes
|
||||||
|
, nosv
|
||||||
, mpi
|
, mpi
|
||||||
, tampi
|
, tampi
|
||||||
|
, tagaspi
|
||||||
|
, gpi-2
|
||||||
|
, openblas
|
||||||
|
, ovni
|
||||||
, gitBranch ? "master"
|
, gitBranch ? "master"
|
||||||
, gitURL ? "ssh://git@bscpm04.bsc.es/rarias/bench6.git"
|
, gitURL ? "ssh://git@bscpm04.bsc.es/rarias/bench6.git"
|
||||||
, gitCommit ? "1e6ce2aa8ad7b4eef38df1581d7ec48a8815f85d"
|
, gitCommit ? "bf29a53113737c3aa74d2fe3d55f59868faea7b4"
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
@@ -21,9 +29,30 @@ stdenv.mkDerivation rec {
|
|||||||
rev = gitCommit;
|
rev = gitCommit;
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ cmake clangOmpss2 nanos6 nodes mpi tampi ];
|
buildInputs = [
|
||||||
|
bigotes
|
||||||
|
cmake
|
||||||
|
clangOmpss2
|
||||||
|
openmp
|
||||||
|
openmpv
|
||||||
|
nanos6
|
||||||
|
nodes
|
||||||
|
nosv
|
||||||
|
mpi
|
||||||
|
tampi
|
||||||
|
tagaspi
|
||||||
|
gpi-2
|
||||||
|
openblas
|
||||||
|
openblas.dev
|
||||||
|
ovni
|
||||||
|
];
|
||||||
|
|
||||||
|
env = {
|
||||||
|
NANOS6_HOME = nanos6;
|
||||||
|
NODES_HOME = nodes;
|
||||||
|
NOSV_HOME = nosv;
|
||||||
|
};
|
||||||
|
|
||||||
enableParallelBuilding = false;
|
|
||||||
cmakeFlags = [
|
cmakeFlags = [
|
||||||
"-DCMAKE_C_COMPILER=clang"
|
"-DCMAKE_C_COMPILER=clang"
|
||||||
"-DCMAKE_CXX_COMPILER=clang++"
|
"-DCMAKE_CXX_COMPILER=clang++"
|
||||||
|
|||||||
@@ -43,23 +43,23 @@ let
|
|||||||
|
|
||||||
source = if (useGit) then git else release;
|
source = if (useGit) then git else release;
|
||||||
|
|
||||||
in stdenv.mkDerivation rec {
|
in stdenv.mkDerivation {
|
||||||
pname = "clang-ompss2";
|
pname = "clang-ompss2";
|
||||||
inherit (source) src version;
|
inherit (source) src version;
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
isClang = true;
|
|
||||||
|
|
||||||
passthru = {
|
passthru = {
|
||||||
CC = "clang";
|
CC = "clang";
|
||||||
CXX = "clang++";
|
CXX = "clang++";
|
||||||
|
|
||||||
|
isClang = true;
|
||||||
|
isClangWithOmpss = true;
|
||||||
|
|
||||||
|
inherit gcc zlib;
|
||||||
};
|
};
|
||||||
|
|
||||||
isClangWithOmpss = true;
|
nativeBuildInputs = [
|
||||||
|
|
||||||
nativeBuildInputs = [ zlib ];
|
|
||||||
|
|
||||||
buildInputs = [
|
|
||||||
which
|
which
|
||||||
bash
|
bash
|
||||||
python3
|
python3
|
||||||
@@ -67,9 +67,13 @@ in stdenv.mkDerivation rec {
|
|||||||
cmake
|
cmake
|
||||||
llvmPackages_latest.lld
|
llvmPackages_latest.lld
|
||||||
elfutils
|
elfutils
|
||||||
libffi
|
|
||||||
pkg-config
|
pkg-config
|
||||||
zlib
|
zlib
|
||||||
|
];
|
||||||
|
|
||||||
|
buildInputs = [
|
||||||
|
libffi
|
||||||
|
zlib
|
||||||
gcc.cc.lib # Required for libstdc++.so.6
|
gcc.cc.lib # Required for libstdc++.so.6
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -9,12 +9,14 @@
|
|||||||
, ompss2rt ? null
|
, ompss2rt ? null
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
usingNodesAndOmpv = (openmp.pname == "openmp-v" && ompss2rt.pname == "nodes");
|
usingNodesAndOmpv = (openmp.pname == "openmp-v" && ompss2rt.pname == "nodes");
|
||||||
sameNosv = openmp.nosv == ompss2rt.nosv;
|
sameNosv = openmp.nosv == ompss2rt.nosv;
|
||||||
in
|
in
|
||||||
|
|
||||||
assert lib.assertMsg (usingNodesAndOmpv -> sameNosv) "OpenMP-V and NODES must share the same nOS-V";
|
assert assertMsg (usingNodesAndOmpv -> sameNosv) "OpenMP-V and NODES must share the same nOS-V";
|
||||||
|
|
||||||
let
|
let
|
||||||
homevar = if ompss2rt.pname == "nanos6" then "NANOS6_HOME" else "NODES_HOME";
|
homevar = if ompss2rt.pname == "nanos6" then "NANOS6_HOME" else "NODES_HOME";
|
||||||
@@ -34,14 +36,15 @@ let
|
|||||||
targetConfig = stdenv.targetPlatform.config;
|
targetConfig = stdenv.targetPlatform.config;
|
||||||
inherit gcc;
|
inherit gcc;
|
||||||
cc = clangOmpss2Unwrapped;
|
cc = clangOmpss2Unwrapped;
|
||||||
|
gccVersion = with versions; let v = gcc.version; in concatStringsSep "." [(major v) (minor v) (patch v)];
|
||||||
in wrapCCWith {
|
in wrapCCWith {
|
||||||
inherit cc bintools;
|
inherit cc bintools;
|
||||||
# extraPackages adds packages to depsTargetTargetPropagated
|
# extraPackages adds packages to depsTargetTargetPropagated
|
||||||
extraPackages = lib.optional (openmp != null) openmp;
|
extraPackages = optional (openmp != null) openmp;
|
||||||
extraBuildCommands = ''
|
extraBuildCommands = ''
|
||||||
echo "-target ${targetConfig}" >> $out/nix-support/cc-cflags
|
echo "-target ${targetConfig}" >> $out/nix-support/cc-cflags
|
||||||
echo "-B${gcc.cc}/lib/gcc/${targetConfig}/${gcc.version}" >> $out/nix-support/cc-cflags
|
echo "-B${gcc.cc}/lib/gcc/${targetConfig}/${gccVersion}" >> $out/nix-support/cc-cflags
|
||||||
echo "-L${gcc.cc}/lib/gcc/${targetConfig}/${gcc.version}" >> $out/nix-support/cc-ldflags
|
echo "-L${gcc.cc}/lib/gcc/${targetConfig}/${gccVersion}" >> $out/nix-support/cc-ldflags
|
||||||
echo "-L${gcc.cc.lib}/lib" >> $out/nix-support/cc-ldflags
|
echo "-L${gcc.cc.lib}/lib" >> $out/nix-support/cc-ldflags
|
||||||
|
|
||||||
for dir in ${gcc.cc}/include/c++/*; do
|
for dir in ${gcc.cc}/include/c++/*; do
|
||||||
@@ -55,12 +58,12 @@ in wrapCCWith {
|
|||||||
|
|
||||||
wrap clang++ $wrapper $ccPath/clang++
|
wrap clang++ $wrapper $ccPath/clang++
|
||||||
|
|
||||||
'' + lib.optionalString (openmp != null) ''
|
'' + optionalString (openmp != null) ''
|
||||||
echo "export OPENMP_RUNTIME=${ompname}" >> $out/nix-support/cc-wrapper-hook
|
echo "export OPENMP_RUNTIME=${ompname}" >> $out/nix-support/cc-wrapper-hook
|
||||||
'' + lib.optionalString (ompss2rt != null) ''
|
'' + optionalString (ompss2rt != null) ''
|
||||||
echo "export OMPSS2_RUNTIME=${rtname}" >> $out/nix-support/cc-wrapper-hook
|
echo "export OMPSS2_RUNTIME=${rtname}" >> $out/nix-support/cc-wrapper-hook
|
||||||
echo "export ${homevar}=${ompss2rt}" >> $out/nix-support/cc-wrapper-hook
|
echo "export ${homevar}=${ompss2rt}" >> $out/nix-support/cc-wrapper-hook
|
||||||
'' + lib.optionalString (ompss2rt != null && ompss2rt.pname == "nodes") ''
|
'' + optionalString (ompss2rt != null && ompss2rt.pname == "nodes") ''
|
||||||
echo "export NOSV_HOME=${ompss2rt.nosv}" >> $out/nix-support/cc-wrapper-hook
|
echo "export NOSV_HOME=${ompss2rt.nosv}" >> $out/nix-support/cc-wrapper-hook
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ stdenv.mkDerivation rec {
|
|||||||
rm -f $out/lib/libiomp*
|
rm -f $out/lib/libiomp*
|
||||||
'' + lib.optionalString enableNosv ''
|
'' + lib.optionalString enableNosv ''
|
||||||
rm -f $out/lib/libomp.*
|
rm -f $out/lib/libomp.*
|
||||||
|
rm -f $out/libllvmrt/libomp.*
|
||||||
'';
|
'';
|
||||||
|
|
||||||
passthru = {
|
passthru = {
|
||||||
|
|||||||
@@ -1,19 +1,20 @@
|
|||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
stdenv,
|
stdenv,
|
||||||
|
libtirpc,
|
||||||
fetchFromGitHub
|
fetchFromGitHub
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "lmbench";
|
pname = "lmbench";
|
||||||
version = "701c6c35";
|
version = "941a0dcc";
|
||||||
|
|
||||||
# We use the intel repo as they have fixed some problems
|
# We use the intel repo as they have fixed some problems
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "intel";
|
owner = "intel";
|
||||||
repo = pname;
|
repo = pname;
|
||||||
rev = "701c6c35b0270d4634fb1dc5272721340322b8ed";
|
rev = "941a0dcc0e7bdd9bb0dee05d7f620e77da8c43af";
|
||||||
sha256 = "0sf6zk03knkardsfd6qx7drpm56nhg53n885cylkggk83r38idyr";
|
sha256 = "sha256-SzwplRBO3V0R3m3p15n71ivYBMGoLsajFK2TapYxdqk=";
|
||||||
};
|
};
|
||||||
|
|
||||||
postUnpack = ''
|
postUnpack = ''
|
||||||
@@ -24,12 +25,19 @@ stdenv.mkDerivation rec {
|
|||||||
sed -i "s@/bin/rm@rm@g" $(find . -name Makefile)
|
sed -i "s@/bin/rm@rm@g" $(find . -name Makefile)
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
buildInputs = [ libtirpc ];
|
||||||
|
patches = [ ./fix-install.patch ];
|
||||||
|
|
||||||
hardeningDisable = [ "all" ];
|
hardeningDisable = [ "all" ];
|
||||||
|
|
||||||
enableParallelBuilding = false;
|
enableParallelBuilding = false;
|
||||||
|
|
||||||
preBuild = ''
|
preBuild = ''
|
||||||
makeFlagsArray+=(BASE=$out)
|
makeFlagsArray+=(
|
||||||
|
BASE=$out
|
||||||
|
CPPFLAGS=-I${libtirpc.dev}/include/tirpc
|
||||||
|
LDFLAGS=-ltirpc
|
||||||
|
)
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
|
|||||||
10
pkgs/lmbench/fix-install.patch
Normal file
10
pkgs/lmbench/fix-install.patch
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
--- a/Makefile
|
||||||
|
+++ b/Makefile
|
||||||
|
@@ -144,6 +144,7 @@ install-target:
|
||||||
|
if [ ! -d $(BASE)/include ]; then mkdir $(BASE)/include; fi
|
||||||
|
if [ ! -d $(BASE)/lib ]; then mkdir $(BASE)/lib; fi
|
||||||
|
cp $(EXES) $(BASE)/bin
|
||||||
|
+ cp $(OPT_EXES) $(BASE)/bin
|
||||||
|
cp $(INCS) $(BASE)/include
|
||||||
|
cp $O/lmbench.a $(BASE)/lib/libmbench.a
|
||||||
|
cd ../doc; env MAKEFLAGS="$(MAKEFLAGS)" make CC="${CC}" OS="${OS}" BASE="$(BASE)" install
|
||||||
Reference in New Issue
Block a user