Newer
Older
#! /bin/bash
source script/discover_package_manager
if [ x"$platform" = x"osx" -a x"$pcman" = x"" ]; then
echo -e "\033[93;5;1m WARNING \033[0m No package manager has been found on this system"
script/solve_brew $platform
discover_package_manager $platform
pcman=$discover_package_manager_ret
if [ x"$pcman" != x"brew" ]; then
echo -e "brew \033[91;5;1m FAILED \033[0m"
fi
if [ $? -ne 0 ]; then
echo >&2
echo -e "cmake\033[91;5;1m FAILED \033[0m"
echo "OpenFPM require cmake but it's not installed, searching a solution... "
script/solve_cmake $platform
command -v cmake >/dev/null 2>&1
command -v wget >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo >&2
echo -e "wget\033[91;5;1m FAILED \033[0m"
echo "OpenFPM require wget but it's not installed, searching a solution... "
script/solve_wget $platform
command -v wget >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo -e "wget\033[91;5;1m FAILED \033[0m"
exit 1
else
echo -e "wget\033[92;1m SUCCESS \033[0m"
fi
else
echo -e "wget \033[92;1m SUCCESS \033[0m"
fi
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
command -v git >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo >&2
echo -e "git\033[91;5;1m FAILED \033[0m"
echo "OpenFPM require git but it's not installed, searching a solution... "
script/solve_git $platform
command -v git >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo -e "git\033[91;5;1m FAILED \033[0m"
exit 1
else
echo -e "git\033[92;1m SUCCESS \033[0m"
fi
else
echo -e "git \033[92;1m SUCCESS \033[0m"
fi
command -v autoconf >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo >&2
echo -e "autoconf\033[91;5;1m FAILED \033[0m"
echo "OpenFPM require autoconf but it's not installed, searching a solution..."
script/solve_autoconf $platform
command -v autoheader >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo -e "autoconf\033[91;5;1m FAILED \033[0m"
exit 1
else
echo -e "autoconf\033[92;1m SUCCESS \033[0m"
fi
else
echo -e "autoconf\033[92;1m SUCCESS \033[0m"
fi
command -v automake >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo >&2
echo -e "automake\033[91;5;1m FAILED \033[0m"
echo "OpenFPM require automake but it's not installed, searching a solution..."
script/solve_automake $platform
command -v automake >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "automake\033[91;5;1m FAILED \033[0m"
exit 1
else
echo -e "automake\033[92;1m SUCCESS \033[0m"
fi
else
echo -e "automake\033[92;1m SUCCESS \033[0m"
fi
command -v libtoolize >/dev/null 2>&1
opt1=$?
command -v glibtoolize >/dev/null 2>&1
opt2=$?
echo >&2
echo -e "libtool\033[91;5;1m FAILED \033[0m"
echo "OpenFPM require libtool but it's not installed, searching a solution..."
script/solve_libtool $platform
command -v libtoolize >/dev/null 2>&1
opt1=$?
command -v glibtoolize >/dev/null 2>&1
opt2=$?
echo -e "libtool\033[91;5;1m FAILED \033[0m"
exit 1
else
echo -e "libtool\033[92;1m SUCCESS \033[0m"
fi
else
echo -e "libtool\033[92;1m SUCCESS \033[0m"
fi
#### Detecting g++
#### Detection is different from os linux in general has g++ and we try to detect g++
if [ x"$platform" == x"osx" ]; then
## we try to detect osx version
major=$(g++ --version | grep LLVM | sed 's/.*\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\)svn.*/\1/g')
middle=$(g++ --version | grep LLVM | sed 's/.*\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\)svn.*/\2/g')
minor=$(g++ --version | grep LLVM | sed 's/.*\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\)svn.*/\3/g')
if [ $major -gt 3 ]; then
echo -e "clang++ $major.$middle.$minor \033[92;1m SUCCESS \033[0m"
elif [ $major -lt 3 ]; then
echo -e "clang++ $major.$middle.$minor \033[91;5;1m FAILED \033[0m your clang is out of date, update to 3.6.0 (Update Xcode) or use gcc 4.8.2 or higher"
elif [ $middle -gt 6 ]; then
echo -e "clang++ $major.$middle.$minor \033[92;1m SUCCESS \033[0m"
elif [ $middle -lt 6 ]; then
echo -e "clang++\033[91;5;1m FAILED \033[0m your clang is out of date, update to 3.6.0 (Update Xcode) or use gcc 4.8.2 or higher"
echo -e "clang++ version $major.$middle.$minor \033[92;1m SUCCESS \033[0m"
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
command -v g++ >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo >&2
echo -e "Configure\033[91;5;1m FAILED \033[0m"
echo "OpenFPM require g++ but it's not installed, searching a solution..."
script/solve_gpp $platform
command -v g++ >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo -e "g++\033[91;5;1m FAILED \033[0m"
exit 1
else
echo -e "g++\033[92;1m SUCCESS \033[0m"
fi
else
major=$(g++ --version | grep g++ | sed 's/.*\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\1/g')
middle=$(g++ --version | grep g++ | sed 's/.*\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\2/g')
minor=$(g++ --version | grep g++ | sed 's/.*\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\3/g')
if [ $major -gt 4 ]; then
echo -e "g++ $major.$middle.$minor \033[92;1m SUCCESS \033[0m"
elif [ $major -lt 4 ]; then
echo -e "g++ $major.$middle.$minor \033[91;5;1m FAILED \033[0m your g++ version is too old"
elif [ $middle -gt 8 ]; then
echo -e "g++ $major.$middle.$minor \033[92;1m SUCCESS \033[0m"
elif [ $middle -lt 8 ]; then
echo -e "g++ $major.$middle.$minor \033[91;5;1m FAILED \033[0m your g++ version is too old"
elif [ $minor -gt 1 ]; then
echo -e "g++ $major.$middle.$minor \033[92;1m SUCCESS \033[0m"
else
echo -e "g++ $major.$middle.$minor \033[92;1m FAILED \033[0m your g++ version is too old"
fi
fi
command -v mpirun >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo -e "No MPI"
else
major=$(mpirun --version | grep mpirun | sed 's/.*\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\1/g')
middle=$(mpirun --version | grep mpirun | sed 's/.*\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\2/g')
minor=$(mpirun --version | grep mpirun | sed 's/.*\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\3/g')
if [ $major -gt 1 ]; then
echo -e "mpirun $major.$middle.$minor \033[92;1m SUCCESS \033[0m"
elif [ $major -lt 1 ]; then
echo -e "mpirun $major.$middle.$minor \033[91;5;1m FAILED \033[0m is too old, 1.8.1 at least required"
elif [ $middle -gt 8 ]; then
echo -e "mpirun $major.$middle.$minor \033[92;1m SUCCESS \033[0m"
elif [ $middle -lt 8 ]; then
echo -e "mpirun $major.$middle.$minor \033[91;5;1m FAILED \033[0m is too old, 1.8.1 at least required"
elif [ $minor -gt 0 ]; then
echo -e "mpirun $major.$middle.$minor \033[92;1m SUCCESS \033[0m"
else
echo -e "mpirun $major.$middle.$minor \033[92;1m FAILED \033[0m is too old, 1.8.1 at least required"
fi
fi