Compare commits
6 Commits
master
...
cross-buil
| Author | SHA1 | Date | |
|---|---|---|---|
| fef302e857 | |||
| 52549cc1f0 | |||
| 290071e6dc | |||
| e0e9a4a77b | |||
| d9a49df8ff | |||
| 1f09f8cac2 |
15
overlay.nix
15
overlay.nix
@@ -13,10 +13,11 @@ let
|
|||||||
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 { };
|
||||||
clangOmpss2Nanos6 = callPackage ./pkgs/llvm-ompss2/default.nix { ompss2rt = final.nanos6; };
|
clangOmpss2Nanos6 = callPackage ./pkgs/llvm-ompss2/default.nix { useNanos6 = true; };
|
||||||
clangOmpss2Nodes = callPackage ./pkgs/llvm-ompss2/default.nix { ompss2rt = final.nodes; openmp = final.openmp; };
|
clangOmpss2Nodes = callPackage ./pkgs/llvm-ompss2/default.nix { useNodes = true; useOpenmp = true; };
|
||||||
clangOmpss2NodesOmpv = callPackage ./pkgs/llvm-ompss2/default.nix { ompss2rt = final.nodes; openmp = final.openmpv; };
|
clangOmpss2NodesOmpv = callPackage ./pkgs/llvm-ompss2/default.nix { useNodes = true; useOpenmpV = true; };
|
||||||
clangOmpss2Unwrapped = callPackage ./pkgs/llvm-ompss2/clang.nix { };
|
clangOmpss2Unwrapped = callPackage ./pkgs/llvm-ompss2/clang.nix { };
|
||||||
|
|
||||||
#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 { }; # Broken: https://jungle.bsc.es/git/rarias/bscpkgs/issues/7
|
#gpi-2 = callPackage ./pkgs/gpi-2/default.nix { }; # Broken: https://jungle.bsc.es/git/rarias/bscpkgs/issues/7
|
||||||
intelPackages_2023 = callPackage ./pkgs/intel-oneapi/2023.nix { };
|
intelPackages_2023 = callPackage ./pkgs/intel-oneapi/2023.nix { };
|
||||||
@@ -40,10 +41,10 @@ let
|
|||||||
#pscom = callPackage ./pkgs/parastation/pscom.nix { }; # Unmaintaned
|
#pscom = callPackage ./pkgs/parastation/pscom.nix { }; # Unmaintaned
|
||||||
#psmpi = callPackage ./pkgs/parastation/psmpi.nix { }; # Unmaintaned
|
#psmpi = callPackage ./pkgs/parastation/psmpi.nix { }; # Unmaintaned
|
||||||
sonar = callPackage ./pkgs/sonar/default.nix { };
|
sonar = callPackage ./pkgs/sonar/default.nix { };
|
||||||
stdenvClangOmpss2 = final.stdenv.override { cc = final.clangOmpss2; allowedRequisites = null; };
|
stdenvClangOmpss2 = final.stdenv.override { cc = final.buildPackages.clangOmpss2; allowedRequisites = null; };
|
||||||
stdenvClangOmpss2Nanos6 = final.stdenv.override { cc = final.clangOmpss2Nanos6; allowedRequisites = null; };
|
stdenvClangOmpss2Nanos6 = final.stdenv.override { cc = final.buildPackages.clangOmpss2Nanos6; allowedRequisites = null; };
|
||||||
stdenvClangOmpss2Nodes = final.stdenv.override { cc = final.clangOmpss2Nodes; allowedRequisites = null; };
|
stdenvClangOmpss2Nodes = final.stdenv.override { cc = final.buildPackages.clangOmpss2Nodes; allowedRequisites = null; };
|
||||||
stdenvClangOmpss2NodesOmpv = final.stdenv.override { cc = final.clangOmpss2NodesOmpv; allowedRequisites = null; };
|
stdenvClangOmpss2NodesOmpv = final.stdenv.override { cc = final.buildPackages.clangOmpss2NodesOmpv; allowedRequisites = null; };
|
||||||
#tagaspi = callPackage ./pkgs/tagaspi/default.nix { }; # Broken due gpi-2
|
#tagaspi = callPackage ./pkgs/tagaspi/default.nix { }; # Broken due gpi-2
|
||||||
tampi = callPackage ./pkgs/tampi/default.nix { };
|
tampi = callPackage ./pkgs/tampi/default.nix { };
|
||||||
wxparaver = callPackage ./pkgs/paraver/default.nix { };
|
wxparaver = callPackage ./pkgs/paraver/default.nix { };
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
llvmPackages_latest
|
stdenv
|
||||||
|
, llvmPackages_latest
|
||||||
, lib
|
, lib
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
, cmake
|
, cmake
|
||||||
@@ -11,7 +12,6 @@
|
|||||||
, libffi
|
, libffi
|
||||||
, zlib
|
, zlib
|
||||||
, pkg-config
|
, pkg-config
|
||||||
, gcc # needed to set the rpath of libstdc++ for clang-tblgen
|
|
||||||
, enableDebug ? false
|
, enableDebug ? false
|
||||||
, useGit ? false
|
, useGit ? false
|
||||||
, gitUrl ? "ssh://git@bscpm04.bsc.es/llvm-ompss/llvm-mono.git"
|
, gitUrl ? "ssh://git@bscpm04.bsc.es/llvm-ompss/llvm-mono.git"
|
||||||
@@ -20,7 +20,10 @@
|
|||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
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 {
|
release = rec {
|
||||||
version = "2025.06";
|
version = "2025.06";
|
||||||
@@ -43,7 +46,7 @@ let
|
|||||||
|
|
||||||
source = if (useGit) then git else release;
|
source = if (useGit) then git else release;
|
||||||
|
|
||||||
in stdenv.mkDerivation rec {
|
in llvmStdenv.mkDerivation rec {
|
||||||
pname = "clang-ompss2";
|
pname = "clang-ompss2";
|
||||||
inherit (source) src version;
|
inherit (source) src version;
|
||||||
|
|
||||||
@@ -57,20 +60,23 @@ in stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
isClangWithOmpss = true;
|
isClangWithOmpss = true;
|
||||||
|
|
||||||
nativeBuildInputs = [ zlib ];
|
nativeBuildInputs = [
|
||||||
|
zlib
|
||||||
|
gcc.cc.lib # Required for libstdc++.so.6
|
||||||
|
cmake
|
||||||
|
python3
|
||||||
|
llvmPackages.lld
|
||||||
|
];
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
which
|
which
|
||||||
bash
|
bash
|
||||||
python3
|
|
||||||
perl
|
perl
|
||||||
cmake
|
llvmPackages.lld
|
||||||
llvmPackages_latest.lld
|
|
||||||
elfutils
|
elfutils
|
||||||
libffi
|
libffi
|
||||||
pkg-config
|
pkg-config
|
||||||
zlib
|
zlib
|
||||||
gcc.cc.lib # Required for libstdc++.so.6
|
|
||||||
];
|
];
|
||||||
|
|
||||||
# Error with -D_FORTIFY_SOURCE=2, see https://bugs.gentoo.org/636604:
|
# Error with -D_FORTIFY_SOURCE=2, see https://bugs.gentoo.org/636604:
|
||||||
@@ -86,6 +92,7 @@ in stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
dontUseCmakeBuildDir = true;
|
dontUseCmakeBuildDir = true;
|
||||||
|
|
||||||
|
|
||||||
# Fix the host triple, as it has changed in a newer config.guess:
|
# 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
|
# https://git.savannah.gnu.org/gitweb/?p=config.git;a=commitdiff;h=ca9bfb8cc75a2be1819d89c664a867785c96c9ba
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
@@ -93,8 +100,13 @@ in stdenv.mkDerivation rec {
|
|||||||
cd build
|
cd build
|
||||||
cmakeDir="../llvm"
|
cmakeDir="../llvm"
|
||||||
cmakeFlagsArray=(
|
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_TARGETS_TO_BUILD=host"
|
||||||
|
'') + ''
|
||||||
"-DLLVM_BUILD_LLVM_DYLIB=ON"
|
"-DLLVM_BUILD_LLVM_DYLIB=ON"
|
||||||
"-DLLVM_LINK_LLVM_DYLIB=ON"
|
"-DLLVM_LINK_LLVM_DYLIB=ON"
|
||||||
# Required to run clang-ast-dump and clang-tblgen during build
|
# 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_CXX_FLAGS_DEBUG=-g -ggnu-pubnames"
|
||||||
"-DCMAKE_EXE_LINKER_FLAGS_DEBUG=-Wl,--gdb-index"
|
"-DCMAKE_EXE_LINKER_FLAGS_DEBUG=-Wl,--gdb-index"
|
||||||
"-DLLVM_LIT_ARGS=-sv --xunit-xml-output=xunit.xml"
|
"-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_ENABLE_ASSERTIONS=ON"
|
||||||
"-DLLVM_INSTALL_TOOLCHAIN_ONLY=ON"
|
"-DLLVM_INSTALL_TOOLCHAIN_ONLY=ON"
|
||||||
"-DCMAKE_INSTALL_BINDIR=bin"
|
"-DCMAKE_INSTALL_BINDIR=bin"
|
||||||
@@ -113,8 +126,8 @@ in stdenv.mkDerivation rec {
|
|||||||
# install
|
# install
|
||||||
"-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON"
|
"-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON"
|
||||||
"-DCMAKE_INSTALL_RPATH=${zlib}/lib:${gcc.cc.lib}/lib"
|
"-DCMAKE_INSTALL_RPATH=${zlib}/lib:${gcc.cc.lib}/lib"
|
||||||
"-DLLVM_APPEND_VC_REV=ON"
|
#"-DLLVM_APPEND_VC_REV=ON"
|
||||||
"-DLLVM_FORCE_VC_REVISION=${source.version}"
|
#"-DLLVM_FORCE_VC_REVISION=${source.version}"
|
||||||
)
|
)
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|||||||
@@ -3,25 +3,42 @@
|
|||||||
, lib
|
, lib
|
||||||
, gcc
|
, gcc
|
||||||
, clangOmpss2Unwrapped
|
, clangOmpss2Unwrapped
|
||||||
, openmp ? null
|
|
||||||
|
, openmp
|
||||||
|
, useOpenmp ? false
|
||||||
|
, openmpv
|
||||||
|
, useOpenmpV ? false
|
||||||
|
, nanos6
|
||||||
|
, useNanos6 ? false
|
||||||
|
, nodes
|
||||||
|
, useNodes ? false
|
||||||
|
|
||||||
, wrapCCWith
|
, wrapCCWith
|
||||||
, llvmPackages_latest
|
, llvmPackages_latest
|
||||||
, ompss2rt ? null
|
|
||||||
}:
|
}:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
usingNodesAndOmpv = (openmp.pname == "openmp-v" && ompss2rt.pname == "nodes");
|
getSplice = target: pkg: if pkg ? "__spliced" && pkg.__spliced ? "${target}" then pkg.__spliced."${target}" else pkg;
|
||||||
sameNosv = openmp.nosv == ompss2rt.nosv;
|
getSpliceTargetTarget = getSplice "targetTarget";
|
||||||
|
omp = if useOpenmp then openmp else if useOpenmpV then openmpv else null;
|
||||||
|
ompss2rtUnspliced = if useNanos6 then nanos6 else if useNodes then nodes else null;
|
||||||
|
ompss2rt = getSpliceTargetTarget ompss2rtUnspliced;
|
||||||
|
usingNodesAndOmpv = (omp.pname == "openmp-v" && ompss2rt.pname == "nodes");
|
||||||
|
sameNosvUnspliced = omp.nosv == ompss2rtUnspliced.nosv;
|
||||||
|
sameNosvSpliced = (getSpliceTargetTarget omp.nosv) == ompss2rt.nosv;
|
||||||
in
|
in
|
||||||
|
|
||||||
assert assertMsg (usingNodesAndOmpv -> sameNosv) "OpenMP-V and NODES must share the same nOS-V";
|
assert assertMsg (usingNodesAndOmpv -> sameNosvUnspliced) "OpenMP-V and NODES must share the same nOS-V before splice";
|
||||||
|
assert assertMsg (usingNodesAndOmpv -> sameNosvSpliced) "OpenMP-V and NODES must share the same nOS-V after splice";
|
||||||
|
assert assertMsg (useOpenmp -> !useOpenmpV) "Either OpenMP or OpenMP-V may be enabled, but not both";
|
||||||
|
assert assertMsg (useNanos6 -> !useNodes) "Either Nanos6 or NODES may be enabled, but not both";
|
||||||
|
|
||||||
let
|
let
|
||||||
homevar = if ompss2rt.pname == "nanos6" then "NANOS6_HOME" else "NODES_HOME";
|
homevar = if ompss2rt.pname == "nanos6" then "NANOS6_HOME" else "NODES_HOME";
|
||||||
rtname = if ompss2rt.pname == "nanos6" then "libnanos6" else "libnodes";
|
rtname = if ompss2rt.pname == "nanos6" then "libnanos6" else "libnodes";
|
||||||
ompname = if openmp.pname == "openmp-v" then "libompv" else "libomp";
|
ompname = if omp.pname == "openmp-v" then "libompv" else "libomp";
|
||||||
|
|
||||||
|
|
||||||
# We need to replace the lld linker from bintools with our linker just built,
|
# We need to replace the lld linker from bintools with our linker just built,
|
||||||
@@ -37,12 +54,13 @@ let
|
|||||||
inherit gcc;
|
inherit gcc;
|
||||||
cc = clangOmpss2Unwrapped;
|
cc = clangOmpss2Unwrapped;
|
||||||
gccVersion = with versions; let v = gcc.version; in concatStringsSep "." [(major v) (minor v) (patch v)];
|
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 = optional (openmp != null) openmp;
|
extraPackages = optional (omp != null) omp;
|
||||||
extraBuildCommands = ''
|
extraBuildCommands = ''
|
||||||
echo "-target ${targetConfig}" >> $out/nix-support/cc-cflags
|
echo "-target ${targetConfig}" >> $out/nix-support/cc-cflags
|
||||||
|
#echo "-fuse-ld=lld" >> $out/nix-support/cc-cflags
|
||||||
echo "-B${gcc.cc}/lib/gcc/${targetConfig}/${gccVersion}" >> $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/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
|
||||||
@@ -56,9 +74,10 @@ in wrapCCWith {
|
|||||||
|
|
||||||
echo "--gcc-toolchain=${gcc}" >> $out/nix-support/cc-cflags
|
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
|
||||||
|
|
||||||
'' + optionalString (openmp != null) ''
|
'' + optionalString (omp != null) ''
|
||||||
echo "export OPENMP_RUNTIME=${ompname}" >> $out/nix-support/cc-wrapper-hook
|
echo "export OPENMP_RUNTIME=${ompname}" >> $out/nix-support/cc-wrapper-hook
|
||||||
'' + 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
|
||||||
@@ -66,5 +85,4 @@ in wrapCCWith {
|
|||||||
'' + 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
|
||||||
'';
|
'';
|
||||||
}
|
}) // { inherit ompss2rt; }
|
||||||
|
|
||||||
|
|||||||
@@ -39,6 +39,9 @@ stdenv.mkDerivation rec {
|
|||||||
perl
|
perl
|
||||||
pkg-config
|
pkg-config
|
||||||
python3
|
python3
|
||||||
|
];
|
||||||
|
|
||||||
|
buildInputs = [
|
||||||
] ++ lib.optionals enableNosv [
|
] ++ lib.optionals enableNosv [
|
||||||
nosv
|
nosv
|
||||||
] ++ lib.optionals enableOvni [
|
] ++ lib.optionals enableOvni [
|
||||||
|
|||||||
@@ -46,15 +46,16 @@ in stdenv.mkDerivation rec {
|
|||||||
inherit (source) src version;
|
inherit (source) src version;
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
separateDebugInfo = true;
|
separateDebugInfo = true;
|
||||||
buildInputs = [
|
nativeBuildInputs = [
|
||||||
autoreconfHook
|
autoreconfHook
|
||||||
automake
|
automake
|
||||||
autoconf
|
autoconf
|
||||||
libtool
|
libtool
|
||||||
gnumake
|
gnumake
|
||||||
|
];
|
||||||
|
buildInputs = [
|
||||||
boost
|
boost
|
||||||
mpi
|
mpi
|
||||||
gcc
|
|
||||||
] ++ optional (enableOvni) ovni;
|
] ++ optional (enableOvni) ovni;
|
||||||
configureFlags = optional (enableOvni) "--with-ovni=${ovni}";
|
configureFlags = optional (enableOvni) "--with-ovni=${ovni}";
|
||||||
dontDisableStatic = true;
|
dontDisableStatic = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user