geodynamics/axisem

ld: library not found for -lnetcdf collect2: error: ld returned 1 exit status

Closed this issue · 3 comments

I am very new to programming. I am trying to install AXISEM and it has a makefile that throws me the following error:

ld: library not found for -lnetcdf
collect2: error: ld returned 1 exit status

The part of code where the error is thrown is the following
ifeq ($(strip $(USE_NETCDF)),true)
FFLAGS += -Dunc
ifdef NETCDF_PATH
LIBS = -L $(strip $(NETCDF_PATH))/lib -lnetcdff -Wl,-rpath,$(strip $(NETCDF_PATH))/lib
INCLUDE = -I $(strip $(NETCDF_PATH))/include
else
LIBS = -lnetcdff
INCLUDE = -I /usr/include
endif
else
LIBS =
INCLUDE =
endif

Thanks in advance if anyone can help me.

Hi @davidn182 ,

It seems to me, that the code cannot find netcdf. Did you install it?

Hi thanks, I uninstall and reinstall netcdf and that solved the problem.

Great, I'm closing the issue