Skip to content

Commit 826770e

Browse files
author
Damian Rouson
committed
Merge branch 'topic-#269-FC-gfortran' of https://github.com/sourceryinstitute/opencoarrays into topic-#269-FC-gfortran
2 parents 096454f + e9b43da commit 826770e

File tree

4 files changed

+46
-30
lines changed

4 files changed

+46
-30
lines changed

AddInstallationScriptTest.cmake

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
macro(add_installation_script_test name path)
22

3-
# Copy the source to the binary tree
3+
# Copy the source to the binary tree
44
configure_file(
55
${CMAKE_CURRENT_SOURCE_DIR}/${path}/${name}
66
${CMAKE_CURRENT_BINARY_DIR}/${path}/${name}
@@ -11,15 +11,7 @@ macro(add_installation_script_test name path)
1111
${CMAKE_CURRENT_BINARY_DIR}/${path}/${name}-usage
1212
COPYONLY
1313
)
14-
set(harness "${CMAKE_BINARY_DIR}/staging/test-${name}.sh")
15-
install(
16-
FILES "${harness}"
17-
PERMISSIONS WORLD_EXECUTE WORLD_READ WORLD_WRITE OWNER_EXECUTE OWNER_READ OWNER_WRITE GROUP_EXECUTE GROUP_READ GROUP_WRITE
18-
DESTINATION ${CMAKE_BINARY_DIR}/${path}
19-
)
20-
file(WRITE "${harness}" "#!/bin/bash\n")
21-
file(APPEND "${harness}" "cd ${CMAKE_BINARY_DIR}/${path}\n")
22-
file(APPEND "${harness}" "OPENCOARRAYS_SRC_DIR=${CMAKE_SOURCE_DIR} ./${name}\n")
23-
add_test(NAME ${name} COMMAND "${CMAKE_CURRENT_BINARY_DIR}/${path}/test-${name}.sh")
24-
#set_property(TEST ${name} PROPERTY PASS_REGULAR_EXPRESSION "Test passed.")
14+
add_test(NAME test-${name} COMMAND "${CMAKE_BINARY_DIR}/${path}/${name}")
15+
set_property(TEST test-${name} PROPERTY WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/${path}")
16+
set_property(TEST test-${name} PROPERTY ENVIRONMENT "OPENCOARRAYS_SRC_DIR=${CMAKE_SOURCE_DIR}")
2517
endmacro(add_installation_script_test)

INSTALL.md

Lines changed: 39 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Download this file as a PDF document
2121
* [Prerequisites]
2222
* [CMake]
2323
* [Make]
24-
* [Obtaining GCC]
24+
* [Obtaining GCC, MPICH, and CMake]
2525

2626
End-User Installation
2727
---------------------
@@ -39,7 +39,7 @@ cd opencoarrays
3939
```
4040

4141
Before installing OpenCoarrays, the above bash script will attempt to detect the presence
42-
of the default prequisite packages: [GCC], [MPICH] , and [CMake]. For additional details, see the [Prerequisites] section. If any of the
42+
of the default prerequisite packages: [GCC], [MPICH] , and [CMake]. For additional details, see the [Prerequisites] section. If any of the
4343
aforementioned packages appear to be absent from the user's PATH environment variable,
4444
the [install.sh] script will attempt to download, build, and install any missing packages
4545
after asking permission to do so. The script has been tested on Linux and OS X. Please
@@ -130,8 +130,19 @@ If using the advanced [CMake] or [Make] builds detailed below, please ensure tha
130130

131131
### CMake ###
132132

133+
#### N.B.: ####
134+
135+
__As of OpenCoarrays 1.7.6, passing `FC=mpi_fortran_wrapper` and
136+
`CC=mpi_c_wrapper` is *DEPRECATED*. Please pass `FC=/path/to/gfortran`
137+
and `CC=/path/to/gcc`. If you are experimenting with the source to
138+
source translation capabilities, then please point `FC` and `CC` to
139+
your Fortran and C compilers of choice. In the case of CRAY, or a
140+
compiler in which MPI is *built-in* to the compiler, you still pass
141+
the `FC` and `CC` as the Fortran and C compiler, even though MPI is
142+
built-in.__
143+
133144
[CMake] is the preferred build system. CMake is a cross-platform Makefile generator that
134-
includes with the testing tool CTest. To avoid cluttering or clobbering the source tree,
145+
includes the testing tool CTest. To avoid cluttering or clobbering the source tree,
135146
our CMake setup requires that your build directory be any directory other than the top-level
136147
OpenCoarrays source directory. In a bash shell, the following steps should build
137148
OpenCoarrays, install OpenCoarrays, build the tests, run the tests, and report the test results:
@@ -141,27 +152,39 @@ tar xvzf opencoarrays.tar.gz
141152
cd opencoarrays
142153
mkdir opencoarrays-build
143154
cd opencoarrays-build
144-
CC=mpicc FC=mpif90 cmake .. -DCMAKE_INSTALL_PREFIX=${PWD}
155+
CC=gcc FC=gfortran cmake .. -DCMAKE_INSTALL_PREFIX=${HOME}/packages/
145156
make
146157
ctest
147158
make install
148159
```
149160

150161
where the the first part of the cmake line sets the CC and FC environment variables
151-
and the final part of the same line defines the installation path as the present
152-
working directory (`opencoarrays-build`). Please report any test failures via the
153-
OpenCoarrays [Issues] page.
162+
and the final part of the same line defines the installation path as
163+
the `packages` directory in the current user's `$HOME` directory. Please report any test failures via the
164+
OpenCoarrays [Issues] page. Please note that you need a recent
165+
GCC/GFortran, and a recent MPI-3 implementation. If CMake is having
166+
trouble finding the MPI implementation, or is finding the wrong MPI
167+
implementation, you can try setting the `MPI_HOME` environment
168+
variable to point to the installation you wish to use. If that fails,
169+
you can also try passing the
170+
`-DMPI_Fortran_COMPILER=/path/to/mpi/fortran/wrapper/script` and
171+
`-DMP_C_COMPILER=/path/to/mpi/c/wrapper/script` options to CMake.
154172

155173
Advanced options (most users should not use these):
156174

157-
-DLEGACY_ARCHITECTURE=OFF enables the use of FFT libraries that employ AVX instructions
158-
-DHIGH_RESOLUTION_TIMER=ON enables timers that tick once per clock cycle
159-
-DCOMPILER_SUPPORTS_ATOMICS enables support for the proposed Fortran 2015 events feature
160-
-DUSE_EXTENSIONS builds the [opencoarrays] module for use with non-OpenCoarrays-aware compilers
161-
-DCOMPILER_PROVIDES_MPI is set automatically when building with the Cray Compiler Environment
175+
-DMPI_HOME=/path/to/mpi/dir # try to force CMake to find your preferred MPI implementation
176+
# OR
177+
-DMPI_C_COMPILER=/path/to/c/wrapper
178+
-DMPI_Fortran_COMPILER=/path/to/fortran/wrapper
179+
180+
-DLEGACY_ARCHITECTURE=OFF # enables the use of FFT libraries that employ AVX instructions
181+
-DHIGH_RESOLUTION_TIMER=ON # enables timers that tick once per clock cycle
182+
-DCOMPILER_SUPPORTS_ATOMICS # enables support for the proposed Fortran 2015 events feature
183+
-DUSE_EXTENSIONS # builds the opencoarrays module for use with non-OpenCoarrays-aware compilers
184+
-DCOMPILER_PROVIDES_MPI # is set automatically when building with the Cray Compiler Environment
162185

163-
The first two flags above are not portable and the third enables code that is incomplete as
164-
of release 1.0.0. The fourth is set automatically by the CMake scripts based on the compiler
186+
The fourth and fifth flags above are not portable and the sixth enables code that is incomplete as
187+
of release 1.0.0. The eighth is set automatically by the CMake scripts based on the compiler
165188
identity and version.
166189

167190
### Make ###
@@ -225,7 +248,7 @@ where the second line builds the flex package that is required for building gcc
225248
[Prerequisites]: #prerequisites
226249
[CMake]: #cmake
227250
[Make]: #make
228-
[Obtaining GCC]: #obtaining-gcc
251+
[Obtaining GCC, MPICH, and CMake]: #obtaining-gcc-mpich-and-cmake
229252
[Sourcery Store]: http://www.sourceryinstitute.org/store
230253
[Sourcery Institute Store]: http://www.sourceryinstitute.org/store
231254
[VirtualBox]: http://www.virtualbox.org
@@ -235,7 +258,7 @@ where the second line builds the flex package that is required for building gcc
235258
[Issues]: https://github.com/sourceryinstitute/opencoarrays/issues
236259
[make.inc]: ./src/make.inc
237260
[opencoarrays]: ./src/extensions/opencoarrays.F90
238-
[prerequisites]: ./prerequisites
261+
[prerequisites]: #prerequisites
239262
[MPICH]: http://www.mpich.org
240263
[MVAPICH]:http://mvapich.cse.ohio-state.edu
241264
[MacPorts]: http://www.macports.org

src/tests/installation/installation-scripts.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ if [[ ! -f "${B3B_USE_CASE:-}/bootstrap.sh" ]]; then
9191
echo "Please set B3B_USE_CASE to the bash3boilerplate use-case directory path."
9292
exit 2
9393
else
94-
# shellcheck source=./prerequisites/use-case/bootstrap.sh
94+
# shellcheck source=../../../prerequisites/use-case/bootstrap.sh
9595
source "${B3B_USE_CASE}/bootstrap.sh" "$@"
9696
fi
9797
### End of boilerplate -- start user edits below #########################
@@ -109,6 +109,7 @@ trap cleanup_before_exit EXIT # The signal is specified here. Could be SIGINT, S
109109

110110
pushd "${OPENCOARRAYS_SRC_DIR}"/src/tests/installation
111111

112+
# shellcheck source=../../../prerequisites/stack.sh
112113
source "${OPENCOARRAYS_SRC_DIR}"/prerequisites/stack.sh
113114
source test-stack.sh
114115
test_stack

src/tests/installation/test-stack.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,6 @@ test_stack()
153153
# Verify that push, peek, and pop yield correct size changes or lack thereof:
154154
verify_stack_size_changes
155155

156-
debug "test-stack.sh: All tests passed."
156+
info "test-stack.sh: All tests passed."
157157

158158
}

0 commit comments

Comments
 (0)