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

migrating.rst 3.5 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. Migrating from an earlier version
  2. =================================
  3. Many longtime GMT users have older scripts written in GMT 4 and even in GMT 5
  4. that may not work immediately in GMT 6. This reason is not that the syntax
  5. of the commands cannot be recognized ("GMT 6 shall be compatible with GMT 4
  6. and GMT 5 syntax"), but because the old scripts do not call the GMT module via
  7. the only installed program called :doc:`gmt`. Because of problems with "namespace
  8. pollution" (there are many open source programs called surface and triangulate and
  9. it is not possible to place them all in /usr/local/bin, for instance) the Linux
  10. distributions usually will only build the gmt executable and we access all modules
  11. via this single program, using the syntax **gmt module** [*options*].
  12. There are several ways to address the lack of using the gmt program:
  13. #. If you are building GMT from source (either from a checked-out GitHub repo or
  14. the source distributed via the tarballs, you can edit a parameter in the file
  15. *cmake/ConfigUser.cmake* and set **GMT_INSTALL_MODULE_LINKS** true. This will add
  16. symbolic links called **blockmean**, **pscoast**, **grdimage**, etc. that all point
  17. to the gmt executable. Your old scripts will now work without the leading gmt
  18. program for each module command.
  19. #. You can run the script *gmt_links.sh* which lives in the **share/tools** directory
  20. (run ``gmt --show-sharedir`` to find the path to share, then look in tools). If
  21. your GMT installation was installed outside your user directory you will need
  22. to run the script as root. It will create all the module links to allow users
  23. to run modules directly. You can run the link-building script this way::
  24. $(gmt --show-sharedir)/tools/gmt_links.sh
  25. which will report the status of any existing links. Add the argument *create*
  26. or *delete* to make actual changes.
  27. #. If your default shell is bash or similar then you can call another **share/tools**
  28. script called **gmt_functions.sh** this way::
  29. source $(gmt --show-sharedir)/tools/gmt_functions.sh
  30. It will instead create bash functions with the
  31. names of the modules and thus let you run **blockmean**, etc. without a leading
  32. gmt invocation.
  33. #. If your default shell is csh or similar then you must instead call **gmt_aliases.csh**
  34. which works similarly to the **gmt_functions.sh** but for csh::
  35. source `gmt --show-sharedir`/tools/gmt_aliases.csh
  36. Both of these two solutions can be implemented via your login setup so they are
  37. always set once you log in to your computer or open a new terminal window.
  38. #. Finally, if the old script is important and is expected to be used in the future,
  39. maybe it is worth the effort to migrate the script code to the stricter default
  40. GMT 6 syntax by starting each GMT command with gmt. If so, also consider to simplify
  41. the script (assuming if is a plotting script) by rewriting it in GMT modern mode.
  42. If your script is particularly old (GMT 3) it may also use a deprecated syntax that
  43. GMT no longer recognizes. If that is the case then you should consult the documentation for
  44. the old version (if you have access to it) and compare with the new documentation to
  45. determine the required changes. Error messages issued by GMT may help in that regard.
  46. Also note that GMT may issue compatibility warnings when it detects deprecated
  47. syntax. In those instances the obsolete syntax will be correctly parsed, but you
  48. may wish to take the opportunity and update the syntax when these issues are reported.
Tip!

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

Comments

Loading...