Skip to content

bug: mkmf + fixsystem relies on the FC variable in the makefile being the name of the compiler #870

@hkershaw-brown

Description

@hkershaw-brown

🐛 Your bug may already be reported!

Describe the bug

  1. List the steps someone needs to take to reproduce the bug.
    Build dart on a machine such as Perlmutter, where the recommended compiler wrapper is ftn.
    FC = ftn
    Or in EMSFx containers where the compiler is gfortran-version
  2. What was the expected outcome?
    You can build DART
  3. What actually happened?
    DART fails to build

Error Message

ftn types_mod.o null_mpi_utilities_mod.o parse_args_mod.o preprocess.o utilities_mod.o time_manager_mod.o -o /global/u2/h/hkershaw/DART/DART/assimilation_code/programs/preprocess/preprocess  -O2 -ffree-line-length-none -I/opt/cray/pe/netcdf/4.9.0.13/gnu/12.3/include -L/opt/cray/pe/netcdf/4.9.0.13/gnu/12.3/lib -lnetcdff -lnetcdf
/usr/lib64/gcc/x86_64-suse-linux/13/../../../../x86_64-suse-linux/bin/ld: null_mpi_utilities_mod.o: in function `__mpi_utilities_mod_MOD_shell_execute':
null_mpi_utilities_mod.f90:(.text+0x391): undefined reference to `system_'
collect2: error: ld returned 1 exit status
make: *** [Makefile:45: /global/u2/h/hkershaw/DART/DART/assimilation_code/programs/preprocess/preprocess] Error 1

You can set FC = gfortran

MPIFC = ftn
MPILD = ftn
FC = gfortran
LD = ftn

but then you loose the compiler wrapper functionality (e.g. linking to netcdf, whatever else they have set up on the machine).

Which model(s) are you working with?

ESM3, lorenz_96, all models.

Version of DART

Which version of DART are you using?
You can find the version using git describe --tags
v11.10.9

Have you modified the DART code?

No

Build information

Please describe:

  1. Perlmutter
  2. The compiler you are using (e.g. gnu, intel). GNU Fortran (SUSE Linux) 13.2.1 20240206

Metadata

Metadata

Assignees

Labels

build-systemissues related to building dartpmppossible Marlee project

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions