Skip to content

Commit 679f822

Browse files
authored
Merge branch 'master' into comment-caf-token
2 parents 1f02c3c + 4575ca1 commit 679f822

22 files changed

+455
-374
lines changed

CMakeLists.txt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set ( CMAKE_BUILD_TYPE "Release"
77
set_property ( CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CMAKE_CONFIGURATION_TYPES} )
88

99
#Name project and specify source languages
10-
project(opencoarrays VERSION 1.8.1 LANGUAGES C Fortran)
10+
project(opencoarrays VERSION 1.8.3 LANGUAGES C Fortran)
1111

1212
#Print an error message on an attempt to build inside the source directory tree:
1313
if ("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
@@ -189,7 +189,7 @@ set(OLD_INCLUDES ${CMAKE_REQUIRED_INCLUDES})
189189
set(CMAKE_REQUIRED_INCLUDES ${MPI_Fortran_INCLUDE_PATH})
190190
set(OLD_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
191191
set(CMAKE_REQUIRED_LIBRARIES ${MPI_Fortran_LIBRARIES})
192-
include (CheckCSourceCompiles)
192+
include (CheckFortranSourceCompiles)
193193
CHECK_Fortran_SOURCE_COMPILES("
194194
program mpi_hello
195195
use mpi
@@ -221,7 +221,7 @@ set(OLD_INCLUDES ${CMAKE_REQUIRED_INCLUDES})
221221
set(CMAKE_REQUIRED_INCLUDES ${MPI_Fortran_INCLUDE_PATH})
222222
set(OLD_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
223223
set(CMAKE_REQUIRED_LIBRARIES ${MPI_Fortran_LIBRARIES})
224-
include (CheckCSourceCompiles)
224+
include (CheckFortranSourceCompiles)
225225
CHECK_Fortran_SOURCE_COMPILES("
226226
program mpi_hello
227227
implicit none
@@ -391,6 +391,8 @@ if(opencoarrays_aware_compiler)
391391
add_mpi_test(duplicate_syncimages 8 ${tests_root}/unit/sync/duplicate_syncimages)
392392
add_mpi_test(co_reduce 4 ${tests_root}/unit/collectives/co_reduce_test)
393393
add_mpi_test(syncimages_status 32 ${tests_root}/unit/sync/syncimages_status)
394+
add_mpi_test(sync_ring_abort_np3 3 ${tests_root}/unit/sync/sync_image_ring_abort_on_stopped_image)
395+
add_mpi_test(sync_ring_abort_np7 7 ${tests_root}/unit/sync/sync_image_ring_abort_on_stopped_image)
394396
add_mpi_test(simpleatomics 32 ${tests_root}/unit/simple/atomics)
395397
# possible logic error in the following test
396398
# add_mpi_test(increment_my_neighbor 32 ${tests_root}/unit/simple/increment_my_neighbor)
@@ -399,7 +401,7 @@ if(opencoarrays_aware_compiler)
399401
add_mpi_test(hello_multiverse 2 ${tests_root}/integration/coarrayHelloWorld/hello_multiverse)
400402
add_mpi_test(coarray_burgers_pde 2 ${tests_root}/integration/pde_solvers/coarrayBurgers/coarray_burgers_pde)
401403
add_mpi_test(co_heat 2 ${tests_root}/integration/pde_solvers/coarrayHeatSimplified/co_heat)
402-
add_mpi_test(asynchronous_hello_world 2 ${tests_root}/integration/events/asynchronous_hello_world)
404+
add_mpi_test(asynchronous_hello_world 3 ${tests_root}/integration/events/asynchronous_hello_world)
403405
if ( ("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "x86_64") AND ("${CMAKE_SYSTEM_NAME}" MATCHES "Linux") )
404406
if ( (NOT (DEFINED ENV{TRAVIS})) AND (NOT SKIP_ASSEMBLY_DEPS) )
405407
add_mpi_test(coarray_navier_stokes 2 ${tests_root}/integration/pde_solvers/navier-stokes/coarray_navier_stokes)
@@ -409,6 +411,7 @@ if(opencoarrays_aware_compiler)
409411

410412
# Regression tests based on reported issues
411413
add_mpi_test(convert-before-put 3 ${tests_root}/regression/reported/convert-before-put)
414+
add_mpi_test(event-post 3 ${tests_root}/regression/reported/event-post)
412415
else()
413416
add_test(co_sum_extension ${tests_root}/unit/extensions/test-co_sum-extension.sh)
414417
set_property(TEST co_sum_extension PROPERTY PASS_REGULAR_EXPRESSION "Test passed.")
@@ -426,5 +429,5 @@ else()
426429
set_property(TEST co_reduce_extension PROPERTY PASS_REGULAR_EXPRESSION "Test passed.")
427430
endif()
428431

429-
include(AddInstallationScriptTest.cmake )
432+
include(cmake/AddInstallationScriptTest.cmake )
430433
add_installation_script_test(installation-scripts.sh src/tests/installation/)
Lines changed: 34 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Make the build directory, configure, and build
22
# shellcheck disable=SC2154
3+
4+
source ${OPENCOARRAYS_SRC_DIR}/prerequisites/build-functions/edit_GCC_download_prereqs_file_if_necessary.sh
5+
36
build_and_install()
47
{
58
num_threads=${arg_j}
@@ -14,17 +17,37 @@ build_and_install()
1417
mkdir -p "${build_path}"
1518
info "pushd ${build_path}"
1619
pushd "${build_path}"
17-
if [[ "${package_to_build}" == "gcc" ]]; then
20+
21+
if [[ "${package_to_build}" != "gcc" ]]; then
22+
23+
info "Configuring ${package_to_build} ${version_to_build} with the following command:"
24+
info "FC=\"${FC:-'gfortran'}\" CC=\"${CC:-'gcc'}\" CXX=\"${CXX:-'g++'}\" \"${download_path}/${package_source_directory}\"/configure --prefix=\"${install_path}\""
25+
FC="${FC:-'gfortran'}" CC="${CC:-'gcc'}" CXX="${CXX:-'g++'}" "${download_path}/${package_source_directory}"/configure --prefix="${install_path}"
26+
info "Building with the following command:"
27+
info "FC=\"${FC:-'gfortran'}\" CC=\"${CC:-'gcc'}\" CXX=\"${CXX:-'g++'}\" make -j\"${num_threads}\""
28+
FC="${FC:-'gfortran'}" CC="${CC:-'gcc'}" CXX="${CXX:-'g++'}" make "-j${num_threads}"
29+
info "Installing ${package_to_build} in ${install_path}"
30+
if [[ ! -z "${SUDO:-}" ]]; then
31+
info "You do not have write permissions to the installation path ${install_path}"
32+
info "If you have administrative privileges, enter your password to install ${package_to_build}"
33+
fi
34+
info "Installing with the following command: ${SUDO:-} make install"
35+
${SUDO:-} make install
36+
37+
else # ${package_to_build} == "gcc"
38+
39+
# Use GCC's contrib/download_prerequisites script after modifying it, if necessary, to use the
40+
# the preferred download mechanism set in prerequisites/build-functions/set_or_print_downloader.sh
41+
1842
info "pushd ${download_path}/${package_source_directory} "
1943
pushd "${download_path}/${package_source_directory}"
20-
arg_string="${gcc_prereqs_fetch_args[@]:-}"
21-
if [[ "$(uname)" == "Linux" ]]; then
22-
sed -i'' s/"wget --no-verbose -O \"\${directory}\/\${ar}\""/"${gcc_prereqs_fetch} ${arg_string}"/ "${PWD}/contrib/download_prerequisites"
23-
else
24-
# This works on OS X and other POSIX-compliant operating systems:
25-
sed -i '' s/"wget --no-verbose -O \"\${directory}\/\${ar}\""/"${gcc_prereqs_fetch} ${arg_string}"/ "${PWD}/contrib/download_prerequisites"
26-
fi
44+
45+
# Switch download mechanism, if wget is not available
46+
edit_GCC_download_prereqs_file_if_necessary
47+
48+
# Download GCC prerequisities
2749
"${PWD}"/contrib/download_prerequisites
50+
2851
info "popd"
2952
popd
3053
info "Configuring gcc/g++/gfortran builds with the following command:"
@@ -38,21 +61,9 @@ build_and_install()
3861
fi
3962
info "Installing with the following command: ${SUDO:-} make install"
4063
${SUDO:-} make install
41-
else
42-
info "Configuring ${package_to_build} ${version_to_build} with the following command:"
43-
info "FC=\"${FC:-'gfortran'}\" CC=\"${CC:-'gcc'}\" CXX=\"${CXX:-'g++'}\" \"${download_path}/${package_source_directory}\"/configure --prefix=\"${install_path}\""
44-
FC="${FC:-'gfortran'}" CC="${CC:-'gcc'}" CXX="${CXX:-'g++'}" "${download_path}/${package_source_directory}"/configure --prefix="${install_path}"
45-
info "Building with the following command:"
46-
info "FC=\"${FC:-'gfortran'}\" CC=\"${CC:-'gcc'}\" CXX=\"${CXX:-'g++'}\" make -j\"${num_threads}\""
47-
FC="${FC:-'gfortran'}" CC="${CC:-'gcc'}" CXX="${CXX:-'g++'}" make "-j${num_threads}"
48-
info "Installing ${package_to_build} in ${install_path}"
49-
if [[ ! -z "${SUDO:-}" ]]; then
50-
info "You do not have write permissions to the installation path ${install_path}"
51-
info "If you have administrative privileges, enter your password to install ${package_to_build}"
52-
fi
53-
info "Installing with the following command: ${SUDO:-} make install"
54-
${SUDO:-} make install
55-
fi
64+
65+
fi # end if [[ "${package_to_build}" != "gcc" ]]; then
66+
5667
info "popd"
5768
popd
5869
}

prerequisites/build-functions/download_if_necessary.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# shellcheck shell=bash disable=SC2148
2-
# shellcheck source=./ftp-url.sh
3-
source "${OPENCOARRAYS_SRC_DIR}/prerequisites/build-functions/ftp-url.sh"
2+
# shellcheck source=./ftp_url.sh
3+
source "${OPENCOARRAYS_SRC_DIR}/prerequisites/build-functions/ftp_url.sh"
44
# shellcheck source=./set_SUDO_if_needed_to_write_to_directory.sh
55
source "${OPENCOARRAYS_SRC_DIR}/prerequisites/build-functions/set_SUDO_if_needed_to_write_to_directory.sh"
66

@@ -18,7 +18,7 @@ download_if_necessary()
1818
"wget" )
1919
args=("--no-check-certificate")
2020
;;
21-
"ftp-url" )
21+
"ftp_url" )
2222
args=("-n")
2323
;;
2424
"git" )
@@ -38,7 +38,7 @@ download_if_necessary()
3838
first_three_characters=$(echo "${package_url}" | cut -c1-3)
3939
case "${first_three_characters}" in
4040
"ftp" )
41-
args=("-LO" "-u" "anonymous:")
41+
args=("-LO" "-u" "anonymous: ")
4242
;;
4343
"htt" )
4444
args=("-LO")
@@ -57,14 +57,14 @@ download_if_necessary()
5757
"wget" )
5858
gcc_prereqs_fetch_args=("--no-check-certificate")
5959
;;
60-
"ftp-url" )
60+
"ftp_url" )
6161
gcc_prereqs_fetch_args=("-n")
6262
;;
6363
"curl" )
64-
gcc_prereqs_fetch_args=("-LO" "-u" "anonymous:")
64+
gcc_prereqs_fetch_args=("-LO" "-u" "anonymous: ")
6565
;;
6666
*)
67-
emergency "download_if_necessary.sh: Unrecognized \${gcc_prereqs_fetch_args}=${gcc_prereqs_fetch_args}."
67+
emergency "download_if_necessary.sh: Unrecognized \${gcc_prereqs_fetch}=${gcc_prereqs_fetch}."
6868
;;
6969
esac
7070

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# Make the build directory, configure, and build
2+
# shellcheck disable=SC2154
3+
4+
edit_GCC_download_prereqs_file_if_necessary()
5+
{
6+
# Only modify download_prerequisites if wget is unavailable
7+
if type wget &> /dev/null; then
8+
info "wget available. Invoking unmodified GCC script contrib/download_prerequisites."
9+
else
10+
info "wget unavailable. Editing GCC contrib/download_prerequisites to replace it with ${gcc_prereqs_fetch}"
11+
12+
download_prereqs_file="${PWD}/contrib/download_prerequisites"
13+
14+
# Define a file extension for the download_prerequisites backup
15+
backup_extension=".original"
16+
backup_file="${download_prereqs_file}${backup_extension}"
17+
if [[ -f ${backup_file} ]]; then
18+
# Prevent overwriting an existing backup:
19+
backup_extension=""
20+
fi
21+
22+
# Grab the line with the first occurence of 'wget'
23+
wget_line=`grep wget "${download_prereqs_file}" | head -1` || true
24+
if [[ ! -z "${wget_line:-}" ]]; then
25+
# Download_prerequisites contains wget so we haven't modified it
26+
already_modified_downloader="false"
27+
else
28+
# Check whether a backup file already exists
29+
if [[ ! -f "${backup_file}" ]]; then
30+
emergency ": gcc contrib/download_prerequisites does not use wget"
31+
else
32+
already_modified_downloader="true"
33+
fi
34+
fi
35+
36+
# Only modify download_prerequisites once
37+
if [[ ${already_modified_downloader} != "true" ]]; then
38+
39+
# Check for wget format used before GCC 7
40+
if [[ "${wget_line}" == *"ftp"* ]]; then
41+
gcc7_format="false"
42+
wget_command="${wget_line%%ftp*}" # grab everything before ftp
43+
44+
# Check for wget format adopted in GCC 7
45+
elif [[ "${wget_line}" == *"base_url"* ]]; then
46+
gcc7_format="true"
47+
case "${gcc_prereqs_fetch}" in
48+
"ftp_url")
49+
# Insert a new line after line 2 to include ftp_url.sh as a download option
50+
sed -i${backup_extension} -e '2 a\'$'\n'". ${OPENCOARRAYS_SRC_DIR}/prerequisites/build-functions/ftp_url.sh"$'\n' "${download_prereqs_file}"
51+
wget_command='wget --no-verbose -O "${directory}\/${ar}"'
52+
;;
53+
"curl")
54+
wget_command="${wget_line%%\"\$\{directory\}*}" # grab everything before "${base_url}
55+
wget_command="wget${wget_command#*wget}" # keep everything from wget forward
56+
;;
57+
*)
58+
emergency "Unknown download program ${gcc_prereqs_fetch} in edit_GCC_download_prereqs_file_if_necessary.sh"
59+
;;
60+
esac
61+
62+
else
63+
emergency "gcc contrib/download_prerequisites does not use a known URL format"
64+
fi
65+
66+
arg_string="${gcc_prereqs_fetch_args[@]:-} "
67+
68+
if [[ ${gcc7_format} == "true" ]]; then
69+
case "${gcc_prereqs_fetch}" in
70+
"curl")
71+
arg_string="${arg_string} -o "
72+
;;
73+
*)
74+
debug "if problem downloading, ensure that the gcc download_prerequisites edits are compatible with ${gcc_prereqs_fetch}"
75+
;;
76+
esac
77+
# Protect against missing sha512sum command adopted in GCC 7 (not available by default on Lubuntu Linux)
78+
if ! type sha512sum &> /dev/null; then
79+
info "sha512sum unavailable. Turning off file integrity verification in GCC contrib/download_prerequisites."
80+
if [[ "$(uname)" == "Linux" ]]; then
81+
# Adjust for non-POSIX OS
82+
sed -i"${backup_extension}" s/"verify=1"/"verify=0"/ "${download_prereqs_file}"
83+
else
84+
sed -i "${backup_extension}" s/"verify=1"/"verify=0"/ "${download_prereqs_file}"
85+
fi
86+
fi
87+
fi
88+
info "Using the following command to replacing wget in the GCC download_prerequisites file:"
89+
info "sed -i${backup_extension} s/\"${wget_command}\"/\"${gcc_prereqs_fetch} ${arg_string} \"/ \"${download_prereqs_file}\""
90+
if [[ "$(uname)" == "Linux" ]]; then
91+
sed -i"${backup_extension}" s/"${wget_command}"/"${gcc_prereqs_fetch} ${arg_string} "/ "${download_prereqs_file}"
92+
else
93+
sed -i "${backup_extension}" s/"${wget_command}"/"${gcc_prereqs_fetch} ${arg_string} "/ "${download_prereqs_file}"
94+
fi
95+
96+
fi # end if [[ ${already_modified_downloader:-} != "true" ]];
97+
fi # end if ! type wget &> /dev/null;
98+
}

