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

Last change on this file since 28197 was 28197, checked in by jdquinn, 12 months ago

CHG: External package upgrades; fixes for distributables; cleanup

  • Property svn:executable set to *
File size: 2.2 KB
Line 
1#!/bin/bash
2set -e
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# Environment
31#
32export CXXFLAGS="${CXXFLAGS} -w"
33
34# Cleanup
35rm -rf ${PREFIX} src
36mkdir -p ${PREFIX} src
37
38# Download source
39$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/gmsh-${VER}-source.tgz" "gmsh-${VER}-source.tgz"
40
41# Unpack source
42tar -xvzf gmsh-${VER}-source.tgz
43
44# Move source to 'src' directory
45mv gmsh-${VER}-source/* src
46rm -rf gmsh-${VER}-source
47
48# Apply patches
49patch src/CMakeLists.txt < configs/${VER}/mac/CMakeLists.txt.patch
50
51# Configure
52#
53# NOTE:
54# - Option -DENABLE_FLTK=0 is used because we do not need GUI.
55# - Option -DENABLE_MPEG_ENCODE=0 is used because we do not need to record MPEG
56# movies.
57# - Option -DENABLE_OCC=0 is used because we do not need CAD kernel and are not
58# importing STEP/IGES files.
59# - Option -DENABLE_TOUCHBAR=0 is used because we do not have GUI, therefore we
60# do not need to support Apple Touch bar (does not affect compilation on
61# Linux).
62#
63cd src
64cmake \
65 -DCMAKE_INSTALL_PREFIX="${PREFIX}" \
66 -DCMAKE_MACOSX_RPATH=ON \
67 -DCMAKE_INSTALL_RPATH="${PREFIX}/lib" \
68 -DCMAKE_BUILD_TYPE=Release \
69 -DENABLE_BUILD_DYNAMIC=1 \
70 -DENABLE_BUILD_SHARED=1 \
71 -DBLAS_LAPACK_LIBRARIES="-L${LAPACK_ROOT}/lib -lflapack -L${BLAS_ROOT}/lib -lfblas -L${LIBGFORTRAN_ROOT} -lgfortran" \
72 -DLIBGFORTRAN_ROOT="${LIBGFORTRAN_ROOT}" \
73 -DENABLE_BLAS_LAPACK=1 \
74 -DENABLE_EIGEN=0 \
75 -DENABLE_FLTK=0 \
76 -DENABLE_MPEG_ENCODE=0 \
77 -DENABLE_MPI=1 \
78 -DENABLE_OCC=0 \
79 -DENABLE_TOUCHBAR=0 \
80 -DMETIS_ROOT="${METIS_ROOT}"
81
82# Compile and install
83if [ $# -eq 0 ]; then
84 make
85 make install
86else
87 make -j $1
88 make -j $1 install
89fi
Note: See TracBrowser for help on using the repository browser.