PIK-LPJmL / LPJmL

Welcome to the central open-source repository of LPJmL at PIK. You are free to download the code under the AGPLv3 license, see LICENSE file. Have fun. Please note that there is absolutely no support outside agreed collaborations. We also don't provide any input data, which is derived from other sources.
GNU Affero General Public License v3.0
72 stars 48 forks source link

Compiling with NETCDF support #12

Closed mahalel closed 3 years ago

mahalel commented 3 years ago

Hi, I am trying to compile LPJmL with netCDF support as per the INSTALL document.

I have set the following flags in my Makefile.inc

LPJFLAGS= -DUSE_NETCDF -DUSE_NETCDF4 -DSAFE -DUSE_RAND48 -DWITH_FPE # -DDAILY_ESTABLISHMENT

then I run make all and I get a bunch of errors:

gcc -Wall -O2 -o ../bin/lpjml lpjml.o   ../lib/liblpj.a ../lib/libgrass.a ../lib/liblanduse.a ../lib/libtree.a ../lib/libimage.a ../lib/libspitfire.a ../lib/libsoil.a ../lib/libclimate.a ../lib/libnum.a ../lib/libtools.a ../lib/libcrop.a ../lib/libreservoir.a ../lib/libpnet.a ../lib/libsocket.a ../lib/liblpj.a ../lib/libcdf.a ../lib/liblpj.a ../lib/libtools.a ../lib/libcpl.a ../lib/libsoil.a -lm  getbuild.o
../lib/libcdf.a(create_netcdf.o): In function `create_netcdf':
create_netcdf.c:(.text+0x125): undefined reference to `nc_def_var'
create_netcdf.c:(.text+0x16f): undefined reference to `nc_put_att_text'
create_netcdf.c:(.text+0x1a9): undefined reference to `nc_put_att_text'
create_netcdf.c:(.text+0x1f2): undefined reference to `nc_enddef'
create_netcdf.c:(.text+0x213): undefined reference to `nc_put_var_int'
create_netcdf.c:(.text+0x229): undefined reference to `nc_put_var_float'
create_netcdf.c:(.text+0x26c): undefined reference to `nc_inq_varid'
create_netcdf.c:(.text+0x325): undefined reference to `nc_open'
create_netcdf.c:(.text+0x334): undefined reference to `nc_strerror'
create_netcdf.c:(.text+0x353): undefined reference to `nc_strerror'
create_netcdf.c:(.text+0x4c3): undefined reference to `nc_def_var_deflate'
create_netcdf.c:(.text+0x4ee): undefined reference to `nc_strerror'
create_netcdf.c:(.text+0x516): undefined reference to `nc_close'
create_netcdf.c:(.text+0x545): undefined reference to `nc_put_att_short'
create_netcdf.c:(.text+0x565): undefined reference to `nc_put_att_short'
create_netcdf.c:(.text+0x64e): undefined reference to `nc_create'
create_netcdf.c:(.text+0x68f): undefined reference to `nc_def_dim'
create_netcdf.c:(.text+0x6be): undefined reference to `nc_def_dim'
create_netcdf.c:(.text+0x6f9): undefined reference to `nc_put_att_text'
create_netcdf.c:(.text+0x72b): undefined reference to `nc_put_att_text'
create_netcdf.c:(.text+0x7d8): undefined reference to `nc_def_dim'
create_netcdf.c:(.text+0x80c): undefined reference to `nc_def_var'
create_netcdf.c:(.text+0x90b): undefined reference to `nc_strerror'
create_netcdf.c:(.text+0x9f5): undefined reference to `nc_put_att_float'
create_netcdf.c:(.text+0xa15): undefined reference to `nc_put_att_float'
create_netcdf.c:(.text+0xa3f): undefined reference to `nc_put_att_int'
create_netcdf.c:(.text+0xa5f): undefined reference to `nc_put_att_int'
create_netcdf.c:(.text+0xafb): undefined reference to `nc_put_var_float'
create_netcdf.c:(.text+0xbd0): undefined reference to `nc_put_att_text'
create_netcdf.c:(.text+0xc04): undefined reference to `nc_def_var'
create_netcdf.c:(.text+0xc92): undefined reference to `nc_def_var'
create_netcdf.c:(.text+0xcd8): undefined reference to `nc_put_att_text'
create_netcdf.c:(.text+0xd0b): undefined reference to `nc_put_att_text'
create_netcdf.c:(.text+0xd3e): undefined reference to `nc_put_att_text'
create_netcdf.c:(.text+0xd71): undefined reference to `nc_put_att_text'
create_netcdf.c:(.text+0xda4): undefined reference to `nc_put_att_text'
../lib/libcdf.a(create_netcdf.o):create_netcdf.c:(.text+0xdd7): more undefined references to `nc_put_att_text' follow
../lib/libcdf.a(close_netcdf.o): In function `close_netcdf':
close_netcdf.c:(.text+0x12): undefined reference to `nc_close'
../lib/libcdf.a(write_float_netcdf.o): In function `write_float_netcdf':
write_float_netcdf.c:(.text+0x10c): undefined reference to `nc_put_vara_float'
write_float_netcdf.c:(.text+0x123): undefined reference to `nc_strerror'
write_float_netcdf.c:(.text+0x174): undefined reference to `nc_put_var_float'
../lib/libcdf.a(write_short_netcdf.o): In function `write_short_netcdf':
write_short_netcdf.c:(.text+0x102): undefined reference to `nc_put_vara_short'
write_short_netcdf.c:(.text+0x119): undefined reference to `nc_strerror'
write_short_netcdf.c:(.text+0x164): undefined reference to `nc_put_var_short'
../lib/libcdf.a(create_pft_netcdf.o): In function `create_pft_netcdf':
create_pft_netcdf.c:(.text+0xc8): undefined reference to `nc_inq_varid'
create_pft_netcdf.c:(.text+0x26d): undefined reference to `nc_open'
create_pft_netcdf.c:(.text+0x27c): undefined reference to `nc_strerror'
create_pft_netcdf.c:(.text+0x291): undefined reference to `nc_strerror'
create_pft_netcdf.c:(.text+0x4a2): undefined reference to `nc_create'
create_pft_netcdf.c:(.text+0x4d8): undefined reference to `nc_def_dim'
create_pft_netcdf.c:(.text+0x517): undefined reference to `nc_def_dim'
create_pft_netcdf.c:(.text+0x546): undefined reference to `nc_def_dim'
create_pft_netcdf.c:(.text+0x572): undefined reference to `nc_def_dim'
create_pft_netcdf.c:(.text+0x5e3): undefined reference to `nc_def_var'
create_pft_netcdf.c:(.text+0x610): undefined reference to `nc_put_att_text'
create_pft_netcdf.c:(.text+0x63d): undefined reference to `nc_put_att_text'
create_pft_netcdf.c:(.text+0x66f): undefined reference to `nc_def_var'
create_pft_netcdf.c:(.text+0x6e5): undefined reference to `nc_put_att_text'
create_pft_netcdf.c:(.text+0x712): undefined reference to `nc_put_att_text'
create_pft_netcdf.c:(.text+0x744): undefined reference to `nc_def_var'
create_pft_netcdf.c:(.text+0x771): undefined reference to `nc_put_att_text'
create_pft_netcdf.c:(.text+0x79e): undefined reference to `nc_put_att_text'
create_pft_netcdf.c:(.text+0x7cb): undefined reference to `nc_put_att_text'
create_pft_netcdf.c:(.text+0x7f8): undefined reference to `nc_put_att_text'
create_pft_netcdf.c:(.text+0x829): undefined reference to `nc_def_var'
create_pft_netcdf.c:(.text+0x856): undefined reference to `nc_put_att_text'
create_pft_netcdf.c:(.text+0x883): undefined reference to `nc_put_att_text'
create_pft_netcdf.c:(.text+0x8b0): undefined reference to `nc_put_att_text'
create_pft_netcdf.c:(.text+0x8dd): undefined reference to `nc_put_att_text'
create_pft_netcdf.c:(.text+0x915): undefined reference to `nc_def_var'
create_pft_netcdf.c:(.text+0x961): undefined reference to `nc_put_att_text'
create_pft_netcdf.c:(.text+0x99d): undefined reference to `nc_put_att_text'
create_pft_netcdf.c:(.text+0x9ff): undefined reference to `nc_put_att_text'
create_pft_netcdf.c:(.text+0xa28): undefined reference to `nc_put_att_text'
create_pft_netcdf.c:(.text+0xad3): undefined reference to `nc_put_att_text'
create_pft_netcdf.c:(.text+0xae6): undefined reference to `nc_enddef'
create_pft_netcdf.c:(.text+0xb03): undefined reference to `nc_put_var_int'
create_pft_netcdf.c:(.text+0xb2d): undefined reference to `nc_put_var_float'
create_pft_netcdf.c:(.text+0xb4e): undefined reference to `nc_put_var_float'
create_pft_netcdf.c:(.text+0xb6f): undefined reference to `nc_put_var_float'
create_pft_netcdf.c:(.text+0xbb3): undefined reference to `nc_strerror'
create_pft_netcdf.c:(.text+0xcdd): undefined reference to `nc_strerror'
create_pft_netcdf.c:(.text+0xd05): undefined reference to `nc_close'
create_pft_netcdf.c:(.text+0xdf3): undefined reference to `nc_def_var'
create_pft_netcdf.c:(.text+0xe58): undefined reference to `nc_put_att_text'
create_pft_netcdf.c:(.text+0xeb3): undefined reference to `nc_def_var_deflate'
create_pft_netcdf.c:(.text+0xef6): undefined reference to `nc_put_var_string'
create_pft_netcdf.c:(.text+0xf44): undefined reference to `nc_put_att_short'
create_pft_netcdf.c:(.text+0xf64): undefined reference to `nc_put_att_short'
create_pft_netcdf.c:(.text+0xfc9): undefined reference to `nc_put_att_float'
create_pft_netcdf.c:(.text+0xfe9): undefined reference to `nc_put_att_float'
create_pft_netcdf.c:(.text+0x1016): undefined reference to `nc_put_att_int'
create_pft_netcdf.c:(.text+0x1036): undefined reference to `nc_put_att_int'
../lib/libcdf.a(write_pft_float_netcdf.o): In function `write_pft_float_netcdf':
write_pft_float_netcdf.c:(.text+0x118): undefined reference to `nc_put_vara_float'
write_pft_float_netcdf.c:(.text+0x153): undefined reference to `nc_strerror'
write_pft_float_netcdf.c:(.text+0x18c): undefined reference to `nc_put_var_float'
../lib/libcdf.a(write_pft_short_netcdf.o): In function `write_pft_short_netcdf':
write_pft_short_netcdf.c:(.text+0x111): undefined reference to `nc_put_vara_short'
write_pft_short_netcdf.c:(.text+0x153): undefined reference to `nc_strerror'
write_pft_short_netcdf.c:(.text+0x18c): undefined reference to `nc_put_var_short'
../lib/libcdf.a(openclimate_netcdf.o): In function `openclimate_netcdf':
openclimate_netcdf.c:(.text+0x7c): undefined reference to `nc_inq_varid'
openclimate_netcdf.c:(.text+0x96): undefined reference to `nc_inq_varndims'
openclimate_netcdf.c:(.text+0x118): undefined reference to `nc_strerror'
openclimate_netcdf.c:(.text+0x14f): undefined reference to `nc_inq_varid'
openclimate_netcdf.c:(.text+0x1b8): undefined reference to `nc_inq_varndims'
openclimate_netcdf.c:(.text+0x246): undefined reference to `nc_inq_vardimid'
openclimate_netcdf.c:(.text+0x258): undefined reference to `nc_inq_dimlen'
openclimate_netcdf.c:(.text+0x279): undefined reference to `nc_inq_attlen'
openclimate_netcdf.c:(.text+0x2b2): undefined reference to `nc_get_att_text'
openclimate_netcdf.c:(.text+0x34f): undefined reference to `nc_get_var_double'
openclimate_netcdf.c:(.text+0x463): undefined reference to `nc_strerror'
openclimate_netcdf.c:(.text+0x4b6): undefined reference to `nc_inq_attlen'
openclimate_netcdf.c:(.text+0x4ef): undefined reference to `nc_get_att_text'
openclimate_netcdf.c:(.text+0x58b): undefined reference to `nc_inq_vardimid'
openclimate_netcdf.c:(.text+0x59b): undefined reference to `nc_inq_dimlen'
openclimate_netcdf.c:(.text+0x5ee): undefined reference to `nc_get_var_int'
openclimate_netcdf.c:(.text+0x611): undefined reference to `nc_strerror'
openclimate_netcdf.c:(.text+0x660): undefined reference to `nc_strerror'
openclimate_netcdf.c:(.text+0x6bb): undefined reference to `nc_strerror'
openclimate_netcdf.c:(.text+0x871): undefined reference to `nc_get_var_int'
openclimate_netcdf.c:(.text+0x8e4): undefined reference to `nc_inq_attlen'
openclimate_netcdf.c:(.text+0x9c8): undefined reference to `nc_strerror'
openclimate_netcdf.c:(.text+0xaba): undefined reference to `nc_get_att_text'
../lib/libcdf.a(readclimate_netcdf.o): In function `myopen_netcdf':
readclimate_netcdf.c:(.text+0x6f): undefined reference to `nc_open'
readclimate_netcdf.c:(.text+0xba): undefined reference to `nc_inq_varndims'
readclimate_netcdf.c:(.text+0xf2): undefined reference to `nc_close'
readclimate_netcdf.c:(.text+0x109): undefined reference to `nc_strerror'
readclimate_netcdf.c:(.text+0x1a2): undefined reference to `nc_close'
../lib/libcdf.a(readclimate_netcdf.o): In function `readclimate_netcdf':
readclimate_netcdf.c:(.text+0x394): undefined reference to `nc_close'
readclimate_netcdf.c:(.text+0x401): undefined reference to `nc_get_vara_short'
readclimate_netcdf.c:(.text+0x47e): undefined reference to `nc_close'
readclimate_netcdf.c:(.text+0x4ca): undefined reference to `nc_get_vara_double'
readclimate_netcdf.c:(.text+0x57a): undefined reference to `nc_get_vara_float'
readclimate_netcdf.c:(.text+0x7d8): undefined reference to `nc_strerror'
readclimate_netcdf.c:(.text+0xb03): undefined reference to `nc_strerror'
../lib/libcdf.a(readclimate_netcdf.o): In function `readintclimate_netcdf':
readclimate_netcdf.c:(.text+0xd4b): undefined reference to `nc_get_vara_int'
readclimate_netcdf.c:(.text+0xdcb): undefined reference to `nc_close'
readclimate_netcdf.c:(.text+0xe72): undefined reference to `nc_close'
readclimate_netcdf.c:(.text+0xf29): undefined reference to `nc_get_vara_short'
readclimate_netcdf.c:(.text+0x1258): undefined reference to `nc_strerror'
readclimate_netcdf.c:(.text+0x1290): undefined reference to `nc_strerror'
../lib/libcdf.a(readclimate_netcdf.o): In function `checkvalidclimate_netcdf':
readclimate_netcdf.c:(.text+0x149c): undefined reference to `nc_close'
readclimate_netcdf.c:(.text+0x1513): undefined reference to `nc_get_vara_double'
readclimate_netcdf.c:(.text+0x169b): undefined reference to `nc_get_vara_float'
readclimate_netcdf.c:(.text+0x17f2): undefined reference to `nc_get_vara_short'
readclimate_netcdf.c:(.text+0x19b3): undefined reference to `nc_strerror'
readclimate_netcdf.c:(.text+0x1a0b): undefined reference to `nc_close'
readclimate_netcdf.c:(.text+0x1a1b): undefined reference to `nc_strerror'
../lib/libcdf.a(coord_netcdf.o): In function `closecoord_netcdf.part.0':
coord_netcdf.c:(.text+0x19): undefined reference to `nc_close'
../lib/libcdf.a(coord_netcdf.o): In function `numcoord_netcdf':
coord_netcdf.c:(.text+0xa8): undefined reference to `nc_get_var_float'
coord_netcdf.c:(.text+0x130): undefined reference to `nc_get_var_int'
coord_netcdf.c:(.text+0x1a4): undefined reference to `nc_get_var_uchar'
coord_netcdf.c:(.text+0x213): undefined reference to `nc_get_var_short'
coord_netcdf.c:(.text+0x29a): undefined reference to `nc_strerror'
../lib/libcdf.a(coord_netcdf.o): In function `getindexcoord_netcdf':
coord_netcdf.c:(.text+0x368): undefined reference to `nc_get_var_float'
coord_netcdf.c:(.text+0x3fd): undefined reference to `nc_get_var_int'
coord_netcdf.c:(.text+0x45d): undefined reference to `nc_get_var_uchar'
coord_netcdf.c:(.text+0x4cb): undefined reference to `nc_get_var_short'
../lib/libcdf.a(coord_netcdf.o): In function `seekcoord_netcdf':
coord_netcdf.c:(.text+0x630): undefined reference to `nc_get_vara_float'
coord_netcdf.c:(.text+0x63b): undefined reference to `nc_strerror'
coord_netcdf.c:(.text+0x720): undefined reference to `nc_get_vara_uchar'
coord_netcdf.c:(.text+0x7b7): undefined reference to `nc_get_vara_int'
coord_netcdf.c:(.text+0x839): undefined reference to `nc_get_vara_short'
../lib/libcdf.a(coord_netcdf.o): In function `readcoord_netcdf':
coord_netcdf.c:(.text+0x994): undefined reference to `nc_get_vara_float'
coord_netcdf.c:(.text+0x99f): undefined reference to `nc_strerror'
coord_netcdf.c:(.text+0xa03): undefined reference to `nc_get_vara_uchar'
coord_netcdf.c:(.text+0xab3): undefined reference to `nc_get_vara_short'
coord_netcdf.c:(.text+0xb77): undefined reference to `nc_get_vara_int'
../lib/libcdf.a(coord_netcdf.o): In function `opencoord_netcdf':
coord_netcdf.c:(.text+0xe55): undefined reference to `nc_open'
coord_netcdf.c:(.text+0xe77): undefined reference to `nc_inq_varid'
coord_netcdf.c:(.text+0xe8e): undefined reference to `nc_inq_varndims'
coord_netcdf.c:(.text+0xec3): undefined reference to `nc_inq_vardimid'
coord_netcdf.c:(.text+0xed7): undefined reference to `nc_inq_dimname'
coord_netcdf.c:(.text+0xeeb): undefined reference to `nc_inq_varid'
coord_netcdf.c:(.text+0xf08): undefined reference to `nc_inq_dimlen'
coord_netcdf.c:(.text+0xf34): undefined reference to `nc_get_var_float'
coord_netcdf.c:(.text+0xf50): undefined reference to `nc_inq_dimname'
coord_netcdf.c:(.text+0xf5f): undefined reference to `nc_inq_varid'
coord_netcdf.c:(.text+0xf7c): undefined reference to `nc_inq_dimlen'
coord_netcdf.c:(.text+0xfb0): undefined reference to `nc_get_var_float'
coord_netcdf.c:(.text+0xfc7): undefined reference to `nc_inq_vartype'
coord_netcdf.c:(.text+0x1004): undefined reference to `nc_get_att_float'
coord_netcdf.c:(.text+0x1026): undefined reference to `nc_inq_nvars'
coord_netcdf.c:(.text+0x1049): undefined reference to `nc_inq_varname'
coord_netcdf.c:(.text+0x10e3): undefined reference to `nc_close'
coord_netcdf.c:(.text+0x1150): undefined reference to `nc_strerror'
coord_netcdf.c:(.text+0x1194): undefined reference to `nc_strerror'
coord_netcdf.c:(.text+0x1205): undefined reference to `nc_get_att_uchar'
coord_netcdf.c:(.text+0x1284): undefined reference to `nc_get_att_short'
coord_netcdf.c:(.text+0x12b3): undefined reference to `nc_strerror'
coord_netcdf.c:(.text+0x131e): undefined reference to `nc_strerror'
coord_netcdf.c:(.text+0x1358): undefined reference to `nc_strerror'
coord_netcdf.c:(.text+0x1394): undefined reference to `nc_get_att_int'
coord_netcdf.c:(.text+0x1464): undefined reference to `nc_get_att_short'
coord_netcdf.c:(.text+0x148c): undefined reference to `nc_strerror'
coord_netcdf.c:(.text+0x14d6): undefined reference to `nc_get_att_float'
coord_netcdf.c:(.text+0x1509): undefined reference to `nc_get_att_uchar'
coord_netcdf.c:(.text+0x1541): undefined reference to `nc_get_att_int'
../lib/libcdf.a(readdata_netcdf.o): In function `readdata_netcdf':
readdata_netcdf.c:(.text+0x125): undefined reference to `nc_get_vara_float'
readdata_netcdf.c:(.text+0x339): undefined reference to `nc_get_vara_short'
readdata_netcdf.c:(.text+0x543): undefined reference to `nc_strerror'
readdata_netcdf.c:(.text+0x573): undefined reference to `nc_strerror'
../lib/libcdf.a(input_netcdf.o): In function `closeinput':
input_netcdf.c:(.text+0x11): undefined reference to `nc_close'
../lib/libcdf.a(input_netcdf.o): In function `openinput_netcdf':
input_netcdf.c:(.text+0x129): undefined reference to `nc_open'
input_netcdf.c:(.text+0x14c): undefined reference to `nc_inq_varid'
input_netcdf.c:(.text+0x168): undefined reference to `nc_inq_varndims'
input_netcdf.c:(.text+0x1a3): undefined reference to `nc_close'
input_netcdf.c:(.text+0x1e6): undefined reference to `nc_inq_nvars'
input_netcdf.c:(.text+0x20a): undefined reference to `nc_inq_varname'
input_netcdf.c:(.text+0x2b8): undefined reference to `nc_inq_vartype'
input_netcdf.c:(.text+0x329): undefined reference to `nc_inq_vardimid'
input_netcdf.c:(.text+0x337): undefined reference to `nc_inq_dimlen'
input_netcdf.c:(.text+0x353): undefined reference to `nc_strerror'
input_netcdf.c:(.text+0x3ab): undefined reference to `nc_get_att_double'
input_netcdf.c:(.text+0x3fc): undefined reference to `nc_inq_varndims'
input_netcdf.c:(.text+0x444): undefined reference to `nc_inq_vardimid'
input_netcdf.c:(.text+0x45b): undefined reference to `nc_inq_dimname'
input_netcdf.c:(.text+0x469): undefined reference to `nc_inq_varid'
input_netcdf.c:(.text+0x484): undefined reference to `nc_inq_dimlen'
input_netcdf.c:(.text+0x4b2): undefined reference to `nc_get_var_float'
input_netcdf.c:(.text+0x54e): undefined reference to `nc_inq_dimname'
input_netcdf.c:(.text+0x55c): undefined reference to `nc_inq_varid'
input_netcdf.c:(.text+0x574): undefined reference to `nc_inq_dimlen'
input_netcdf.c:(.text+0x5a8): undefined reference to `nc_get_var_float'
input_netcdf.c:(.text+0x66b): undefined reference to `nc_get_att_float'
input_netcdf.c:(.text+0x6a3): undefined reference to `nc_get_att_int'
input_netcdf.c:(.text+0x6db): undefined reference to `nc_get_att_uchar'
input_netcdf.c:(.text+0x713): undefined reference to `nc_get_att_short'
input_netcdf.c:(.text+0x88b): undefined reference to `nc_strerror'
input_netcdf.c:(.text+0x9c9): undefined reference to `nc_strerror'
input_netcdf.c:(.text+0xa41): undefined reference to `nc_strerror'
input_netcdf.c:(.text+0xa81): undefined reference to `nc_get_att_short'
input_netcdf.c:(.text+0xaa6): undefined reference to `nc_strerror'
input_netcdf.c:(.text+0xaf2): undefined reference to `nc_get_att_float'
input_netcdf.c:(.text+0xb2c): undefined reference to `nc_get_att_uchar'
input_netcdf.c:(.text+0xb5c): undefined reference to `nc_get_att_double'
input_netcdf.c:(.text+0xb9d): undefined reference to `nc_get_att_int'
../lib/libcdf.a(input_netcdf.o): In function `closeinput_netcdf':
input_netcdf.c:(.text+0xbdc): undefined reference to `nc_close'
../lib/libcdf.a(input_netcdf.o): In function `readinput_netcdf':
input_netcdf.c:(.text+0xdda): undefined reference to `nc_get_vara_double'
input_netcdf.c:(.text+0xf0c): undefined reference to `nc_get_vara_short'
input_netcdf.c:(.text+0x1018): undefined reference to `nc_get_vara_float'
input_netcdf.c:(.text+0x10c4): undefined reference to `nc_get_vara_int'
input_netcdf.c:(.text+0x1183): undefined reference to `nc_strerror'
input_netcdf.c:(.text+0x11d3): undefined reference to `nc_strerror'
input_netcdf.c:(.text+0x1203): undefined reference to `nc_strerror'
../lib/libcdf.a(input_netcdf.o): In function `readintinput_netcdf':
input_netcdf.c:(.text+0x1346): undefined reference to `nc_get_vara_int'
input_netcdf.c:(.text+0x1425): undefined reference to `nc_get_vara_short'
input_netcdf.c:(.text+0x14b3): undefined reference to `nc_strerror'
input_netcdf.c:(.text+0x158b): undefined reference to `nc_strerror'
../lib/libcdf.a(input_netcdf.o): In function `readshortinput_netcdf':
input_netcdf.c:(.text+0x16df): undefined reference to `nc_get_vara_short'
input_netcdf.c:(.text+0x17cb): undefined reference to `nc_strerror'
../lib/libcdf.a(getvar_netcdf.o): In function `getvar_netcdf':
getvar_netcdf.c:(.text+0x46): undefined reference to `nc_inq_varid'
getvar_netcdf.c:(.text+0x78): undefined reference to `nc_inq_vartype'
getvar_netcdf.c:(.text+0x109): undefined reference to `nc_inq_nvars'
getvar_netcdf.c:(.text+0x133): undefined reference to `nc_inq_varname'
getvar_netcdf.c:(.text+0x1e4): undefined reference to `nc_inq_vartype'
getvar_netcdf.c:(.text+0x227): undefined reference to `nc_get_att_double'
getvar_netcdf.c:(.text+0x253): undefined reference to `nc_inq_atttype'
getvar_netcdf.c:(.text+0x282): undefined reference to `nc_get_att_double'
getvar_netcdf.c:(.text+0x2bd): undefined reference to `nc_inq_atttype'
getvar_netcdf.c:(.text+0x2f4): undefined reference to `nc_get_att_double'
getvar_netcdf.c:(.text+0x332): undefined reference to `nc_get_att_float'
getvar_netcdf.c:(.text+0x36a): undefined reference to `nc_get_att_int'
getvar_netcdf.c:(.text+0x3ab): undefined reference to `nc_get_att_short'
getvar_netcdf.c:(.text+0x3dd): undefined reference to `nc_get_att_float'
getvar_netcdf.c:(.text+0x415): undefined reference to `nc_get_att_float'
getvar_netcdf.c:(.text+0x4a3): undefined reference to `nc_get_att_short'
getvar_netcdf.c:(.text+0x4cb): undefined reference to `nc_strerror'
getvar_netcdf.c:(.text+0x51b): undefined reference to `nc_get_att_int'
getvar_netcdf.c:(.text+0x553): undefined reference to `nc_get_att_float'
getvar_netcdf.c:(.text+0x593): undefined reference to `nc_get_att_double'
../lib/libcdf.a(readintdata_netcdf.o): In function `readintdata_netcdf':
readintdata_netcdf.c:(.text+0x113): undefined reference to `nc_get_vara_int'
readintdata_netcdf.c:(.text+0x2af): undefined reference to `nc_get_vara_short'
readintdata_netcdf.c:(.text+0x3e3): undefined reference to `nc_strerror'
readintdata_netcdf.c:(.text+0x423): undefined reference to `nc_strerror'
../lib/libcdf.a(open_netcdf.o): In function `open_netcdf':
open_netcdf.c:(.text+0xa8): undefined reference to `nc_open'
../lib/libcdf.a(open_netcdf.o): In function `free_netcdf':
open_netcdf.c:(.text+0x19b): undefined reference to `nc_close'
open_netcdf.c:(.text+0x1b9): undefined reference to `nc_close'
../lib/libcdf.a(create1_netcdf.o): In function `create1_netcdf':
create1_netcdf.c:(.text+0x113): undefined reference to `nc_def_var'
create1_netcdf.c:(.text+0x155): undefined reference to `nc_put_att_text'
create1_netcdf.c:(.text+0x17e): undefined reference to `nc_strerror'
create1_netcdf.c:(.text+0x1a6): undefined reference to `nc_close'
create1_netcdf.c:(.text+0x26f): undefined reference to `nc_def_dim'
create1_netcdf.c:(.text+0x299): undefined reference to `nc_def_var'
create1_netcdf.c:(.text+0x49e): undefined reference to `nc_put_att_int'
create1_netcdf.c:(.text+0x4be): undefined reference to `nc_put_att_int'
create1_netcdf.c:(.text+0x53e): undefined reference to `nc_put_att_text'
create1_netcdf.c:(.text+0x586): undefined reference to `nc_enddef'
create1_netcdf.c:(.text+0x5a2): undefined reference to `nc_put_var_int'
create1_netcdf.c:(.text+0x5b8): undefined reference to `nc_put_var_float'
create1_netcdf.c:(.text+0x5fa): undefined reference to `nc_create'
create1_netcdf.c:(.text+0x63f): undefined reference to `nc_def_dim'
create1_netcdf.c:(.text+0x663): undefined reference to `nc_def_dim'
create1_netcdf.c:(.text+0x694): undefined reference to `nc_put_att_text'
create1_netcdf.c:(.text+0x6bc): undefined reference to `nc_put_att_text'
create1_netcdf.c:(.text+0x767): undefined reference to `nc_put_att_text'
create1_netcdf.c:(.text+0x7bf): undefined reference to `nc_def_var'
create1_netcdf.c:(.text+0x7e9): undefined reference to `nc_def_var'
create1_netcdf.c:(.text+0x877): undefined reference to `nc_put_att_text'
create1_netcdf.c:(.text+0x8fb): undefined reference to `nc_strerror'
create1_netcdf.c:(.text+0x9fe): undefined reference to `nc_def_var_deflate'
create1_netcdf.c:(.text+0xabc): undefined reference to `nc_put_att_short'
create1_netcdf.c:(.text+0xadc): undefined reference to `nc_put_att_short'
create1_netcdf.c:(.text+0xb06): undefined reference to `nc_put_att_float'
create1_netcdf.c:(.text+0xb26): undefined reference to `nc_put_att_float'
create1_netcdf.c:(.text+0xb49): undefined reference to `nc_put_att_text'
create1_netcdf.c:(.text+0xb71): undefined reference to `nc_put_att_text'
create1_netcdf.c:(.text+0xb97): undefined reference to `nc_put_att_text'
create1_netcdf.c:(.text+0xbbf): undefined reference to `nc_put_att_text'
create1_netcdf.c:(.text+0xbe7): undefined reference to `nc_put_att_text'
../lib/libcdf.a(create1_netcdf.o):create1_netcdf.c:(.text+0xc0f): more undefined references to `nc_put_att_text' follow
../lib/libcdf.a(create1_netcdf.o): In function `create1_netcdf':
create1_netcdf.c:(.text+0xca6): undefined reference to `nc_put_var_float'
../lib/libcdf.a(create1_pft_netcdf.o): In function `create1_pft_netcdf':
create1_pft_netcdf.c:(.text+0x345): undefined reference to `nc_create'
create1_pft_netcdf.c:(.text+0x38e): undefined reference to `nc_def_dim'
create1_pft_netcdf.c:(.text+0x3c5): undefined reference to `nc_def_dim'
create1_pft_netcdf.c:(.text+0x3f9): undefined reference to `nc_def_dim'
create1_pft_netcdf.c:(.text+0x46f): undefined reference to `nc_def_var'
create1_pft_netcdf.c:(.text+0x4a8): undefined reference to `nc_put_att_text'
create1_pft_netcdf.c:(.text+0x4e1): undefined reference to `nc_put_att_text'
create1_pft_netcdf.c:(.text+0x51e): undefined reference to `nc_def_var'
create1_pft_netcdf.c:(.text+0x557): undefined reference to `nc_put_att_text'
create1_pft_netcdf.c:(.text+0x590): undefined reference to `nc_put_att_text'
create1_pft_netcdf.c:(.text+0x5c9): undefined reference to `nc_put_att_text'
create1_pft_netcdf.c:(.text+0x602): undefined reference to `nc_put_att_text'
create1_pft_netcdf.c:(.text+0x63f): undefined reference to `nc_def_var'
create1_pft_netcdf.c:(.text+0x678): undefined reference to `nc_put_att_text'
create1_pft_netcdf.c:(.text+0x6b1): undefined reference to `nc_put_att_text'
create1_pft_netcdf.c:(.text+0x6ea): undefined reference to `nc_put_att_text'
create1_pft_netcdf.c:(.text+0x723): undefined reference to `nc_put_att_text'
create1_pft_netcdf.c:(.text+0x771): undefined reference to `nc_def_var'
create1_pft_netcdf.c:(.text+0x7b0): undefined reference to `nc_def_var'
create1_pft_netcdf.c:(.text+0x824): undefined reference to `nc_put_att_text'
create1_pft_netcdf.c:(.text+0x85c): undefined reference to `nc_put_att_text'
create1_pft_netcdf.c:(.text+0x8b4): undefined reference to `nc_put_att_text'
create1_pft_netcdf.c:(.text+0x8fc): undefined reference to `nc_put_att_text'
create1_pft_netcdf.c:(.text+0x969): undefined reference to `nc_put_att_text'
../lib/libcdf.a(create1_pft_netcdf.o):create1_pft_netcdf.c:(.text+0x99e): more undefined references to `nc_put_att_text' follow
../lib/libcdf.a(create1_pft_netcdf.o): In function `create1_pft_netcdf':
create1_pft_netcdf.c:(.text+0xa87): undefined reference to `nc_enddef'
create1_pft_netcdf.c:(.text+0xac9): undefined reference to `nc_put_var_float'
create1_pft_netcdf.c:(.text+0xaf3): undefined reference to `nc_put_var_float'
create1_pft_netcdf.c:(.text+0xb18): undefined reference to `nc_put_var_float'
create1_pft_netcdf.c:(.text+0xb83): undefined reference to `nc_strerror'
create1_pft_netcdf.c:(.text+0xbac): undefined reference to `nc_close'
create1_pft_netcdf.c:(.text+0xc13): undefined reference to `nc_strerror'
create1_pft_netcdf.c:(.text+0xd61): undefined reference to `nc_def_dim'
create1_pft_netcdf.c:(.text+0xdf9): undefined reference to `nc_def_var'
create1_pft_netcdf.c:(.text+0xe7e): undefined reference to `nc_def_var_deflate'
create1_pft_netcdf.c:(.text+0xecc): undefined reference to `nc_def_var'
create1_pft_netcdf.c:(.text+0xf1d): undefined reference to `nc_put_var_string'
create1_pft_netcdf.c:(.text+0xf6c): undefined reference to `nc_put_var_int'
create1_pft_netcdf.c:(.text+0xfb1): undefined reference to `nc_put_att_short'
create1_pft_netcdf.c:(.text+0xfd3): undefined reference to `nc_put_att_short'
create1_pft_netcdf.c:(.text+0x1037): undefined reference to `nc_put_att_float'
create1_pft_netcdf.c:(.text+0x1059): undefined reference to `nc_put_att_float'
create1_pft_netcdf.c:(.text+0x108f): undefined reference to `nc_put_att_int'
create1_pft_netcdf.c:(.text+0x10b1): undefined reference to `nc_put_att_int'
../lib/libcdf.a(getlatlon_netcdf.o): In function `getlatlon_netcdf':
getlatlon_netcdf.c:(.text+0x39): undefined reference to `nc_inq_varndims'
getlatlon_netcdf.c:(.text+0x8d): undefined reference to `nc_inq_vardimid'
getlatlon_netcdf.c:(.text+0xa5): undefined reference to `nc_inq_dimname'
getlatlon_netcdf.c:(.text+0xbe): undefined reference to `nc_inq_varid'
getlatlon_netcdf.c:(.text+0xdd): undefined reference to `nc_inq_dimlen'
getlatlon_netcdf.c:(.text+0x10f): undefined reference to `nc_get_var_float'
getlatlon_netcdf.c:(.text+0x1d8): undefined reference to `nc_inq_dimname'
getlatlon_netcdf.c:(.text+0x1e9): undefined reference to `nc_inq_varid'
getlatlon_netcdf.c:(.text+0x203): undefined reference to `nc_inq_dimlen'
getlatlon_netcdf.c:(.text+0x250): undefined reference to `nc_get_var_float'
getlatlon_netcdf.c:(.text+0x313): undefined reference to `nc_strerror'
getlatlon_netcdf.c:(.text+0x39b): undefined reference to `nc_strerror'
getlatlon_netcdf.c:(.text+0x460): undefined reference to `nc_strerror'
collect2: error: ld returned 1 exit status
Makefile:98: recipe for target '../bin/lpjml' failed
make[2]: *** [../bin/lpjml] Error 1
make[2]: Leaving directory '/opt/LPJmL-4.0.003/src'
Makefile:50: recipe for target 'bin' failed
make[1]: *** [bin] Error 2
make[1]: Leaving directory '/opt/LPJmL-4.0.003/src'
Makefile:53: recipe for target 'main' failed
make: *** [main] Error 2

This is on Ubuntu 18.04, I am have also installed the libnetcdf-dev and libnetcdff-dev libraries but I have no luck. Hoping you can point me in the right direction, I seem to be missing a step in the install.

Thank you

cmueller-pik commented 3 years ago

Try not including -DUSE_NETCDF4, make clean, make. Just a first idea, but as stated throughout the project here, we're unable to provide support.

sostberg commented 3 years ago

Please check whether the LIBS entry in your Makefile.inc includes -lnetcdf. You need to list all the external libraries that LPJmL should be linked to. If you want to activate JSON support as well, you also need to add -ljson-c to the LIBS entry.

mahalel commented 3 years ago

Thank you, looks like adding the -lnetcdf to the LIBS entry did the trick and package compiled successfully. Appreciate it!