Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experimental fpm build/test/install capability #758

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .VERSION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$Format:%d%n%n$
# Fall back version, probably last release:
2.10.0
3.0.0

# OpenCoarrays version file. This project uses semantic
# versioning. For details see http://semver.org
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fpm.toml
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,7 @@ find_program(BASH_EXECUTABLE bash
REQUIRED)
function(caf_compile_executable target main_depend)
set(includes "")
list(APPEND includes "-I${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR}/${mod_dir_tail}")
foreach(includedir ${MPI_Fortran_INCLUDE_DIRS})
list(APPEND includes "-I${includedir}")
endforeach()
Expand Down Expand Up @@ -645,6 +646,7 @@ define_property(TARGET
# Recurse into the src directory
#-------------------------------
add_subdirectory(src)
add_subdirectory(tests)

#-----------------------------------------------------
# Publicize installed location to other CMake projects
Expand Down Expand Up @@ -964,7 +966,7 @@ endif()

# Test bash installation scripts
include(cmake/AddInstallationScriptTest.cmake )
add_installation_script_test(installation-scripts.sh src/tests/installation/)
add_installation_script_test(installation-scripts.sh tests/installation/)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code adds the test-installation-scripts.sh test case that is failing in CI.

The test expects the prerequisites/use-case/bootstrap.sh file to exist, but it is removed by this PR.


if( CAF_ENABLE_FAILED_IMAGES AND ( NOT
( "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" ) AND ( "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64" ) )
Expand Down
9 changes: 5 additions & 4 deletions doc/man/man1/caf.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH CAF 1 2017\-09\-12 OpenCoarrays\-1.9.1 "caf compiler wrapper manual"
.TH CAF 1 2022\-06\-05 OpenCoarrays\-3.0.0 "caf compiler wrapper manual"
.SH NAME
.PP
\fB\fCcaf\fR \- OpenCoarrays compiler wrapper to compile and link coarray Fortran source files and programs
Expand All @@ -7,9 +7,9 @@
\fB\fCcaf\fR [compiler\-options] [linker\-options] \fI<fortran\-source\-file>\fP [\fIobject\-files\fP] [libraries]
.SH DESCRIPTION
.PP
\fB\fCcaf\fR is a compiler wrapper script which is generated when the OpenCoarrays library \[la]https://github.com/sourceryinstitute/OpenCoarrays#readme\[ra] that ensures coarray fortran programs are compiled with the same fortran compiler OpenCoarrays was built for,
\fB\fCcaf\fR is a compiler wrapper script which is generated when the OpenCoarrays library \[la]https://github.com/sourceryinstitute/OpenCoarrays#readme\[ra] that ensures coarray Fortran programs are compiled with the same Fortran compiler OpenCoarrays was built for,
.BR gfortran (1)
by default, and that the linker links against the appropriate parallel runtime, MPI by default. The \fB\fCcaf\fR compiler wrapper serves a similar purpose to the MPI fortran wrapper compiler,
by default, and that the linker links against the appropriate parallel runtime, MPI by default. The \fB\fCcaf\fR compiler wrapper serves a similar purpose to the MPI Fortran wrapper compiler,
.BR mpifort (1).
\fB\fCcaf\fR embeds the full path to the Fortran compiler it was built for, and to the parallel runtime libraries it links against, and a relative path, based on the install location of \fB\fCcaf\fR itself, to the OpenCoarrays library. This ensures that the API and ABI of OpenCoarrays is always consistent with the Fortran compiler it was built for, and the parallel runtime it uses. To upgrade the parallel runtime, e.g., MPI, or the Fortran compiler, you will need to rebuild and install OpenCoarrays, which will regenerate and reinstall the \fB\fCcaf\fR wrapper script.
.PP
Expand All @@ -30,9 +30,10 @@ Report the name and version of the Fortran compiler \fB\fCcaf\fR is wrapping and
.SH BUGS
.PP
For a list of bugs currently affecting OpenCoarrays, or to report a new one, please report any bugs to the OpenCoarrays project at \[la]https://github.com/sourceryinstitute/OpenCoarrays/issues\[ra]
.SH AUTHOR
.SH AUTHORS
.PP
Izaak Beekman \[la][email protected]\[ra]
Damian Rouson \[la][email protected]\[ra]
.SH SEE ALSO
.PP
.BR cafrun (1),
Expand Down
5 changes: 3 additions & 2 deletions doc/man/man1/cafrun.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH CAFRUN 1 2017\-09\-12 OpenCoarrays\-1.9.1 "cafrun coarray Fortran job launcher manual"
.TH CAFRUN 1 2022\-06\-05 OpenCoarrays\-3.0.0 "cafrun coarray Fortran job launcher manual"
.SH NAME
.PP
\fB\fCcafrun\fR \- Coarray Fortran executable launcher for OpenCoarrays
Expand Down Expand Up @@ -64,9 +64,10 @@ Report the version of the parallel runtime \fB\fCcafrun\fR is wrapping and exit.
.SH BUGS
.PP
For a list of bugs currently affecting OpenCoarrays, or to report a new one, please report any bugs to the OpenCoarrays project at \[la]https://github.com/sourceryinstitute/OpenCoarrays/issues\[ra]
.SH AUTHOR
.SH AUTHORS
.PP
Izaak Beekman \[la][email protected]\[ra]
Damian Rouson \[la][email protected]\[ra]
.SH SEE ALSO
.PP
.BR caf (1),
Expand Down
2 changes: 1 addition & 1 deletion doc/sample-compiler-output.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* SYNOPSIS
* This C program represents the code an OpenCoarrays-compatible
* Fortran compiler might generate from doc/sample-fortran-source.f90.
* The code delegates all necessary synchronization and communicaiton
* The code delegates all necessary synchronization and communication
* to an OpenCoarrays transport layer. In this program, image 1 puts
* its local elements of an array coarray into the corresponding
* elements of image 2.
Expand Down
4 changes: 4 additions & 0 deletions example/hello.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
program main
implicit none
print*,"Hello from image ",this_image()
end program
3 changes: 3 additions & 0 deletions example/support-test/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Test Support
------------
The programs in this directory intentionally error-terminate to support the `error stop` tests in `test/caf_error_stop.f90`, which use Fortran's `execute_command_line` to run the programms in this directory and check for the expected non-zero stop codes. Running the tests in this manner enables the Vegetable tests to continue executing in the presence of error-terminating tests.
7 changes: 7 additions & 0 deletions example/support-test/error_stop_character_code.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
program error_stop_character_code
implicit none

error stop ""

stop 0 ! ../../test/error_stop_test.f90 will report a test failure if this line runs
end program
7 changes: 7 additions & 0 deletions example/support-test/error_stop_integer_code.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
program error_stop_integer_code
implicit none

error stop

stop 0 ! caffeine/test/error_stop_test.f90 reports a failure if this line runs
end program
7 changes: 7 additions & 0 deletions example/support-test/normal_termination.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
program normal_termination
implicit none

stop 0

stop 1 ! opencoarrays/test/zzz_finalization_test.f90 reports a failure if this line runs
end program
Loading