Tuesday, December 5, 2023
rated 0 times [  0] [ 0]  / answers: 1 / hits: 585  / 2 Years ago, sun, march 27, 2022, 11:46:17

I want to install and run SURFEX on Ubuntu 18.04, so I'm following the steps explained here. when I run the make command in the src directory (compiling the master version of the code), after a while I get an error that says:

configure: error: Could not link to netcdf C library. Please set LDFLAGS; for static builds set LIBS to the results of nc-config --libs.

I tried this solution in the step before "make", i.e.

CFLAGS=$(nc-config --cflags) LDFLAGS=$(nc-config --libs) ./configure


CFLAGS=$(nc-config --cflags) LDFLAGS=$(nc-config --libs) . ../conf/profile_surfex-LXgfortran-SFX-V8-1-1-MPIAUTO-O2-X0

but I couldn't resolve the problem, probably because I don't know what I am doing. Could someone tell me how I set those flags?

More From » software-installation


I faced the same problem with Ubuntu 20.04 and this solution of theWrongAlice did the trick for me as well.

Installing libcurl4-gnutls-dev:

sudo apt-get install -y libcurl4-gnutls-dev

And before make:

CFLAGS=$(nc-config --cflags) LDFLAGS=$(nc-config --libs) ./configure

[#1003] Sunday, March 27, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.

Total Points: 176
Total Questions: 130
Total Answers: 122

Location: Egypt
Member since Sun, Apr 23, 2023
8 Months ago
ateact questions
Mon, Dec 26, 22, 21:54, 1 Year ago
Tue, Feb 21, 23, 21:30, 10 Months ago
Sat, May 27, 23, 02:42, 7 Months ago
Fri, Oct 1, 21, 15:43, 2 Years ago