Fix mpich cross compilation and clean up tagaspi #213

Open
abonerib wants to merge 7 commits from abonerib/jungle:fix/cross-mpich into master
Collaborator

mpich seems to work (although we lose fortran support when cross compiling). This also fixed its dependants:

  • cross.riscv64.osumb
  • cross.riscv64.sonar
  • cross.riscv64.tampi

tagaspi gpi-2 for tagaspi fails in configure phase still:

<...>
----------------------
   Checking for MPI
----------------------
checking for /nix/store/pjz8q4a8v10m43xm9d2vvbg48qca7pw9-mpi-all/include/mpi.h... configure: error: cannot check for file existence when cross compiling

Details in weasel:
http://weasel:3001/jobset/bscpkgs/fix-cross

mpich seems to work (although we lose fortran support when cross compiling). This also fixed its dependants: - `cross.riscv64.osumb` - `cross.riscv64.sonar` - `cross.riscv64.tampi` ~tagaspi~ gpi-2 for tagaspi fails in configure phase still: ``` <...> ---------------------- Checking for MPI ---------------------- checking for /nix/store/pjz8q4a8v10m43xm9d2vvbg48qca7pw9-mpi-all/include/mpi.h... configure: error: cannot check for file existence when cross compiling ``` Details in weasel: http://weasel:3001/jobset/bscpkgs/fix-cross
abonerib added the
mpi
label 2025-10-30 12:21:27 +01:00
abonerib added 2 commits 2025-10-30 12:21:27 +01:00
Fix cross for tagaspi
All checks were successful
CI / build:cross (pull_request) Successful in 5s
CI / build:all (pull_request) Successful in 18m8s
89442e6af8
abonerib added the
cross
label 2025-10-30 12:25:42 +01:00
Owner

Thanks!

mpich seems to work (although we lose fortran support when cross compiling). This also fixed its dependants:

  • cross.riscv64.osumb
  • cross.riscv64.sonar
  • cross.riscv64.tampi

Can we enable cross = true on those?

tagaspi fails in configure phase still:

<...>
----------------------
   Checking for MPI
----------------------
checking for /nix/store/pjz8q4a8v10m43xm9d2vvbg48qca7pw9-mpi-all/include/mpi.h... configure: error: cannot check for file existence when cross compiling

We may be able to patch it to follow what TAMPI is doing. Not sure if anybody maintains it anymore.

Thanks! > mpich seems to work (although we lose fortran support when cross compiling). This also fixed its dependants: > > - `cross.riscv64.osumb` > - `cross.riscv64.sonar` > - `cross.riscv64.tampi` Can we enable `cross = true` on those? > tagaspi fails in configure phase still: > ``` > <...> > ---------------------- > Checking for MPI > ---------------------- > checking for /nix/store/pjz8q4a8v10m43xm9d2vvbg48qca7pw9-mpi-all/include/mpi.h... configure: error: cannot check for file existence when cross compiling > ``` We may be able to patch it to follow what TAMPI is doing. Not sure if anybody maintains it anymore.
abonerib force-pushed fix/cross-mpich from 89442e6af8 to a17ad0417d 2025-10-30 15:11:34 +01:00 Compare
abonerib force-pushed fix/cross-mpich from a17ad0417d to ee7daa3922 2025-10-30 15:18:36 +01:00 Compare
abonerib force-pushed fix/cross-mpich from ee7daa3922 to a4e0c14e5c 2025-10-30 15:35:49 +01:00 Compare
abonerib changed title from WIP: Fix mpich and tagaspi cross compilation to Fix mpich cross compilation and clean up tagaspi 2025-10-30 16:51:04 +01:00
abonerib force-pushed fix/cross-mpich from a4e0c14e5c to 31302d4a97 2025-10-30 17:00:03 +01:00 Compare
abonerib force-pushed fix/cross-mpich from 31302d4a97 to 81fa5392bc 2025-10-30 17:23:41 +01:00 Compare
abonerib force-pushed fix/cross-mpich from 81fa5392bc to 00e7bafb6b 2025-10-30 17:40:56 +01:00 Compare
abonerib force-pushed fix/cross-mpich from 00e7bafb6b to 8f96735e85 2025-10-30 18:08:54 +01:00 Compare
Author
Collaborator

