source: issm/trunk-jpl/externalpackages/gmsh/install-4-mac.sh@ 28133

Last change on this file since 28133 was 28133, checked in by jdquinn, 13 months ago

CHG: Updating Gmsh 4 to latest version

  • Property svn:executable set to *
File size: 2.1 KB
Line 
1#!/bin/bash
2set -eu
3
4
5# TODO:
6# - Add support for,
7# - MUMPS
8# - PETSc
9#
10# See Also:
11# - configs/4/static/CMakeLists.txt
12# - http://gmsh.info/doc/texinfo/gmsh.html#Compiling-the-source-code
13#
14
15## Constants
16#
17VER="4.12.2"
18
19PREFIX="${ISSM_DIR}/externalpackages/gmsh/install" # Set to location where external package should be installed
20
21# Find libgfortran so that we do not have to hardcode it.
22#
23# TODO:
24# - Move this to etc/environment.sh
25#
26echo "Finding libgfortran..."
27LIBGFORTRAN=$(find /usr /opt -name libgfortran* 2>/dev/null | egrep -n libgfortran.a | egrep -v i386 | sed "s/[0-9]*://g" | head -1)
28LIBGFORTRAN_ROOT=${LIBGFORTRAN%/*}
29
30# Cleanup
31rm -rf ${PREFIX} src
32mkdir -p ${PREFIX} src
33
34# Download source
35$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gmsh-${VER}-source.tgz" "gmsh-${VER}-source.tgz"
36
37# Unpack source
38tar -xvzf gmsh-${VER}-source.tgz
39
40# Move source to 'src' directory
41mv gmsh-${VER}-source/* src
42rm -rf gmsh-${VER}-source
43
44# Apply patches
45patch src/CMakeLists.txt < configs/${VER}/mac/CMakeLists.txt.patch
46
47# Configure
48#
49# NOTE:
50# - Option -DENABLE_FLTK=0 is used because we do not need GUI.
51# - Option -DENABLE_MPEG_ENCODE=0 is used because we do not need to record MPEG
52# movies.
53# - Option -DENABLE_OCC=0 is used because we do not need CAD kernel and are not
54# importing STEP/IGES files.
55# - Option -DENABLE_TOUCHBAR=0 is used because we do not have GUI, therefore we
56# do not need to support Apple Touch bar (does not affect compilation on
57# Linux).
58#
59cd src
60cmake \
61 -DCMAKE_INSTALL_PREFIX="${PREFIX}" \
62 -DCMAKE_MACOSX_RPATH=ON \
63 -DCMAKE_INSTALL_RPATH="${PREFIX}/lib" \
64 -DCMAKE_BUILD_TYPE=Release \
65 -DENABLE_BUILD_DYNAMIC=1 \
66 -DENABLE_BUILD_SHARED=1 \
67 -DBLAS_LAPACK_LIBRARIES="-L${LAPACK_ROOT}/lib -lflapack -L${BLAS_ROOT}/lib -lfblas -L${LIBGFORTRAN_ROOT} -lgfortran" \
68 -DLIBGFORTRAN_ROOT="${LIBGFORTRAN_ROOT}" \
69 -DENABLE_BLAS_LAPACK=1 \
70 -DENABLE_EIGEN=0 \
71 -DENABLE_FLTK=0 \
72 -DENABLE_MPEG_ENCODE=0 \
73 -DENABLE_MPI=1 \
74 -DENABLE_OCC=0 \
75 -DENABLE_TOUCHBAR=0 \
76 -DMETIS_ROOT="${METIS_ROOT}"
77
78# Compile and install
79if [ $# -eq 0 ]; then
80 make
81 make install
82else
83 make -j $1
84 make -j $1 install
85fi
Note: See TracBrowser for help on using the repository browser.