-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild-prc-module.csh
More file actions
executable file
·122 lines (105 loc) · 3.63 KB
/
build-prc-module.csh
File metadata and controls
executable file
·122 lines (105 loc) · 3.63 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#!/bin/csh -f
## build-prc-module.csh
#
# Copyright 2006-2012 David G. Barnes, Paul Bourke, Christopher Fluke
#
# This file is part of S2PLOT.
#
# S2PLOT is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# S2PLOT is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with S2PLOT. If not, see <http://www.gnu.org/licenses/>.
#
# We would appreciate it if research outcomes using S2PLOT would
# provide the following acknowledgement:
#
# "Three-dimensional visualisation was conducted with the S2PLOT
# progamming library"
#
# and a reference to
#
# D.G.Barnes, C.J.Fluke, P.D.Bourke & O.T.Parry, 2006, Publications
# of the Astronomical Society of Australia, 23(2), 82-93.
#
# $Id: build-prc-module.csh 5798 2012-10-09 02:22:00Z dbarnes $
#
echo
echo ====================================================================
echo S2PLOT PRC export module
echo ====================================================================
echo
if (!(${?S2PATH})) then
echo "S2PATH environment variable MUST be set ... please fix and retry."
exit(-1);
endif
if (! -d $S2PATH || ! -e ${S2PATH}/scripts/s2plot.csh) then
echo "S2PATH is set but invalid: ${S2PATH} ... please fix and retry."
exit(-1);
endif
source ${S2PATH}/scripts/s2plot.csh
if ($status) then
exit(-1)
endif
if (!(${?S2PLOT_PRCDRIVER})) then
echo "S2PLOT_PRCDRIVER environment variable MUST be set ... please fix and retry."
echo " [recommended value: s2prcwriter]"
exit(-1);
endif
set thisdir=`pwd`
if ($thisdir != $S2PATH) then
echo "You must be in directory ${S2PATH} to build this module."
exit(-1);
endif
if (! -d ${S2PATH}/${S2KERNEL}) then
echo "Directory ${S2PATH}/${S2KERNEL} does not exist! Cannot build! Try running"
echo "build-lib.csh script first, or re-installing your distribution."
exit(-1);
endif
if (! -e ${S2PATH}/${S2KERNEL}/${S2LIBNAME}) then
echo "Library ${S2LIBNAME} is missing! Cannot build! Try running "
echo "build-lib.csh script first, or re-installing your distribution."
exit(-1);
endif
if ($1 != "-n") then
echo "Building PRC support code ..."
cd $S2PATH/s2prc/newprc
make clean
if ($S2OSTYPE == linux) then
make CFLAGS="$BASEFLAGS -fPIC -DS2LINUX"
else
make CFLAGS="$BASEFLAGS"
endif
endif
cd $S2PATH/s2prc
echo "Compiling PRC module ..."
$S2MODCMPLR -I./newprc -I${S2HARUDIR}/include s2prc.cc
echo "Linking PRC module ..."
#$S2MODMAKER -o ${S2PLOT_PRCDRIVER}.so s2prc.o ./newprc/*.o -L${S2HARUDIR}/lib${S2LBITS} -lhpdf -lz
$S2MODMAKER -o ${S2PLOT_PRCDRIVER}.so s2prc.o ./newprc/*.o \
-L${S2PATH}/${S2KERNEL} -ls2plot -L${S2HARUDIR}/lib${S2LBITS} -lhpdf -lz \
-lstdc++
echo "Copying module to $S2PATH/$S2ARCH ..."
/bin/mv -f ${S2PLOT_PRCDRIVER}.so ${S2PATH}/${S2KERNEL}
if ($S2KERNEL == darwin && $S2SHARED == yes) then
echo "Modifying dynamic library path ..."
install_name_tool -change ${S2PATH}/${S2KERNEL}/${S2LIBNAME} @executable_path/${S2LIBNAME} ${S2PATH}/${S2KERNEL}/${S2PLOT_PRCDRIVER}.so
endif
#echo "Copying support JavaScript to $S2PATH/ ..."
#/bin/cp -f s2plot-prc.js $S2PATH
echo "Removing objects ..."
/bin/rm s2prc.o
echo "Cleaning up ..."
cd newprc
make clean
rm -f s2direct.map s2direct.prc s2plotprc.pdf
cd ..
rm -f s2direct.map s2direct.prc s2plotprc.pdf
echo Done!