osu micro bencharks breaks since it uses:

configureFlags = [
      "CC=mpicc"
      "CXX=mpicxx"
];

With the patch to do CC=${CC:-gcc} mpicc references itself.

EDIT: I'm going to leave it as CC=gcc for now.

osu micro bencharks breaks since it uses: ``` configureFlags = [ "CC=mpicc" "CXX=mpicxx" ]; ``` With the patch to do `CC=${CC:-gcc}` mpicc references itself. EDIT: I'm going to leave it as `CC=gcc` for now.
abonerib force-pushed fix/cross-mpich from 8f96735e85 to ad4d3f6719 2025-10-30 18:33:28 +01:00 Compare
abonerib added 2 commits 2025-10-31 11:22:21 +01:00
Fix osu cross-compilation
All checks were successful
CI / build:cross (pull_request) Successful in 13m47s
CI / build:all (pull_request) Successful in 20m1s
4778cb3b5e
abonerib reviewed 2025-10-31 11:26:55 +01:00
@ -35,0 +49,4 @@
sed -i 's:^CC=.*:CC=${targetPackages.stdenv.cc}/bin/${targetPackages.stdenv.cc.targetPrefix}cc:' $out/bin/mpicc
sed -i 's:^CXX=.*:CXX=${targetPackages.stdenv.cc}/bin/${targetPackages.stdenv.cc.targetPrefix}++:' $out/bin/mpicxx
'' + lib.optionalString enableFortran ''
sed -i 's:^FC=.*:FC=${targetPackages.gfortran or gfortran}/bin/${targetPackages.gfortran.targetPrefix or gfortran.targetPrefix}gfortran:' $out/bin/mpifort
Author
Collaborator

I noticed openmpi nixpkgs they use targetPacages.gfortran or gfortran daf6dc47aa/pkgs/by-name/op/openmpi/package.nix (L189)

Not sure if we should also do that in our openmpi.

I noticed openmpi nixpkgs they use `targetPacages.gfortran or gfortran` https://github.com/NixOS/nixpkgs/blob/daf6dc47aa4b44791372d6139ab7b25269184d55/pkgs/by-name/op/openmpi/package.nix#L189 Not sure if we should also do that in our openmpi.
Owner

Currently we don't use the openmpi package of jungle, so I wouldn't change it.

Currently we don't use the openmpi package of jungle, so I wouldn't change it.
abonerib force-pushed fix/cross-mpich from 4778cb3b5e to 12abc41e48 2025-10-31 11:44:44 +01:00 Compare
abonerib requested review from rarias 2025-10-31 11:45:10 +01:00
abonerib force-pushed fix/cross-mpich from 12abc41e48 to 100e4e7029 2025-10-31 11:54:09 +01:00 Compare
abonerib force-pushed fix/cross-mpich from 100e4e7029 to 4752afae0c 2025-10-31 11:57:18 +01:00 Compare
abonerib force-pushed fix/cross-mpich from 4752afae0c to 32a2b87313 2025-10-31 12:22:54 +01:00 Compare
rarias reviewed 2025-10-31 13:25:39 +01:00
rarias left a comment
Owner

Thanks!

Thanks!
@ -60,5 +70,6 @@ stdenv.mkDerivation rec {
maintainers = with lib.maintainers.bsc; [ rarias ];
platforms = lib.platforms.linux;
license = lib.licenses.gpl3Plus;
cross = false;
Owner

Can we add a comment here on why is broken? Maybe also in the --with-mpi=yes above.

Can we add a comment here on why is broken? Maybe also in the `--with-mpi=yes` above.
All checks were successful
CI / build:cross (pull_request) Successful in 12s
CI / build:all (pull_request) Successful in 15s
This pull request can be merged automatically.
You are not authorized to merge this pull request.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u fix/cross-mpich:abonerib-fix/cross-mpich
git checkout abonerib-fix/cross-mpich
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: rarias/jungle#213
No description provided.