Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

build-gmt-master.sh 1.6 KB

You have to be logged in to leave a comment. Sign In
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
  1. #!/usr/bin/env bash
  2. #
  3. # Build the lastest GMT source codes.
  4. #
  5. # Usage:
  6. #
  7. # 1. Install GMT dependencies following the [wiki](https://github.com/GenericMappingTools/gmt/wiki)
  8. # 2. curl https://raw.githubusercontent.com/GenericMappingTools/gmt/master/ci/build-gmt-master.sh | bash
  9. #
  10. # Environmental variables that affect the building process:
  11. #
  12. # - GMT_INSTALL_DIR: GMT installation location
  13. #
  14. set -x -e
  15. # Following variables can be modified via environment variables
  16. GMT_INSTALL_DIR=${GMT_INSTALL_DIR:-${HOME}/gmt-install-dir}
  17. # General settings
  18. GSHHG_VERSION="2.3.7"
  19. DCW_VERSION="1.1.4"
  20. GSHHG="gshhg-gmt-${GSHHG_VERSION}"
  21. DCW="dcw-gmt-${DCW_VERSION}"
  22. EXT="tar.gz"
  23. cwd=${PWD}
  24. # 1. Create temporary directory for building
  25. GMT_BUILD_TMPDIR=$(mktemp -d ${TMPDIR:-/tmp/}gmt.XXXXXX)
  26. cd ${GMT_BUILD_TMPDIR}
  27. # 2. Download GMT, GSHHG and DCW from GitHub
  28. git clone --depth 1 https://github.com/GenericMappingTools/gmt.git gmt
  29. curl -SLO https://github.com/GenericMappingTools/gshhg-gmt/releases/download/${GSHHG_VERSION}/${GSHHG}.${EXT}
  30. curl -SLO https://github.com/GenericMappingTools/dcw-gmt/releases/download/${DCW_VERSION}/${DCW}.${EXT}
  31. # 3. Extract tarballs
  32. tar -xvf ${GSHHG}.${EXT}
  33. tar -xvf ${DCW}.${EXT}
  34. mv ${GSHHG} gmt/share/gshhg-gmt
  35. mv ${DCW} gmt/share/dcw-gmt
  36. # 4. Configure GMT
  37. cd gmt/
  38. cat > cmake/ConfigUser.cmake << EOF
  39. set (CMAKE_INSTALL_PREFIX "${GMT_INSTALL_DIR}")
  40. set (CMAKE_C_FLAGS "-Wall -Wdeclaration-after-statement \${CMAKE_C_FLAGS}")
  41. set (CMAKE_C_FLAGS "-Wextra \${CMAKE_C_FLAGS}")
  42. EOF
  43. # 5. Build and install GMT
  44. mkdir build
  45. cd build
  46. cmake ..
  47. make
  48. make install
  49. # 6. Cleanup
  50. cd ${cwd}
  51. rm -rf ${GMT_BUILD_TMPDIR}
  52. set -x -e
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...