MPAS | netcdf-c-4.7.4 final link failed - nonrepresentable section on output
Issue
In order to write netCDF-4 files, you must have the NetCDF-4 C library (libnetcdf) - version 4.3.1 or above - available on your system, along with all supporting libraries (libhdf5, libz, etc). The details of this differ for each operating system.
nc-config and libnetcdf.so are expected to be generated. And, check with
nc-config --cflags nc-config --libs
netcdf-c-4.7.4
final link failed: nonrepresentable section on output
Solution
- [ ] have to add --disable-shared to avoid Error-ld: final link failed: nonrepresentable section on output.
- [x] add -enable-static
Ref:
In the common case that these are switches to a "configure" script generated by Autoconf and Libtool, then they officially mean closely-related, but different, things. --enable-static means do build static libraries; --disable-shared means don't build shared libraries. If you want to be sure to get only static libraries, no matter what, you need to give both options. However, often just --disable-shared will have that effect, because think about the possibilities: if the package builds only static libraries by default, then --disable-shared is a no-op; if it builds both static and shared libraries by default, then you just have to turn off the shared libraries to get what you want; and if it builds only shared libraries by default, then you might think you need both options, but if you just say --disable-shared, Libtool will usually notice that it's now being asked to build nothing, assume that that couldn't possibly be what you wanted, and flip the --enable-static switch for you.
1 |
|