installing-gmt-under-cygwin
来源:互联网 发布:诸葛亮网络用语含义 编辑:程序博客网 时间:2024/04/30 08:30
http://the-moni-blog.blogspot.com/2009/11/installing-gmt-under-cygwin.html
I just struggled through installing GMT under Cygwin, and since I not only had to rely on piecing together information from out-of-date online tutorials, but also on direct help from Kurt, I figured I would write everything down here for future reference and to also hopefully make someone else's life easier.
First things first, check your home directory:
Always check your home directory in cygwin to see if it is actually what it should be. When you install Fledermaus on your machine, it sets a 'HOME' variable that is Program File/IVS/Fledermaus. Now Cygwin thinks this is its home as well. The CCOM wiki offers this solution:
To resolve this, you can create a system-wide HOME area that may be more suitable for any/all programs. To do this, create (or decide) the folder you'd like to be your Cygwin home area. Once you have the folder, edit the HOME variable in the Advanced System properties in Windows and specify that folder. Finally, copy the contents of the previously specified home area into your new home area folder. This will prevent IVS or GMT from breaking. This situation may not be limited to these two products, so it's important to check your 'HOME' environment variable before installing Cygwin software.
Once you are happy with your home directory, here are the steps I followed to successfully install GMT:
1) Make sure you have bzip2 installed. You will also need the 'make' utility and a good C++ compiler (I have a couple different ones, including the gcc one. netcdf will fail to compile without the right one, so if it fails, try grabbing another C compiler. I think gcc is the one to have).
2) Go to the GMT webpage and create an install parameter file. Save this as GMTparams.txt in your usr/local/ directory under your cygwin directory. (If you do not have netcdf already, make sure to let GMT get it and install it for you)
3) Get the GMT install file here, and save it as install_gmt to usr/local/
4) Under cygwin, navigate to usr/local/ and type the following command (this may fail, but this is okay):
./install_gmt GMTparams.txt > install.log
5) If it failed, you probably got a message about a missing -lnetcdf file. This is because netcdf is bad, and uses a .lib extension rather than .a. To fix this, you can just create a symbolic link:
navigate to usr/local/netcdf-xxx/lib
type ln -s libnetcdf.lib libnetcdf.a
Now modify your GMTparams.txt so that netcdf is not downloaded or installed again. You can also modify not to download the GMT files again.
6) navigate back to usr/local/ and rerun ./install_gmt GMTparams.txt >install.log. This should complete without failing, though you may see warnings scroll by.
7) Once it is installed, you must edit your .bashrc or .bash_profile. Cygwin, by default, does not create a .bashrc or .bash_profile in your home directory, so you may need to create one from scratch. GMT looks for a .bash_profile, so if you use .bashrc, make sure you create a .bash_profile that points to it. I'll share mine below:
my .bashrc file (all are needed for GMT to work):
export PATH=/usr/local/gmt/bin:$PATH
export NETCDFHOME=/usr/local/netcdf
export GMTHOME=/usr/local/gmt
export MANPATH=/usr/local/gmt/man:$MANPATH
export DISPLAY=:0
my .bash_profile file:
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
export BASH_ENV=$HOME/.bashrc
8) Now you may notice that my paths in .bashrc do not seem to be correct. I use "gmt" and "netcdf" instead of "GMT4.5.1" and "netcdf-3.6.3." This is because I want to be able to update both of these in the future without having to edit any scripts or my .bashrc every time. Therefore I set up the following symbolic links:
navigate to usr/local/ and then type the following commands:
ln -s GMT4.5.1 gmt
ln -s netcdf-3.6.3 netcdf
9) You should be good to go!
To test one of the examples GMT runs upon successful install, you can navigate to any one of the examples found in /GMT4.5.1/share/doc/gmt/examples/. Each ex directory will contain the example scripts, necessary files, and the resulting postscript. I found that to view these files, I need to make sure the X-windows environment is up and running (from cygwin command prompt, type startx). Then I use ghostview (gs) to view the ps:
gs example_27.ps
here is the result:
- installing-gmt-under-cygwin
- installing GMT under cygwin
- buildroot+mips under cygwin
- using cling under cygwin
- Installing Octave on Cygwin
- Installing and Testing cygwin
- Installing from Source Under Ubuntu
- 在Windows上安裝Cygwin/GMT系統
- Installing virtualenv under Anaconda on OSX
- Build ffmpeg under Cygwin
- Installing Cygwin and Starting the SSH Daemon
- Installing SunSPOT SDK under Vista - Step-by-Step
- Installing DB2 for Linux under FreeBSD using Linux compat
- Installing FLTK 1.3.3 under Visual Studio Community 2013
- GMT
- 配置cygwin Installing sshd as a service failed!错误解决方案
- vista下安装cygwin (图文)|Install Cygwin/X under Windows Vista (Pictures)
- 在Cygwin环境下,堆栈的修改-(stack modification under cygwin)
- CET,GMT等各种时间总结
- 不用加减乘除完成两数相加
- 第一个代码
- VS HelpLibAgent.exe已停止工作 解决方法
- 关于opencv内存泄露的一些记录
- installing-gmt-under-cygwin
- Oracle出现“TNS: 监听程序无法分发客户机连接”解决方法
- 使用pl/sql来Oracle创建表空间和创建用户 .
- linux网络配置文件及其对应功能
- 一个由24个字母组成的数组,其中每个字符出现3次(也就是8组相同字母,混序放在一个数组中),用程序实现将相同字母的下标存入一个8*3的数组中
- 二叉树问题
- 使用Oracle 的 imp ,exp 命令实现数据的导入导出
- UILocalNotification实现本地的闹钟提醒的方法
- 对树这种基本数据结构以及递归函数的理解