# Problem running example 1

**URL:** <https://forum.generic-mapping-tools.org/t/problem-running-example-1/2177>\
**Category:** Q&A\
**Created:** [October 7, 2021, 10:16pm UTC](https://forum.generic-mapping-tools.org/t/problem-running-example-1/2177 "2021-10-07T22:16:29Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tolu](https://avatars.discourse-cdn.com/v4/letter/t/7feea3/32.png) [@Tolu](https://forum.generic-mapping-tools.org/u/Tolu)\
**Post date:** [October 7, 2021, 10:16pm UTC](https://forum.generic-mapping-tools.org/t/problem-running-example-1/2177/1 "2021-10-07T22:16:29Z")

</div>

Have installed gmt from Synaptic package manager and am trying the first example.

But getting

```
hagbard@fuckup:~/05chaos/geosw/stg1$ ./gmt-ex1.sh

	GMT - The Generic Mapping Tools, Version 5.4.3 (r19528) [64-bit] [8 cores]
(c) 1991-2018 Paul Wessel, Walter H. F. Smith, Remko Scharroo, Joaquim Luis, and Florian Wobbe

Supported in part by the US National Science Foundation (http://www.nsf.gov/)
and volunteers from around the world (see http://gmt.soest.hawaii.edu/).

This program comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of this program under the terms of the
GNU Lesser General Public License (http://www.gnu.org/licenses/lgpl.html).
For more information about legal matters, see the file named LICENSE.TXT.

usage: gmt [options]
       gmt <module name> [<module-options>]

Session management:
  gmt clear history | conf | cache | all
                    Deletes gmt.history, gmt.conf, the user cache dir, or all of them

options:
  --help List descriptions of available GMT modules.
  --show-bindir Show directory with GMT executables.
  --show-cores Print number of available cores.
  --show-datadir Show directory/ies with user data.
  --show-modules List all module names.
  --show-library Show path of the shared GMT library.
  --show-plugindir Show directory for plug-ins.
  --show-sharedir Show directory for shared GMT resources.
  --version Print GMT version number.

if <module-options> is '=' we call exit (0) if module exist and non-zero otherwise.

ERROR: No module named begin was found. This could mean one of three cases:
  1. There actually is no such module; please check your spelling.
  2. Module exists in the GMT supplemental library, but the library could not be found.
  3. Module exists in a GMT custom library, but none was specified via GMT_CUSTOM_LIBS.
Shared libraries must be in standard system paths or set via environmental parameter LD_LIBRARY_PATH.

	GMT - The Generic Mapping Tools, Version 5.4.3 (r19528) [64-bit] [8 cores]
(c) 1991-2018 Paul Wessel, Walter H. F. Smith, Remko Scharroo, Joaquim Luis, and Florian Wobbe

Supported in part by the US National Science Foundation (http://www.nsf.gov/)
and volunteers from around the world (see http://gmt.soest.hawaii.edu/).

This program comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of this program under the terms of the
GNU Lesser General Public License (http://www.gnu.org/licenses/lgpl.html).
For more information about legal matters, see the file named LICENSE.TXT.

usage: gmt [options]
       gmt <module name> [<module-options>]

Session management:
  gmt clear history | conf | cache | all
                    Deletes gmt.history, gmt.conf, the user cache dir, or all of them

options:
  --help List descriptions of available GMT modules.
  --show-bindir Show directory with GMT executables.
  --show-cores Print number of available cores.
  --show-datadir Show directory/ies with user data.
  --show-modules List all module names.
  --show-library Show path of the shared GMT library.
  --show-plugindir Show directory for plug-ins.
  --show-sharedir Show directory for shared GMT resources.
  --version Print GMT version number.

if <module-options> is '=' we call exit (0) if module exist and non-zero otherwise.

ERROR: No module named subplot was found. This could mean one of three cases:
  1. There actually is no such module; please check your spelling.
  2. Module exists in the GMT supplemental library, but the library could not be found.
  3. Module exists in a GMT custom library, but none was specified via GMT_CUSTOM_LIBS.
Shared libraries must be in standard system paths or set via environmental parameter LD_LIBRARY_PATH.

	GMT - The Generic Mapping Tools, Version 5.4.3 (r19528) [64-bit] [8 cores]
(c) 1991-2018 Paul Wessel, Walter H. F. Smith, Remko Scharroo, Joaquim Luis, and Florian Wobbe

Supported in part by the US National Science Foundation (http://www.nsf.gov/)
and volunteers from around the world (see http://gmt.soest.hawaii.edu/).

This program comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of this program under the terms of the
GNU Lesser General Public License (http://www.gnu.org/licenses/lgpl.html).
For more information about legal matters, see the file named LICENSE.TXT.

usage: gmt [options]
       gmt <module name> [<module-options>]

Session management:
  gmt clear history | conf | cache | all
                    Deletes gmt.history, gmt.conf, the user cache dir, or all of them

options:
  --help List descriptions of available GMT modules.
  --show-bindir Show directory with GMT executables.
  --show-cores Print number of available cores.
  --show-datadir Show directory/ies with user data.
  --show-modules List all module names.
  --show-library Show path of the shared GMT library.
  --show-plugindir Show directory for plug-ins.
  --show-sharedir Show directory for shared GMT resources.
  --version Print GMT version number.

if <module-options> is '=' we call exit (0) if module exist and non-zero otherwise.

ERROR: No module named coast was found. This could mean one of three cases:
  1. There actually is no such module; please check your spelling.
  2. Module exists in the GMT supplemental library, but the library could not be found.
  3. Module exists in a GMT custom library, but none was specified via GMT_CUSTOM_LIBS.
Shared libraries must be in standard system paths or set via environmental parameter LD_LIBRARY_PATH.

grdcontour: Syntax error: Must specify a map projection with the -J option
grdcontour: Syntax error: Must specify a map projection with the -J option

	GMT - The Generic Mapping Tools, Version 5.4.3 (r19528) [64-bit] [8 cores]
(c) 1991-2018 Paul Wessel, Walter H. F. Smith, Remko Scharroo, Joaquim Luis, and Florian Wobbe

Supported in part by the US National Science Foundation (http://www.nsf.gov/)
and volunteers from around the world (see http://gmt.soest.hawaii.edu/).

This program comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of this program under the terms of the
GNU Lesser General Public License (http://www.gnu.org/licenses/lgpl.html).
For more information about legal matters, see the file named LICENSE.TXT.

usage: gmt [options]
       gmt <module name> [<module-options>]

Session management:
  gmt clear history | conf | cache | all
                    Deletes gmt.history, gmt.conf, the user cache dir, or all of them

options:
  --help List descriptions of available GMT modules.
  --show-bindir Show directory with GMT executables.
  --show-cores Print number of available cores.
  --show-datadir Show directory/ies with user data.
  --show-modules List all module names.
  --show-library Show path of the shared GMT library.
  --show-plugindir Show directory for plug-ins.
  --show-sharedir Show directory for shared GMT resources.
  --version Print GMT version number.

if <module-options> is '=' we call exit (0) if module exist and non-zero otherwise.

ERROR: No module named coast was found. This could mean one of three cases:
  1. There actually is no such module; please check your spelling.
  2. Module exists in the GMT supplemental library, but the library could not be found.
  3. Module exists in a GMT custom library, but none was specified via GMT_CUSTOM_LIBS.
Shared libraries must be in standard system paths or set via environmental parameter LD_LIBRARY_PATH.

grdcontour: Syntax error: Must specify a map projection with the -J option
grdcontour: Syntax error: Must specify a map projection with the -J option

	GMT - The Generic Mapping Tools, Version 5.4.3 (r19528) [64-bit] [8 cores]
(c) 1991-2018 Paul Wessel, Walter H. F. Smith, Remko Scharroo, Joaquim Luis, and Florian Wobbe

Supported in part by the US National Science Foundation (http://www.nsf.gov/)
and volunteers from around the world (see http://gmt.soest.hawaii.edu/).

This program comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of this program under the terms of the
GNU Lesser General Public License (http://www.gnu.org/licenses/lgpl.html).
For more information about legal matters, see the file named LICENSE.TXT.

usage: gmt [options]
       gmt <module name> [<module-options>]

Session management:
  gmt clear history | conf | cache | all
                    Deletes gmt.history, gmt.conf, the user cache dir, or all of them

options:
  --help List descriptions of available GMT modules.
  --show-bindir Show directory with GMT executables.
  --show-cores Print number of available cores.
  --show-datadir Show directory/ies with user data.
  --show-modules List all module names.
  --show-library Show path of the shared GMT library.
  --show-plugindir Show directory for plug-ins.
  --show-sharedir Show directory for shared GMT resources.
  --version Print GMT version number.

if <module-options> is '=' we call exit (0) if module exist and non-zero otherwise.

ERROR: No module named subplot was found. This could mean one of three cases:
  1. There actually is no such module; please check your spelling.
  2. Module exists in the GMT supplemental library, but the library could not be found.
  3. Module exists in a GMT custom library, but none was specified via GMT_CUSTOM_LIBS.
Shared libraries must be in standard system paths or set via environmental parameter LD_LIBRARY_PATH.

	GMT - The Generic Mapping Tools, Version 5.4.3 (r19528) [64-bit] [8 cores]
(c) 1991-2018 Paul Wessel, Walter H. F. Smith, Remko Scharroo, Joaquim Luis, and Florian Wobbe

Supported in part by the US National Science Foundation (http://www.nsf.gov/)
and volunteers from around the world (see http://gmt.soest.hawaii.edu/).

This program comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of this program under the terms of the
GNU Lesser General Public License (http://www.gnu.org/licenses/lgpl.html).
For more information about legal matters, see the file named LICENSE.TXT.

usage: gmt [options]
       gmt <module name> [<module-options>]

Session management:
  gmt clear history | conf | cache | all
                    Deletes gmt.history, gmt.conf, the user cache dir, or all of them

options:
  --help List descriptions of available GMT modules.
  --show-bindir Show directory with GMT executables.
  --show-cores Print number of available cores.
  --show-datadir Show directory/ies with user data.
  --show-modules List all module names.
  --show-library Show path of the shared GMT library.
  --show-plugindir Show directory for plug-ins.
  --show-sharedir Show directory for shared GMT resources.
  --version Print GMT version number.

if <module-options> is '=' we call exit (0) if module exist and non-zero otherwise.

ERROR: No module named end was found. This could mean one of three cases:
  1. There actually is no such module; please check your spelling.
  2. Module exists in the GMT supplemental library, but the library could not be found.
  3. Module exists in a GMT custom library, but none was specified via GMT_CUSTOM_LIBS.
Shared libraries must be in standard system paths or set via environmental parameter LD_LIBRARY_PATH.

hagbard@fuckup:~/05chaos/geosw/stg1$
```

---

<div class="post-metadata">

**Author:** ![Esteban82](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/esteban82/32/54_2.png) [@Esteban82](https://forum.generic-mapping-tools.org/u/Esteban82)\
**Post date:** [October 8, 2021, 2:39am UTC](https://forum.generic-mapping-tools.org/t/problem-running-example-1/2177/2 "2021-10-08T02:39:03Z")

</div>

What GMT version do you have? It seems you have 5.4.3 and you are running and script with modern syntax which is only available since version 6.

---

<div class="post-metadata">

**Author:** ![Tolu](https://avatars.discourse-cdn.com/v4/letter/t/7feea3/32.png) [@Tolu](https://forum.generic-mapping-tools.org/u/Tolu)\
**Post date:** [October 8, 2021, 11:17am UTC](https://forum.generic-mapping-tools.org/t/problem-running-example-1/2177/3 "2021-10-08T11:17:30Z")

</div>

I see, that makes sense then. It is what I was getting from my package manager. Shall get the newer version, install it, and see how that goes.

---

<div class="post-metadata">

**Author:** ![Tolu](https://avatars.discourse-cdn.com/v4/letter/t/7feea3/32.png) [@Tolu](https://forum.generic-mapping-tools.org/u/Tolu)\
**Post date:** [October 8, 2021, 12:16pm UTC](https://forum.generic-mapping-tools.org/t/problem-running-example-1/2177/4 "2021-10-08T12:16:58Z")

</div>

Built the latest release and ran some examples successfully.

---

<div class="post-metadata">

**Author:** ![Tolu](https://avatars.discourse-cdn.com/v4/letter/t/7feea3/32.png) [@Tolu](https://forum.generic-mapping-tools.org/u/Tolu)\
**Post date:** [October 8, 2021, 12:22pm UTC](https://forum.generic-mapping-tools.org/t/problem-running-example-1/2177/5 "2021-10-08T12:22:37Z")

</div>

Have exported some environment variables, but unsure of the path to the `netcdf` installation.  
Have installed `netcdf` through Synaptic Package Manager.

This is what I have got

```
   GMTHOME=/usr/local/bin/gmt
   PATH="$PATH:$GMTHOME/bin"
   NETCDFHOME=/usr/lib
   NETCDF_PREFIX=$NETCDFHOME
   MANPATH="$MANPATH:$GMTHOME/man"

   export GMTHOME
   export PATH
   export NETCDFHOME
   export MANPATH

```

Although tho path to the `netcdf` is incorrect

---

<div class="post-metadata">

**Author:** ![Tolu](https://avatars.discourse-cdn.com/v4/letter/t/7feea3/32.png) [@Tolu](https://forum.generic-mapping-tools.org/u/Tolu)\
**Post date:** [October 8, 2021, 12:29pm UTC](https://forum.generic-mapping-tools.org/t/problem-running-example-1/2177/6 "2021-10-08T12:29:53Z")

</div>

In previous installations one did set path to netcdf as listed next

```
   NETCDFHOME=/usr/lib
   NETCDF_PREFIX=$NETCDFHOME

```

But reading the `BUILDING.md` file, it mentions only the path to gmt.

`export PATH=${PATH}:/path/to/gmt/bin`

---

<div class="post-metadata">

**Author:** ![Tolu](https://avatars.discourse-cdn.com/v4/letter/t/7feea3/32.png) [@Tolu](https://forum.generic-mapping-tools.org/u/Tolu)\
**Post date:** [October 8, 2021, 12:40pm UTC](https://forum.generic-mapping-tools.org/t/problem-running-example-1/2177/7 "2021-10-08T12:40:21Z")

</div>

For the netcdf installation I have the following paths

```
/.
/usr
/usr/bin
/usr/bin/nc-config
/usr/include
/usr/include/netcdf.h
/usr/include/netcdf_mem.h
/usr/include/netcdf_meta.h
/usr/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/cmake
/usr/lib/x86_64-linux-gnu/cmake/netCDF
/usr/lib/x86_64-linux-gnu/cmake/netCDF/netCDFConfig.cmake
/usr/lib/x86_64-linux-gnu/cmake/netCDF/netCDFConfigVersion.cmake
/usr/lib/x86_64-linux-gnu/cmake/netCDF/netCDFTargets-none.cmake
/usr/lib/x86_64-linux-gnu/cmake/netCDF/netCDFTargets.cmake
/usr/lib/x86_64-linux-gnu/libnetcdf.settings
/usr/lib/x86_64-linux-gnu/libnetcdf.so
/usr/lib/x86_64-linux-gnu/pkgconfig
/usr/lib/x86_64-linux-gnu/pkgconfig/netcdf.pc
/usr/share
/usr/share/doc
/usr/share/doc/libnetcdf-dev
/usr/share/doc/libnetcdf-dev/changelog.Debian.gz
/usr/share/doc/libnetcdf-dev/copyright
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/nc-config.1.gz
/usr/share/man/man3
/usr/share/man/man3/netcdf.3.gz
```

---

<div class="post-metadata">

**Author:** ![Tolu](https://avatars.discourse-cdn.com/v4/letter/t/7feea3/32.png) [@Tolu](https://forum.generic-mapping-tools.org/u/Tolu)\
**Post date:** [October 8, 2021, 12:53pm UTC](https://forum.generic-mapping-tools.org/t/problem-running-example-1/2177/8 "2021-10-08T12:53:54Z")

</div>

Although I do not see why the gmt developers are bothering users with finding the netcdf path to export.

---

<div class="post-metadata">

**Author:** ![Esteban82](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/esteban82/32/54_2.png) [@Esteban82](https://forum.generic-mapping-tools.org/u/Esteban82)\
**Post date:** [October 9, 2021, 12:41am UTC](https://forum.generic-mapping-tools.org/t/problem-running-example-1/2177/9 "2021-10-09T00:41:45Z")

</div>

What operating system do you have?

---

<div class="post-metadata">

**Author:** ![Tolu](https://avatars.discourse-cdn.com/v4/letter/t/7feea3/32.png) [@Tolu](https://forum.generic-mapping-tools.org/u/Tolu)\
**Post date:** [October 9, 2021, 12:47am UTC](https://forum.generic-mapping-tools.org/t/problem-running-example-1/2177/10 "2021-10-09T00:47:35Z")

</div>

I am using Ubuntu 20.04 LTS. Are there examples using GSHHG 2.3.7 and DCW 2.0.0 ?

---

<div class="post-metadata">

**Author:** ![Esteban82](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/esteban82/32/54_2.png) [@Esteban82](https://forum.generic-mapping-tools.org/u/Esteban82)\
**Post date:** [October 9, 2021, 12:54am UTC](https://forum.generic-mapping-tools.org/t/problem-running-example-1/2177/11 "2021-10-09T00:54:20Z")

</div>

Ok. The same as me.

You could try:

> gmt coast -R-30/30/-40/40 -Jm0.1i -B5 -I1/1p,blue -N1/0.25p,- -I2/0.25p,blue -W0.25p,white -Sblue -png africa -ENA+gred

 ![africa](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/c/ce8242a0348d3c1b66c99ac8a2d299dcb1b017be.png)

---

<div class="post-metadata">

**Author:** ![Tolu](https://avatars.discourse-cdn.com/v4/letter/t/7feea3/32.png) [@Tolu](https://forum.generic-mapping-tools.org/u/Tolu)\
**Post date:** [October 9, 2021, 12:57am UTC](https://forum.generic-mapping-tools.org/t/problem-running-example-1/2177/12 "2021-10-09T00:57:36Z")

</div>

There should be examples for testing the installation using GSHHG and DCW. There does not seem to be such a distinction in the examples.

---

<div class="post-metadata">

**Author:** ![Tolu](https://avatars.discourse-cdn.com/v4/letter/t/7feea3/32.png) [@Tolu](https://forum.generic-mapping-tools.org/u/Tolu)\
**Post date:** [October 9, 2021, 12:58am UTC](https://forum.generic-mapping-tools.org/t/problem-running-example-1/2177/13 "2021-10-09T00:58:20Z")

</div>

I got the plot. Thank you.

---

<div class="post-metadata">

**Author:** ![Esteban82](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/esteban82/32/54_2.png) [@Esteban82](https://forum.generic-mapping-tools.org/u/Esteban82)\
**Post date:** [October 9, 2021, 1:04am UTC](https://forum.generic-mapping-tools.org/t/problem-running-example-1/2177/14 "2021-10-09T01:04:05Z")

</div>

In the gallery there are lot of examples for testing the installation. Those datasets are used by the module coast. You can check for examples in the docs.

> **[Example Gallery — GMT 6.2.0 documentation](https://docs.generic-mapping-tools.org/latest/gallery.html)**

---

<div class="post-metadata">

**Author:** ![Tolu](https://avatars.discourse-cdn.com/v4/letter/t/7feea3/32.png) [@Tolu](https://forum.generic-mapping-tools.org/u/Tolu)\
**Post date:** [October 9, 2021, 1:05am UTC](https://forum.generic-mapping-tools.org/t/problem-running-example-1/2177/15 "2021-10-09T01:05:31Z")

</div>

Yes, but I am unsure which ones are testing GSHHG, and which DCW, and which other things. As regards `netcdf`, does one still have to specify the netcdf paths using environment variables?

---

<div class="post-metadata">

**Author:** ![Esteban82](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/esteban82/32/54_2.png) [@Esteban82](https://forum.generic-mapping-tools.org/u/Esteban82)\
**Post date:** [October 9, 2021, 1:08am UTC](https://forum.generic-mapping-tools.org/t/problem-running-example-1/2177/16 "2021-10-09T01:08:52Z")

</div>

You can red these links:

> **[The Global Self-consistent, Hierarchical, High-resolution Geography Database...](https://docs.generic-mapping-tools.org/dev/datasets/gshhg.html)**

> **[The Digital Chart of the World Data (DCW) — GMT 6.3.0 documentation](https://docs.generic-mapping-tools.org/dev/datasets/dcw.html)**
