-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patholdopticks.bash
261 lines (196 loc) · 6.03 KB
/
oldopticks.bash
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
##
## Copyright (c) 2019 Opticks Team. All Rights Reserved.
##
## This file is part of Opticks
## (see https://bitbucket.org/simoncblyth/opticks).
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
##
oldopticks(){ cat << EON
This is a resting place for old bash functions
from opticks.bash before they get deleted.
EON
}
opticks-cmake-generator(){ echo ${OPTICKS_CMAKE_GENERATOR:-Unix Makefiles} ; }
opticks-cmake-generator-old()
{
if [ "$NODE_TAG" == "M" ]; then
echo MSYS Makefiles
else
case $(uname -s) in
MINGW64_NT*) echo Visual Studio 14 2015 ;;
*) echo Unix Makefiles ;;
esac
fi
}
opticks-cmake-info(){ g4- ; xercesc- ; cat << EOI
$FUNCNAME
======================
NODE_TAG : $NODE_TAG
opticks-sdir : $(opticks-sdir)
opticks-bdir : $(opticks-bdir)
opticks-cmake-generator : $(opticks-cmake-generator)
opticks-compute-capability : $(opticks-compute-capability)
opticks-prefix : $(opticks-prefix)
opticks-optix-install-dir : $(opticks-optix-install-dir)
g4-cmake-dir : $(g4-cmake-dir)
xercesc-library : $(xercesc-library)
xercesc-include-dir : $(xercesc-include-dir)
EOI
}
opticks-cmakecache(){ echo $(opticks-bdir)/CMakeCache.txt ; }
opticks-cmakecache-grep(){ grep ${1:-COMPUTE_CAPABILITY} $(opticks-cmakecache) ; }
opticks-cmakecache-vars-(){ cat << EOV
CMAKE_BUILD_TYPE
COMPUTE_CAPABILITY
CMAKE_INSTALL_PREFIX
OptiX_INSTALL_DIR
Geant4_DIR
XERCESC_LIBRARY
XERCESC_INCLUDE_DIR
EOV
}
opticks-cmakecache-vars(){
local var
$FUNCNAME- | while read var ; do
opticks-cmakecache-grep $var
done
}
opticks-cmake(){
local msg="=== $FUNCNAME : "
local iwd=$PWD
local bdir=$(opticks-bdir)
echo $msg configuring installation
mkdir -p $bdir
[ -f "$bdir/CMakeCache.txt" ] && echo $msg configured already use opticks-configure to wipe build dir and re-configure && return
opticks-bcd
g4-
xercesc-
opticks-cmake-info
cmake \
-G "$(opticks-cmake-generator)" \
-DCMAKE_BUILD_TYPE=Debug \
-DCOMPUTE_CAPABILITY=$(opticks-compute-capability) \
-DCMAKE_INSTALL_PREFIX=$(opticks-prefix) \
-DOptiX_INSTALL_DIR=$(opticks-optix-install-dir) \
-DGeant4_DIR=$(g4-cmake-dir) \
-DXERCESC_LIBRARY=$(xercesc-library) \
-DXERCESC_INCLUDE_DIR=$(xercesc-include-dir) \
$* \
$(opticks-sdir)
cd $iwd
}
opticks-cmake-modify-ex1(){
local msg="=== $FUNCNAME : "
local bdir=$(opticks-bdir)
local bcache=$bdir/CMakeCache.txt
[ ! -f "$bcache" ] && echo $msg requires a preexisting $bcache from prior opticks-cmake run && return
opticks-bcd
g4-
xercesc-
cmake \
-DGeant4_DIR=$(g4-cmake-dir) \
-DXERCESC_LIBRARY=$(xercesc-library) \
-DXERCESC_INCLUDE_DIR=$(xercesc-include-dir) \
.
}
opticks-cmake-modify-ex2(){
local msg="=== $FUNCNAME : "
local bdir=$(opticks-bdir)
local bcache=$bdir/CMakeCache.txt
[ ! -f "$bcache" ] && echo $msg requires a preexisting $bcache from prior opticks-cmake run && return
opticks-bcd
cmake \
-DCOMPUTE_CAPABILITY=$(opticks-compute-capability) \
.
}
opticks-cmake-modify-ex3(){
local msg="=== $FUNCNAME : "
local bdir=$(opticks-bdir)
local bcache=$bdir/CMakeCache.txt
[ ! -f "$bcache" ] && echo $msg requires a preexisting $bcache from prior opticks-cmake run && return
opticks-bcd
echo $msg opticks-cmakecache-vars BEFORE MODIFY
opticks-cmakecache-vars
cmake \
-DOptiX_INSTALL_DIR=/Developer/OptiX_380 \
-DCOMPUTE_CAPABILITY=30 \
.
echo $msg opticks-cmakecache-vars AFTER MODIFY
opticks-cmakecache-vars
}
opticks-configure()
{
opticks-wipe
case $(opticks-cmake-generator) in
"Visual Studio 14 2015") opticks-configure-local-boost $* ;;
*) opticks-configure-system-boost $* ;;
esac
}
opticks-configure-system-boost()
{
opticks-cmake $*
}
opticks-configure-local-boost()
{
local msg="=== $FUNCNAME :"
boost-
local prefix=$(boost-prefix)
[ ! -d "$prefix" ] && type $FUNCNAME && return
echo $msg prefix $prefix
opticks-cmake \
-DBOOST_ROOT=$prefix \
-DBoost_USE_STATIC_LIBS=1 \
-DBoost_USE_DEBUG_RUNTIME=0 \
-DBoost_NO_SYSTEM_PATHS=1 \
-DBoost_DEBUG=0
# vi $(cmake-find-package Boost)
}
#opticks-config-type(){ echo Debug ; }
opticks-config-type(){ echo RelWithDebInfo ; }
opticks--old(){
local msg="$FUNCNAME : "
local iwd=$PWD
local bdir=$1
shift
[ -z "$bdir" -o "$bdir" == "." ] && bdir=$(opticks-bdir)
[ ! -d "$bdir" ] && echo $msg bdir $bdir does not exist && return
cd $bdir
cmake --build . --config $(opticks-config-type) --target ${1:-install}
cd $iwd
}
opticks-t-old-approach(){ cat << EOA
# this old approach was used before the move to
# treating the sub-projs as independant : so it
# worked from the top level bdir
local log=ctest.log
#opticks-t-- $*
date | tee $log
ctest $* 2>&1 | tee -a $log
date | tee -a $log
cd $iwd
echo $msg use -V to show output, ctest output written to $bdir/ctest.log
EOA
}
opticks-tl-old-approach()
{
local arg=$1
if [ "${arg:0:1}" == "/" -a -d "$arg" ]; then
bdir=$arg
shift
else
bdir=$(opticks-bdir)
fi
ls -l $bdir/ctest.log
cat $bdir/ctest.log
}