1.12.1: undefined reference to `nc_get_var_text' etc.

Wei-Keng Liao wkliao at northwestern.edu
Mon Dec 7 09:59:38 CST 2020


I suggest you first to build PnetCDF without using --enable-netcdf4 and
then build NetCDF using --enable-pnetcdf. 

Wei-keng

> On Dec 7, 2020, at 11:22 PM, Sebastian Schubert <schubert.seb at gmail.com> wrote:
> 
> Hi all
> 
> I try to compile the NetCDF library with pnetcdf support. For that, I first compile the NetCDF library without pnetcdf and then pnetcdf with
> 
> MPICC=mpiicc MPICXX=mpiicpc MPIF77=mpiifort MPIF90=mpiifort ./configure --prefix=/programs/intel-2019.5/pnetcdf/1.12.1 --enable-netcdf4 --enable-shared
> 
> using the Intel compiler suite 2019 update 5. All tests were successful.
> 
> Now I try to recompile NetCDF with pnetcdf support. The configure script fails, though, running
> 
> mpiicc -o conftest conftest.c -lpnetcdf  -lhdf5_hl -lhdf5 -lm -lz -lcurl
> 
> with conftest.c being
> 
> #ifdef __cplusplus
> extern "C"
> #endif
> char ncmpi_create ();
> int
> main ()
> {
> return ncmpi_create ();
>  ;
>  return 0;
> }
> 
> The error:
> 
> /programs/intel-2019.5/pnetcdf/1.12.1/lib/libpnetcdf.so: undefined reference to `nc_get_var_text'
> /programs/intel-2019.5/pnetcdf/1.12.1/lib/libpnetcdf.so: undefined reference to `nc_get_varm_ulonglong'
> /programs/intel-2019.5/pnetcdf/1.12.1/lib/libpnetcdf.so: undefined reference to `nc_put_att_uchar'
> /programs/intel-2019.5/pnetcdf/1.12.1/lib/libpnetcdf.so: undefined reference to `nc_put_vara_uint'
> ...
> 
> Obviously, this refers to the NetCDF library. Adding -lnetcdf fixes this. However, I get other errors during the compilation.
> 
> Now the strange thing is that I was able to compile everything with a more recent version of the Intel compiler using the very same approach.
> 
> Do you have any idea what is happening? Sorry if I did something stupid...
> 
> Thanks a lot
> Sebastian



More information about the parallel-netcdf mailing list