Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ matrix:
packages:
- gcc-5
- gfortran-5
- g++-5
- binutils
- cmake-data
- cmake
Expand All @@ -72,6 +73,7 @@ matrix:
packages:
- gcc-5
- gfortran-5
- g++-5

before_install:
- |
Expand Down Expand Up @@ -151,13 +153,7 @@ script:
ln -fs "$(which gcc-5)" "$HOME/bin/gcc"
ln -fs "$(which g++-5)" "$HOME/bin/g++"
export PATH="$PATH:$HOME/bin"
yes | ./install.sh -i "$HOME/opt/opencoarrays" -j 4 -f "$HOME/bin/gfortran" -c "$HOME/bin/gcc" -C "$HOME/bin/g++" > install.log &
install_sh_PID=$!
echo "install.log will be displayed after success or failure"
while ps -p $install_sh_PID > /dev/null; do
echo "Still working on installing opencoarrays and dependencies"
sleep 300 # prevent Travis-CI abort due to inactivity and excessive logging
done
yes | ./install.sh -i "$HOME/opt/opencoarrays" -j 4 -f "$HOME/bin/gfortran" -c "$HOME/bin/gcc" -C "$HOME/bin/g++"
else
mkdir cmake-build
cd cmake-build
Expand All @@ -172,10 +168,6 @@ after_success:
- find . -name '*.gcno' -print
- gcov-5 --version
- bash <(curl -s https://codecov.io/bash) -x $(which gcov-5)
- cat install.log || true

after_failure:
- cat install.log || true

notifications:
webhooks:
Expand Down
56 changes: 39 additions & 17 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
# (4) Parse the command line using the usage information.

### Start of boilerplate -- do not edit this block #######################
export OPENCOARRAYS_SRC_DIR="${OPENCOARRAYS_SRC_DIR:-${PWD}}"
export OPENCOARRAYS_SRC_DIR="${OPENCOARRAYS_SRC_DIR:-${PWD%/}}"
if [[ ! -f "${OPENCOARRAYS_SRC_DIR}/src/libcaf.h" ]]; then
echo "Please run this script inside the top-level OpenCoarrays source directory or "
echo "set OPENCOARRAYS_SRC_DIR to the OpenCoarrays source directory path."
Expand Down Expand Up @@ -149,7 +149,7 @@ info "-D (--print-downloader): ${arg_D}"
info "-e (--verbose): ${arg_e}"
info "-f (--with-fortran): ${arg_f}"
info "-h (--help): ${arg_h}"
info "-i (--install-dir): ${arg_i}"
info "-i (--install-prefix): ${arg_i}"
info "-I (--install-version): ${arg_I}"
info "-j (--num-threads): ${arg_j}"
info "-l (--list-packages): ${arg_l}"
Expand Down Expand Up @@ -188,21 +188,20 @@ info "-V (--print-version): ${arg_V}"
this_script="$(basename "$0")"
export this_script

export install_path="${arg_i}"
info "install_path=${arg_i}"
export install_path="${arg_i%/}"
info "install_path=\"${install_path}\""

export num_threads="${arg_j}"
info "num_threads=${arg_j}"
info "num_threads=\"${arg_j}\""

export opencoarrays_src_dir="${OPENCOARRAYS_SRC_DIR}"
info "opencoarrays_src_dir=${OPENCOARRAYS_SRC_DIR}"

export build_path=$opencoarrays_src_dir/prerequisites/builds
info "build_path=$opencoarrays_src_dir/prerequisites/builds"

export build_script=$opencoarrays_src_dir/prerequisites/build.sh
info "build_script=$opencoarrays_src_dir/prerequisites/build.sh"
export build_path="${opencoarrays_src_dir}"/prerequisites/builds
info "build_path=\"${opencoarrays_src_dir}\"/prerequisites/builds"

export build_script="${opencoarrays_src_dir}"/prerequisites/build.sh
info "build_script=\"${opencoarrays_src_dir}\"/prerequisites/build.sh"

# ___________________ Define functions for use in the Main Body ___________________

Expand All @@ -214,12 +213,16 @@ stack_new dependency_pkg
stack_new dependency_exe
stack_new dependency_path
stack_new script_installed

# shellcheck source=./prerequisites/install-functions/find_or_install.sh
source $opencoarrays_src_dir/prerequisites/install-functions/find_or_install.sh

# shellcheck source=./prerequisites/install-functions/print_header.sh
source $opencoarrays_src_dir/prerequisites/install-functions/print_header.sh

# shellcheck source=./prerequisites/install-functions/build_opencoarrays.sh
source $opencoarrays_src_dir/prerequisites/install-functions/build_opencoarrays.sh

# shellcheck source=./prerequisites/install-functions/report_results.sh
source $opencoarrays_src_dir/prerequisites/install-functions/report_results.sh

Expand All @@ -232,7 +235,7 @@ source $opencoarrays_src_dir/prerequisites/install-functions/report_results.sh
if [[ "${arg_v}" == "${__flag_present}" || "${arg_V}" == "opencoarrays" ]]; then

# Print script copyright if invoked with -v, -V, or --version argument
cmake_project_line=$(grep project CMakeLists.txt | grep VERSION)
cmake_project_line=$(grep project ${opencoarrays_src_dir}/CMakeLists.txt | grep VERSION)
text_after_version_keyword="${cmake_project_line##*VERSION}"
text_before_language_keyword="${text_after_version_keyword%%LANGUAGES*}"
opencoarrays_version=$text_before_language_keyword
Expand All @@ -249,7 +252,7 @@ if [[ "${arg_v}" == "${__flag_present}" || "${arg_V}" == "opencoarrays" ]]; then
echo "http://www.sourceryinstitute.org/license.html"
echo ""
elif [[ "${arg_V}" == "opencoarrays" ]]; then
echo "${opencoarrays_version}"
echo "${opencoarrays_version//[[:space:]]/}"
fi

elif [[ ! -z "${arg_D:-${arg_P:-${arg_U:-${arg_V}}}}" || "${arg_l}" == "${__flag_present}" ]]; then
Expand All @@ -261,29 +264,48 @@ elif [[ ! -z "${arg_D:-${arg_P:-${arg_U:-${arg_V}}}}" || "${arg_l}" == "${__fla
[ ! -z "${arg_U}" ] && build_flag="-U"
[ ! -z "${arg_V}" ] && build_flag="-V"
[ "${arg_l}" == "${__flag_present}" ] && build_flag="-l"
"${opencoarrays_src_dir}"/prerequisites/build.sh "${build_flag}" "${build_arg}"
# Add lines other packages the current script builds
if [[ "${arg_l}" == "${__flag_present}" ]]; then
echo "opencoarrays (version $("${opencoarrays_src_dir}/install.sh" -V opencoarrays))"
echo "ofp (version: ofp-sdf for OS X )"

if [[ "${arg_P}" == "opencoarrays" ]]; then

version="$("${opencoarrays_src_dir}/install.sh" -V opencoarrays)"
echo "${install_path%/}/opencoarrays/${version}"

else

info "Invoking build script with the following command:"
info "\"${opencoarrays_src_dir}\"/prerequisites/build.sh \"${build_flag}\" \"${build_arg}\""
"${opencoarrays_src_dir}"/prerequisites/build.sh "${build_flag}" "${build_arg}"

# Add lines other packages the current script builds
if [[ "${arg_l}" == "${__flag_present}" ]]; then
echo "opencoarrays (version $("${opencoarrays_src_dir}/install.sh" -V opencoarrays))"
echo "ofp (version: ofp-sdf for OS X )"
fi
fi

elif [[ "${arg_p:-}" == "opencoarrays" ]]; then


cd prerequisites || exit 1
installation_record=install-opencoarrays.log
# shellcheck source=./prerequisites/build-functions/set_SUDO_if_needed_to_write_to_directory.sh
source "${OPENCOARRAYS_SRC_DIR:-}/prerequisites/build-functions/set_SUDO_if_needed_to_write_to_directory.sh"
version="$("${opencoarrays_src_dir}/install.sh" -V opencoarrays)"
install_path="${install_path}/opencoarrays/${version}"
set_SUDO_if_needed_to_write_to_directory "${install_path}"
build_opencoarrays 2>&1 | tee ../"${installation_record}"
report_results 2>&1 | tee -a ../"${installation_record}"

elif [[ "${arg_p:-}" == "ofp" ]]; then

info "Invoking Open Fortran Parser build script with the following command:"
info "\"${opencoarrays_src_dir}\"/prerequisites/install-ofp.sh"
"${opencoarrays_src_dir}"/prerequisites/install-ofp.sh

elif [[ ! -z "${arg_p:-}" ]]; then

info "Invoking build script with the following command:"
info "\"${opencoarrays_src_dir}\"/prerequisites/build.sh ${@:-}"
"${opencoarrays_src_dir}"/prerequisites/build.sh ${@:-}

fi
Expand Down
4 changes: 2 additions & 2 deletions install.sh-usage
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
-e --verbose Enable verbose mode, print script as it is executed.
-f --with-fortran [arg] Use specified Fortran compiler.
-h --help Print this page.
-i --install-dir [arg] Install package in specified path. Default="${OPENCOARRAYS_SRC_DIR}/prerequisites/installations/"
-i --install-prefix [arg] Install package in specified path. Default="${OPENCOARRAYS_SRC_DIR}/prerequisites/installations/"
-I --install-version [arg] Install package version.
-j --num-threads [arg] Number of threads to use when invoking make. Default="1"
-l --list-packages Print packages this script can install.
-m --with-cmake [arg] Use specified CMake installation. Default="cmake"
-M --with-mpi [arg] Use specified MPI installation. Default="mpif90"
-M --with-mpi [arg] Use specified MPI installation.
-n --no-color Disable color output.
-p --package [arg] Install specified package. Default="opencoarrays"
-P --print-path [arg] Print installation directory for specified package.
Expand Down
1 change: 1 addition & 0 deletions prerequisites/build-functions/build_and_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ build_and_install()

info "Building ${package_to_build} ${version_to_build}"
info "Build path: ${build_path}"
info "Installation path: ${install_path}"

set_SUDO_if_needed_to_write_to_directory "${build_path}"
set_SUDO_if_needed_to_write_to_directory "${install_path}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
set_or_print_installation_path()
{
# Verify requirements
[ ! -z "${arg_P}" ] && [ ! -z "${arg_D:-${arg_p:-${arg_U:-${arg_V}}}}" ] &&
[ ! -z "${arg_P}" ] && [ ! -z "${arg_p:-${arg_D:-${arg_U:-${arg_V}}}}" ] &&
emergency "Please pass only one of {-D, -p, -P, -U, -V} or a longer equivalent (multiple detected)."

install_path="${arg_i}/${arg_p:-${arg_D:-${arg_P:-${arg_U:-${arg_V}}}}}/${version_to_build}"
install_path="${arg_i%/}/${arg_p:-${arg_D:-${arg_P:-${arg_U:-${arg_V}}}}}/${version_to_build}"

# If -P is present, print ${install_path} and exit with normal status
if [[ ! -z "${arg_P:-}" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion prerequisites/build-functions/set_or_print_url.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ set_or_print_url()
"flex;flex-${version_to_build}.tar.bz2"
"bison;bison-${version_to_build}.tar.gz"
"make;make-${version_to_build}.tar.bz2"
"cmake;cmake-${version_to_build}.tar.gz "
"cmake;cmake-${version_to_build}.tar.gz"
"subversion;subversion-${version_to_build}.tar.gz"
)
for package in "${package_url_tail[@]}" ; do
Expand Down
7 changes: 4 additions & 3 deletions prerequisites/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
# (4) Parse the command line using the usage information.


export OPENCOARRAYS_SRC_DIR="${OPENCOARRAYS_SRC_DIR:-${PWD}/..}"
export OPENCOARRAYS_SRC_DIR="${OPENCOARRAYS_SRC_DIR:-${PWD%prerequisites*}}"
export __usage=${OPENCOARRAYS_SRC_DIR}/prerequisites/build.sh-usage
if [[ ! -f "${OPENCOARRAYS_SRC_DIR}/src/libcaf.h" ]]; then
echo "Please run this script inside the OpenCoarrays source \"prerequisites\" subdirectory"
Expand Down Expand Up @@ -91,13 +91,13 @@ info "LOG_LEVEL: ${LOG_LEVEL}"

info "-b (--branch): ${arg_b} "
info "-c (--with-c): ${arg_c} "
info "-C (--with-cpp): ${arg_C} "
info "-C (--with-cxx): ${arg_C} "
info "-d (--debug): ${arg_d} "
info "-D (--print-downloader): ${arg_D} "
info "-e (--verbose): ${arg_e} "
info "-f (--with-fortran): ${arg_f} "
info "-h (--help): ${arg_h} "
info "-i (--install-dir): ${arg_i} "
info "-i (--install-prefix): ${arg_i} "
info "-j (--num-threads): ${arg_j} "
info "-I (--install-version): ${arg_I} "
info "-l (--list-packages): ${arg_l} "
Expand All @@ -112,6 +112,7 @@ info "-U (--print-url): ${arg_U} "
info "-v (--version): ${arg_v} "
info "-V (--print-version): ${arg_V} "
}

# shellcheck source=./build-functions/set_or_print_default_version.sh
source "${OPENCOARRAYS_SRC_DIR:-}/prerequisites/build-functions/set_or_print_default_version.sh"
set_or_print_default_version "${@}"
Expand Down
8 changes: 4 additions & 4 deletions prerequisites/build.sh-usage
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
-e --verbose Enable verbose mode, print script as it is executed.
-f --with-fortran [arg] Specify Fortran compiler location. Default="gfortran"
-h --help This page.
-i --install-dir [arg] Install package in specified path. Default="${OPENCOARRAYS_SRC_DIR}/prerequisites/installations/${package_name:-}/"
-i --install-prefix [arg] Install package in specified path. Default="${OPENCOARRAYS_SRC_DIR%/}/prerequisites/installations/"
-j --num-threads [arg] Number of threads to use when invoking make. Default="1"
-I --install-version [arg] Package version to install. (To see default, use -V or --print-version)
-l --list-packages List the packages this script can install.
-L --list-branches List the repository branches this script can download.
-m --with-cmake [arg] Specify CMake location. Default="'`which cmake`'"
-M --with-mpi [arg] Specify MPI location. Default="'`which mpif90`'"
-m --with-cmake [arg] Use the specified CMake installation. Default="cmake"
-M --with-mpi [arg] Use the specified MPI installation.
-n --no-color Disable color output.
-p --package [arg] Package to install.
-P --print-path [arg] Print installation path for package specified in argument.
-t --with-tau [arg] Use the specified TAU parallel performance utilities installation. Default="'`which tauf90`'"
-t --with-tau [arg] Use the specified TAU parallel performance utilities installation. Default="tauf90"
-T --install-tau [arg] Install TAU in specified path. Default="${OPENCOARRAYS_SRC_DIR}/prerequisites/installations/${package_name:-}/${version_to_build:-}/"
-U --print-url [arg] Print URL for package specified in argument.
-v --version Print OpenCoarrays version number.
Expand Down
5 changes: 3 additions & 2 deletions prerequisites/install-functions/build_opencoarrays.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
build_opencoarrays()
{
print_header
info "find_or_install mpich"
info "Invoking find_or_install mpich"
find_or_install mpich
info "find_or_install cmake"
info "Invoking find_or_install cmake"
find_or_install cmake
build_path="${build_path}"/opencoarrays/$("${opencoarrays_src_dir}"/install.sh -V opencoarrays)
mkdir -p "$build_path"
pushd "$build_path"
if [[ -z "${MPICC:-}" || -z "${MPIFC:-}" || -z "${CMAKE:-}" ]]; then
Expand Down
Loading