prerequisites/build-functions/ftp-url.sh

Lines changed: 0 additions & 43 deletions
This file was deleted.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#! /bin/sh
2+
# Download a file from an anonymous ftp site
3+
#
4+
# Usage:
5+
# ftp_url <ftp-mode> ftp://<fully-qualified-domain>:/<path-to-file>/<file-name>
6+
#
7+
# Example:
8+
# ftp_url -n ftp://ftp.gnu.org:/gnu/gcc/gcc-6.1.0/gcc-6.1.0.tar.bz2
9+
ftp_url()
10+
{
11+
ftp_mode="${1}"
12+
url="${2}"
13+
14+
if [ "${ftp_mode}" != "-n" ]; then
15+
echo "Unexpected ftp mode received by ftp_url.sh: ${ftp_mode}"
16+
fi
17+
18+
protocol="${url%%:*}" # grab text_before_first_colon
19+
if [ "${protocol}" != "ftp" ]; then
20+
echo "URL with unexpected protocol received by ftp_url.sh: ${text_before_first_colon}"
21+
fi
22+
23+
text_after_double_slash="${url##*//}"
24+
FTP_SERVER="${text_after_double_slash%%/*}" # grab remaining text before first slash
25+
FILE_NAME="${url##*/}" # grab text after final slash
26+
27+
text_after_final_colon="${url##*:}"
28+
FILE_PATH="${text_after_final_colon#*//}"
29+
FILE_PATH="${FILE_PATH#*/}"
30+
FILE_PATH="${FILE_PATH%/*}"
31+
32+
USERNAME=anonymous
33+
PASSWORD="[email protected]"
34+
echo "starting anonymous download: ${protocol} ${ftp_mode} ${FTP_SERVER};... cd ${FILE_PATH}; ...; get ${FILE_NAME}"
35+
36+
ftp "${ftp_mode}" "${FTP_SERVER}" <<Done-ftp
37+
user "${USERNAME}" "${PASSWORD}"
38+
cd "${FILE_PATH}"
39+
passive
40+
binary
41+
get "${FILE_NAME}"
42+
bye
43+
Done-ftp
44+
45+
echo "finished anonymous ftp"
46+
}

prerequisites/build-functions/set_or_print_downloader.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ set_or_print_downloader()
2828
elif type ftp &> /dev/null; then
2929
if [[ "${package_name}" == "gcc" || "${package_name}" == "wget" || "${package_name}" == "make" ||
3030
"${package_name}" == "bison" || "${package_name}" == "m4" ]]; then
31-
gcc_prereqs_fetch=wget
31+
gcc_prereqs_fetch=ftp_url
3232
fi
3333
else
3434
tried="curl, wget, and ftp"

0 commit comments

Comments
 (0)