[PYTHON] GMT installation part 1.

20160801

On Windows 10. Even though it's on ʻAnaconda` above WSL.

GMT is a map drawing command that can also draw graphs.

  1. Enable WSL
  2. Install Anaconda
  3. GMT4.5
  4. GMT5

1. Enable WSL

Windows Subsystem for Linux

windows 10 only

  1. Settings app => Update & Security => For developers => Select developer mode
  2. After rebooting, enable or disable Windows features from Programs and Features (right-click the Start button) => Enable Windows Subsystem for Linux
  3. After rebooting if necessary, type bash on cmd.exe to set the user name and password

First

$ sudo vi /etc/hosts

Second line

127.0.1.1 YOURHOSTNAME

Add

$ sudo apt-get install build-essential gfortran
$ sudo apt-get install ghostscript

Install the compiler etc. with. As for ghostscript, since it is required by gmt

2. Install Anaconda

https://www.continuum.io/downloads

Download ʻAnaconda3-4.X.X-Linux-x86_64.sh` for Linux from

$ bash ./Anaconda3-4.1.1-Linux-x86_64.sh

Is usually installed in $ {HOME} / anaconda3.

--Yes to the question --You can follow the installer's instructions for PATH, or you can register it yourself.

New environment construction

$ conda create -n gmt4 anaconda      #Environment creation
$ conda create -n gmt5 anaconda      #Environment creation
$ source activate gmt5               #Environment call

libcom_err.so.3

** Only when installing GMT5 **

--Because the following error occurs when executing make all of gmt5

/usr/bin/ld: warning: libcom_err.so.3, needed by ${HOME}/anaconda3/env/gmt5/lib/libgdal.so, not found (try using -rpath or -rpath-link)

Look for libcom_err.so * and symlink it and it will work.

$ cd ${HOME}/anaconda3/env/gmt5/lib
$ ln -s /lib/x86_64-linux-gnu/libcom_err.so.2.1 libcom_err.so.3

Since it differs depending on the environment, it is necessary to search for / lib, / usr / lib, / lib64, / usr / lib64, etc.

Minimal library command installation for GMT

netcdf4 etc. are included by default [^ 1].

[^ 1]: [Updated on May 24, 2019] It seems that it may not be included in Anaconda with a different version, so in that case, conda install netcdf4.

$ conda install -c menpo fftw         #Installation of libraries for GMT, etc.
$ conda install gdal libgdal=2.0.0=0  # 〃
$ conda install cmake                 #If you plan to include GMT5.

--Since the version of libgdal is 2.0.0-1, some commands may cause conflicts, so downgrade in advance.

Recommended Posts

GMT installation part 2.
GMT installation part 1.
datetime part 1
numpy part 1
Django installation
Cuda installation
boto3 installation
Pythia Installation
argparse part 1
Docker installation
Volatility installation
Python installation
pip installation
Sphinx installation
InstantOS 1 installation
Jupyter installation
Python installation
pip installation
numpy part 2
Kivy installation
ChaSen installation
Backtrader installation
pip installation