-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbashrc_for_gmt
More file actions
executable file
·86 lines (75 loc) · 4.37 KB
/
bashrc_for_gmt
File metadata and controls
executable file
·86 lines (75 loc) · 4.37 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#
# .bashrc include file for simplifying GMT building and testing
# from the bash command line. Include in your .bashrc via
# source <path>/bashrc_for_gmt
#
# You must set these parameter to reflect your setup
builder=ninja # If ninja is not installed (please do) then set to make
Bname="Ninja" # If ninja is not installed (please do) then use "Unix Makefiles"
pngview=open # Program that can open and display PNG files
pdfview=open # Program that can open and display PDF files
MATLAB=/Applications/MATLAB_R2019a.app # Path to the Matlab app
GMT_DEV=<path to GMT_dev directory containing all repos (such as gmt-dev)>
EDITOR=subl # Program that can open and display text files
#--------------------------------------------------------------
# These are needed to run admin/build-gmt-release.sh
export GMT_GSHHG_SOURCE=${GMT_DEV}/gshhg-gmt-2.3.7
export GMT_DCW_SOURCE=${GMT_DEV}/dcw-gmt-1.1.4
# To run matlab without the GUI:
alias matlab='$MATLAB/bin/matlab -nojvm'
# function for processing find output and return list of unique files.
function unique {
awk -F: '{print $1}' | sort -u
}
# List source, docs, scripts and txt files where the argument to gmtfind appears as is in the file
# e.g, gmtfind "Grid increment is"
function gmtfind {
find . -name '*.[ch]' -exec egrep -H "$*" {} \; | unique ;
find . -name '*.in]' -exec egrep -H "$*" {} \; | unique ;
find . -name '*.txt]' -exec egrep -H "$*" {} \; | unique ;
find . -name '*.rst*' -exec egrep -H "$*" {} \; | unique ;
find . -name '*.sh' -exec egrep -H "$*" {} \; | unique ;
find . -name '*.bat' -exec egrep -H "$*" {} \; | unique ;
}
# Various GMT building aliases
# To run cmake for GMT for various setups
alias cmakegmtd='cmake -DCMAKE_INSTALL_PREFIX=gmt6 -DCMAKE_BUILD_TYPE=Debug ..'
alias cmakegmtr='cmake -DCMAKE_INSTALL_PREFIX=gmt6 -DCMAKE_BUILD_TYPE=Release ..'
alias cmakegmtx='cmake -DCMAKE_INSTALL_PREFIX=gmt6 -DCMAKE_BUILD_TYPE=Debug -G Xcode ..'
gmt6='cd $GMT_DEV/gmt-dev/src' # Cd to the GMT source directory
alias gtop='cd $GMT_DEV/gmt-dev' # Cd to the top of the dev tree
alias dlog='pushd .; gtop; ${EDITOR} dbuild/Testing/Temporary/LastTest.log; popd'
alias rlog='pushd .; gtop; ${EDITOR} rbuild/Testing/Temporary/LastTest.log; popd'
alias bdoc='pushd .; gmt6; cd ../dbuild; ${builder} -j${ncores} docs_html install; popd'
alias buildd='pushd .; gtop; git pull; cd dbuild; ${builder} -j${ncores} install; popd'
alias buildr='pushd .; gtop; git pull; cd rbuild; ${builder} -j${ncores} install; popd'
alias buildnewd='pushd .; gtop; git pull; rm -rf dbuild; mkdir dbuild; cd dbuild; cmake -DCMAKE_INSTALL_PREFIX=gmt6 -DCMAKE_BUILD_TYPE=Debug -G ${Bname} ..; ${builder} -j${ncores} install; popd'
alias buildnewr='pushd .; gtop; git pull; rm -rf rbuild; mkdir rbuild; cd rbuild; cmake -DCMAKE_INSTALL_PREFIX=gmt6 -DCMAKE_BUILD_TYPE=Release -G ${Bname} ..; ${builder} -j${ncores} install; popd'
alias buildnewx='pushd .; gtop; git pull; rm -rf xbuild; mkdir xbuild; cd xbuild; cmake -DCMAKE_INSTALL_PREFIX=gmt6 -DCMAKE_BUILD_TYPE=Debug -G Xcode ..; xcodebuild; popd'
alias checkdbuild='pushd .; gtop; cd dbuild; ${builder} -j${ncores} check; popd'
alias checkrbuild='pushd .; gtop; cd rbuild; ${builder} -j${ncores} check; popd'
# If gcc-mp is installed you can do OpenMP builds
alias buildnewr-mp='pushd .; gtop; git pull; rm -rf rbuild-mp; mkdir rbuild-mp; cd rbuild-mp; cmake -DCMAKE_INSTALL_PREFIX=gmt6 -DCMAKE_BUILD_TYPE=Release -G ${Bname} -C ~/cache.cmake ..; ${builder} -j${ncores} install; popd'
alias buildnewd-mp='pushd .; gtop; git pull; rm -rf dbuild-mp; mkdir dbuild-mp; cd dbuild-mp; cmake -DCMAKE_INSTALL_PREFIX=gmt6 -DCMAKE_BUILD_TYPE=Release -G ${Bname} -C ~/cache.cmake ..; ${builder} -j${ncores} install; popd'
# Shorter aliases for the build aliases
alias bd=buildd
alias br=buildr
alias bnd=buildnewd
alias bnr=buildnewr
alias bnx=buildnewx
alias bnd-mp=buildnewd-mp
alias bnr-mp=buildnewr-mp
alias cdb=checkdbuild
alias crb=checkrbuild
# build new master debug and run all tests
alias bmdc='buildnewd; checkdbuild'
# See test results
alias vpngdbuild='pushd .; gtop; cd dbuild; $pngview */*/*/*.png; popd'
alias vpdfdbuild='pushd .; gtop; cd dbuild; $pdfview */*/*/*.pdf; popd'
alias vpngrbuild='pushd .; gtop; cd rbuild; $pngview */*/*/*.png; popd'
alias vpdfrbuild='pushd .; gtop; cd rbuild; $pdfview */*/*/*.pdf; popd'
# Very short shortnamds for seeing test results
alias vgd=vpngdbuild
alias vpd=vpdfdbuild
alias vgr=vpngrbuild
alias vpr=vpdfrbuild