Skip to content

Commit 1866e6e

Browse files
committed
fixed linux build script: julia fastsum, julia/matlab tests before packaging as in windows build script
1 parent 1025c48 commit 1866e6e

File tree

1 file changed

+40
-1
lines changed

1 file changed

+40
-1
lines changed

linux-build-mex.sh

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ MPCVERSION=1.1.0
3636
# default values (to be overwritten if respective parameters are set)
3737
OCTAVEDIR=/usr
3838

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+
3943
# read the options
4044
TEMP=`getopt -o o:m:f: --long octave:,matlab:,fftw: -n 'linux-build-mex.sh' -- "$@"`
4145
eval set -- "$TEMP"
@@ -138,6 +142,16 @@ if [ ! -f "$FFTWDIR/build-success" ]; then
138142
fi
139143

140144

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+
141155
# Build NFFT
142156
READMECONTENT="
143157
$(sed -e '/^\[!/d' -e '/Directory structure/Q' $NFFTDIR/README)
@@ -184,19 +198,27 @@ NFFTVERSION=$( grep 'Version: ' nfft3.pc | cut -c10-)
184198

185199
# Create archive for Julia interface
186200
cd julia
187-
for LIB in nf*t fastsum
201+
for LIB in nf*t
188202
do
189203
cd "$LIB"
190204
"$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
191205
cd ..
192206
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
193213
cd "$NFFTBUILDDIR"
194214

195215
ARCH=$(uname -m)
196216
JULIADIR=nfft-"$NFFTVERSION"-julia-linux_$ARCH$OMPSUFFIX
197217
mkdir "$JULIADIR"
198218
$RSYNC -rLt --exclude='Makefile*' --exclude='doxygen*' --exclude='*.c.in' --exclude='*.c' --exclude='*.h' --exclude='*.so' "$NFFTDIR/julia/" "$JULIADIR"
199219
$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+
200222
echo 'This archive contains the Julia interface of NFFT '$NFFTVERSION'
201223
compiled for '$ARCH' Linux using GCC '$GCCVERSION' and FFTW '$FFTWVERSION'.
202224
' "$READMECONTENT" "$FFTWREADME" > "$JULIADIR"/readme.txt
@@ -235,6 +257,23 @@ do
235257
cp -f -L -r matlab/$SUBDIR/*.mex* "$DIR"/$SUBDIR/
236258
done
237259

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+
238277
cd "$NFFTBUILDDIR"
239278
cp "$NFFTDIR"/COPYING "$DIR"/COPYING
240279
if [ -n "$MATLABDIR" ]; then

0 commit comments

Comments
 (0)