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>
This commit is contained in:
parent
8ceaddfea7
commit
3ed644b88f
@ -79,6 +79,9 @@ in bscPkgs // {
|
||||
clangNosvOpenmp-nosv = callPackage ./test/compilers/clang-openmp-nosv.nix {
|
||||
stdenv = final.stdenvClangOmpss2Nodes;
|
||||
};
|
||||
clangNosvOpenmp-ld = callPackage ./test/compilers/clang-openmp-ld.nix {
|
||||
stdenv = final.stdenvClangOmpss2Nodes;
|
||||
};
|
||||
};
|
||||
|
||||
pkgs = final.runCommand "ci-pkgs" { }
|
||||
|
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