Compare commits

..

10 Commits

Author SHA1 Message Date
5d3820631a Fix Nanos6 4.0 build
It looks like after upgrading the compiler the build breaks. The patch
simply adds the missing cstdint include, until a new release is made.

Reviewed-by: Aleix Roca Nonell <aleix.rocanonell@bsc.es>
Tested-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
2024-04-23 12:03:49 +02:00
9c8a077828 Enable separatedebuginfo for openmp
Reviewed-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
Tested-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
2024-04-12 12:27:54 +02:00
fce556cb28 Build OmpSs-2 LLVM with commit version information
Allows users to see which commit (or git tag) was used in clang.
Examples for the release and git versions:

% clang --version
clang version 18.0.0 (18.0.0-ompss-2)

% clang --version
clang version 18.0.0 (0a6d6c6)

Reviewed-by: Aleix Roca Nonell <aleix.rocanonell@bsc.es>
Tested-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
2024-03-14 14:13:14 +01:00
37ce5ef391 Paraver: Use wrapGApps Hook for nixos
Needed to fix the error on NixOS:

  GLib-GIO-ERROR **: No GSettings schemas are installed on the system

See https://github.com/NixOS/nixpkgs/issues/16285

Reviewed-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
Tested-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
2024-02-15 16:06:29 +01:00
Raúl Peñacoba
3b21a32d83 Add ovni to OpenMP-V
Allows building OpenMP-V with ovni support, which is neccessary to run
the runtime tests of OpenMP-V in ovni.

Reviewed-by: Aleix Roca Nonell <aleix.rocanonell@bsc.es>
Reviewed-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
Tested-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
2024-01-15 10:20:46 +01:00
c4d5135fde Split openmp versions in separate derivations
The openmp derivation provides both libomp and libompv. To avoid
accidentally linking with the wrong library and to avoid the nosv
dependency on libomp, this patch separates each version in a different
derivation.

Also, it adapts the clang wrappers and stdenvs to provide an stdenv per
openmp library where each openmp will be used by default when the
compiler flag "-fopenmp" is used. This eases linking ompv with nixpkgs
libraries, such as blis, that expect openmp to be provided with stdenv.

Reviewed-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
Tested-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
2023-12-07 18:01:20 +01:00
3f2b9a766b Update clang with internal bug release
Reviewed-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
2023-12-07 18:01:08 +01:00
Raúl Peñacoba
3ed644b88f Add clangNosvOpenmp-ld compiler test
Add a test to verify that "clang -fopenmp=libompv" links correctly with
nOS-V even though it is not placed in the buildInputs.

Reviewed-by: Aleix Roca Nonell <aleix.rocanonell@bsc.es>
Reviewed-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
Tested-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
2023-12-01 16:35:24 +01:00
Raúl Peñacoba
8ceaddfea7 Split OpenMP from Clang in LLVM
As the OpenMP-V implementation requires to be built with nOS-V, we can
split the OpenMP package in a different derivation to prevent rebuilds
of clang. Additionally, as OpenMP-V now can be build alongside the
vanilla OpenMP runtime, we simply build a single openmp derivation with
both runtimes. Only a single build of the clang compiler is now
required.

Reviewed-by: Aleix Roca Nonell <aleix.rocanonell@bsc.es>
Reviewed-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
2023-12-01 16:31:56 +01:00
2a953d811c Build TAMPI with ovni support
By default we build TAMPI with ovni support, as it will be disabled in
runtime unless explicitly enabled by the TAMPI_INSTRUMENT=ovni
environment variable.

Reviewed-by: Aleix Roca Nonell <aleix.rocanonell@bsc.es>
2023-11-29 17:49:30 +01:00
10 changed files with 205 additions and 30 deletions

View File

@ -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;
};
};

View File

@ -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

View File

@ -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

View 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;
};
}

View 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

View File

@ -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;
};
}
})

View File

@ -84,6 +84,6 @@ in
];
passthru = {
nosv = nosv;
inherit nosv;
};
}

View File

@ -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

View File

@ -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" ];
}

View 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
'';
}