Skip to content

Commit

Permalink
conda: Macros: add '-L' argument to the linker command (CICE-Consorti…
Browse files Browse the repository at this point in the history
…um#418)

On Linux, compiling CICE in serial mode under the conda environment
currently fails as the linker does not find the NetCDF libraries.

Compiling in parallel mode does work as the MPI compilation wrappers
seem to pass the necessary flag to the linker under the hood.

Explicitely tell the linker the location of the libraries using the
`SLIBS` variable in the Macros file. To be on the safe side, also do it
on macOS.
  • Loading branch information
phil-blain committed Mar 26, 2020
1 parent 5f97e45 commit 9040fe2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion configuration/scripts/machines/Macros.conda_linux
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ LD:= $(FC)
MODDIR += -I$(CONDA_PREFIX)/include

# Libraries to be passed to the linker
SLIBS := -lnetcdf -lnetcdff
SLIBS := -L$(CONDA_PREFIX)/lib -lnetcdf -lnetcdff

# Necessary flag to compile with OpenMP support
ifeq ($(ICE_THREADED), true)
Expand Down
2 changes: 1 addition & 1 deletion configuration/scripts/machines/Macros.conda_macos
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ MODDIR += -I$(CONDA_PREFIX)/include
CFLAGS_HOST = -isysroot$(shell xcrun --show-sdk-path)

# Libraries to be passed to the linker
SLIBS := -lnetcdf -lnetcdff
SLIBS := -L$(CONDA_PREFIX)/lib -lnetcdf -lnetcdff

# Necessary flag to compile with OpenMP support
ifeq ($(ICE_THREADED), true)
Expand Down

0 comments on commit 9040fe2

Please sign in to comment.