Skip to content

Commit a2df923

Browse files
committed
Merge branch 'issue-422-implement-by-refs' of github.com:sourceryinstitute/opencoarrays into issue-422-implement-by-refs
2 parents a8ff97a + 9b8ef30 commit a2df923

18 files changed

+877
-489
lines changed

.travis.yml

Lines changed: 8 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ env:
99
- MPICH_VER="3.2"
1010
- MPICH_URL_HEAD="https://www.mpich.org/static/downloads/${MPICH_VER}"
1111
- MPICH_URL_TAIL="mpich-${MPICH_VER}.tar.gz"
12-
- MPICH_DIR="${HOME}/.local/usr/mpich"
1312
- MPICH_GCC6_BOT_URL_HEAD="https://github.com/sourceryinstitute/OpenCoarrays/files/979804/"
1413
- MPICH_GCC7_BOT_URL_HEAD="https://github.com/sourceryinstitute/OpenCoarrays/files/976779/"
1514
- MPICH_BOT_URL_TAIL="mpich-3.2_3.yosemite.bottle.1.tar.gz"
@@ -114,82 +113,19 @@ before_install:
114113
export PATH="${PATH}:${HOME}/Library/Python/2.7/bin"
115114
else
116115
[[ -d "${CACHE}/bin" ]] || mkdir -p "${CACHE}/bin"
117-
[[ -d "${MPICH_DIR}" ]] || mkdir -p "${MPICH_DIR}"
118116
export PATH="${CACHE}/bin:${PATH}"
119117
${FC} --version
120118
${CC} --version
121119
${CXX} --version
122120
fi
123121
124122
install:
125-
- |
126-
if [[ (-n ${TRAVIS}) && (${TRAVIS_OS_NAME} == osx) ]]; then
127-
brew update > /dev/null
128-
129-
brew ls --versions shellcheck >/dev/null || brew install --force-bottle shellcheck
130-
brew outdated shellcheck || brew upgrade --force-bottle shellcheck
131-
for pkg in ${OSX_PACKAGES}; do
132-
brew ls --versions ${pkg} >/dev/null || brew install ${pkg} || brew link --overwrite ${pkg}
133-
brew outdated ${pkg} || brew upgrade ${pkg}
134-
done
135-
if [[ ${BUILD_TYPE} == InstallScript ]]; then # uninstall some stuff if present
136-
brew uninstall --force --ignore-dependencies cmake || true
137-
brew uninstall --force --ignore-dependencies mpich || true
138-
brew uninstall --force --ignore-dependencies openmpi || true
139-
else
140-
wget "${!MPICH_BOT_URL_HEAD}${MPICH_BOT_URL_TAIL}"
141-
brew install --force-bottle ${MPICH_BOT_URL_TAIL}
142-
brew ls --versions mpich >/dev/null || brew install --force-bottle mpich
143-
fi
144-
mpif90 --version || mpif90 -show || true
145-
mpicc --version || mpicc -show || true
146-
cmake --version || true
147-
148-
elif [[ ${BUILD_TYPE} != InstallScript ]]; then # Ubuntu on Travis-CI, NOT testing install.sh
149-
if ! [[ -x "${HOME}/.local/bin/mpif90" && -x "${HOME}/.local/bin/mpicc" ]]; then
150-
# mpich install not cached
151-
# could use prerequisites/build instead...
152-
wget "${MPICH_URL_HEAD}/${MPICH_URL_TAIL}"
153-
mv "${MPICH_URL_TAIL}" "${MPICH_DIR}/.."
154-
pushd "${MPICH_DIR}/.."
155-
tar -xzvf "${MPICH_URL_TAIL}"
156-
cd "${MPICH_URL_TAIL%.tar.gz}"
157-
./configure --prefix="${MPICH_DIR}"
158-
make -j 4
159-
make install
160-
popd
161-
for f in "${MPICH_DIR}/bin/"*; do
162-
if [[ -x "${f}" ]]; then
163-
ln -fs "${f}" "${HOME}/.local/bin/${f##*/}"
164-
fi
165-
done
166-
fi
167-
mpif90 --version
168-
mpicc --version
169-
cmake --version
170-
fi
123+
- pwd
124+
- developer-scripts/travis/install.${TRAVIS_OS_NAME}.sh
171125

