Compare commits

...

10 Commits

Author SHA1 Message Date
chn
a66eb7e404 fix oneapi 2024-09-21 03:40:30 +08:00
Rodrigo Arias Mallo
de89197a4a Add bigotes package
Reviewed-by: Aleix Roca Nonell <aleix.rocanonell@bsc.es>
Tested-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
2024-04-24 17:59:24 +02:00
Rodrigo Arias Mallo
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
Aleix Roca Nonell
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
Rodrigo Arias Mallo
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
Aleix Roca Nonell
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
Aleix Roca Nonell
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
Aleix Roca Nonell
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
13 changed files with 163 additions and 21 deletions

View File

@ -11,10 +11,11 @@ let
bscPkgs = {
bench6 = callPackage ./pkgs/bench6/default.nix { };
bigotes = callPackage ./pkgs/bigotes/default.nix { };
clangOmpss2 = callPackage ./pkgs/llvm-ompss2/default.nix { };
openmp = callPackage ./pkgs/llvm-ompss2/openmp.nix { monorepoSrc = final.clangOmpss2Unwrapped.src; version = final.clangOmpss2Unwrapped.version; };
clangOmpss2Nanos6 = callPackage ./pkgs/llvm-ompss2/default.nix { ompss2rt = final.nanos6; };
clangOmpss2Nodes = callPackage ./pkgs/llvm-ompss2/default.nix { ompss2rt = final.nodes; };
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 { };
#extrae = callPackage ./pkgs/extrae/default.nix { }; # Broken and outdated
gpi-2 = callPackage ./pkgs/gpi-2/default.nix { };
@ -30,6 +31,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; };
@ -40,6 +43,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; };
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,8 +80,11 @@ in bscPkgs // {
clangNosvOpenmp-task = callPackage ./test/compilers/clang-openmp.nix {
stdenv = final.stdenvClangOmpss2Nodes;
};
clangNosvOpenmp-nosv = callPackage ./test/compilers/clang-openmp-nosv.nix {
stdenv = final.stdenvClangOmpss2Nodes;
clangNosvOmpv-nosv = callPackage ./test/compilers/clang-openmp-nosv.nix {
stdenv = final.stdenvClangOmpss2NodesOmpv;
};
clangNosvOmpv-ld = callPackage ./test/compilers/clang-openmp-ld.nix {
stdenv = final.stdenvClangOmpss2NodesOmpv;
};
};

17
pkgs/bigotes/default.nix Normal file
View File

@ -0,0 +1,17 @@
{
stdenv
, fetchFromGitHub
, cmake
}:
stdenv.mkDerivation rec {
pname = "bigotes";
version = "9dce13";
src = fetchFromGitHub {
owner = "rodarima";
repo = "bigotes";
rev = "9dce13446a8da30bea552d569d260d54e0188518";
sha256 = "sha256-ktxM3pXiL8YXSK+/IKWYadijhYXqGoLY6adLk36iigE=";
};
buildInputs = [ cmake ];
}

View File

@ -200,6 +200,7 @@ let
libxml2
hwloc
stdenv.cc.cc.lib
zlib
];
nativeBuildInputs = [ autoPatchelfHook ];
@ -397,6 +398,8 @@ let
echo "-L${intel-compiler-shared}/lib" >> $out/nix-support/cc-ldflags
echo "-L${cc}/lib" >> $out/nix-support/cc-ldflags
cp ${mygcc}/nix-support/cc-cflags-before $out/nix-support
# Need the gcc in the path
echo 'export "PATH=${mygcc}/bin:$PATH"' >> $out/nix-support/cc-wrapper-hook

View File

@ -23,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=";
};
};
@ -113,8 +113,9 @@ 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}"
)
'';
# 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

@ -9,30 +9,38 @@
, 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";
pname = "openmp" + (lib.optionalString enableNosv "-v");
inherit version;
src = runCommand "${pname}-src" {} ''
mkdir -p "$out"
cp -r ${monorepoSrc}/cmake "$out"
cp -r ${monorepoSrc}/${pname} "$out"
cp -r ${monorepoSrc}/openmp "$out"
'';
sourceRoot = "${src.name}/${pname}";
sourceRoot = "${src.name}/openmp";
nativeBuildInputs = [
cmake
ninja
perl
pkg-config
] ++ lib.optionals enableNosv [
nosv
] ++ lib.optionals enableOvni [
ovni
];
doCheck = false;
@ -43,15 +51,25 @@ stdenv.mkDerivation rec {
dontStrip = enableDebug;
separateDebugInfo = true;
cmakeFlags = [
"-DLIBOMP_OMPD_SUPPORT=OFF"
"-DOPENMP_ENABLE_LIBOMPTARGET=OFF"
];
# Remove support for GNU and Intel Openmp
# 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

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

View File

@ -2,7 +2,6 @@
stdenv
, nosv
, writeText
, openmp
}:
let
@ -41,7 +40,7 @@ in stdenv.mkDerivation {
# fail to run otherwise, so we disable the sandbox for this test.
__noChroot = true;
buildInputs = [ nosv openmp ];
buildInputs = [ nosv ];
buildPhase = ''
set -x

View File

@ -1,7 +1,6 @@
{
stdenv
, writeText
, openmp
}:
let
@ -29,8 +28,6 @@ in stdenv.mkDerivation {
# fail to run otherwise, so we disable the sandbox for this test.
__noChroot = true;
buildInputs = [ openmp ];
buildPhase = ''
set -x