Skip to content

Commit 4fb814b

Browse files
authored
Merge branch 'master' into bugfix-event_wait
2 parents 3117ff7 + 7dbcf92 commit 4fb814b

File tree

23 files changed

+219
-88
lines changed

23 files changed

+219
-88
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ if ("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
8181
"in a manner such as\n"
8282
" $ mkdir build-opencarrays\n"
8383
" $ cd build-opencoarrays\n"
84-
" $ CC=mpicc FC=mpif90 cmake <path-to-opencoarrays-source-directory> -DCMAKE_INSTALL_PREFIX=<path-to-install-directory>\n"
84+
" $ CC=gcc FC=gfortran cmake -DBUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/path/to/install/dir /path/to/opencoarrays/src/dir \n"
8585
"\nsubstituting the appropriate syntax for your shell (the above line assumes the bash shell)."
8686
)
8787
endif()
@@ -188,7 +188,7 @@ endif()
188188
# Find MPI and set some flags so that FC and CC can point to gfortran and gcc
189189
#----------------------------------------------------------------------------
190190

191-
# If the user passes FC=mpif90 etc. check and prefer that location
191+
# If the user passes FC=mpifort etc. check and prefer that location
192192
get_filename_component( FTN_COMPILER_NAME "${CMAKE_Fortran_COMPILER}"
193193
NAME )
194194
get_filename_component( C_COMPILER_NAME "${CMAKE_C_COMPILER}"

GETTING_STARTED.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,13 @@ If the `caf` compiler wrapper cannot process the source code in question, invoke
107107
the underlying communication library directly:
108108

109109
```bash
110-
mpif90 -fcoarray=lib -L/opt/opencoarrays/ tally.f90 \ -lcaf_mpi -o htally -I<OpenCoarrays-install-path>/mod
110+
mpifort -fcoarray=lib -L/opt/opencoarrays/ tally.f90 \ -lcaf_mpi -o htally -I<OpenCoarrays-install-path>/mod
111111
```
112112

113113
and also run the program with the lower-level communication library:
114114

115115
```bash
116-
mpirun -np <number-of-images> ./tally
116+
mpiexec -np <number-of-images> ./tally
117117
```
118118

119119
---

INSTALL.md

Lines changed: 54 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,25 +119,71 @@ thread starting with [commit comment 20539810].
119119

120120
### Linux ###
121121

122-
Acces OpenCoarrays on Linux via any of the following package managers
122+
Access OpenCoarrays on Linux via any of the following package managers
123123
or pre-installed copies:
124124

125125
* The [linuxbrew] package manager installs OpenCoarrays on all Linux distributions.
126126
* Debian-based distributions such as Ubuntu provide an "open-coarrays" [APT package].
127127
* [Arch Linux] provides an [aur package].
128128
* [HPCLinux] includes a pre-installed copy of OpenCoarrays.
129+
* [EasyBuild], a software build and installation framework, can install
130+
OpenCoarrays on Linux distributions
131+
* [Spack], a multiplatform package manager, can also install OpenCoarrays on Linux distributions
132+
129133

130134
[linuxbrew] does not require `sudo` privileges and will generally
131135
provide the most up-to-date OpenCoarrays release because linxubrew
132136
pulls directly from macOS homebrew, which updates automatically.
133137

138+
139+
<a name="easybuild"></a>
140+
[EasyBuild] can be used to install OpenCoarrays with the following bash commands:
141+
```bash
142+
# Search available specification files (also known as easyconfigs) for OpenCoarrays
143+
eb --search OpenCoarrays
144+
145+
# Automatically download prerequisites (with the --robot flag) and install OpenCoarrays
146+
# with the desired easyconfig, e.g., OpenCoarrays-1.9.0-gompi-2017a.eb
147+
eb OpenCoarrays-1.9.0-gompi-2017a.eb --robot
148+
```
149+
Once installed, OpenCoarrays can be used by loading the newly created environment
150+
module `OpenCoarrays/1.9.0-gompi-2017a`.
151+
```bash
152+
module load OpenCoarrays/1.9.0-gompi-2017a
153+
```
154+
155+
156+
<a name="spack"></a>
157+
[Spack] can be used to install OpenCoarrays with the following bash commands:
158+
```bash
159+
# Check build information for OpenCoarrays in the default specification file
160+
spack spec opencoarrays
161+
162+
# To automatically download prerequisites and install OpenCoarrays with the default specification.
163+
# (Note: In addition to its own prerequisites, Spack requires gfortran compiler
164+
# to be installed to compile OpenMPI)
165+
spack install opencoarrays
166+
167+
# Or, To install with customisations (e.g., to install OpenCoarrays [version 1.9.0]
168+
# with MPICH [version default] and GCC [version 7.1.0]).
169+
170+
```
171+
In the previous example, it was assumed that GCC [version 7.1.0] is already installed, and is available as
172+
a compiler to Spack. Otherwise, [add a new compiler to Spack].
173+
Once installed, OpenCoarrays can be used by [loading the environment modules with Spack], e.g.
174+
```bash
175+
spack module loads --dependencies opencoarrays
176+
```
177+
134178
[top]
135179

136180
### FreeBSD ###
137181

138-
A FreeBSD Port is available for installing OpenCoarrays and can be
139-
located via [port search]. See the FreeBSD OpenCoarrays [port details]
140-
page for installation instructions.
182+
A FreeBSD Port is available for installing OpenCoarrays. FreeBSD users can now simply do the following as root:
183+
```bash
184+
pkg install opencoarrays
185+
```
186+
For more information, please review the [FreeBSD ports/packages installation information](https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports.html).
141187

142188
[top]
143189

@@ -422,3 +468,7 @@ export gcc_install_path=/desired/installation/destination
422468
[dnf]: https://github.com/rpm-software-management/dnf
423469
[port details]: http://www.freshports.org/lang/opencoarrays
424470
[port search]: https://www.freebsd.org/cgi/ports.cgi?query=opencoarrays
471+
[EasyBuild]: https://github.com/easybuilders/easybuild
472+
[Spack]: https://github.com/LLNL/spack
473+
[add a new compiler to Spack]: http://spack.readthedocs.io/en/latest/tutorial_modules.html#add-a-new-compiler
474+
[loading the environment modules with Spack]: http://spack.readthedocs.io/en/latest/module_file_support.html#cmd-spack-module-loads

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ OpenCoarrays provides a compiler wrapper (named `caf`), a runtime
4646
library (named `libcaf_mpi.a` by default), and an executable file
4747
launcher (named `cafrun`). With OpenCoarrays-aware compilers, the
4848
compiler wrapper passes the provided source code to the chosen
49-
compiler (`mpif90` by default). For non-OpenCoarrays-aware compilers,
49+
compiler (`mpifort` by default). For non-OpenCoarrays-aware compilers,
5050
the wrapper transforms CAF syntax into OpenCoarrays procedure calls
5151
before invoking the chosen compiler on the transformed code. The
5252
runtime library supports compiler communication and synchronization
5353
requests by invoking a lower-level communication library--the Message
5454
Passing Interface ([MPI]) by default. The launcher passes execution
5555
to the chosen communication library's parallel program launcher
56-
(`mpirun` by default).
56+
(`mpiexec` by default).
5757

5858
OpenCoarrays defines an application binary interface ([ABI]) that
5959
translates high-level communication and synchronization requests into

developer-scripts/hpclinux-install.sh

Lines changed: 43 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,37 @@
22

33
# BSD 3-Clause License
44
#
5-
# -- hpclinux-install.sh
6-
#
5+
# -- hpclinux-install.sh
6+
#
77
# Install OpenCoarrays inside the HPCLinux distribution from hpclinux.org.
88
#
99
# Usage: cd opencoarrays && ./prerequisites/hpclinux-install.sh"
1010
#
1111
# Motivation:
1212
#
13-
# On Fedora-based distributions, the OpenCoarrays installer fails during the stack-based
14-
# system interrogation (presumably due to problems with the prerequisites/stack.sh script).
15-
# At least in the case of HPCLinux, system interrogation is unnecessary because HPCLinux is
16-
# uber-stable and it's safe bet that all prerequisites need to be installed so this script
13+
# On Fedora-based distributions, the OpenCoarrays installer fails during the stack-based
14+
# system interrogation (presumably due to problems with the prerequisites/stack.sh script).
15+
# At least in the case of HPCLinux, system interrogation is unnecessary because HPCLinux is
16+
# uber-stable and it's safe bet that all prerequisites need to be installed so this script
1717
# omits the interrogation and invokes prerequisites/build.sh to build all prerequisites.
18-
#
18+
#
1919
# Copyright (c) 2016, Sourcery Institute
2020
# All rights reserved.
21-
#
21+
#
2222
# Redistribution and use in source and binary forms, with or without
2323
# modification, are permitted provided that the following conditions are met:
24-
#
24+
#
2525
# * Redistributions of source code must retain the above copyright notice, this
2626
# list of conditions and the following disclaimer.
27-
#
27+
#
2828
# * Redistributions in binary form must reproduce the above copyright notice,
2929
# this list of conditions and the following disclaimer in the documentation
3030
# and/or other materials provided with the distribution.
31-
#
31+
#
3232
# * Neither the name of the copyright holder nor the names of its
3333
# contributors may be used to endorse or promote products derived from
3434
# this software without specific prior written permission.
35-
#
35+
#
3636
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
3737
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
3838
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -45,57 +45,58 @@
4545
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4646

4747
if [[ ! -d prerequisites ]]; then
48-
echo "Please execute this script with your present working directory"
49-
echo "set to the top level of the OpenCoarrays source tree."
50-
exit 1
48+
printf "Please execute this script with your present working directory"
49+
printf "set to the top level of the OpenCoarrays source tree."
50+
exit 1
5151
fi
5252

5353
pushd prerequisites
5454

55-
# Build CMake using the system GCC (4.8.1) and prepend its bin subdirectory to the PATH
56-
export cmake_install_path="${PWD}"/installations/cmake/cmake
57-
./build.sh --package cmake --install-prefix "${cmake_install_path}"
58-
if [[ -z "${PATH}" ]]; then
59-
export PATH="${cmake_install_path}"/bin
60-
else
61-
export PATH="${cmake_install_path}"/bin:$PATH
62-
fi
55+
# Build CMake using the system GCC (4.8.1) and prepend its bin subdirectory to the PATH
56+
export cmake_install_path="${PWD}/installations/cmake/cmake"
57+
./build.sh --package cmake --install-prefix "${cmake_install_path}"
58+
if [[ -z "${PATH}" ]]; then
59+
export PATH="${cmake_install_path}/bin"
60+
else
61+
export PATH="${cmake_install_path}/bin:${PATH}"
62+
fi
6363

64-
# Build GCC 6.3.0 and prepend its bin subdirectory to the PATH
65-
export gcc_version=6.3.0
66-
export gcc_install_path="${PWD}"/installations/gnu/$gcc_version
67-
./build.sh --package gcc --install-version $gcc_version --install-prefix "${gcc_install_path}"
68-
export PATH="${gcc_install_path}"/bin:$PATH
69-
export LD_LIBRARY_PATH="${gcc_install_path}"/lib64:"${gcc_install_path}"/lib:$LD_LIBRARY_PATH
64+
# Build GCC 6.3.0 and prepend its bin subdirectory to the PATH
65+
export gcc_version=6.3.0
66+
export gcc_install_path="${PWD}/installations/gnu/${gcc_version}"
67+
./build.sh --package gcc --install-version "${gcc_version}" --install-prefix "${gcc_install_path}"
68+
export PATH="${gcc_install_path}/bin:${PATH}"
69+
export LD_LIBRARY_PATH="${gcc_install_path}/lib64:${gcc_install_path}/lib:${LD_LIBRARY_PATH}"
7070

71-
# Build MPICH 3.2 and prepend its bin subdirectory to the PATH
72-
export mpich_install_path="${PWD}"/installations/mpich
73-
./build.sh --package mpich --install-prefix "${mpich_install_path}" --num-threads 4
74-
export PATH="${mpich_install_path}"/bin:$PATH
71+
# Build MPICH 3.2 and prepend its bin subdirectory to the PATH
72+
export mpich_install_path="${PWD}/installations/mpich"
73+
./build.sh --package mpich --install-prefix "${mpich_install_path}" --num-threads 4
74+
export PATH="${mpich_install_path}/bin:${PATH}"
7575

7676
popd # return to top level of OpenCoarrays source tree
7777

7878
# Build OpenCoarrays
7979
if [[ -d build ]]; then
80-
echo -e 'Old build subdirectory found. Ok to delete the "build" subdirectory? (Y/n) '
80+
printf 'Old build subdirectory found. Ok to delete the "build" subdirectory? (Y/n)'
8181
read -r delete_build
8282

83-
if [[ "$delete_build" == "n" || "$delete_build" == "no" ]]; then
83+
if [[ "${delete_build}" == "n" || "${delete_build}" == "no" ]]; then
8484
printf "n\n"
85-
echo -e "Please rename or delete the build subdirectory and restart this script. Aborting. [exit 10]\n"
85+
printf "Please rename or delete the build subdirectory and restart this script. Aborting. [exit 10]\n"
8686
exit 10
8787
else # permission granted to delete build subdirectory
8888
printf "Y\n"
89-
fi
89+
fi
9090
rm -rf build
9191
fi
9292
mkdir build
9393
pushd build
9494

95-
export opencoarrays_install_path="${PWD}"/prerequisites/installations/opencoarrays
96-
FC=gfortran CC=gcc cmake .. -DCMAKE_INSTALL_PREFIX="{opencoarrays_install_path}"
97-
make
98-
make install
99-
export PATH="${opencoarrays_install_path}"/bin:$PATH
95+
export opencoarrays_install_path="${PWD}/prerequisites/installations/opencoarrays"
96+
FC=gfortran CC=gcc cmake .. -DCMAKE_INSTALL_PREFIX="${opencoarrays_install_path}"
97+
make
98+
ctest --output-on-failure --schedule-random
99+
make install
100+
export PATH="${opencoarrays_install_path}/bin:${PATH}"
100101

101102
popd # return to top level of OpenCoarrays source tree

developer-scripts/patched-trunk-install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ echo "Building MPICH with the patched compilers."
179179

180180
# Verify that MPICH installed where expected
181181
mpich_install_path=$(./install.sh -P mpich)
182-
if ! type "${mpich_install_path}"/bin/mpif90; then
182+
if ! type "${mpich_install_path}"/bin/mpifort; then
183183
echo "MPICH is not installed in the expected location ${mpich_install_path}."
184184
exit 1
185185
fi

install.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,9 @@ source $opencoarrays_src_dir/prerequisites/install-functions/build_opencoarrays.
234234
# shellcheck source=./prerequisites/install-functions/report_results.sh
235235
source $opencoarrays_src_dir/prerequisites/install-functions/report_results.sh
236236

237+
# shellcheck source=./prerequisites/install-functions/install-xcode-clt.sh
238+
source "${opencoarrays_src_dir}/prerequisites/install-functions/install-xcode-clt.sh"
239+
237240
# ___________________ End of function definitions for use in the Main Body __________________
238241

239242

@@ -303,6 +306,8 @@ elif [[ "${arg_p:-}" == "opencoarrays" ]]; then
303306

304307
else
305308

309+
# Install Xcode command line tools (CLT) if on macOS and if needed
310+
maybe_install_xcodeCLT
306311
# Install OpenCoarrays
307312
cd prerequisites || exit 1
308313
installation_record=install-opencoarrays.log
@@ -320,12 +325,18 @@ elif [[ "${arg_p:-}" == "opencoarrays" ]]; then
320325

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

328+
# Install Xcode command line tools (CLT) if on macOS and if needed
329+
maybe_install_xcodeCLT
330+
323331
info "Invoking Open Fortran Parser build script with the following command:"
324332
info "\"${opencoarrays_src_dir}\"/prerequisites/install-ofp.sh"
325333
"${opencoarrays_src_dir}"/prerequisites/install-ofp.sh
326334

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

337+
# Install Xcode command line tools (CLT) if on macOS and if needed
338+
maybe_install_xcodeCLT
339+
329340
info "Invoking build script with the following command:"
330341
info "\"${opencoarrays_src_dir}\"/prerequisites/build.sh ${*:-}"
331342
"${opencoarrays_src_dir}"/prerequisites/build.sh "${@:-}"

prerequisites/install-functions/find_or_install.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ find_or_install()
88
package_executable_array=(
99
"gcc:gfortran"
1010
"cmake:cmake"
11-
"mpich:mpif90"
11+
"mpich:mpifort"
1212
"flex:flex"
1313
"bison:yacc"
1414
"m4:m4"
@@ -121,11 +121,11 @@ find_or_install()
121121
# MPIFC, MPICC, and MPICXX environment variables. Every branch must also manage the
122122
# dependency stack.
123123

124-
# If the user specified a Fortran compiler, verify that mpif90 wraps the specified compiler
124+
# If the user specified a Fortran compiler, verify that mpifort wraps the specified compiler
125125
if [[ ! -z "${arg_M:-}" ]]; then
126126

127127
echo -e "$this_script: Using the $package specified by -M or --with-mpi: ${arg_M}\n"
128-
export MPIFC="${arg_M}"/bin/mpif90
128+
export MPIFC="${arg_M}"/bin/mpifort
129129
export MPICC="${arg_M}"/bin/mpicc
130130
export MPICXX="${arg_M}"/bin/mpicxx
131131
# Halt the recursion
@@ -136,7 +136,7 @@ find_or_install()
136136
elif [[ "$script_installed_package" == true ]]; then
137137

138138
echo -e "$this_script: Using the $package installed by $this_script\n"
139-
export MPIFC=$package_install_path/bin/mpif90
139+
export MPIFC=$package_install_path/bin/mpifort
140140
export MPICC=$package_install_path/bin/mpicc
141141
export MPICXX=$package_install_path/bin/mpicxx
142142
# Halt the recursion
@@ -147,8 +147,8 @@ find_or_install()
147147
elif [[ "$package_in_path" == "true" ]]; then
148148

149149
echo -e "$this_script: Checking whether $executable in PATH wraps gfortran... "
150-
mpif90_version_header=$(mpif90 --version | head -1)
151-
first_three_characters=$(echo "$mpif90_version_header" | cut -c1-3)
150+
mpifort_version_header=$(mpifort --version | head -1)
151+
first_three_characters=$(echo "$mpifort_version_header" | cut -c1-3)
152152
if [[ "$first_three_characters" != "GNU" ]]; then
153153
printf "no.\n"
154154
# Trigger 'find_or_install gcc' and subsequent build of $package
@@ -162,7 +162,7 @@ find_or_install()
162162

163163
info "-f (or --with-fortran) argument detected with value ${arg_f}"
164164
printf "yes.\n %s: Using the specified %s.\n" "$this_script" "$executable"
165-
export MPIFC=mpif90
165+
export MPIFC=mpifort
166166
export MPICC=mpicc
167167
export MPICXX=mpicxx
168168

@@ -185,7 +185,7 @@ find_or_install()
185185
fi
186186
if [[ "$acceptable" == "${is_true:-}" ]]; then
187187
printf "yes.\n %s: Using the $executable found in the PATH.\n" "$this_script"
188-
export MPIFC=mpif90
188+
export MPIFC=mpifort
189189
export MPICC=mpicc
190190
export MPICXX=mpicxx
191191

@@ -637,8 +637,8 @@ find_or_install()
637637
export LD_LIBRARY_PATH="$gfortran_lib_paths:$LD_LIBRARY_PATH"
638638
fi
639639
elif [[ $package == "mpich" ]]; then
640-
echo "$this_script: export MPIFC=$package_install_path/bin/mpif90"
641-
export MPIFC="$package_install_path/bin/mpif90"
640+
echo "$this_script: export MPIFC=$package_install_path/bin/mpifort"
641+
export MPIFC="$package_install_path/bin/mpifort"
642642
echo "$this_script: export MPICC= $package_install_path/bin/mpicc"
643643
export MPICC="$package_install_path/bin/mpicc"
644644
echo "$this_script: export MPICXX=$package_install_path/bin/mpicxx"

0 commit comments

Comments
 (0)