-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild.sh
executable file
·69 lines (60 loc) · 2.1 KB
/
build.sh
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
#!/bin/bash
export CFLAGS="-O2 -g $CFLAGS"
if [[ "$target_platform" == "win-64" ]]; then
export PATH="$PREFIX/Library/bin:$BUILD_PREFIX/Library/bin:$PATH"
export CC=clang-cl
export RANLIB=llvm-ranlib
export AS=llvm-as
export AR=llvm-ar
export LD=lld-link
export CFLAGS="-MD -I$PREFIX/Library/include -O2"
export LDFLAGS="$LDFLAGS -L$PREFIX/Library/lib"
export LIBRARY_PREFIX=$PREFIX/Library
else
export CFLAGS="$CFLAGS -fPIC"
export LIBRARY_PREFIX=$PREFIX
# Get an updated config.sub and config.guess
cp $BUILD_PREFIX/share/gnuconfig/config.guess config.guess
cp $BUILD_PREFIX/share/gnuconfig/config.sub config.sub
fi
sed -i.bak 's/popsup=0/popsup=0,popsup=0/g' configure.ac
autoreconf -vfi
./configure --disable-popcnt --disable-clz --enable-generic --enable-tls
make
programs="addedgeg amtog biplabg catg complg converseg copyg cubhamg deledgeg delptg directg dreadnaut dretodot dretog \
genbg genbgL geng genquarticg genrang genspecialg gentourng gentreeg hamheuristic labelg linegraphg listg multig newedgeg \
planarg ranlabg showg subdivideg twohamg vcolg watercluster2 NRswitchg"
if [[ "$CONDA_BUILD_CROSS_COMPILATION" != "1" ]]; then
check_output=`make checks`
echo "$check_output"
if [[ "$target_platform" == "win-64" ]]; then
# countg and pickg are not supported on platforms with size(void*) != size(long)
if [[ "$check_output" != *"3 TESTS FAILED"* ]]; then
exit 1
fi
else
if [[ "$check_output" != *"PASSED ALL TESTS"* ]]; then
exit 1
fi
fi
fi
if [[ "$target_platform" != win-* ]]; then
programs="$programs countg pickg shortg"
fi
mkdir -p "$LIBRARY_PREFIX"/bin
for program in $programs;
do
cp -p $program "$LIBRARY_PREFIX"/bin/$program
done
mkdir -p "$LIBRARY_PREFIX"/lib
libs="nauty nauty1 nautyL nautyL1 nautyW nautyW1"
for lib in $libs;
do
if [[ "$target_platform" == "win-64" ]]; then
cp -p $lib.a "$LIBRARY_PREFIX"/lib/$lib.lib
else
cp -p $lib.a "$LIBRARY_PREFIX"/lib/lib$lib.a
fi
done
mkdir -p "$LIBRARY_PREFIX"/include/nauty
cp *.h "$LIBRARY_PREFIX"/include/nauty/