forked from rarias/bscpkgs
Compare commits
7 Commits
f962816eab
...
4de42f117a
| Author | SHA1 | Date | |
|---|---|---|---|
| 4de42f117a | |||
| 0093075cc6 | |||
| 1a810c35b7 | |||
| f0d2601697 | |||
| 9d1944c658 | |||
| 8e5b2dc5cc | |||
| f89cd4d7e2 |
10
overlay.nix
10
overlay.nix
@@ -21,7 +21,7 @@ let
|
||||
gpi-2 = callPackage ./pkgs/gpi-2/default.nix { };
|
||||
intelPackages_2023 = callPackage ./pkgs/intel-oneapi/2023.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 { };
|
||||
nanos6 = callPackage ./pkgs/nanos6/default.nix { };
|
||||
nanos6Debug = final.nanos6.override { enableDebug = true; };
|
||||
@@ -40,10 +40,10 @@ let
|
||||
#pscom = callPackage ./pkgs/parastation/pscom.nix { }; # Unmaintaned
|
||||
#psmpi = callPackage ./pkgs/parastation/psmpi.nix { }; # Unmaintaned
|
||||
sonar = callPackage ./pkgs/sonar/default.nix { };
|
||||
stdenvClangOmpss2 = final.stdenv.override { cc = final.clangOmpss2; allowedRequisites = null; };
|
||||
stdenvClangOmpss2Nanos6 = final.stdenv.override { cc = final.clangOmpss2Nanos6; allowedRequisites = null; };
|
||||
stdenvClangOmpss2Nodes = final.stdenv.override { cc = final.clangOmpss2Nodes; allowedRequisites = null; };
|
||||
stdenvClangOmpss2NodesOmpv = final.stdenv.override { cc = final.clangOmpss2NodesOmpv; allowedRequisites = null; };
|
||||
stdenvClangOmpss2 = final.stdenv.override { cc = final.buildPackages.clangOmpss2; allowedRequisites = null; };
|
||||
stdenvClangOmpss2Nanos6 = final.stdenv.override { cc = final.buildPackages.clangOmpss2Nanos6; allowedRequisites = null; };
|
||||
stdenvClangOmpss2Nodes = final.stdenv.override { cc = final.buildPackages.clangOmpss2Nodes; allowedRequisites = null; };
|
||||
stdenvClangOmpss2NodesOmpv = final.stdenv.override { cc = final.buildPackages.clangOmpss2NodesOmpv; allowedRequisites = null; };
|
||||
tagaspi = callPackage ./pkgs/tagaspi/default.nix { };
|
||||
tampi = callPackage ./pkgs/tampi/default.nix { };
|
||||
wxparaver = callPackage ./pkgs/paraver/default.nix { };
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
llvmPackages_latest
|
||||
stdenv
|
||||
, llvmPackages_latest
|
||||
, lib
|
||||
, fetchFromGitHub
|
||||
, cmake
|
||||
@@ -11,7 +12,6 @@
|
||||
, libffi
|
||||
, zlib
|
||||
, pkg-config
|
||||
, gcc # needed to set the rpath of libstdc++ for clang-tblgen
|
||||
, enableDebug ? false
|
||||
, useGit ? false
|
||||
, gitUrl ? "ssh://git@bscpm04.bsc.es/llvm-ompss/llvm-mono.git"
|
||||
@@ -20,7 +20,10 @@
|
||||
}:
|
||||
|
||||
let
|
||||
stdenv = llvmPackages_latest.stdenv;
|
||||
llvmPackages = llvmPackages_latest;
|
||||
llvmStdenv = llvmPackages.stdenv;
|
||||
# needed to set the rpath of libstdc++ for clang-tblgen
|
||||
gcc = stdenv.cc;
|
||||
|
||||
release = rec {
|
||||
version = "2024.11";
|
||||
@@ -43,7 +46,7 @@ let
|
||||
|
||||
source = if (useGit) then git else release;
|
||||
|
||||
in stdenv.mkDerivation rec {
|
||||
in llvmStdenv.mkDerivation rec {
|
||||
pname = "clang-ompss2";
|
||||
inherit (source) src version;
|
||||
|
||||
@@ -57,20 +60,23 @@ in stdenv.mkDerivation rec {
|
||||
|
||||
isClangWithOmpss = true;
|
||||
|
||||
nativeBuildInputs = [ zlib ];
|
||||
nativeBuildInputs = [
|
||||
zlib
|
||||
gcc.cc.lib # Required for libstdc++.so.6
|
||||
cmake
|
||||
python3
|
||||
llvmPackages.lld
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
which
|
||||
bash
|
||||
python3
|
||||
perl
|
||||
cmake
|
||||
llvmPackages_latest.lld
|
||||
llvmPackages.lld
|
||||
elfutils
|
||||
libffi
|
||||
pkg-config
|
||||
zlib
|
||||
gcc.cc.lib # Required for libstdc++.so.6
|
||||
];
|
||||
|
||||
# Error with -D_FORTIFY_SOURCE=2, see https://bugs.gentoo.org/636604:
|
||||
@@ -86,6 +92,7 @@ in stdenv.mkDerivation rec {
|
||||
|
||||
dontUseCmakeBuildDir = true;
|
||||
|
||||
|
||||
# Fix the host triple, as it has changed in a newer config.guess:
|
||||
# https://git.savannah.gnu.org/gitweb/?p=config.git;a=commitdiff;h=ca9bfb8cc75a2be1819d89c664a867785c96c9ba
|
||||
preConfigure = ''
|
||||
@@ -93,8 +100,13 @@ in stdenv.mkDerivation rec {
|
||||
cd build
|
||||
cmakeDir="../llvm"
|
||||
cmakeFlagsArray=(
|
||||
"-DLLVM_HOST_TRIPLE=${stdenv.targetPlatform.config}"
|
||||
"-DLLVM_HOST_TRIPLE=${llvmStdenv.targetPlatform.config}"
|
||||
'' + (if "${llvmStdenv.targetPlatform.config}" == "riscv64-unknown-linux-gnu" then ''
|
||||
"-DLLVM_DEFAULT_TARGET_TRIPLE=riscv64-unknown-linux-gnu"
|
||||
"-DLLVM_TARGETS_TO_BUILD=RISCV"
|
||||
'' else ''
|
||||
"-DLLVM_TARGETS_TO_BUILD=host"
|
||||
'') + ''
|
||||
"-DLLVM_BUILD_LLVM_DYLIB=ON"
|
||||
"-DLLVM_LINK_LLVM_DYLIB=ON"
|
||||
# Required to run clang-ast-dump and clang-tblgen during build
|
||||
@@ -103,7 +115,8 @@ in stdenv.mkDerivation rec {
|
||||
"-DCMAKE_CXX_FLAGS_DEBUG=-g -ggnu-pubnames"
|
||||
"-DCMAKE_EXE_LINKER_FLAGS_DEBUG=-Wl,--gdb-index"
|
||||
"-DLLVM_LIT_ARGS=-sv --xunit-xml-output=xunit.xml"
|
||||
"-DLLVM_ENABLE_PROJECTS=clang;compiler-rt;lld"
|
||||
"-DLLVM_ENABLE_PROJECTS=clang;lld"
|
||||
#"-DLLVM_ENABLE_PROJECTS=clang;compiler-rt;lld"
|
||||
"-DLLVM_ENABLE_ASSERTIONS=ON"
|
||||
"-DLLVM_INSTALL_TOOLCHAIN_ONLY=ON"
|
||||
"-DCMAKE_INSTALL_BINDIR=bin"
|
||||
@@ -113,8 +126,8 @@ in stdenv.mkDerivation rec {
|
||||
# install
|
||||
"-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON"
|
||||
"-DCMAKE_INSTALL_RPATH=${zlib}/lib:${gcc.cc.lib}/lib"
|
||||
"-DLLVM_APPEND_VC_REV=ON"
|
||||
"-DLLVM_FORCE_VC_REVISION=${source.version}"
|
||||
#"-DLLVM_APPEND_VC_REV=ON"
|
||||
#"-DLLVM_FORCE_VC_REVISION=${source.version}"
|
||||
)
|
||||
'';
|
||||
|
||||
|
||||
@@ -9,12 +9,14 @@
|
||||
, ompss2rt ? null
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
usingNodesAndOmpv = (openmp.pname == "openmp-v" && ompss2rt.pname == "nodes");
|
||||
sameNosv = openmp.nosv == ompss2rt.nosv;
|
||||
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
|
||||
homevar = if ompss2rt.pname == "nanos6" then "NANOS6_HOME" else "NODES_HOME";
|
||||
@@ -34,14 +36,16 @@ let
|
||||
targetConfig = stdenv.targetPlatform.config;
|
||||
inherit gcc;
|
||||
cc = clangOmpss2Unwrapped;
|
||||
gccVersion = with versions; let v = gcc.version; in concatStringsSep "." [(major v) (minor v) (patch v)];
|
||||
in wrapCCWith {
|
||||
inherit cc bintools;
|
||||
# extraPackages adds packages to depsTargetTargetPropagated
|
||||
extraPackages = lib.optional (openmp != null) openmp;
|
||||
extraPackages = optional (openmp != null) openmp;
|
||||
extraBuildCommands = ''
|
||||
echo "-target ${targetConfig}" >> $out/nix-support/cc-cflags
|
||||
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 "-fuse-ld=lld" >> $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}/${gccVersion}" >> $out/nix-support/cc-ldflags
|
||||
echo "-L${gcc.cc.lib}/lib" >> $out/nix-support/cc-ldflags
|
||||
|
||||
for dir in ${gcc.cc}/include/c++/*; do
|
||||
@@ -53,14 +57,15 @@ in wrapCCWith {
|
||||
|
||||
echo "--gcc-toolchain=${gcc}" >> $out/nix-support/cc-cflags
|
||||
|
||||
wrap clang++ $wrapper $ccPath/clang++
|
||||
wrap ${targetConfig}clang++ $wrapper $ccPath/clang++
|
||||
wrap ${targetConfig}clang $wrapper $ccPath/clang
|
||||
|
||||
'' + lib.optionalString (openmp != null) ''
|
||||
'' + optionalString (openmp != null) ''
|
||||
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 ${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
|
||||
'';
|
||||
}
|
||||
|
||||
@@ -39,6 +39,9 @@ stdenv.mkDerivation rec {
|
||||
perl
|
||||
pkg-config
|
||||
python3
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
] ++ lib.optionals enableNosv [
|
||||
nosv
|
||||
] ++ lib.optionals enableOvni [
|
||||
@@ -68,6 +71,7 @@ stdenv.mkDerivation rec {
|
||||
rm -f $out/lib/libiomp*
|
||||
'' + lib.optionalString enableNosv ''
|
||||
rm -f $out/lib/libomp.*
|
||||
rm -f $out/libllvmrt/libomp.*
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
libtirpc,
|
||||
fetchFromGitHub
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "lmbench";
|
||||
version = "701c6c35";
|
||||
version = "941a0dcc";
|
||||
|
||||
# We use the intel repo as they have fixed some problems
|
||||
src = fetchFromGitHub {
|
||||
owner = "intel";
|
||||
repo = pname;
|
||||
rev = "701c6c35b0270d4634fb1dc5272721340322b8ed";
|
||||
sha256 = "0sf6zk03knkardsfd6qx7drpm56nhg53n885cylkggk83r38idyr";
|
||||
rev = "941a0dcc0e7bdd9bb0dee05d7f620e77da8c43af";
|
||||
sha256 = "sha256-SzwplRBO3V0R3m3p15n71ivYBMGoLsajFK2TapYxdqk=";
|
||||
};
|
||||
|
||||
postUnpack = ''
|
||||
@@ -24,12 +25,19 @@ stdenv.mkDerivation rec {
|
||||
sed -i "s@/bin/rm@rm@g" $(find . -name Makefile)
|
||||
'';
|
||||
|
||||
buildInputs = [ libtirpc ];
|
||||
patches = [ ./fix-install.patch ];
|
||||
|
||||
hardeningDisable = [ "all" ];
|
||||
|
||||
enableParallelBuilding = false;
|
||||
|
||||
preBuild = ''
|
||||
makeFlagsArray+=(BASE=$out)
|
||||
makeFlagsArray+=(
|
||||
BASE=$out
|
||||
CPPFLAGS=-I${libtirpc.dev}/include/tirpc
|
||||
LDFLAGS=-ltirpc
|
||||
)
|
||||
'';
|
||||
|
||||
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