Can fpm work in ARM cluster

Dear all:

May I ask if is there ARM based fpm binary that can be downloaded and compile on the ARM cluster? Or is it possible that I can use fpm to compile a binary file locally that can be run on the cluster?

Thank you!


Without knowing more about your platform, you can try using the bootstrap instructions at GitHub - fortran-lang/fpm: Fortran Package Manager (fpm)
for the single file build; but without knowing what operating system you have installed, what Fortran compiler you have, … this cannot be directly answered. fpm has been built with at least gfortran and the Intel ifort compiler; but I do not know if it compiles with the Arm Fortran compiler, for example.

Hi @urbanjost, thank you so much for your quick reply!

Sorry for the lack of clarity in my question. The local computer operating system is either windows or arch linux, and the ARM cluster is redhat. The compiler I am using now is either gfortran or ifort.

I think thinking of a possible way to deal with this without recompiling fpm itself into the ARM-compatible way, i.e., use fpm build with the fortran compiler that can generate the executable that can run on the ARM cluster. Is this something that is doable?



I think you are referring to the concept of cross-compilation. I don’t think fpm has anything to assist in that. You probably need a special compiler for that see cross-compiling for arm64 target on x86_64 host? · Issue #15 · fxcoudert/gfortran-for-macOS · GitHub.

It would be easier to just build fpm on your cluster with the Fortran ARM compiler, upload your code, compile it with fpm and run the job.


We do cross-compilation for and with fpm already to create MacOS/Arm64 binaries on conda-forge. The workflow boils down to

mkdir _tmp
curl -LJ > _tmp/fpm.F90
$FC_FOR_BUILD -J _tmp _tmp/fpm.F90 -o _tmp/fpm
_tmp/fpm install --flag "-g -fbacktrace -O3" --compiler $FC_FOR_HOST --c-compiler $CC_FOR_HOST
rm -r _tmp

Where FC_FOR_HOST is the path to the native Fortran compiler, and FC_FOR_HOST / CC_FOR_HOST are the Fortran / C cross-compilers, respectively.

As an aside, we already provide Linux/aarch64 binaries via conda-forge: GitHub - conda-forge/fpm-feedstock: A conda-smithy repository for fpm.

1 Like

Sorry for late reply, I will try it!