0

When compiling IOAPI-3.1, I encountered this error:

cd /home/usr/ioapi/Linux2_x86_64gfort; gfortran  /home/usr/ioapi/Linux2_x86_64gfort/airs2m3.o -L/home/usr/ioapi/Linux2_x86_64gfort -lioapi -lnetcdff -lnetcdf -fopenmp -dynamic -L/usr/lib64 -lm -lpthread -lc  -o airs2m3
/usr/bin/ld: /home/usr/ioapi/Linux2_x86_64gfort/libnetcdf.a(libnetcdf4_la-nc4file.o): undefined reference to symbol 'H5DSget_num_scales@@HDF5_SERIAL_1.8.7'
/usr/lib/mpich/lib/libhdf5_serial_hl.so.100: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Makefile:181: recipe for target 'airs2m3' failed
make[1]: *** [airs2m3] Error 1
make[1]: Leaving directory '/home/usr/ioapi/m3tools'
Makefile:141: recipe for target 'all' failed
make: *** [all] Error 2

I've read this post which is related to my problem Strange linking error: DSO missing from command line but I was unable to follow the solutions presented due to my relative inexperience with Linux.

Could you give me ideas to solve this?

egarcia
  • 1
  • 2

1 Answers1

0

You don't link with the HDF5 library.

Static libraries (like the netcdf library is) is nothing more than an archive of object files, it's really no different than specifying the object files themselves on the command line. As such, all dependencies of a static library must be specified when linking.

Also remember that order matters. If library A depends on library B, then A must come before B on the command line.

Some programmer dude
  • 400,186
  • 35
  • 402
  • 621