File tree Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change 35
35
program main
36
36
use iso_fortran_env, only : compiler_version
37
37
implicit none
38
- print * ,(compiler_version() >= " GCC version 6.1.0 " )
38
+ integer , parameter :: first_argument= 1
39
+ integer stat
40
+ character (len= 9 ) version_number
41
+ call get_command_argument(first_argument,version_number,status= stat)
42
+ select case (stat)
43
+ case (- 1 )
44
+ error stop " acceptable_compiler.f90: insufficient string length in attempt to read command argument"
45
+ case (0 )
46
+ ! successful command argument read
47
+ case (1 :)
48
+ error stop " acceptable_compiler.f90: no version-number supplied"
49
+ case default
50
+ error stop " invalid status"
51
+ end select
52
+ print * ,(compiler_version() >= " GCC version " // adjustl (trim (version_number))// " " )
39
53
end program
Original file line number Diff line number Diff line change @@ -273,16 +273,18 @@ find_or_install()
273
273
stack_push dependency_path " none"
274
274
275
275
elif [[ " $package_in_path " == " true" ]]; then
276
- info " $this_script : Checking whether $executable in PATH is version $( ./build.sh -V gcc) or later..."
276
+ export minimum_acceptable_version=$( ./build.sh -V gcc)
277
+ info " $this_script : Checking whether $executable in PATH is version $minimum_acceptable_version or later..."
277
278
$executable -o acceptable_compiler acceptable_compiler.f90 || true ;
278
279
$executable -o print_true print_true.f90 || true ;
279
280
if [[ -f ./acceptable_compiler && -f ./print_true ]]; then
280
281
is_true=$( ./print_true)
281
- acceptable=$( ./acceptable_compiler)
282
+ acceptable=$( ./acceptable_compiler $minimum_acceptable_version )
282
283
rm acceptable_compiler print_true
283
284
else
284
285
acceptable=false
285
286
fi
287
+
286
288
if [[ " $acceptable " == " ${is_true:- } " ]]; then
287
289
printf " yes.\n"
288
290
echo -e " $this_script : Using the $executable found in the PATH.\n"
You can’t perform that action at this time.
0 commit comments