Skip to content

Installation

Ben Baker edited this page Aug 8, 2018 · 5 revisions

Prerequisites

Core Prerequisites

  1. A C11 compliant C compiler.
  2. A C14 compliant C++ compiler.
  3. CMake for generation of Makefiles.
  4. LAPACKE, LAPACK, and BLAS. A high-performance and free implementation of LAPACKE and BLAS for Intel processors is available in MKL.
  5. iniparser for parsing the initialization files.
  6. HDF5. At the moment HDF5 v. 1.10.1 is required.
  7. libxml2 for generation and parsing of XML messages.
  8. ISCL for C translations of some of the original Python NumPy functions.
  9. compearth. I intend this for to be merged back into Carl Tape's original repository so I'll have to update the link at some point.

Real-time

  1. Earthworm v7.8 or higher with geojson2ew. This, additionally, will require Jansson and RabbitMQ-c.

Earthquake Early Warning

  1. ActiveMQ for messaging. This will also require OpenSSL and the Apache Runtime Library.

Configuring CMake

I find the most expedient way to configure CMake is to make a configuration script to be run in the root directory. For example, in the root directory one might make a configure script, config.sh, that looks like

#!/bin/bash
if [ -f Makefile ]; then
   make clean
fi
if [ -f CMakeCache.txt ]; then
   echo "Removing CMakeCache.txt"
   rm CMakeCache.txt
fi
if [ -d CMakeFiles ]; then
   echo "Removing CMakeFiles"
   rm -rf CMakeFiles
fi
/usr/bin/cmake ./ \
-DCMAKE_BUILD_TYPE=DEBUG \
-DCMAKE_INSTALL_PREFIX=./ \
-DCMAKE_C_COMPILER=/usr/local/bin/clang \
-DCMAKE_CXX_COMPILER=/usr/local/bin/clang++ \
-DCMAKE_C_FLAGS="-g3 -O2 -Weverything -Wno-reserved-id-macro -Wno-padded -fopenmp" \
-DEW_BUILD_FLAGS="-Dlinux -D_LINUX -D_INTEL -D_USE_SCHED -D_USE_PTHREADS" \
-DCMAKE_CXX_FLAGS="-g3 -O2 -Weverything -fopenmp" \
-DGFAST_INSTANCE="PNSN" \
-DGFAST_USE_INTEL=TRUE \
-DGFAST_USE_AMQ=TRUE \
-DGFAST_USE_EW=TRUE \
-DAPR_INCLUDE_DIR=/usr/include/apr-1.0 \
-DLIBAMQ_INCLUDE_DIR=/home/bakerb25/cpp/activemq-cpp-library-3.9.3/include/activemq-cpp-3.9.3 \
-DLIBAMQ_LIBRARY=/home/bakerb25/cpp/activemq-cpp-library-3.9.3/lib/libactivemq-cpp.so \
-DLSSL_LIBRARY=/usr/lib/x86_64-linux-gnu/libssl.so \
-DLCRYPTO_LIBRARY=/usr/lib/x86_64-linux-gnu/libcrypto.so \
-DMKL_LIBRARY="/opt/intel/mkl/lib/intel64/libmkl_intel_lp64.so;/opt/intel/mkl/lib/intel64/libmkl_core.so;/opt/intel/mkl/lib/intel64/libmkl_sequential.so" \
-DIPP_LIBRARY="/opt/intel/ipp/lib/intel64/libipps.so;/opt/intel/ipp/lib/intel64/libippvm.so;/opt/intel/ipp/lib/intel64/libippcore.so" \
-DH5_C_INCLUDE_DIR=/home/bakerb25/C/hdf5-1.10.1_intel/include \
-DH5_LIBRARY=/home/bakerb25/C/hdf5-1.10.1_intel/lib/libhdf5.so \
-DINIPARSER_INCLUDE_DIR=/home/bakerb25/C/iniparser/src \
-DINIPARSER_LIBRARY=/home/bakerb25/C/iniparser/libiniparser.so.1 \
-DCOMPEARTH_INCLUDE_DIR=/home/bakerb25/C/compearth/momenttensor/c_src/include \
-DCOMPEARTH_LIBRARY=/home/bakerb25/C/compearth/momenttensor/c_src/lib/libcompearth_shared.so \
-DISCL_INCLUDE_DIR=/home/bakerb25/C/iscl/include \
-DISCL_LIBRARY="/home/bakerb25/C/iscl/lib/libiscl_shared.so;/opt/intel/lib/intel64/libirc.so" \
-DGEOLIB_LIBRARY=/home/bakerb25/C/GeographicLib-1.46/lib/libGeographic.so \
-DEW_INCLUDE_DIR=/home/bakerb25/C/earthworm/earthworm-working/include \
-DEW_LIBRARY="/home/bakerb25/C/earthworm/earthworm-working/lib/libew.a" \
-DLIBXML2_INCLUDE_DIR=/usr/include/libxml2 \
-DLIBXML2_LIBRARY=/usr/lib/x86_64-linux-gnu/libxml2.so

then would run it with

./config.sh

Assuming, this is successful the next step would be to build the software by entering in the root source directory

make

And installing the software with

make install

which may require sudo privileges.

Generating the Doxygen Documentation

If Doxygen is available the developer level documentation can be created by running

doxygen Doxyfile

in the root directory.

Clone this wiki locally