Skip to content

Commit 10ec821

Browse files
author
Damian Rouson
committed
Added m4 to the dependency tree.
install.sh will now build m4 if any of each of the following is either not found has an insufficient version number: mpich->gfortran->flex->bison.
1 parent caae076 commit 10ec821

File tree

3 files changed

+63
-2
lines changed

3 files changed

+63
-2
lines changed

doc/dependency_tree/opencoarrays-tree.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ opencoarrays
44
└── gcc-5.1.0
55
├── flex-2.6.0
66
│   └── bison-3.0.4
7+
│   └── m4-1.4.17
78
├── gmp
89
├── mpc
910
└── mpfr
1011

11-
8 directories, 0 files
12+
9 directories, 0 files

install.sh

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ find_or_install()
141141
"mpich:mpif90"
142142
"flex:flex"
143143
"bison:yacc"
144+
"m4:m4"
144145
"_unknown:0"
145146
)
146147
for element in "${package_executable_array[@]}" ; do
@@ -479,9 +480,68 @@ find_or_install()
479480
stack_push dependency_path "none"
480481
fi
481482

483+
else # $package not in PATH and not yet installed by this script
484+
# Trigger 'find_or_install bison' and subsequent build of $package
485+
stack_push dependency_pkg "m4"
486+
stack_push dependency_exe "m4"
487+
stack_push dependency_path `./build m4 --default --query-path`
488+
fi
489+
490+
elif [[ $package == "m4" ]]; then
491+
492+
# We arrive when the 'elif [[ $package == "bison" ]]' block pushes "m4" onto the
493+
# the dependency_pkg stack, resulting in the recursive call 'find_or_install m4'
494+
495+
# Every branch that discovers an acceptable pre-existing installation must set the
496+
# M4 environment variable. Every branch must also manage the dependency stack.
497+
498+
if [[ "$script_installed_package" == true ]]; then
499+
printf "$this_script: Using the $package executable $executable installed by $this_script\n"
500+
export M4=$package_install_path/bin/m4
501+
# Remove m4 from the dependency stack
502+
stack_pop dependency_pkg package_done
503+
stack_pop dependency_exe executable_done
504+
stack_pop dependency_path package_done_path
505+
# Put $package onto the script_installed log
506+
stack_push script_installed package_done
507+
stack_push script_installed executable_done
508+
stack_push script_installed package_done_path
509+
# Halt the recursion and signal that there are no prerequisites to build
510+
stack_push dependency_pkg "none"
511+
stack_push dependency_exe "none"
512+
stack_push dependency_path "none"
513+
514+
elif [[ "$package_in_path" == "true" ]]; then
515+
printf "$this_script: Checking whether $package executable $executable in PATH is version < $minimum_version... "
516+
if [[ "$package_version_in_path" < "$package (GNU Bison) $minimum_version" ]]; then
517+
printf "yes.\n"
518+
export M4="$package_install_path/bin/m4"
519+
# Halt the recursion and signal that there are no prerequisites to build
520+
stack_push dependency_pkg "none"
521+
stack_push dependency_exe "none"
522+
stack_push dependency_path "none"
523+
else
524+
printf "no.\n"
525+
printf "$this_script: Using the $package executable $executable found in the PATH.\n"
526+
M4=m4
527+
stack_push acceptable_in_path $package $executable
528+
# Remove m4 from the dependency stack
529+
stack_pop dependency_pkg package_done
530+
stack_pop dependency_exe executable_done
531+
stack_pop dependency_path package_done_path
532+
# Put $package onto the script_installed log
533+
stack_push script_installed package_done
534+
stack_push script_installed executable_done
535+
stack_push script_installed package_done_path
536+
# Halt the recursion and signal that there are no prerequisites to build
537+
stack_push dependency_pkg "none"
538+
stack_push dependency_exe "none"
539+
stack_push dependency_path "none"
540+
fi
541+
482542
else # $package not in PATH and not yet installed by this script
483543
# Halt the recursion and signal that there are no prerequisites to build
484-
export YACC="$package_install_path/bin/yacc"
544+
export M4="$package_install_path/bin/m4"
485545
stack_push dependency_pkg "none"
486546
stack_push dependency_exe "none"
487547
stack_push dependency_path "none"

0 commit comments

Comments
 (0)