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

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

CHG: Varied clean up

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