Skip to content

Compiling

mpentek edited this page Mar 30, 2020 · 19 revisions

Possible dependencies

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 (accurate as of 30.03.2020). Check and adapt setup in config.mk.

Steps

  1. Clone the WinGen to your local machine, go into the new library
  2. Necassary make for fftw: make fftw
  3. Make for src and test: make
  4. Navigate into the hdf5_demo folder: cd hdf5_demo
  5. Make the demo: make
  6. Test our your compilation with one of the example setup files (hdf5_demo_2d.wfs or hdf5_demo_3d.wfs): ./hdf5_demo hdf5_demo_3d.wfs
  7. Once done, visualize the resulting file windgen.h5 in an HDF5-viewer (such as HDFCompass)

Note

You should adapt the config.mk file to fit your necessities and system requirements. This example setup was done using:

WFS_ROOT              := /home/<username>/Repositories/WindGen

# ----------------------------------------------------------------------
#                               NO MPI
# ----------------------------------------------------------------------
CC                    := gcc
FFTW_CONFIG_FLAGS     := --prefix=$(WFS_ROOT)/fftw-3.3.3/
CFLAGS                := -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
# ----------------------------------------------------------------------
#                               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

For a proper setup of a consiedered case refer to Choice of parameters for a new case.

Project information

Getting started

Clone this wiki locally