-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathcompile.sh
More file actions
executable file
·35 lines (28 loc) · 996 Bytes
/
compile.sh
File metadata and controls
executable file
·35 lines (28 loc) · 996 Bytes
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
#!/bin/bash -e
# This script builds the optional parallel find
# Regular options, set on the command line CC
CC="${CC:-mpicc}"
CFLAGS="-g -O2 -Wextra -Wall -pipe -std=gnu99 -Wno-format-overflow"
LDFLAGS=""
# Test settings
#CC="${CC:-clang-10}"
#CFLAGS="-g -O2 -Wextra -Wall -pipe -std=gnu99 -Wno-format-overflow $(mpicc -showme:compile)"
#LDFLAGS="$(mpicc -showme:link)"
rm *.o *.a 2>&1 || true
echo "Building parallel find;"
FILES=""
# Pfind can use lz4 to optimize the job stealing.
# If you use ./prepare.sh it will try to download and compile lz4
if [[ -e ./lz4 ]] ; then
echo "Using LZ4 for optimization"
CFLAGS+=" $CFLAGS -DLZ4 -I./lz4/lib/"
LDFLAGS+=" ./lz4/lib/liblz4.a"
FILES+=./lz4/lib/*.a
fi
$CC $CFLAGS -c src/pfind-main.c || exit 1
$CC $CFLAGS -c src/pfind-options.c || exit 1
$CC $CFLAGS -c src/pfind.c || exit 1
$CC $CFLAGS -c src/option.c || exit 1
$CC $CFLAGS -o pfind *.o -lm $LDFLAGS || exit 1
ar rcsT pfind.a option.o pfind-options.o pfind.o $FILES
echo "[OK]"