Compare commits
10 Commits
fec4ddf6ab
...
5d3820631a
Author | SHA1 | Date | |
---|---|---|---|
5d3820631a | |||
9c8a077828 | |||
fce556cb28 | |||
37ce5ef391 | |||
|
3b21a32d83 | ||
c4d5135fde | |||
3f2b9a766b | |||
|
3ed644b88f | ||
|
8ceaddfea7 | ||
2a953d811c |
18
overlay.nix
18
overlay.nix
@ -13,10 +13,9 @@ let
|
||||
bench6 = callPackage ./pkgs/bench6/default.nix { };
|
||||
clangOmpss2 = callPackage ./pkgs/llvm-ompss2/default.nix { };
|
||||
clangOmpss2Nanos6 = callPackage ./pkgs/llvm-ompss2/default.nix { ompss2rt = final.nanos6; };
|
||||
clangOmpss2Nodes = callPackage ./pkgs/llvm-ompss2/default.nix { ompss2rt = final.nodes; };
|
||||
clangOmpss2OpenmpNodes = callPackage ./pkgs/llvm-ompss2/default.nix { ompss2rt = final.nodes; clangOmpss2Unwrapped = final.clangOmpss2OpenmpUnwrapped; };
|
||||
clangOmpss2Nodes = callPackage ./pkgs/llvm-ompss2/default.nix { ompss2rt = final.nodes; openmp = final.openmp; };
|
||||
clangOmpss2NodesOmpv = callPackage ./pkgs/llvm-ompss2/default.nix { ompss2rt = final.nodes; openmp = final.openmpv; };
|
||||
clangOmpss2Unwrapped = callPackage ./pkgs/llvm-ompss2/clang.nix { };
|
||||
clangOmpss2OpenmpUnwrapped = final.clangOmpss2Unwrapped.override { enableNosv = true; };
|
||||
#extrae = callPackage ./pkgs/extrae/default.nix { }; # Broken and outdated
|
||||
gpi-2 = callPackage ./pkgs/gpi-2/default.nix { };
|
||||
intelPackages_2023 = callPackage ./pkgs/intel-oneapi/2023.nix { };
|
||||
@ -31,6 +30,8 @@ let
|
||||
#nix-wrap = callPackage ./pkgs/nix-wrap/default.nix { };
|
||||
nodes = callPackage ./pkgs/nodes/default.nix { };
|
||||
nosv = callPackage ./pkgs/nosv/default.nix { };
|
||||
openmp = callPackage ./pkgs/llvm-ompss2/openmp.nix { monorepoSrc = final.clangOmpss2Unwrapped.src; version = final.clangOmpss2Unwrapped.version; };
|
||||
openmpv = final.openmp.override { enableNosv = true; enableOvni = true; };
|
||||
osumb = callPackage ./pkgs/osu/default.nix { };
|
||||
ovni = callPackage ./pkgs/ovni/default.nix { };
|
||||
ovniGit = final.ovni.override { useGit = true; };
|
||||
@ -41,7 +42,7 @@ let
|
||||
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; };
|
||||
stdenvClangOmpss2OpenmpNodes = final.stdenv.override { cc = final.clangOmpss2OpenmpNodes; allowedRequisites = null; };
|
||||
stdenvClangOmpss2NodesOmpv = final.stdenv.override { cc = final.clangOmpss2NodesOmpv; allowedRequisites = null; };
|
||||
tagaspi = callPackage ./pkgs/tagaspi/default.nix { };
|
||||
tampi = callPackage ./pkgs/tampi/default.nix { };
|
||||
wxparaver = callPackage ./pkgs/paraver/default.nix { };
|
||||
@ -76,10 +77,13 @@ in bscPkgs // {
|
||||
stdenv = final.stdenvClangOmpss2Nodes;
|
||||
};
|
||||
clangNosvOpenmp-task = callPackage ./test/compilers/clang-openmp.nix {
|
||||
stdenv = final.stdenvClangOmpss2OpenmpNodes;
|
||||
stdenv = final.stdenvClangOmpss2Nodes;
|
||||
};
|
||||
clangNosvOpenmp-nosv = callPackage ./test/compilers/clang-openmp-nosv.nix {
|
||||
stdenv = final.stdenvClangOmpss2OpenmpNodes;
|
||||
clangNosvOmpv-nosv = callPackage ./test/compilers/clang-openmp-nosv.nix {
|
||||
stdenv = final.stdenvClangOmpss2NodesOmpv;
|
||||
};
|
||||
clangNosvOmpv-ld = callPackage ./test/compilers/clang-openmp-ld.nix {
|
||||
stdenv = final.stdenvClangOmpss2NodesOmpv;
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -10,11 +10,9 @@
|
||||
, elfutils
|
||||
, libffi
|
||||
, zlib
|
||||
, nosv
|
||||
, pkg-config
|
||||
, gcc # needed to set the rpath of libstdc++ for clang-tblgen
|
||||
, enableDebug ? false
|
||||
, enableNosv ? false
|
||||
, useGit ? false
|
||||
, gitUrl ? "ssh://git@bscpm03.bsc.es/llvm-ompss/llvm-mono.git"
|
||||
, gitBranch ? "master"
|
||||
@ -25,12 +23,12 @@ let
|
||||
stdenv = llvmPackages_latest.stdenv;
|
||||
|
||||
release = rec {
|
||||
version = "2023.11";
|
||||
version = "18.0.0-ompss-2";
|
||||
src = fetchFromGitHub {
|
||||
owner = "bsc-pm";
|
||||
repo = "llvm";
|
||||
rev = "refs/tags/github-release-${version}";
|
||||
hash = "sha256-XLYS401BixGw3Ke/JKuikVKvbA92ENCdUvYLyZX9UtI=";
|
||||
rev = "refs/tags/${version}";
|
||||
hash = "sha256-Z0TVrujOQNHiAuTlyexbIBA2pOk2Tdmv7JuQn3M3foY=";
|
||||
};
|
||||
};
|
||||
|
||||
@ -73,8 +71,6 @@ in stdenv.mkDerivation rec {
|
||||
pkg-config
|
||||
zlib
|
||||
gcc.cc.lib # Required for libstdc++.so.6
|
||||
] ++ lib.optionals enableNosv [
|
||||
nosv
|
||||
];
|
||||
|
||||
# Error with -D_FORTIFY_SOURCE=2, see https://bugs.gentoo.org/636604:
|
||||
@ -107,27 +103,19 @@ 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;openmp;compiler-rt;lld"
|
||||
"-DLLVM_ENABLE_PROJECTS=clang;compiler-rt;lld"
|
||||
"-DLLVM_ENABLE_ASSERTIONS=ON"
|
||||
"-DLLVM_INSTALL_TOOLCHAIN_ONLY=ON"
|
||||
"-DCMAKE_INSTALL_BINDIR=bin"
|
||||
"-DLLVM_ENABLE_ZLIB=FORCE_ON"
|
||||
"-DLLVM_ENABLE_LIBXML2=OFF"
|
||||
'' + (lib.optionalString enableNosv ''
|
||||
"-DCLANG_DEFAULT_NOSV_HOME=${nosv}"
|
||||
'') + ''
|
||||
# Set the rpath to include external libraries (zlib) both on build and
|
||||
# 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}"
|
||||
)
|
||||
|
||||
'';
|
||||
|
||||
# Remove support for GNU and Intel Openmp
|
||||
postInstall = ''
|
||||
rm -f $out/lib/libgomp*
|
||||
rm -f $out/lib/libiomp*
|
||||
'';
|
||||
|
||||
# About "-DCLANG_DEFAULT_NANOS6_HOME=${nanos6}", we could specify a default
|
||||
|
@ -3,15 +3,24 @@
|
||||
, lib
|
||||
, gcc
|
||||
, clangOmpss2Unwrapped
|
||||
, openmp ? null
|
||||
, wrapCCWith
|
||||
, llvmPackages_latest
|
||||
, ompss2rt ? null
|
||||
}:
|
||||
|
||||
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";
|
||||
|
||||
let
|
||||
homevar = if ompss2rt.pname == "nanos6" then "NANOS6_HOME" else "NODES_HOME";
|
||||
rtname = if ompss2rt.pname == "nanos6" then "libnanos6" else "libnodes";
|
||||
ompname = if openmp.pname == "openmp-v" then "libompv" else "libomp";
|
||||
|
||||
|
||||
# We need to replace the lld linker from bintools with our linker just built,
|
||||
# otherwise we run into incompatibility issues when mixing compiler and linker
|
||||
@ -27,6 +36,8 @@ let
|
||||
cc = clangOmpss2Unwrapped;
|
||||
in wrapCCWith {
|
||||
inherit cc bintools;
|
||||
# extraPackages adds packages to depsTargetTargetPropagated
|
||||
extraPackages = lib.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
|
||||
@ -43,6 +54,9 @@ in wrapCCWith {
|
||||
echo "--gcc-toolchain=${gcc}" >> $out/nix-support/cc-cflags
|
||||
|
||||
wrap clang++ $wrapper $ccPath/clang++
|
||||
|
||||
'' + lib.optionalString (openmp != null) ''
|
||||
echo "export OPENMP_RUNTIME=${ompname}" >> $out/nix-support/cc-wrapper-hook
|
||||
'' + lib.optionalString (ompss2rt != null) ''
|
||||
echo "export OMPSS2_RUNTIME=${rtname}" >> $out/nix-support/cc-wrapper-hook
|
||||
echo "export ${homevar}=${ompss2rt}" >> $out/nix-support/cc-wrapper-hook
|
||||
|
75
pkgs/llvm-ompss2/openmp.nix
Normal file
75
pkgs/llvm-ompss2/openmp.nix
Normal file
@ -0,0 +1,75 @@
|
||||
{ lib
|
||||
, llvmPackages_latest
|
||||
, monorepoSrc
|
||||
, runCommand
|
||||
, cmake
|
||||
, ninja
|
||||
, llvm
|
||||
, perl
|
||||
, pkg-config
|
||||
, version
|
||||
, nosv
|
||||
, ovni
|
||||
, enableNosv ? false
|
||||
, enableDebug ? false
|
||||
, enableOvni ? false
|
||||
}:
|
||||
|
||||
assert enableOvni -> enableNosv;
|
||||
|
||||
let
|
||||
stdenv = llvmPackages_latest.stdenv;
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "openmp" + (lib.optionalString enableNosv "-v");
|
||||
inherit version;
|
||||
|
||||
src = runCommand "${pname}-src" {} ''
|
||||
mkdir -p "$out"
|
||||
cp -r ${monorepoSrc}/cmake "$out"
|
||||
cp -r ${monorepoSrc}/openmp "$out"
|
||||
'';
|
||||
|
||||
sourceRoot = "${src.name}/openmp";
|
||||
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
ninja
|
||||
perl
|
||||
pkg-config
|
||||
] ++ lib.optionals enableNosv [
|
||||
nosv
|
||||
] ++ lib.optionals enableOvni [
|
||||
ovni
|
||||
];
|
||||
|
||||
doCheck = false;
|
||||
|
||||
hardeningDisable = [ "all" ];
|
||||
|
||||
cmakeBuildType = if enableDebug then "Debug" else "Release";
|
||||
|
||||
dontStrip = enableDebug;
|
||||
|
||||
separateDebugInfo = true;
|
||||
|
||||
cmakeFlags = [
|
||||
"-DLIBOMP_OMPD_SUPPORT=OFF"
|
||||
"-DOPENMP_ENABLE_LIBOMPTARGET=OFF"
|
||||
];
|
||||
|
||||
# Remove support for GNU and Intel Openmp.
|
||||
# Also, remove libomp if building with nosv, as there is no support to build
|
||||
# only one runtime at a time.
|
||||
postInstall = ''
|
||||
rm -f $out/lib/libgomp*
|
||||
rm -f $out/lib/libiomp*
|
||||
'' + lib.optionalString enableNosv ''
|
||||
rm -f $out/lib/libomp.*
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
inherit nosv;
|
||||
};
|
||||
}
|
||||
|
32
pkgs/nanos6/0001-Add-missing-cstdint-include.patch
Normal file
32
pkgs/nanos6/0001-Add-missing-cstdint-include.patch
Normal file
@ -0,0 +1,32 @@
|
||||
From 6fc5bef066ac011d6b15a7c090f4498b0b730818 Mon Sep 17 00:00:00 2001
|
||||
From: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
|
||||
Date: Fri, 12 Apr 2024 14:44:43 +0200
|
||||
Subject: [PATCH] Add missing cstdint include
|
||||
|
||||
---
|
||||
src/dependencies/DataTrackingSupport.hpp | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/dependencies/DataTrackingSupport.hpp b/src/dependencies/DataTrackingSupport.hpp
|
||||
index 56226085..cdfd5e1c 100644
|
||||
--- a/src/dependencies/DataTrackingSupport.hpp
|
||||
+++ b/src/dependencies/DataTrackingSupport.hpp
|
||||
@@ -1,13 +1,14 @@
|
||||
/*
|
||||
This file is part of Nanos6 and is licensed under the terms contained in the COPYING file.
|
||||
|
||||
- Copyright (C) 2020 Barcelona Supercomputing Center (BSC)
|
||||
+ Copyright (C) 2020-2024 Barcelona Supercomputing Center (BSC)
|
||||
*/
|
||||
|
||||
#ifndef DATA_TRACKING_SUPPORT_HPP
|
||||
#define DATA_TRACKING_SUPPORT_HPP
|
||||
|
||||
#include "support/config/ConfigVariable.hpp"
|
||||
+#include <cstdint>
|
||||
|
||||
class Task;
|
||||
|
||||
--
|
||||
2.44.0
|
||||
|
@ -35,6 +35,10 @@ let
|
||||
rev = "version-${version}";
|
||||
hash = "sha256-o2j7xNufdjcWykbwDDHQYxYCs4kpyQvJnuFyeXYZULw=";
|
||||
};
|
||||
patches = [
|
||||
# https://pm.bsc.es/gitlab/nanos6/nanos6/-/issues/185
|
||||
./0001-Add-missing-cstdint-include.patch
|
||||
];
|
||||
};
|
||||
|
||||
git = rec {
|
||||
@ -48,9 +52,8 @@ let
|
||||
|
||||
source = if (useGit) then git else release;
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
stdenv.mkDerivation (source // rec {
|
||||
pname = "nanos6";
|
||||
inherit (source) src version;
|
||||
|
||||
prePatch = ''
|
||||
patchShebangs scripts/generate_config.sh
|
||||
@ -114,4 +117,4 @@ in
|
||||
platforms = platforms.linux;
|
||||
license = licenses.gpl3;
|
||||
};
|
||||
}
|
||||
})
|
||||
|
@ -84,6 +84,6 @@ in
|
||||
];
|
||||
|
||||
passthru = {
|
||||
nosv = nosv;
|
||||
inherit nosv;
|
||||
};
|
||||
}
|
||||
|
@ -10,6 +10,7 @@
|
||||
, paraverKernel
|
||||
, openssl
|
||||
, glibcLocales
|
||||
, wrapGAppsHook
|
||||
}:
|
||||
|
||||
let
|
||||
@ -48,6 +49,10 @@ stdenv.mkDerivation rec {
|
||||
"--with-openssl=${openssl.dev}"
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
wrapGAppsHook
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
autoreconfHook
|
||||
boost
|
||||
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
stdenv
|
||||
, lib
|
||||
, fetchFromGitHub
|
||||
, automake
|
||||
, autoconf
|
||||
@ -9,12 +10,18 @@
|
||||
, mpi
|
||||
, gcc
|
||||
, autoreconfHook
|
||||
, enableOvni ? true
|
||||
, ovni ? null
|
||||
, useGit ? false
|
||||
, gitUrl ? "ssh://git@bscpm03.bsc.es/interoperability/tampi.git"
|
||||
, gitBranch ? "master"
|
||||
, gitCommit ? "16f92094ca6da25e2f561c000f5fbc2901944f7b"
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
assert enableOvni -> (ovni != null);
|
||||
|
||||
let
|
||||
release = rec {
|
||||
version = "3.0";
|
||||
@ -48,7 +55,8 @@ in stdenv.mkDerivation rec {
|
||||
boost
|
||||
mpi
|
||||
gcc
|
||||
];
|
||||
] ++ optional (enableOvni) ovni;
|
||||
configureFlags = optional (enableOvni) "--with-ovni=${ovni}";
|
||||
dontDisableStatic = true;
|
||||
hardeningDisable = [ "all" ];
|
||||
}
|
||||
|
46
test/compilers/clang-openmp-ld.nix
Normal file
46
test/compilers/clang-openmp-ld.nix
Normal file
@ -0,0 +1,46 @@
|
||||
{
|
||||
stdenv
|
||||
, writeText
|
||||
, openmp
|
||||
}:
|
||||
|
||||
let
|
||||
hello_c = writeText "hello.c" ''
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#pragma omp parallel
|
||||
{
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
'';
|
||||
|
||||
in stdenv.mkDerivation {
|
||||
pname = "openmp-test-ld";
|
||||
version = "1.0.0";
|
||||
|
||||
dontUnpack = true;
|
||||
dontConfigure = true;
|
||||
|
||||
# nOS-V requires access to /sys/devices to request NUMA information. It will
|
||||
# fail to run otherwise, so we disable the sandbox for this test.
|
||||
__noChroot = true;
|
||||
|
||||
buildInputs = [ openmp ];
|
||||
|
||||
buildPhase = ''
|
||||
set -x
|
||||
|
||||
cp ${hello_c} hello.c
|
||||
clang -fopenmp=libompv ./hello.c -o hello
|
||||
|
||||
set +x
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
touch $out
|
||||
'';
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user