Reviewed-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es> Tested-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
		
			
				
	
	
		
			46 lines
		
	
	
		
			641 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
			
		
		
	
	
			46 lines
		
	
	
		
			641 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
{ 
 | 
						|
  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
 | 
						|
  requiredSystemFeatures = [ "sys-devices" ];
 | 
						|
 | 
						|
  buildPhase = ''
 | 
						|
    set -x
 | 
						|
 | 
						|
    cp ${hello_c} hello.c
 | 
						|
    clang -fopenmp ./hello.c -o hello
 | 
						|
    ./hello
 | 
						|
 | 
						|
    set +x
 | 
						|
  '';
 | 
						|
 | 
						|
  installPhase = ''
 | 
						|
    touch $out
 | 
						|
  '';
 | 
						|
 | 
						|
}
 | 
						|
 |