Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
ace106f
Improved build/install directory management.
May 17, 2016
6d80784
Handle -f/-c/-C present without -M.
May 18, 2016
04aa217
Reverted --MPI-path to --with-mpi
May 18, 2016
192ef08
Fixed typo in diagnostic output.
May 18, 2016
7013dfe
Don't background install.sh on Travis-CI
zbeekman May 19, 2016
711cce8
Make sure g++-5 installed where needed
zbeekman May 19, 2016
5eca9ac
Merge pull request #185 from sourceryinstitute/fix-termination-when-n…
zbeekman May 19, 2016
7724f51
Bump version for 1.6.0 release
zbeekman May 19, 2016
e03fdbd
Bump version 2 distinguish post-release git builds
zbeekman May 19, 2016
43daf10
Merge branch 'rev-bump' for 1.6.0 release
zbeekman May 19, 2016
9d2dc94
Add ./build.sh -B to list gcc branches via svn
May 22, 2016
9ed6fbf
Add dev branch build: ./build.sh -p gcc -b trunk
May 22, 2016
4d755f0
Add dev branch build: ./install.sh -p gcc -b trunk
May 23, 2016
1f84193
Correct typo that blocked Travis-CI test
May 24, 2016
67ecc3b
Merge pull request #190 from sourceryinstitute/support-gcc-dev-branch…
May 28, 2016
706ea5a
Use any of ftp wget curl (#196)
Jun 4, 2016
f3f6a78
caf invokes compiler specified by OC-build-time FC (#197)
Jun 4, 2016
5e816e4
Fixes #48 Navier-Stokes test failures.
zbeekman May 31, 2016
6b47189
Fix CI silent failures
zbeekman May 31, 2016
ad94d57
Full barrier for any allocation
May 31, 2016
a433b88
Add more stressful test to catch #42 more often
zbeekman Jun 1, 2016
e7d7bcc
Merge pull request #195 from sourceryinstitute/bugfix-allocate_as_bar…
zbeekman Jun 4, 2016
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
20 changes: 9 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,9 +73,11 @@ matrix:
packages:
- gcc-5
- gfortran-5
- g++-5

before_install:
- |
set -o errexit
if [[ $TRAVIS ]] && [[ "X$TRAVIS_OS_NAME" = "Xosx" ]]; then
export PATH="$PATH:$HOME/Library/Python/2.7/bin"
else
Expand All @@ -86,9 +89,11 @@ before_install:
$FC --version
$CC --version
fi
set +o errexit

install:
- |
set -o errexit
if [[ $TRAVIS ]] && [[ "X$TRAVIS_OS_NAME" = "Xosx" ]]; then
brew update > /dev/null

Expand Down Expand Up @@ -139,9 +144,11 @@ install:
export FC=mpif90
export CC=mpicc
fi
set +o errexit

script:
- |
set -o errexit
if [[ "X$BUILD_TYPE" = "XInstallScript" ]]; then
export FC=gfortran-5
export CC=gcc-5
Expand All @@ -151,13 +158,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 @@ -167,15 +168,12 @@ script:
make install
cd ..
fi
set +o errexit

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
6 changes: 2 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set ( CMAKE_BUILD_TYPE "Release"
set_property ( CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CMAKE_CONFIGURATION_TYPES} )

#Name project and specify source languages
project(opencoarrays VERSION 1.5.1 LANGUAGES C Fortran)
project(opencoarrays VERSION 1.6.1 LANGUAGES C Fortran)

#Print an error message on an attempt to build inside the source directory tree:
if ("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
Expand Down Expand Up @@ -166,9 +166,7 @@ if(opencoarrays_aware_compiler)
add_mpi_test(register_rename_me 2 ${tests_root}/unit/init_register/register_rename_me)
add_mpi_test(register_rename_me_too 2 ${tests_root}/unit/init_register/register_rename_me_too)
add_mpi_test(allocate_as_barrier 2 ${tests_root}/unit/init_register/allocate_as_barrier)
if (NOT ( APPLE AND ( DEFINED ENV{TRAVIS} ) ) )
add_mpi_test(allocate_as_barrier_proc 2 ${tests_root}/unit/init_register/allocate_as_barrier_proc)
endif ()
add_mpi_test(allocate_as_barrier_proc 32 ${tests_root}/unit/init_register/allocate_as_barrier_proc)
add_mpi_test(get_array 2 ${tests_root}/unit/send-get/get_array)
add_mpi_test(send_array 2 ${tests_root}/unit/send-get/send_array)
add_mpi_test(get_with_offset_1d 2 ${tests_root}/unit/send-get/get_with_offset_1d)
Expand Down
82 changes: 54 additions & 28 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 @@ -113,22 +113,25 @@ trap cleanup_before_exit EXIT # The signal is specified here. Could be SIGINT, S
[ -z "${LOG_LEVEL:-}" ] && emergency "Cannot continue without LOG_LEVEL. "

# shellcheck disable=SC2154
if [[ "${arg_v}" == "${__flag_present}" || "${arg_l}" == "${__flag_present}" || ! -z "${arg_P:-${arg_U:-${arg_V:-${arg_D}}}}" ]]; then
if [[ "${arg_v}" == "${__flag_present}" || "${arg_l}" == "${__flag_present}" || ! -z "${arg_P:-${arg_U:-${arg_V:-${arg_D:-${arg_B}}}}}" ]]; then
print_debug_only=7
if [ "$(( LOG_LEVEL < print_debug_only ))" -ne 0 ]; then
debug "Supressing info and debug messages: one of {-l, -v, -P, -U, -V, -D} present."
suppress_info_debug_messages
fi
fi

[ ! -z "${arg_D}" ] && [ ! -z "${arg_P:-${arg_U:-${arg_V}}}" ] &&
emergency "Please pass only one of {-D, -p, -P, -U, -V} or a longer equivalent (multiple detected). [exit 101]"
[ ! -z "${arg_D}" ] && [ ! -z "${arg_P:-${arg_U:-${arg_V:-${arg_B}}}}" ] &&
emergency "Please pass only one of {-B, -D, -p, -P, -U, -V} or a longer equivalent (multiple detected). [exit 101]"

[ ! -z "${arg_P}" ] && [ ! -z "${arg_U:-${arg_V}}" ] &&
emergency "Please pass only one of {-D, -p, -P, -U, -V} or a longer equivalent (multiple detected). [exit 103]"
[ ! -z "${arg_P}" ] && [ ! -z "${arg_U:-${arg_V:-${arg_B}}}" ] &&
emergency "Please pass only one of {-B, -D, -p, -P, -U, -V} or a longer equivalent (multiple detected). [exit 102]"

[ ! -z "${arg_U}" ] && [ ! -z "${arg_V}" ] &&
emergency "Please pass only one of {-D, -p, -P, -U, -V} or a longer equivalent (multiple detected). [exit 104]"
[ ! -z "${arg_U}" ] && [ ! -z "${arg_V:-${arg_B}}" ] &&
emergency "Please pass only one of {-B, -D, -p, -P, -U, -V} or a longer equivalent (multiple detected). [exit 103]"

[ ! -z "${arg_V}" ] && [ ! -z "${arg_B}" ] &&
emergency "Please pass only one of {-B, -D, -p, -P, -U, -V} or a longer equivalent (multiple detected). [exit 104]"

### Print bootstrapped magic variables to STDERR when LOG_LEVEL
### is at the default value (6) or above.
Expand All @@ -142,14 +145,16 @@ info "__os: ${__os}"
info "__usage: ${__usage}"
info "LOG_LEVEL: ${LOG_LEVEL}"

info "-b (--install-branch): ${arg_b}"
info "-B (--list-branches): ${arg_B}"
info "-c (--with-c): ${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 "-I (--install-version): ${arg_I}"
info "-j (--num-threads): ${arg_j}"
info "-l (--list-packages): ${arg_l}"
Expand Down Expand Up @@ -188,21 +193,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 +218,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 @@ -228,11 +236,10 @@ source $opencoarrays_src_dir/prerequisites/install-functions/report_results.sh

# ________________________________ Start of the Main Body ___________________________________


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,41 +256,60 @@ 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
elif [[ ! -z "${arg_D:-${arg_P:-${arg_U:-${arg_V:-${arg_B}}}}}" || "${arg_l}" == "${__flag_present}" ]]; then

# Delegate to build.sh for the packages it builds
build_arg=${arg_D:-${arg_P:-${arg_U:-${arg_V:-${arg_p}}}}}
build_arg=${arg_B:-${arg_D:-${arg_P:-${arg_U:-${arg_V:-${arg_p}}}}}}
[ ! -z "${arg_B}" ] && build_flag="-B"
[ ! -z "${arg_D}" ] && build_flag="-D"
[ ! -z "${arg_P}" ] && build_flag="-P"
[ ! -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
6 changes: 4 additions & 2 deletions install.sh-usage
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
-b --branch [arg] Install the specified repository development branch.
-B --list-branches [arg] List the available branches in the specified package's repository.
-c --with-c [arg] Use specified C compiler.
-C --with-cxx [arg] Use specified C++ compiler.
-d --debug Enable debug mode.
-D --print-downloader [arg] Print download program for package specified in argument.
-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
34 changes: 17 additions & 17 deletions prerequisites/build-functions/download_if_necessary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ download_if_necessary()
else
# The download mechanism is in the path.
if [[ "${fetch}" == "svn" ]]; then
if [[ ${version_to_build} == '--avail' || ${version_to_build} == '-a' ]]; then
if [[ "${arg_B:-}" == "gcc" ]]; then
args="ls"
else
args="checkout"
Expand All @@ -59,29 +59,29 @@ download_if_necessary()
else
package_source_directory="${package_name}-${version_to_build}"
fi
info "Downloading ${package_name} ${version_to_build} to the following location:"
info "Downloading ${package_name} ${version_to_build-} to the following location:"
info "${download_path}/${package_source_directory}"
info "Download command: \"${fetch}\" ${args:-} ${package_url}"
info "Depending on the file size and network bandwidth, this could take several minutes or longer."
pushd "${download_path}"
"${fetch}" ${args:-} ${package_url}
popd
if [[ "${version_to_build}" == '--avail' || "${version_to_build}" == '-a' ]]; then
# In this case, args="ls" and the list of available versions has been printed so we can move on.
exit 1
fi
if [[ "${fetch}" == "svn" ]]; then
search_path="${download_path}/${version_to_build}"
else
search_path="${download_path}/${url_tail}"
fi
if [ -f "${search_path}" ] || [ -d "${search_path}" ]; then
info "Download succeeded. The ${package_name} source is in the following location:"
info "${search_path}"
if [[ ! -z "${arg_B:-}" ]]; then
return
else
info "Download failed. The ${package_name} source is not in the following, expected location:"
info "${search_path}"
emergency "Aborting. [exit 110]"
if [[ "${fetch}" == "svn" ]]; then
search_path="${download_path}/${version_to_build}"
else
search_path="${download_path}/${url_tail}"
fi
if [[ -f "${search_path}" || -d "${search_path}" ]]; then
info "Download succeeded. The ${package_name} source is in the following location:"
info "${search_path}"
else
info "Download failed. The ${package_name} source is not in the following, expected location:"
info "${search_path}"
emergency "Aborting. [exit 110]"
fi
fi
fi
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ set_or_print_default_version()

# Exit with error status and diagnostic output if empty default_version
if [[ -z "${default_version:-}" ]]; then
emergency "Package ${package_name:-} not recognized. Use --l or --list-packages to list the allowable names."
emergency "set_or_print_default.sh: Package ${package_name:-} not recognized. Use --l or --list-packages to list the allowable names."
fi
}
Loading