HomerReid / scuff-em

A comprehensive and full-featured computational physics suite for boundary-element analysis of electromagnetic scattering, fluctuation-induced phenomena (Casimir forces and radiative heat transfer), nanophotonics, RF device engineering, electrostatics, and more. Includes a core library with C++ and python APIs as well as many command-line applications.
http://www.homerreid.com/scuff-em
GNU General Public License v2.0
126 stars 50 forks source link

autogen.sh is not able to find HDF5 #91

Open zimoun opened 8 years ago

zimoun commented 8 years ago

this is relative, and hope will close, at least part of, bugs #66 #76.

These issues come from how configure.ac detects HDF5 header files and library. Especially, Debian does not store the header file hdf5.h in /usr/include but in /usr/include/hdf5/serial. And the library is somewhere, e.g., /usr/lib/x86_64-linux-gnu/hdf5/serial. Moreover, the option --with-hdf5=<dir> fixes then the flags at: CPPFLAGS=<dir>/include and LDFLAGS=<dir>/lib. However, this does not help to inform the configuration system to the both right locations.

There are different ways, more or less flexible, to fix that:

 sh autogen.sh
 ./configure CPPFLAGS="-I/usr/include/hdf5/serial -L/usr/lib/x86_64-linux-gnu/hdf5/serial" LDFLAGS=-L/usr/lib/x86_64-linux-gnu/hdf5/serial`
 make

(do not know exactly when scuff-em requires HDF5: compile time or linking time, etc. that's why it is maybe redundant)

Everything compiles, just some warnings e.g. in machcon.c, UserDefinedMaterials.cc, matheval.c, pcubature.c. And then, make check fails. I do not know if the fail comes from wrong HDF5 locations (at run-time) or not. I can open another bug report about that. Just, in short:

FAIL: unit-test-BEMMatrix
...
============================================================================
Testsuite summary for scuff-em 0.95
============================================================================
# TOTAL: 3
# PASS:  0
# SKIP:  0
# XFAIL: 0
# FAIL:  3
# XPASS: 0
# ERROR: 0

No idea yet if it is expected or not...

 sh autogen.sh --with-hdf5-includedir="/usr/include/hdf5/serial" --with-hdf5-libdir=/usr/lib/x86_64-linux-gnu/hdf5/serial
 make

and there is some warnings. Then, make check fails too.

Hope that help

HomerReid commented 8 years ago

Thanks for this contribution. I merged it in 25096c6. Hopefully this will help people get around confusing HDF5-related errors in the build process.

Alternatively, specifying the --without-hdf5 option to configure will remove HDF5 from the build process entirely. This not particularly disabling to the code---the only reason for including HDF5 support is to allow the export of internal matrices and vectors for use by algorithm developers, so users who are just interested in solving scattering problems will generally not need HDF5 support.