On Mon, Mar 17, 2014 at 11:11 AM, Boyce Griffith <email@example.com> wrote:
I was wondering if I could get some information about how an installed build of libMesh expects to interact with the bundled libraries --- and specifically with NetCDF. Is -lmesh_METHOD meant also to provide all of the archives for the contrib libraries, or are there some special cases?
The reason that I ask is that I regularly use ExodusII for I/O, and on most systems that I use, it seems like I do not need to include an explicit link to libnetcdf. Specifically, -lmesh_METHOD does the trick. (This is also what is suggested by 'libmesh-config --libs'.) However, when NetCDF is enabled, libnetcdf always appears to be installed along with the libMesh library archive, and on at least one system, I recently determined that I need to include -lnetcdf as a linker flag to avoid undefined symbols.
Hmm... well it appears that netcdf is included as one of the dependency libs in libmesh_METHOD.la file,dependency_libs=' /Users/username/projects/libmesh_git/install/lib/libnetcdf.la ...'
so if you use libtool to link I think you get netcdf.
On my system, netcdf does *not* appear to be included in the output of 'libmesh-config --libs' so this might be a bug for people that are not using libtool and are instead relying on the output of libmesh-config --libs to do their linking.Ben, any comments on this?--John