-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathPROJ.4-9.2.0_install
executable file
·89 lines (70 loc) · 2.88 KB
/
PROJ.4-9.2.0_install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/usr/bin/env bash
###############################################
# Installing PROJ.4 using GCC
#
# by Brian Alston, 2015
#
# Updated November 2016 to add missing proj_def.dat
# to .../PROJ.4/4.9.1/share/proj/
# Updated April 2019 for version 6.0.0
# Updated June 2019 for version 6.1.0
# Updated July 2019 to add epasg datum file required by R package sf
# Updated April 2020 for version 7.0.0 using GNU 9.2.0
# Updated September 2021 for version 8.1.1 using GNU 10.2.0
# Updated June 2023 for version 9.2.0 using GNU 10.2.0
#
# Using Ian's require function to load modules
#
# Will need modules: rcps-core/1.0.0, gcc-libs/4.9.2, compilers/gnu/4.9.2
# Now needs gcc-libs/10.2.0, compilers/gnu/10.2.0 and sqlite/3.36.0/gnu-10.2.0 from beta-modules
# Major change in this version - MUST be built using CMAKE!
VERSION=${VERSION:-9.2.0}
DATA_VERSION=${DATA_VERSION:-1.13}
DATUM_VERSION=${DATUM_VERSION:-1.8}
INSTALL_PREFIX=${INSTALL_PREFIX:-/shared/ucl/apps/PROJ.4/${VERSION}}
MD5=${MD5:-1241c7115d8c380ea19469ba0828a22a}
SRC_ARCHIVE=${SRC_ARCHIVE:- https://download.osgeo.org/proj/proj-${VERSION}.tar.gz}
DATA_ARCHIVE=${DATUM_ARCHIVE:- http://download.osgeo.org/proj/proj-data-${DATA_VERSION}.tar.gz}
# May no longer be needed and doesn't exist at this location anymore.
EPSG_ARCHIVE=${EPSG_ARCHIVE:- https://rpmfind.net/linux/fedora/linux/releases/30/Everything/aarch64/os/Packages/p/proj-epsg-5.2.0-1.fc30.aarch64.rpm}
export PATH=$INSTALL_PREFIX/bin:$PATH
dirname=$(dirname $0 2>/dev/null || pwd)
INCLUDES_DIR=${INCLUDES_DIR:-${dirname}/includes}
source ${INCLUDES_DIR}/module_maker_inc.sh
source ${INCLUDES_DIR}/require_inc.sh
require beta-modules
require gcc-libs/10.2.0
require cmake/3.21.1
require compilers/gnu/10.2.0
require sqlite/3.36.0/gnu-10.2.0
# require gmt/recommended
temp_dir=`mktemp -d -p /dev/shm`
cd $temp_dir
wget --no-check-certificate $SRC_ARCHIVE
# wget $DATA_ARCHIVE projsync is used to download data files.
# wget $EPSG_ARCHIVE
CHECKSUM=`md5sum proj-${VERSION}.tar.gz| awk '{print $1}'`
# Suggest build sequence is slighty different than previous versions.
if [[ "$MD5" == "$CHECKSUM" ]]
then
tar xvzf proj-${VERSION}.tar.gz
cd proj-${VERSION}
# build now uses CMAKE
mkdir build
cd build
cmake -D SQLITE3_INCLUDE_DIR=/shared/ucl/apps/SQLite/3360000/include -D SQLITE3_LIBRARY=/shared/ucl/apps/SQLite/3360000/lib/libsqlite3.so -D CMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} ..
cmake --build .
cmake --build . --target install
# Get data files
export PATH=${INSTALL_PREFIX}/bin:$PATH
projsync --system-directory --all
cd $temp_dir
# epsg is required by R package sf - May no longer be needed - could acess
# from version 7.0.0 install if needed.
# rpm2cpio proj-epsg-5.2.0-1.fc30.aarch64.rpm | cpio -idmv
# cp ./usr/share/proj/epsg ${INSTALL_PREFIX}/share/proj/
else
echo "***** Hash mismatch,"
echo " Expected: $MD5"
echo " Got: $CHECKSUM"
fi