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

Last change on this file since 27397 was 27397, checked in by jdquinn, 2 years ago

CHG: Updates to way we discover libgfortran in ext pkg install scripts; file name; compact unbind warning suppression.

  • Property svn:executable set to *
File size: 2.0 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.10.5"
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#
26LIBGFORTRAN=$(find /usr -name libgfortran* 2>/dev/null | egrep -n libgfortran.a | sed "s/[0-9]*://g" | head -1)
27LIBGFORTRAN_ROOT=${LIBGFORTRAN%/*}
28
29# Cleanup
30rm -rf ${PREFIX} src
31mkdir -p ${PREFIX} src
32
33# Download source
34$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gmsh-${VER}-source.tgz" "gmsh-${VER}-source.tgz"
35
36# Unpack source
37tar -xvzf gmsh-${VER}-source.tgz
38
39# Move source to 'src' directory
40mv gmsh-${VER}-source/* src
41rm -rf gmsh-${VER}-source
42
43# Configure
44#
45# NOTE:
46# - Option -DENABLE_FLTK=0 is used because we do not need GUI.
47# - Option -DENABLE_MPEG_ENCODE=0 is used because we do not need to record MPEG
48# movies.
49# - Option -DENABLE_OCC=0 is used because we do not need CAD kernel and are not
50# importing STEP/IGES files.
51# - Option -DENABLE_TOUCHBAR=0 is used because we do not have GUI, therefore we
52# do not need to support Apple Touch bar (does not affect compilation on
53# Linux).
54#
55cd src
56cmake \
57 -DCMAKE_INSTALL_PREFIX="${PREFIX}" \
58 -DENABLE_BUILD_DYNAMIC=1 \
59 -DENABLE_BUILD_SHARED=1 \
60 -DBLAS_LAPACK_LIBRARIES="-L${LAPACK_ROOT}/lib -lflapack -L${BLAS_ROOT}/lib -lfblas -L${LIBGFORTRAN_ROOT} -lgfortran" \
61 -DENABLE_BLAS_LAPACK=1 \
62 -DENABLE_EIGEN=0 \
63 -DENABLE_FLTK=0 \
64 -DENABLE_MPEG_ENCODE=0 \
65 -DENABLE_MPI=1 \
66 -DENABLE_OCC=0 \
67 -DENABLE_TOUCHBAR=0 \
68 -DMETIS_ROOT="${METIS_ROOT}"
69
70# Compile and install
71if [ $# -eq 0 ]; then
72 make
73 make install
74else
75 make -j $1
76 make -j $1 install
77fi
78
79# Make necessary link on RHEL
80if [[ -d ${PREFIX}/lib64 && ! -d ${PREFIX}/lib ]]; then
81 cd ${PREFIX}
82 ln -s ./lib64 ./lib
83fi
Note: See TracBrowser for help on using the repository browser.