Fix mpich cross compilation and clean up tagaspi #213
@ -6,6 +6,12 @@
 | 
				
			|||||||
, pmix
 | 
					, pmix
 | 
				
			||||||
, gfortran
 | 
					, gfortran
 | 
				
			||||||
, symlinkJoin
 | 
					, symlinkJoin
 | 
				
			||||||
 | 
					# Disabled when cross-compiling
 | 
				
			||||||
 | 
					# To fix cross compilation, we should fill the values in:
 | 
				
			||||||
 | 
					# https://github.com/pmodels/mpich/blob/main/maint/fcrosscompile/cross_values.txt.in
 | 
				
			||||||
 | 
					# For each arch
 | 
				
			||||||
 | 
					, enableFortran ? stdenv.hostPlatform == stdenv.buildPlatform
 | 
				
			||||||
 | 
					, perl
 | 
				
			||||||
}:
 | 
					}:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
let
 | 
					let
 | 
				
			||||||
@ -15,10 +21,13 @@ let
 | 
				
			|||||||
    paths = [ pmix.dev pmix.out ];
 | 
					    paths = [ pmix.dev pmix.out ];
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
in mpich.overrideAttrs (old: {
 | 
					in mpich.overrideAttrs (old: {
 | 
				
			||||||
  buildInput = old.buildInputs ++ [
 | 
					  buildInputs = old.buildInputs ++ [
 | 
				
			||||||
    libfabric
 | 
					    libfabric
 | 
				
			||||||
    pmixAll
 | 
					    pmixAll
 | 
				
			||||||
  ];
 | 
					  ];
 | 
				
			||||||
 | 
					  nativeBuildInputs = old.nativeBuildInputs ++ [
 | 
				
			||||||
 | 
					    perl
 | 
				
			||||||
 | 
					  ];
 | 
				
			||||||
  configureFlags = [
 | 
					  configureFlags = [
 | 
				
			||||||
    "--enable-shared"
 | 
					    "--enable-shared"
 | 
				
			||||||
    "--enable-sharedlib"
 | 
					    "--enable-sharedlib"
 | 
				
			||||||
@ -31,7 +40,17 @@ in mpich.overrideAttrs (old: {
 | 
				
			|||||||
  ] ++ lib.optionals (lib.versionAtLeast gfortran.version "10") [
 | 
					  ] ++ lib.optionals (lib.versionAtLeast gfortran.version "10") [
 | 
				
			||||||
    "FFLAGS=-fallow-argument-mismatch" # https://github.com/pmodels/mpich/issues/4300
 | 
					    "FFLAGS=-fallow-argument-mismatch" # https://github.com/pmodels/mpich/issues/4300
 | 
				
			||||||
    "FCFLAGS=-fallow-argument-mismatch"
 | 
					    "FCFLAGS=-fallow-argument-mismatch"
 | 
				
			||||||
 | 
					  ] ++ lib.optionals (!enableFortran) [
 | 
				
			||||||
 | 
					    "--disable-fortran"
 | 
				
			||||||
  ];
 | 
					  ];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  preFixup = ''
 | 
				
			||||||
 | 
					    sed -i 's:^CC=.*:CC=gcc:' $out/bin/mpicc
 | 
				
			||||||
 | 
					    sed -i 's:^CXX=.*:CXX=g++:' $out/bin/mpicxx
 | 
				
			||||||
 | 
					  '' + lib.optionalString enableFortran ''
 | 
				
			||||||
 | 
					    sed -i 's:^FC=.*:FC=gfortran:' $out/bin/mpifort
 | 
				
			||||||
 | 
					  '';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  hardeningDisable = [ "all" ];
 | 
					  hardeningDisable = [ "all" ];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  meta = old.meta // {
 | 
					  meta = old.meta // {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user