-
Notifications
You must be signed in to change notification settings - Fork 2
Compiling
For compiling on Linux-based systems you will need the HDF5 libraries for development:
- OpenMP:
sudo apt-get install libhdf5-dev
- MPI:
sudo apt-get install llibhdf5-openmpi-dev
Further dependencies will be prompted for during compilation, if needed. These seem to be the necessary ones in case of a serial (OpenMP) compilation on Ubuntu 18.04 LTS (Linux 4.4.0-91 - accurate as of 30.03.2020). Check and adapt setup in config.mk
.
Currently these are known to work with the HDF5 versions:
- 1.10.0-patch1 (OpenMP)
- 1.10.7 (OpenMP)
- 1.10.2 (MPI)
- 1.12.0 (MPI)
If you are running HDF5 with version greater than 1.10.2, (ex: 1.12.0) you might need to add following flags.
CFLAGS += -DH5_USE_110_API -ldl
Check your current version in terminal with h5cc -showconfig
.
- Clone the WinGen to your local machine, go into the new library
- Necassary make for
fftw
:make fftw
- Make for
src
andtest
:make
- Navigate into the
hdf5_demo
folder:cd hdf5_demo
- Make the demo:
make
- Test our your compilation with one of the example setup files (
hdf5_demo_2d.wfs
orhdf5_demo_3d.wfs
):./hdf5_demo hdf5_demo_3d.wfs
- Once done, visualize the resulting file
windgen.h5
in an HDF5-viewer (such as HDFCompass)
Here once again all steps once you are in the local folder WindGen
:
make fftw
make
cd hdf5_demo
make
And to generate a case
cd hdf5_demo
# for a 3d predefined setup
./hdf5_demo hdf5_demo_3d.wfs
# for a 2d predefined setup
./hdf5_demo hdf5_demo_2d.wfs
You should adapt the config.mk
file to fit your necessities and system requirements.
This example serial setup (Ubuntu 22.04.2 LTS - Linux 5.19.0-41-generic & GCC 11.3.0 & HDF5 1.10.7) was done using:
WFS_ROOT := /<path_to_windgen>/WindGen
# ----------------------------------------------------------------------
# NO MPI
# ----------------------------------------------------------------------
CC := gcc-11
FFTW_CONFIG_FLAGS := --prefix=$(WFS_ROOT)/fftw-3.3.10/
CFLAGS := -O2 -ffast-math -freciprocal-math -I $(WFS_ROOT)/src -I $(WFS_ROOT)/fftw-3.3.10/include
LDFLAGS := -L $(WFS_ROOT)/src -L $(WFS_ROOT)/fftw-3.3.10/lib
LDFLAGS += -lwfs -lfftw3
# ----------------------------------------------------------------------
# HDF5
# ----------------------------------------------------------------------
HDF5_ROOT := /usr/lib/x86_64-linux-gnu
ZLIB_ROOT := /usr/lib/x86_64-linux-gnu
SZIP_ROOT := /usr/lib/x86_64-linux-gnu
CFLAGS += -I/usr/include/hdf5/serial -DHAVE_HDF5
LDFLAGS += $(HDF5_ROOT)/hdf5/serial/libhdf5.a
# ----------------------------------------------------------------------
LDFLAGS += -pthread -lsz -lz -ldl -lm
This example parallel setup (Linux 3.13.0-87 & HDF5 1.10.2) (ATTENTION: this needs to be updated for the lates FFTW and GCC!) was done using:
WFS_ROOT := /<path_to_windgen>/WindGen
# ----------------------------------------------------------------------
# MPI
# ----------------------------------------------------------------------
CC := mpicc
FFTW_CONFIG_FLAGS := --enable-mpi --prefix=$(WFS_ROOT)/fftw-3.3.3/
CFLAGS := -DHAVE_MPI -O0 -I $(WFS_ROOT)/src -I $(WFS_ROOT)/fftw-3.3.3/include
LDFLAGS := -L $(WFS_ROOT)/src -L $(WFS_ROOT)/fftw-3.3.3/lib
LDFLAGS += -lwfs -lfftw3_mpi -lfftw3
# ----------------------------------------------------------------------
# HDF5
# ----------------------------------------------------------------------
HDF5_ROOT := /<path_to_hdf5>/hdf5/1.10.2-intel-726msh6
ZLIB_ROOT := /<path_to_zlib>/zlib-1.2.11-install
SZIP_ROOT := /<path_to_szip>/szip/2.1
CFLAGS += -DHAVE_HDF5 -I $(HDF5_ROOT)/include
LDFLAGS += $(HDF5_ROOT)/lib/libhdf5.a $(ZLIB_ROOT)/lib/libz.a $(SZIP_ROOT)/lib/libsz.a
# ----------------------------------------------------------------------
LDFLAGS += -pthread -lsz -lz -ldl -lm
For a proper setup of a considered case refer to the Choice of parameters for a new case.
- Compiling
- Choice of parameters for a new case
- Checking input in an empty channel