Add clang openmp test for CI
Reviewed-By: Rodrigo Arias Mallo <rodrigo.arias@bsc.es> Tested-By: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
This commit is contained in:
parent
8d5714c67b
commit
f605f8e5e4
@ -75,6 +75,9 @@ in bscPkgs // {
|
||||
clangNodes-task = callPackage ./test/compilers/ompss2.nix {
|
||||
stdenv = final.stdenvClangOmpss2Nodes;
|
||||
};
|
||||
clangNosvOpenmp-task = callPackage ./test/compilers/clang-openmp.nix {
|
||||
stdenv = final.stdenvClangOmpss2OpenmpNodes;
|
||||
};
|
||||
};
|
||||
|
||||
pkgs = final.runCommand "ci-pkgs" { }
|
||||
|
46
test/compilers/clang-openmp.nix
Normal file
46
test/compilers/clang-openmp.nix
Normal file
@ -0,0 +1,46 @@
|
||||
{
|
||||
stdenv
|
||||
, writeText
|
||||
}:
|
||||
|
||||
let
|
||||
hello_c = writeText "hello.c" ''
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int test = 1;
|
||||
#pragma omp parallel
|
||||
#pragma omp single
|
||||
#pragma omp task
|
||||
test = 0;
|
||||
|
||||
return test;
|
||||
}
|
||||
'';
|
||||
|
||||
in stdenv.mkDerivation {
|
||||
pname = "openmp-test";
|
||||
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;
|
||||
|
||||
buildPhase = ''
|
||||
set -x
|
||||
|
||||
cp ${hello_c} hello.c
|
||||
clang -fopenmp ./hello.c -o hello
|
||||
./hello
|
||||
|
||||
set +x
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
touch $out
|
||||
'';
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user