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

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

CHG: More changes for new Mac Intel build node; clean up

  • Property svn:executable set to *
File size: 2.1 KB
RevLine 
[27191]1#!/bin/bash
2set -eu
3
4
5# TODO:
6# - Add support for,
7# - MUMPS
[27202]8# - PETSc
9#
10# See Also:
11# - configs/4/static/CMakeLists.txt
12# - http://gmsh.info/doc/texinfo/gmsh.html#Compiling-the-source-code
[27191]13#
14
15## Constants
16#
[27202]17VER="4.10.5"
[27191]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#
[27406]26echo "Finding libgfortran..."
[27541]27LIBGFORTRAN=$(find /usr /opt -name libgfortran* 2>/dev/null | egrep -n libgfortran.a | egrep -v i386 | sed "s/[0-9]*://g" | head -1)
[27191]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}" \
[27553]59 -DCMAKE_SKIP_RPATH=TRUE \
[27191]60 -DENABLE_BUILD_DYNAMIC=1 \
61 -DENABLE_BUILD_SHARED=1 \
[27202]62 -DBLAS_LAPACK_LIBRARIES="-L${LAPACK_ROOT}/lib -lflapack -L${BLAS_ROOT}/lib -lfblas -L${LIBGFORTRAN_ROOT} -lgfortran" \
63 -DENABLE_BLAS_LAPACK=1 \
64 -DENABLE_EIGEN=0 \
[27191]65 -DENABLE_FLTK=0 \
66 -DENABLE_MPEG_ENCODE=0 \
67 -DENABLE_MPI=1 \
68 -DENABLE_OCC=0 \
69 -DENABLE_TOUCHBAR=0 \
70 -DMETIS_ROOT="${METIS_ROOT}"
71
72# Compile and install
73if [ $# -eq 0 ]; then
74 make
75 make install
76else
77 make -j $1
78 make -j $1 install
79fi
80
81# Make necessary link on RHEL
82if [[ -d ${PREFIX}/lib64 && ! -d ${PREFIX}/lib ]]; then
83 cd ${PREFIX}
84 ln -s ./lib64 ./lib
85fi
Note: See TracBrowser for help on using the repository browser.