172126
script:
173-
- echo "In Travis-CI 'script' section."
174-
- |
175-
if [[ ${BUILD_TYPE} == InstallScript ]]; then
176-
./install.sh --yes-to-all -i "${HOME}/opencoarrays" -j 4 -f "$(type -P "${FC}")" -c "$(type -P "${CC}")" -C "$(type -P "${CXX}")"
177-
cd prerequisites/builds/opencoarrays/*
178-
../../../installations/cmake/*/bin/ctest --output-on-failure --schedule-random --repeat-until-fail ${NREPEAT:-5}
179-
cd -
180-
else
181-
mkdir cmake-build || echo "Cannot mkdir cmake-build"
182-
for BUILD_TYPE in ${BUILD_TYPES}; do
183-
rm -rf cmake-build/* || true
184-
cd cmake-build || echo 'cannot cd to cmake-build/'
185-
cmake -DCMAKE_INSTALL_PREFIX:PATH="${HOME}/OpenCoarrays" -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" .. || echo "running cmake failed"
186-
make -j 4 || echo "running make failed"
187-
ctest --output-on-failure --schedule-random --repeat-until-fail ${NREPEAT:-5} --timeout ${TEST_TIMEOUT:-200}
188-
make install
189-
make uninstall
190-
cd ..
191-
done
192-
fi
127+
- pwd
128+
- developer-scripts/travis/test-script.${BUILD_TYPE:-cmake}.sh
193129

194130
after_script:
195131
- find . -name '*.gcno' -print
@@ -254,3 +190,7 @@ notifications:
254190
on_success: change # options: [always|never|change]
255191
on_failure: always
256192
on_start: always
193+
email:
194+
on_success: change
195+
on_failure: always
196+
on_start: never

CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,6 @@ if(opencoarrays_aware_compiler)
651651
add_caf_test(comp_allocated_1 2 comp_allocated_1)
652652
add_caf_test(comp_allocated_2 2 comp_allocated_2)
653653
add_caf_test(alloc_comp_get_convert_nums 2 alloc_comp_get_convert_nums)
654-
add_caf_test(alloc_comp_send_convert_nums 2 alloc_comp_send_convert_nums)
655654
endif()
656655

657656

@@ -668,9 +667,11 @@ if(opencoarrays_aware_compiler)
668667
endif()
669668
if((NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 7.3.0) OR (CAF_RUN_DEVELOPER_TESTS OR $ENV{OPENCOARRAYS_DEVELOPER}))
670669
add_caf_test(send_convert_char_array 2 send_convert_char_array)
670+
add_caf_test(alloc_comp_send_convert_nums 2 alloc_comp_send_convert_nums)
671671
else()#if((CAF_RUN_DEVELOPER_TESTS OR $ENV{OPENCOARRAYS_DEVELOPER}))
672672
message( AUTHOR_WARNING "Skipping the following tests to GFortran < 7.3.0 lack of compatibility:
673-
send_convert_char_array.f90")
673+
send_convert_char_array.f90
674+
alloc_comp_send_convert_nums.f90")
674675
endif()
675676
endif()
676677

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/usr/bin/env bash
2+
3+
set -o errexit
4+
set -o verbose
5+
set -o pipefail
6+
set -o nounset
7+
set -o errtrace
8+
9+
__file=developer-scripts/travis/install.linux.sh
10+
11+
# Error tracing
12+
# requires `set -o errtrace`
13+
__caf_err_report() {
14+
local error_code
15+
error_code=${?}
16+
echo "Error (code=${error_code}) in ${__file} in function ${1} on line ${2}." >&2
17+
false
18+
return ${error_code}
19+
}
20+
# Always provide an error backtrace
21+
trap '__caf_err_report "${FUNCNAME:-.}" ${LINENO}' ERR
22+
23+
echo "Performing Travis-CI installation phase on Linux..."
24+
25+
if [[ "${BUILD_TYPE:-}" != InstallScript ]]; then # Ubuntu on Travis-CI, NOT testing install.sh
26+
if ! [[ -x "${HOME}/.local/bin/mpif90" && -x "${HOME}/.local/bin/mpicc" ]]; then
27+
# mpich install not cached
28+
# could use prerequisites/build instead...
29+
wget "${MPICH_URL_HEAD}/${MPICH_URL_TAIL}"
30+
tar -xzvf "${MPICH_URL_TAIL}"
31+
(
32+
cd "${MPICH_URL_TAIL%.tar.gz}"
33+
./configure --prefix="${CACHE}"
34+
make -j 4
35+
make install
36+
)
37+
fi
38+
mpif90 --version
39+
mpicc --version
40+
cmake --version
41+
fi
42+
43+
echo "Done."
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/usr/bin/env bash
2+
3+
set -o errexit
4+
set -o verbose
5+
set -o pipefail
6+
set -o nounset
7+
set -o errtrace
8+
9+
__file=developer-scripts/travis/install.osx.sh
10+
11+
# Error tracing
12+
# requires `set -o errtrace`
13+
__caf_err_report() {
14+
local error_code
15+
error_code=${?}
16+
echo "Error (code=${error_code}) in ${__file} in function ${1} on line ${2}." >&2
17+
false
18+
return ${error_code}
19+
}
20+
# Always provide an error backtrace
21+
trap '__caf_err_report "${FUNCNAME:-.}" ${LINENO}' ERR
22+
23+
echo "Performing Travis-CI installation phase on macOS..."
24+
25+
# Update and install via Homebrew on macOS
26+
brew update > /dev/null
27+
28+
brew ls --versions shellcheck >/dev/null || brew install --force-bottle shellcheck
29+
brew outdated shellcheck || brew upgrade --force-bottle shellcheck
30+
for pkg in ${OSX_PACKAGES}; do
31+
brew ls --versions "${pkg}" >/dev/null || brew install "${pkg}" || brew link --overwrite "${pkg}"
32+
brew outdated "${pkg}" || brew upgrade "${pkg}"
33+
done
34+
if [[ "${BUILD_TYPE:-}" == InstallScript ]]; then # uninstall some stuff if present
35+
brew uninstall --force --ignore-dependencies cmake || true
36+
brew uninstall --force --ignore-dependencies mpich || true
37+
brew uninstall --force --ignore-dependencies openmpi || true
38+
else
39+
wget "${!MPICH_BOT_URL_HEAD}${MPICH_BOT_URL_TAIL}"
40+
brew install --force-bottle "${MPICH_BOT_URL_TAIL}"
41+
brew ls --versions mpich >/dev/null || brew install --force-bottle mpich
42+
fi
43+
mpif90 --version || mpif90 -show || true
44+
mpicc --version || mpicc -show || true
45+
cmake --version || true
46+
47+
echo "Done."
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env bash
2+
3+
set -o errexit
4+
set -o verbose
5+
set -o pipefail
6+
set -o nounset
7+
set -o errtrace
8+
9+
__file=developer-scripts/travis/test-script.InstallScript.sh
10+
11+
# Error tracing
12+
# requires `set -o errtrace`
13+
__caf_err_report() {
14+
local error_code
15+
error_code=${?}
16+
echo "Error (code=${error_code}) in ${__file} in function ${1} on line ${2}." >&2
17+
false
18+
return ${error_code}
19+
}
20+
# Always provide an error backtrace
21+
trap '__caf_err_report "${FUNCNAME:-.}" ${LINENO}' ERR
22+
23+
echo "Performing Travis-CI script phase for the OpenCoarrays installation script..."
24+
25+
./install.sh --yes-to-all -i "${HOME}/opencoarrays" -j 4 -f "$(type -P "${FC}")" -c "$(type -P "${CC}")" -C "$(type -P "${CXX}")"
26+
(
27+
cd prerequisites/builds/opencoarrays/*
28+
"../../../installations/cmake/*/bin/ctest" --output-on-failure --schedule-random --repeat-until-fail "${NREPEAT:-5}"
29+
)
30+
31+
echo "Done."
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/usr/bin/env bash
2+
3+
set -o errexit
4+
set -o verbose
5+
set -o pipefail
6+
set -o nounset
7+
set -o errtrace
8+
9+
__file=developer-scripts/travis/test-script.cmake.sh
10+
11+
# Error tracing
12+
# requires `set -o errtrace`
13+
__caf_err_report() {
14+
local error_code
15+
error_code=${?}
16+
echo "Error (code=${error_code}) in ${__file} in function ${1} on line ${2}." >&2
17+
false
18+
return ${error_code}
19+
}
20+
# Always provide an error backtrace
21+
trap '__caf_err_report "${FUNCNAME:-.}" ${LINENO}' ERR
22+
23+
echo "Performing Travis-CI script phase for the OpenCoarrays direct cmake build..."
24+
25+
mkdir cmake-build || echo "Cannot mkdir cmake-build"
26+
for BUILD_TYPE in ${BUILD_TYPES}; do
27+
rm -rf cmake-build/* || true
28+
(
29+
cd cmake-build
30+
cmake -DCMAKE_INSTALL_PREFIX:PATH="${HOME}/OpenCoarrays" -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" ..
31+
make -j 4
32+
ctest --output-on-failure --schedule-random --repeat-until-fail "${NREPEAT:-5}" --timeout "${TEST_TIMEOUT:-200}"
33+
make install
34+
make uninstall
35+
)
36+
done
37+
38+
echo "Done."

prerequisites/acceptable_compiler.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@
3535
program main
3636
use iso_fortran_env, only : compiler_version
3737
implicit none
38-
print *,(compiler_version() >= "GCC version 6.1.0 ") .and. (compiler_version() < "GCC version 7.0.0 ")
38+
print *,(compiler_version() >= "GCC version 6.1.0 ")
3939
end program

prerequisites/install-functions/find_or_install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ find_or_install()
173173

174174
else
175175

176-
info "$this_script: Checking whether $executable in PATH wraps gfortran version >= $(./build.sh -V gcc) and < 7.0.0 ... "
176+
info "$this_script: Checking whether $executable in PATH wraps gfortran version >= $(./build.sh -V gcc)... "
177177
$executable acceptable_compiler.f90 -o acceptable_compiler || true;
178178
$executable print_true.f90 -o print_true || true;
179179
if [[ -f ./acceptable_compiler && -f ./print_true ]]; then

src/tests/unit/send-get/CMakeLists.txt

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,24 @@ caf_compile_executable(get_with_vector_index get_with_vector_index.f90)
1414

1515
## Pure send() tests
1616
caf_compile_executable(send_array send_array_test.f90)
17+
if(NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 7.0.0)
18+
caf_compile_executable(send_convert_nums send_convert_nums.f90)
19+
endif()
1720
caf_compile_executable(send_with_vector_index send_with_vector_index.f90)
1821

1922
# Pure sendget() tests
2023
caf_compile_executable(sendget_convert_char_array sendget_convert_char_array.f90)
24+
if(NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 7.0.0)
25+
caf_compile_executable(sendget_convert_nums sendget_convert_nums.f90)
26+
endif()
2127
caf_compile_executable(send_convert_char_array send_convert_char_array.f90)
2228
#caf_compile_executable(sendget_with_vector_index sendget_with_vector_index.f90)
2329
caf_compile_executable(strided_sendget strided_sendget.f90)
2430
set_target_properties(build_strided_sendget
2531
PROPERTIES MIN_IMAGES 3)
2632

27-
if (gfortran_compiler AND (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 7.3.0))
28-
caf_compile_executable(sendget_convert_nums sendget_convert_nums.f90)
29-
caf_compile_executable(send_convert_nums send_convert_nums.f90)
33+
# Allocatable components w/ convert
34+
if((NOT (CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 7.0.0)) OR (CAF_RUN_DEVELOPER_TESTS OR $ENV{OPENCOARRAYS_DEVELOPER}))
3035
caf_compile_executable(alloc_comp_get_convert_nums alloc_comp_get_convert_nums.f90)
3136
caf_compile_executable(alloc_comp_send_convert_nums alloc_comp_send_convert_nums.f90)
32-
elseif((CAF_RUN_DEVELOPER_TESTS OR $ENV{OPENCOARRAYS_DEVELOPER}))
33-
message( AUTHOR_WARNING
34-
"Skipping building the following tests due to GFortran < 7.3.0 lack of compatibility:
35-
sendget_convert_nums.f90
36-
send_convert_nums.f90"
37-
)
38-
3937
endif()
40-

0 commit comments

Comments
 (0)