easybuilders / easybuild-easyblocks

Collection of easyblocks that implement support for building and installing software with EasyBuild.
https://easybuild.io
GNU General Public License v2.0
104 stars 284 forks source link

Siesta easyblock lacks NetCDF-4 support #1965

Closed mstud closed 4 years ago

mstud commented 4 years ago

Hi all, a user complained that our Siesta build does not generate certain output files which it actually should do. That's probably because it has just been built with -DCDF but not with -DNCDF -DNCDF_4 and that's what you want to have, apparently. A longer description of the issue can be found here:

https://answers.launchpad.net/siesta/+question/667589

where the suggestion is to build with:

FPPFLAGS += -DCDF -DNCDF -DNCDF_4
LIBS += -lnetcdff -lnetcdf -lhdf5_fortran -lhdf5 -lz

This brings netCDF-4 Format support (HDF5), see https://www.unidata.ucar.edu/software/netcdf/docs/netcdf_introduction.html#netcdf_4_format which is currently missing from the EasyBuild-built Siesta. I did not succeed in adding this to the easyblock myself and getting it to build without errors, so maybe someone could look into this?

migueldiascosta commented 4 years ago

@mstud you're right, netCDF support seems to be incomplete

Can you try this? (builds for me with version 4.1-b4)

--- siesta.py.orig  2020-02-15 00:00:26.485186165 +0800
+++ siesta.py   2020-02-19 13:58:02.382413497 +0800
@@ -177,7 +177,8 @@
             if netcdff_loc:
                 regex_subs.extend([
                     (r"^(LIBS\s*=.*)$", r"\1 $(NETCDF_LIBS)"),
-                    (r"^(FPPFLAGS\s*:?=.*)$", r"\1 -DCDF $(NETCDF_INCLUDE)"),
+                    (r"^(FPPFLAGS\s*:?=.*)$", r"\1 -DCDF -DNCDF -DNCDF_4 $(NETCDF_INCLUDE)"),
+                    (r"^(COMP_LIBS\s*=.*)$", r"\1 libncdf.a libfdict.a"),
                 ])
                 netcdf_lib_and_inc = "NETCDF_LIBS = -lnetcdff\nNETCDF_INCLUDE = -I%s/include" % netcdff_loc
                 regex_newlines.append((r"^(COMP_LIBS\s*=.*)$", r"\1\n%s" % netcdf_lib_and_inc))
mstud commented 4 years ago

@migueldiascosta yes, works for me, too. tbtrans now reports "NetCDF-4 support" properly. Thanks for the quick help.

migueldiascosta commented 4 years ago

@mstud you may also want to have a look at https://github.com/easybuilders/easybuild-easyblocks/pull/1973 and https://github.com/easybuilders/easybuild-easyconfigs/pull/9858 (which includes METIS as a dependency, via ELSI)