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

Last change on this file since 27191 was 27191, checked in by jdquinn, 3 years ago

BUG: libgfortran not being found under bash on macOS (grep -> egrep; split gmsh into mac and linux install scripts)

  • Property svn:executable set to *
File size: 2.0 KB
RevLine 
[27191]1#!/bin/bash
2set -eu
3
4
5# TODO:
6# - Add support for,
7# - BLAS_LAPACK
8# - MUMPS
9# - PETSC
10# (see configs/4/static/CMakeLists.txt)
11#
12
13## Constants
14#
15VER="4.5.6"
16
17PREFIX="${ISSM_DIR}/externalpackages/gmsh/install" # Set to location where external package should be installed
18
19# Find libgfortran so that we do not have to hardcode it.
20#
21# Should retrieve a copy of gfortran that is compiled from source before
22# returning one that is installed via package manager.
23#
24# TODO:
25# - Move this to etc/environment.sh
26#
27LIBGFORTRAN=$(mdfind -onlyin /usr -name libgfortran | 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# Configure
45#
46# NOTE:
47# - Option -DENABLE_FLTK=0 is used because we do not need GUI.
48# - Option -DENABLE_MPEG_ENCODE=0 is used because we do not need to record MPEG
49# movies.
50# - Option -DENABLE_OCC=0 is used because we do not need CAD kernel and are not
51# importing STEP/IGES files.
52# - Option -DENABLE_TOUCHBAR=0 is used because we do not have GUI, therefore we
53# do not need to support Apple Touch bar (does not affect compilation on
54# Linux).
55#
56cd src
57cmake \
58 -DCMAKE_INSTALL_PREFIX="${PREFIX}" \
59 -DENABLE_BUILD_DYNAMIC=1 \
60 -DENABLE_BUILD_SHARED=1 \
61 -DENABLE_FLTK=0 \
62 -DENABLE_MPEG_ENCODE=0 \
63 -DENABLE_MPI=1 \
64 -DENABLE_OCC=0 \
65 -DENABLE_TOUCHBAR=0 \
66 -DBLAS_LAPACK_LIBRARIES="-L${LAPACK_ROOT}/lib -lflapack -L${BLAS_ROOT}/lib -lfblas -L${LIBGFORTRAN_ROOT} -lgfortran" \
67 -DMETIS_ROOT="${METIS_ROOT}"
68
69# Compile and install
70if [ $# -eq 0 ]; then
71 make
72 make install
73else
74 make -j $1
75 make -j $1 install
76fi
77
78# Make necessary link on RHEL
79if [[ -d ${PREFIX}/lib64 && ! -d ${PREFIX}/lib ]]; then
80 cd ${PREFIX}
81 ln -s ./lib64 ./lib
82fi
Note: See TracBrowser for help on using the repository browser.