@@ -36,6 +36,10 @@ MPCVERSION=1.1.0
36
36
# default values (to be overwritten if respective parameters are set)
37
37
OCTAVEDIR=/usr
38
38
39
+ JULIA_BIN=julia/julia-1.1.1/bin/julia
40
+ JULIA_ARCHIVE=julia-1.1.1-linux-x86_64.tar.gz
41
+ JULIA_URL=https://julialang-s3.julialang.org/bin/linux/x64/1.1/$JULIA_ARCHIVE
42
+
39
43
# read the options
40
44
TEMP=` getopt -o o:m:f: --long octave:,matlab:,fftw: -n ' linux-build-mex.sh' -- " $@ " `
41
45
eval set -- " $TEMP "
@@ -138,6 +142,16 @@ if [ ! -f "$FFTWDIR/build-success" ]; then
138
142
fi
139
143
140
144
145
+ # Get Julia
146
+ if [ ! -f $JULIA_BIN ]; then
147
+ rm -f -r julia
148
+ mkdir julia
149
+ cd julia
150
+ curl " $JULIA_URL " --output " $JULIA_ARCHIVE "
151
+ tar xzf $JULIA_ARCHIVE
152
+ fi
153
+
154
+
141
155
# Build NFFT
142
156
READMECONTENT="
143
157
$( sed -e ' /^\[!/d' -e ' /Directory structure/Q' $NFFTDIR /README)
@@ -184,19 +198,27 @@ NFFTVERSION=$( grep 'Version: ' nfft3.pc | cut -c10-)
184
198
185
199
# Create archive for Julia interface
186
200
cd julia
187
- for LIB in nf* t fastsum
201
+ for LIB in nf* t
188
202
do
189
203
cd " $LIB "
190
204
" $GCCINSTALLDIR /bin/gcc-$GCCVERSION " -shared -fPIC -DPIC .libs/lib" $LIB " julia.o -Wl,--whole-archive ../../.libs/libnfft3_julia.a $FFTWLIBSTATIC $GCCINSTALLDIR /lib64/libgomp.a -Wl,--no-whole-archive -O3 -malign-double -march=" $GCCARCH " -Wl,-soname -Wl,lib" $LIB " julia.so -o .libs/lib" $LIB " julia.so
191
205
cd ..
192
206
done
207
+ for LIB in fastsum
208
+ do
209
+ cd " $LIB "
210
+ " $GCCINSTALLDIR /bin/gcc-$GCCVERSION " -shared -fPIC -DPIC .libs/lib" $LIB " julia.o -Wl,--whole-archive ../../applications/fastsum/.libs/libfastsum.a ../../applications/fastsum/.libs/libkernels.a ../../.libs/libnfft3_julia.a $FFTWLIBSTATIC $GCCINSTALLDIR /lib64/libgomp.a -Wl,--no-whole-archive -O3 -malign-double -march=" $GCCARCH " -Wl,-soname -Wl,lib" $LIB " julia.so -o .libs/lib" $LIB " julia.so
211
+ cd ..
212
+ done
193
213
cd " $NFFTBUILDDIR "
194
214
195
215
ARCH=$( uname -m)
196
216
JULIADIR=nfft-" $NFFTVERSION " -julia-linux_$ARCH$OMPSUFFIX
197
217
mkdir " $JULIADIR "
198
218
$RSYNC -rLt --exclude=' Makefile*' --exclude=' doxygen*' --exclude=' *.c.in' --exclude=' *.c' --exclude=' *.h' --exclude=' *.so' " $NFFTDIR /julia/" " $JULIADIR "
199
219
$RSYNC -rLt --exclude=' Makefile*' --exclude=' .deps' --exclude=' .libs' --exclude=' *.la' --exclude=' *.lo' --exclude=' *.o' --exclude=' *.c' ' julia/' " $JULIADIR "
220
+ for DIR in $JULIADIR /nf* t $JULIADIR /fastsum; do cd $DIR ; for NAME in simple_test* .jl; do $HOMEDIR /$JULIA_BIN " $NAME " ; done ; cd " $NFFTBUILDDIR " ; done ;
221
+
200
222
echo ' This archive contains the Julia interface of NFFT ' $NFFTVERSION '
201
223
compiled for ' $ARCH ' Linux using GCC ' $GCCVERSION ' and FFTW ' $FFTWVERSION ' .
202
224
' " $READMECONTENT " " $FFTWREADME " > " $JULIADIR " /readme.txt
235
257
cp -f -L -r matlab/$SUBDIR /* .mex* " $DIR " /$SUBDIR /
236
258
done
237
259
260
+ for SUBDIR in nfft nfsft nfsoft nnfft fastsum nfct nfst infft1d fpt ; do
261
+ cd " $DIR /$SUBDIR "
262
+ if [ -f simple_test.m ] ; then
263
+ for TESTFILE in * test* .m
264
+ do
265
+ if [ " $SUBDIR " != " infft1d" ] ; then
266
+ " $OCTAVEDIR " /bin/octave-cli --no-window-system --eval=" run('$TESTFILE ')"
267
+ fi
268
+ if [ -n " $MATLABDIR " ]; then
269
+ " $MATLABDIR " /bin/matlab -nodisplay -r " run('$TESTFILE '); exit"
270
+ fi
271
+ done
272
+ fi
273
+ cd " $NFFTBUILDDIR "
274
+ done
275
+
276
+
238
277
cd " $NFFTBUILDDIR "
239
278
cp " $NFFTDIR " /COPYING " $DIR " /COPYING
240
279
if [ -n " $MATLABDIR " ]; then
0 commit comments