diff --git a/garlic/apps/hpccg/default.nix b/garlic/apps/hpccg/default.nix index 0799aad..778dd2a 100644 --- a/garlic/apps/hpccg/default.nix +++ b/garlic/apps/hpccg/default.nix @@ -1,44 +1,53 @@ { stdenv -, nanos6 -, mpi -, mcxx -, tampi , icc +, mpi ? null +, tampi ? null +, mcxx ? null +, gitBranch ? "garlic/mpi+isend+seq" +, gitCommit ? null +, garlicTools }: +assert !(tampi != null && mcxx == null); + +with stdenv.lib; + +let + gitSource = garlicTools.fetchGarlicApp { + appName = "hpccg"; + inherit gitCommit gitBranch; + gitTable = import ./git-table.nix; + }; +in stdenv.mkDerivation rec { name = "hpccg"; - src = builtins.fetchGit { - url = "ssh://git@bscpm03.bsc.es/mmaronas/HPCCG.git"; - ref = "mmaronas-development"; - }; + inherit (gitSource) src gitBranch gitCommit; + + programPath = "/bin/test_HPCCG-mpi.exe"; buildInputs = [ - nanos6 - mpi icc - tampi - mcxx - ]; + ] + ++ optional (mpi != null) mpi + ++ optional (tampi != null) tampi + ++ optional (mcxx != null) mcxx; # The hpccg app fails to compile in parallel. Makefile must be fixed before. enableParallelBuilding = false; - postPatch = '' - sed -i 's/mpic++/mpiicpc/g' Makefile - sed -i 's/g++/icpc/g' Makefile - mkdir obj - ''; - - makeFlags = [ + makeFlags = [ "USE_MPI=-DUSING_MPI" - "TAMPI_HOME=${tampi}" - ]; + ] + ++ optional (tampi != null) "TAMPI_HOME=${tampi}"; + + dontPatchShebangs = true; installPhase = '' + echo ${tampi} mkdir -p $out/bin - cp test_HPCCG* $out/bin + cp test_HPCCG-mpi.exe $out/bin ''; + } diff --git a/garlic/apps/hpccg/git-table.nix b/garlic/apps/hpccg/git-table.nix new file mode 100644 index 0000000..507dab2 --- /dev/null +++ b/garlic/apps/hpccg/git-table.nix @@ -0,0 +1,9 @@ +{ + # Auto-generated with garlic-git-table on 2021-04-20 for repo: + # ssh://git@bscpm03.bsc.es/garlic/apps/hpccg.git + + "garlic/mpi+isend+omp+fork" = "c84af0480d231961201f2904ee4e3fced9d5f9be"; + "garlic/mpi+isend+seq" = "d1b47cd459440700de1b68233ec4fe794343dbd4"; + "garlic/tampi+isend+oss+task" = "7238e9be2e4a7b028abc05d40b476462eaa3de6a"; + "garlic/tampi+isend+oss+taskfor" = "02ec60f43b8d68d74575ea0563a9029fd441f1f1"; +}