@@ -158,29 +158,45 @@ find_or_install()
158
158
else
159
159
printf " yes.\n"
160
160
161
- echo -e " $this_script : Checking whether $executable in PATH wraps gfortran version ` ./build.sh -V gcc` or later... "
162
- $executable acceptable_compiler.f90 -o acceptable_compiler
163
- $executable print_true.f90 -o print_true
164
- acceptable=$( ./acceptable_compiler)
165
- is_true=$( ./print_true)
166
- rm acceptable_compiler print_true
167
-
168
- if [[ " $acceptable " == " $is_true " ]]; then
169
- printf " yes.\n $this_script : Using the $executable found in the PATH.\n"
161
+ if [[ ! -z " ${arg_f:- } " ]]; then
162
+
163
+ info " -f (or --with-fortran) argument detected with value ${arg_f} "
164
+ printf " yes.\n $this_script : Using the specified $executable .\n"
170
165
export MPIFC=mpif90
171
166
export MPICC=mpicc
172
167
export MPICXX=mpicxx
173
-
168
+
174
169
# Halt the recursion
175
170
stack_push dependency_pkg " none"
176
171
stack_push dependency_exe " none"
177
172
stack_push dependency_path " none"
173
+
178
174
else
179
- printf " no\n"
180
- # Trigger 'find_or_install gcc' and subsequent build of $package
181
- stack_push dependency_pkg " none" " $package " " gcc"
182
- stack_push dependency_exe " none" " $executable " " gfortran"
183
- stack_push dependency_path " none" " $( ./build.sh -P " $package " ) " " $( ./build.sh -P gcc) "
175
+
176
+ echo -e " $this_script : Checking whether $executable in PATH wraps gfortran version ` ./build.sh -V gcc` or later... "
177
+ $executable acceptable_compiler.f90 -o acceptable_compiler
178
+ $executable print_true.f90 -o print_true
179
+ acceptable=$( ./acceptable_compiler)
180
+ is_true=$( ./print_true)
181
+ rm acceptable_compiler print_true
182
+
183
+ if [[ " $acceptable " == " $is_true " ]]; then
184
+ printf " yes.\n $this_script : Using the $executable found in the PATH.\n"
185
+ export MPIFC=mpif90
186
+ export MPICC=mpicc
187
+ export MPICXX=mpicxx
188
+
189
+ # Halt the recursion
190
+ stack_push dependency_pkg " none"
191
+ stack_push dependency_exe " none"
192
+ stack_push dependency_path " none"
193
+ else
194
+ printf " no\n"
195
+ # Trigger 'find_or_install gcc' and subsequent build of $package
196
+ stack_push dependency_pkg " none" " $package " " gcc"
197
+ stack_push dependency_exe " none" " $executable " " gfortran"
198
+ stack_push dependency_path " none" " $( ./build.sh -P " $package " ) " " $( ./build.sh -P gcc) "
199
+ fi
184
200
fi
185
201
fi
186
202
0 commit comments