configure.sh 1.78 KB
Newer Older
Gerard Ryan's avatar
Gerard Ryan committed
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
echo Welcome to PALISADE
echo This tool checks to see if you can run palisade in your environment,
echo and tells you what tools you may need

KernelName=`uname -s`

echo OS is $OS
echo Kernel is $KernelName
echo

##### REQUIRED
### Compiler suite that supports C++11
if [ "$OS" = "Windows_NT" ]
then
	CC="g++ -std=gnu++11"
elif [ "$KernelName" = "Linux" ]
then
	CC="g++ -std=gnu++11"
elif [ "$KernelName" = "Darwin" ]
then
	CC="clang++ -std=c++11"
else
	echo $OS and $KernelName are not supported
	exit 1
fi

$CC -v >/dev/null 2>&1
[ $? -ne 0 ] && echo Compiler is not available && exit 1

($CC -x c++ -o ./__test - <<XXX--end
#if __cplusplus < 201103L
#error This library requires a C++11 compliant compiler
#endif
int main() { return 0; }
XXX--end
) && ./__test && rm -f ./__test

[ $? -ne 0 ] && echo Compiler does not support C++11 && exit 1

echo Compiler OK

### make

make -v >/dev/null 2>&1

[ $? -ne 0 ] && echo make is not installed && exit 1

echo make is installed

### flex

flex --version >/dev/null 2>&1

[ $? -ne 0 ] && echo flex is not installed && exit 1

echo flex is installed

### bison

bison --version >/dev/null 2>&1

[ $? -ne 0 ] && echo bison is not installed && exit 1

echo bison is installed

### Open MP

($CC -x c++ -o ./__test -fopenmp - <<XXX--end
#include <omp.h>
int main() {
#pragma omp parallel
{
int t = omp_get_thread_num();
}
return 0;
}
XXX--end
) && ./__test && rm -f ./__test

[ $? -ne 0 ] && echo Environment does not support OpenMP && exit 1

echo OpenMP OK

### 128 bit unsigned int if you want native

	MINGWREGEX="-Lc:/Mingw64/mingw64/opt/lib -lregex -lshlwapi"

	OMPINCLUDE="-I /opt/local/include/libomp -fopenmp"
Gerard Ryan's avatar
Gerard Ryan committed
89 90 91 92 93 94


lzip -V >/dev/null 2>&1
[ $? -ne 0 ] && echo lzip is not available installed -- needed for gmp install && exit 1

echo lzip OK -- needed for gmp install