[MITgcm-support] Compiling problem by ifort: undefined reference to '_gfortran_st_write'

Martin Losch Martin.Losch at awi.de
Tue Feb 9 02:14:25 EST 2021


Hi Shawn,

normally you don’t have to add “-lmpi" to the build options file. For MPI simulations it’s important that you add the -mpi flag to genmake2 and that you know where your mpi include files are.
Before you run genmake2 set the enviroment flag MPI_INC_DIR to the location of your mpifiles. E.g. on my laptop I installed OpenMP and have this:

>> echo $MPI_INC_DIR
/opt/local/include/openmpi-mp
>> ls /opt/local/include/openmpi-mp
mpi-ext.h               mpi_portable_platform.h mpif-config.h           mpif-ext.h              mpif-handles.h          mpif-io-handles.h       mpif-sizeof.h           openmpi
mpi.h                   mpif-c-constants-decl.h mpif-constants.h        mpif-externals.h        mpif-io-constants.h     mpif-sentinels.h        mpif.h

it’s important that “mpif.h” is also in that directory.

Martin


> On 9. Feb 2021, at 07:49, H.W. Shu <shawn_chou at ees.hokudai.ac.jp> wrote:
> 
> Dear MITgcm users, 
> 
> Hello, this is Shawn from Hokkaido University.
> We are trying compiling an mpi run in our system by default compiler in 
> tools/build_options: linux_amd64_ifort
> (we added "-lmpi -03" in flags.)
> 
> However, in the process of Make,
> it told us that "undefined reference to '_gfortran_st_write_done'" and " 
> undefined reference to '_gfortran_transfer'".
> and leaved by this error. 
> 
> I am not familiar with compile problems, 
> I will really appreciate if can get any hint to start to fix the problem.
> 
> Thank you really much,
> 
> Best regards,
> Shawn
> 
> 
> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1665 bytes
Desc: not available
URL: <http://mailman.mitgcm.org/pipermail/mitgcm-support/attachments/20210209/cbd2172a/attachment.p7s>


More information about the MITgcm-support mailing list