Commits
11 11 | m4_include([ac/m4/m4_ax_wcslib.m4]) |
12 12 | m4_include([ac/m4/m4_ax_rpfits.m4]) |
13 13 | m4_include([ac/m4/m4_ax_check_compile_flag.m4]) |
14 14 | m4_include([ac/m4/m4_ax_cxx11.m4]) |
15 15 | m4_include([ac/m4/m4_ax_cxx_compile_stdcxx_11.m4]) |
16 16 | m4_include([ac/m4/m4_ax_expand_path.m4]) |
17 17 | m4_include([ac/m4/m4_ax_lib_stdcxx.m4]) |
18 18 | m4_include([ac/m4/m4_ax_libsakura.m4]) |
19 19 | m4_include([ac/m4/m4_ax_libxml2.m4]) |
20 20 | m4_include([ac/m4/m4_ax_openmp.m4]) |
21 + | m4_include([ac/m4/ax_prog_cxx_mpi.m4]) |
21 22 | m4_include([ac/m4/m4_ax_path_to_binary.m4]) |
22 23 | m4_include([ac/m4/m4_ax_pthread.m4]) |
23 24 | m4_include([ac/m4/m4_ax_python_devel.m4]) |
24 25 | m4_include([ac/m4/m4_ax_python_numpy.m4]) |
25 26 | m4_include([ac/m4/m4_ax_eigen.m4]) |
26 27 | m4_include([ac/m4/m4_ax_swig.m4]) |
27 28 | |
28 29 | dnl setup cannonical host variables without requiring |
29 30 | dnl install.sh et al. as AC_CANONICAL_HOST does |
30 31 | AX_CANONICAL_NAME |
63 64 | case $host_osname in |
64 65 | linux) |
65 66 | BREAKPADCLIENT=`pwd`/build/breakpad/breakpad-distro/src/client/linux/libbreakpad_client.a |
66 67 | ;; |
67 68 | darwin) |
68 69 | BREAKPADCLIENT=`pwd`/build/breakpad/breakpad-distro/src/client/mac/build/Release/breakpadUtilities.dylib |
69 70 | ;; |
70 71 | esac |
71 72 | AC_SUBST(BREAKPADCLIENT) |
72 73 | |
74 + | |
75 + | |
73 76 | if [[ "${ac_success}" = "no" ]]; then |
74 77 | dnl############################################################################################# |
75 78 | dnl### could not find a C++ compiler that supported C++11 in user's PATH ### |
76 79 | dnl############################################################################################# |
77 80 | case $host_osname in |
78 81 | linux) |
79 82 | AX_CXX11_CLEAR_CACHE |
80 83 | AC_MSG_NOTICE([could not find a C++ compiler that supports C++11, in your PATH... trying other possible linux paths...]) |
81 84 | AX_CXX11([/opt/rh/devtoolset-3/root/usr/bin:/opt/rh/devtoolset-2/root/usr/bin:/usr/local/bin:/opt/local/bin:/usr/bin:/bin]) |
82 85 | ;; |
101 104 | AC_MSG_ERROR([failed to find viable C++11 compiler, please include the path to one in your PATH environment variable]) |
102 105 | fi |
103 106 | |
104 107 | AC_MSG_CHECKING([for std::defaultfloat]) |
105 108 | AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include <ios>]], |
106 109 | [[std::defaultfloat;]])], |
107 110 | [AC_MSG_RESULT([yes])], |
108 111 | [AC_MSG_RESULT([no]) |
109 112 | AC_MSG_ERROR([C++ compiler is not new enough]) ] ) |
110 113 | |
114 + | |
115 + | dnl Add --with-mpi option to configure |
116 + | AC_ARG_WITH(mpi, [AS_HELP_STRING([--with-mpi], |
117 + | [compile with MPI (parallelization) support. Auto: if no MPI compiler/libraries are |
118 + | found, MPI is not used. Default: auto]) |
119 + | ],, |
120 + | [with_mpi=auto]) |
121 + | |
122 + | dnl Try to find an MPI compiler wrapper. Far from ideal. |
123 + | dnl AC_PROG_CXX_MPI is meant to be used intead of AC_PROG_CXX for MPI applications. |
124 + | dnl But we have "m4_ax_cxx11" fiddling with CXX etc variables up here. |
125 + | if [test x"$with_mpi" != xno]; then |
126 + | _PRE_MPI_CXX=$CXX |
127 + | _PRE_MPI_CC=$CC |
128 + | _PRE_MPI_PATH=$PATH |
129 + | _CXX_PATH=$(dirname ${CXX}) |
130 + | _PATH_CASA_OPENMPI=$PATH${PATH_SEPARATOR}/opt/casa/03/bin/ |
131 + | AC_MSG_NOTICE([Looking for MPI compiler wrappers in extended path: ${_PATH_CASA_OPENMPI}]) |
132 + | dnl want to find this or alternatives: CXX=/opt/casa/03/bin/mpic++ |
133 + | AC_PATH_PROGS(CASA_MPI_CXX, [mpiCC, mpicxx, mpic++],,${_PATH_CASA_OPENMPI}) |
134 + | AC_MSG_NOTICE([After looking for an MPI wrapper, the C++ compiler is: ${CASA_MPI_CXX}]) |
135 + | CXX=$CASA_MPI_CXX |
136 + | PATH=${_CXX_PATH}${PATH_SEPARATOR}${PATH} |
137 + | dnl want to find this or alternatives: CC=/opt/casa/03/bin/mpicc |
138 + | AC_PATH_PROGS(CASA_MPI_CC, [mpicc],,${_PATH_CASA_OPENMPI}) |
139 + | AC_MSG_NOTICE([After looking for an MPI wrapper, the C compiler is: ${CASA_MPI_CC}]) |
140 + | CC=$CASA_MPI_CC |
141 + | AX_PROG_CXX_MPI(true, |
142 + | [ |
143 + | CASA_HAVE_MPI=1 |
144 + | AC_SUBST(CASA_HAVE_MPI) |
145 + | ],[ |
146 + | CXX=$_PRE_MPI_CXX |
147 + | CC=$_PRE_MPI_CC |
148 + | PATH=$_PRE_MPI_PATH |
149 + | if test x"$with_mpi" = xyes; then |
150 + | AC_MSG_FAILURE([MPI compiler requested, but couldn't use MPI.]) |
151 + | else |
152 + | AC_MSG_WARN([No working MPI compiler could be found, won't use MPI.]) |
153 + | fi |
154 + | ]) |
155 + | fi |
156 + | |
111 157 | dnl# use faster fortran rules for complex operations, removes restoring complex infinities |
112 158 | dnl# if naive computation results in NAN + NAN * I Handling complex multiplication and |
113 159 | dnl# division with correct treating of complex infinities (one element Inf regardless of |
114 160 | dnl# the other) according to the C is complicated, e.g |
115 161 | dnl# |
116 162 | dnl# if a = NaN + 1e30 i; a * a is not NaN but a complex infinity (-Inf - NaN). |
117 163 | dnl# |
118 164 | dnl# Treating this situation correctly has large performance impact. In GCC's implementation |
119 165 | dnl# it is about 4 times slower than the naive implementation, with vectorization enabled the |
120 166 | dnl# impact is even larger. As correct treatment of complex infinities when NaN appear in |
146 192 | if [[ $? -ne 0 ]] ; then |
147 193 | AC_MSG_NOTICE([creation of temporary directory $temporary_script_dir failed]) |
148 194 | exit 1 |
149 195 | fi |
150 196 | cd $temporary_script_dir |
151 197 | ln -s `which sed` |
152 198 | ln -s `which rm` |
153 199 | ln -s `which dirname` |
154 200 | ln -s `which basename` |
155 201 | ln -s `which grep` |
202 + | ln -s `which sort` |
203 + | ln -s `which printf` |
204 + | ln -s `which cat` |
156 205 | cd $current_directory |
157 206 | |
158 207 | PATH=$(dirname ${CXX}):/bin:$temporary_script_dir |
159 208 | |
160 209 | if [[ "$host_osname" = "darwin" ]]; then |
161 210 | AC_PROG_CC([clang cc gcc gcc-mp-5]) |
162 211 | else |
163 212 | AC_PROG_CC([gcc cc clang]) |
164 213 | fi |
165 214 | AX_PATH_TO_BINARY(${CC},CC) |
166 215 | AC_MSG_NOTICE([C compiler ${CC}]) |
167 216 | |
168 217 | AC_LANG_PUSH([C]) |
169 218 | AX_CHECK_COMPILE_FLAG(-fcx-fortran-rules,[CC_FORTRAN_COMPLEX=-fcx-fortran-rules],[CC_FORTRAN_COMPLEX=]) |
170 219 | AC_SUBST(CC_FORTRAN_COMPLEX) |
171 220 | AC_LANG_POP([C]) |
172 221 | |
173 222 | for pp in $(dirname ${CXX})${PATH_SEPARATOR}${PATH} ${save_PATH_save}; do |
174 - | PATH=${pp} |
175 - | AC_PROG_FC([gfortran-mp-5 gfortran-mp-4.9 gfortran-mp-4.8 gfortran]) |
223 + | PATH=${pp}:${temporary_script_dir} |
224 + | AC_PROG_FC([gfortran-mp-9 gfortran-mp-8 gfortran-mp-5 gfortran-mp-4.9 gfortran-mp-4.8 gfortran]) |
176 225 | AX_PATH_TO_BINARY(${FC},FC) |
177 226 | if [[ -f "$FC" -a -x "$FC" ]]; then |
178 227 | AC_MSG_NOTICE([Fortran compiler ${FC}]) |
179 228 | break |
180 229 | else |
181 230 | unset ac_cv_prog_FC |
182 231 | unset FC |
183 232 | fi |
184 233 | done |
185 234 | |