I have an account on a cluster which I access through SSH. The cluster uses Red Hat. My account does not have root privileges.
I do not have gfortran installed but I need it to compile a program that I will be using. This program is a Python wrapper of a Fortran code, which uses MPI.
I followed this brilliant answer to create a conda environment with Fortran compilers.
I activate the environment and then try to run python setup.py install
for my Python code. I get this error:
/disk/username/bin/x86_64-conda-linux-gnu-gfortran -ffree-line-length-none -cpp -fPIC -fno-stack-arrays -Ofast -DMPI -c utils.F90
utils.F90:5: Error: Can't open included file 'mpif.h'
Then I try to modify the Makefile of the original Fortran code, including an explicit reference to where mpif.h
is, with -I/path/to/conda/environment/include
, following this other brilliant SO answer. This helps, and the installation is then complete.
However, when I try to import
the Python package I get the following error:
ImportError: undefined symbol: mpi_allreduce_
What is going wrong? Incidentally, if I compile the Fortran code without MPI, everything works fine.