@ -7,15 +7,15 @@ set ( CMAKE_BUILD_TYPE "Release"
set_property ( CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${ CMAKE_CONFIGURATION_TYPES } )
set_property ( CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${ CMAKE_CONFIGURATION_TYPES } )
# A d d o p t i o n a n d c h e c k e n v i r o n m e n t t o d e t e r m i n e i f d e v e l o p e r t e s t s s h o u l d b e r u n
# A d d o p t i o n a n d c h e c k e n v i r o n m e n t t o d e t e r m i n e i f d e v e l o p e r t e s t s s h o u l d b e r u n
if ( $ENV{ OPENCOARRAY S_DEVELOPER} )
if ( $ENV{ PSBLA S_DEVELOPER} )
option ( CAF _RUN_DEVELOPER_TESTS "Run tests intended only for developers" ON )
option ( MPI _RUN_DEVELOPER_TESTS "Run tests intended only for developers" ON )
else ( )
else ( )
option ( CAF _RUN_DEVELOPER_TESTS "Run tests intended only for developers" OFF )
option ( MPI _RUN_DEVELOPER_TESTS "Run tests intended only for developers" OFF )
endif ( )
endif ( )
mark_as_advanced ( CAF _RUN_DEVELOPER_TESTS)
mark_as_advanced ( MPI _RUN_DEVELOPER_TESTS)
if ( NOT DEFINED ENV{ OPENCOARRAY S_DEVELOPER})
if ( NOT DEFINED ENV{ PSBLA S_DEVELOPER})
set ( ENV{ OPENCOARRAY S_DEVELOPER} FALSE )
set ( ENV{ PSBLA S_DEVELOPER} FALSE )
endif ( )
endif ( )
# N a m e p r o j e c t a n d s p e c i f y s o u r c e l a n g u a g e s
# N a m e p r o j e c t a n d s p e c i f y s o u r c e l a n g u a g e s
@ -25,9 +25,9 @@ file(STRINGS ".VERSION" first_line
)
)
string ( REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+"
string ( REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+"
Op e n C o a r r a y s V e r s i o n " $ { f i r s t _ l i n e } " )
PS B L A S _ V e r s i o n " $ { f i r s t _ l i n e } " )
if ( ( NOT ( OpenCoarrays Version MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+" ) ) AND ( EXISTS "${CMAKE_SOURCE_DIR}/.git" ) )
if ( ( NOT ( PSBLAS_ Version MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+" ) ) AND ( EXISTS "${CMAKE_SOURCE_DIR}/.git" ) )
message ( STATUS "Build from git repository detected" )
message ( STATUS "Build from git repository detected" )
find_package ( Git )
find_package ( Git )
if ( GIT_FOUND )
if ( GIT_FOUND )
@ -37,7 +37,7 @@ if((NOT (OpenCoarraysVersion MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+")) AND (EXISTS "$
O U T P U T _ V A R I A B L E g i t _ o u t p u t
O U T P U T _ V A R I A B L E g i t _ o u t p u t
O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E )
O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E )
if ( ( git_status STREQUAL "0" ) AND ( git_output MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+" ) )
if ( ( git_status STREQUAL "0" ) AND ( git_output MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+" ) )
set ( OpenCoarrays Version "${git_output}" )
set ( PSBLAS_ Version "${git_output}" )
endif ( )
endif ( )
execute_process ( COMMAND "${GIT_EXECUTABLE}" describe --always
execute_process ( COMMAND "${GIT_EXECUTABLE}" describe --always
W O R K I N G _ D I R E C T O R Y " $ { C M A K E _ S O U R C E _ D I R } "
W O R K I N G _ D I R E C T O R Y " $ { C M A K E _ S O U R C E _ D I R } "
@ -58,20 +58,24 @@ if((NOT (OpenCoarraysVersion MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+")) AND (EXISTS "$
endif ( )
endif ( )
endif ( )
endif ( )
if ( NOT ( OpenCoarrays Version MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+" ) )
if ( NOT ( PSBLAS_ Version MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+" ) )
message ( WARNING "Could not extract version from git, falling back on .VERSION, line 3." )
message ( WARNING "Could not extract version from git, falling back on .VERSION, line 3." )
file ( STRINGS ".VERSION" OpenCoarrays Version
file ( STRINGS ".VERSION" PSBLAS_ Version
R E G E X " [ 0 - 9 ] + \ \ . [ 0 - 9 ] + \ \ . [ 0 - 9 ] + "
R E G E X " [ 0 - 9 ] + \ \ . [ 0 - 9 ] + \ \ . [ 0 - 9 ] + "
)
)
endif ( )
endif ( )
if ( NOT full_git_describe )
if ( NOT full_git_describe )
set ( full_git_describe ${ OpenCoarrays Version} )
set ( full_git_describe ${ PSBLAS_ Version} )
endif ( )
endif ( )
project ( opencoarrays VERSION "${OpenCoarraysVersion}" LANGUAGES C Fortran )
# S t r i p l e a d i n g " v " c h a r a c t e r f r o m P S B L A S v e r s i o n t a g s
message ( STATUS "Building OpenCoarrays version: ${full_git_describe}" )
string ( REPLACE "v" "" PSBLAS_Version "${PSBLAS_Version}" )
set ( OpenCoarrays_dist_string "OpenCoarrays-${full_git_describe}" )
project ( psblas VERSION "${PSBLAS_Version}" LANGUAGES C Fortran )
message ( STATUS "Building PSBLAS version: ${full_git_describe}" )
set ( PSBLAS_dist_string "PSBLAS-${full_git_describe}" )
# P r i n t a n e r r o r m e s s a g e o n a n a t t e m p t t o b u i l d i n s i d e t h e s o u r c e d i r e c t o r y t r e e :
# P r i n t a n e r r o r m e s s a g e o n a n a t t e m p t t o b u i l d i n s i d e t h e s o u r c e d i r e c t o r y t r e e :
if ( "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}" )
if ( "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}" )
@ -84,11 +88,11 @@ if ("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
" \ n Y o u m u s t n o w r u n s o m e t h i n g l i k e : \ n "
" \ n Y o u m u s t n o w r u n s o m e t h i n g l i k e : \ n "
" $ r m - r C M a k e C a c h e . t x t C M a k e F i l e s / "
" $ r m - r C M a k e C a c h e . t x t C M a k e F i l e s / "
" \ n "
" \ n "
" P l e a s e c r e a t e a d i r e c t o r y o u t s i d e t h e op e n c o a r r a y s s o u r c e t r e e a n d b u i l d u n d e r t h a t o u t s i d e d i r e c t o r y "
" P l e a s e c r e a t e a d i r e c t o r y o u t s i d e t h e PS B L A S s o u r c e t r e e a n d b u i l d u n d e r t h a t o u t s i d e d i r e c t o r y "
" i n a m a n n e r s u c h a s \ n "
" i n a m a n n e r s u c h a s \ n "
" $ m k d i r b u i l d -o p e n c a r r a y s \n "
" $ m k d i r b u i l d \n "
" $ c d b u i l d -o p e n c o a r r a y s \n "
" $ c d b u i l d \n "
" $ C C = g c c F C = g f o r t r a n c m a k e - D B U I L D _ T Y P E = R e l e a s e - D C M A K E _ I N S T A L L _ P R E F I X = / p a t h / t o / i n s t a l l / d i r / p a t h / t o / op e n c o a r r a y s / s r c / d i r \ n "
" $ C C = g c c F C = g f o r t r a n c m a k e - D B U I L D _ T Y P E = R e l e a s e - D C M A K E _ I N S T A L L _ P R E F I X = / p a t h / t o / i n s t a l l / d i r / p a t h / t o / ps b l a s 3 / s r c / d i r \ n "
" \ n s u b s t i t u t i n g t h e a p p r o p r i a t e s y n t a x f o r y o u r shell ( the above line assumes the bash shell ) . "
" \ n s u b s t i t u t i n g t h e a p p r o p r i a t e s y n t a x f o r y o u r shell ( the above line assumes the bash shell ) . "
)
)
endif ( )
endif ( )
@ -104,7 +108,7 @@ else()
message ( WARNING
message ( WARNING
" \ n "
" \ n "
" A t t e m p t i n g t o b u i l d w i t h u n t e s t e d F o r t r a n c o m p i l e r : $ { C M A K E _ F o r t r a n _ C O M P I L E R _ I D } . "
" A t t e m p t i n g t o b u i l d w i t h u n t e s t e d F o r t r a n c o m p i l e r : $ { C M A K E _ F o r t r a n _ C O M P I L E R _ I D } . "
" P l e a s e r e p o r t a n y f a i l u r e s to o p e n c o a r r a y s @ g o o g l e g r o u p s . c o m \ n \ n "
" P l e a s e r e p o r t a n y f a i l u r e s at h t t p s : / / g i t h u b . c o m / s f i l i p p o n e / p s b l a s 3 \ n \ n "
)
)
endif ( )
endif ( )
@ -149,32 +153,6 @@ the C compiler if it matches the Fortran compiler ID." )
set ( CMAKE_Fortran_COMPILER_VERSION "${DETECTED_VER}" )
set ( CMAKE_Fortran_COMPILER_VERSION "${DETECTED_VER}" )
endif ( )
endif ( )
# W e h a v e p o p u l a t e d C M A K E _ F o r t r a n _ C O M P I L E R _ V E R S I O N i f i t w a s m i s s i n g
if ( gfortran_compiler AND ( CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER 5.0.0 ) )
set ( opencoarrays_aware_compiler true )
add_definitions ( -DPREFIX_NAME=_gfortran_caf_ )
else ( )
set ( opencoarrays_aware_compiler false )
add_definitions ( -DPREFIX_NAME=_caf_extensions_ )
endif ( )
if ( gfortran_compiler AND ( CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 5.4.0 ) )
# G C C p a t c h t o f i x i s s u e a c c e p t e d f o r 5 . 4 r e l e a s e
# S e e h t t p s : / / g i t h u b . c o m / s o u r c e r y i n s t i t u t e / o p e n c o a r r a y s / i s s u e s / 2 8 a n d
# h t t p s : / / g r o u p s . g o o g l e . c o m / f o r u m / # ! m s g / o p e n c o a r r a y s / R Z O w w Y T q G 8 0 / 4 6 S 9 e L 6 9 6 d g J
message ( STATUS "Disabling optimization flags due to GCC < 5.4 bug" )
set ( CMAKE_Fortran_FLAGS_RELEASE -O0
C A C H E S T R I N G " F l a g s u s e d b y t h e c o m p i l e r d u r i n g r e l e a s e b u i l d s . " F O R C E )
set ( CMAKE_Fortran_FLAGS_RELWITHDEBINFO "-g -DNDEBUG -O0"
C A C H E S T R I N G " F l a g s u s e d b y t h e c o m p i l e r d u r i n g r e l e a s e b u i l d s w i t h d e b u g i n f o " F O R C E )
set ( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -O0" )
endif ( )
if ( gfortran_compiler AND ( NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 7.0.0 ) )
add_definitions ( -DGCC_GE_7 ) # T e l l l i b r a r y t o b u i l d a g a i n s t G F o r t r a n 7 . x b i n d i n g s b / c w e m i g h t b e u s i n g c l a n g f o r C
endif ( )
if ( gfortran_compiler AND ( NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 8.0.0 ) )
add_definitions ( -DGCC_GE_8 ) # T e l l l i b r a r y t o b u i l d a g a i n s t G F o r t r a n 8 . x b i n d i n g s w / d e s c r i p t o r c h a n g e
endif ( )
if ( gfortran_compiler )
if ( gfortran_compiler )
set ( OLD_REQUIRED_FLAGS ${ CMAKE_REQUIRED_FLAGS } )
set ( OLD_REQUIRED_FLAGS ${ CMAKE_REQUIRED_FLAGS } )
set ( CMAKE_REQUIRED_FLAGS "-fcoarray=single -ffree-form" )
set ( CMAKE_REQUIRED_FLAGS "-fcoarray=single -ffree-form" )
@ -236,8 +214,8 @@ list(REMOVE_DUPLICATES MPI_Fortran_INCLUDE_PATH)
# T e s t f o r c o n s i s t e n t M P I e n v i r o n m e n t
# T e s t f o r c o n s i s t e n t M P I e n v i r o n m e n t
if ( NOT MPIEXEC )
if ( NOT MPIEXEC )
message ( ERROR " CMake failed to find `mpiexec` or similar. If building with `./install.sh` please
message ( ERROR " CMake failed to find `mpiexec` or similar. If building with `./install.sh` please
r e p o r t t h i s b u g t o t h e Op e n C o a r r a y s d e v e l o p e r s a t
r e p o r t t h i s b u g t o t h e PS B L A S d e v e l o p e r s a t
h t t p s : / / g i t h u b . c o m / s ou r c e r y i n s t i t u t e / o p e n c o a r r a y s / i s s u e s , o t h e r w i s e p o i n t C M a k e
h t t p s : / / g i t h u b . c o m / s fi l i p p o n e / p s b l a s 3 / i s s u e s , o t h e r w i s e p o i n t C M a k e
t o t h e d e s i r e d M P I r u n t i m e . " )
t o t h e d e s i r e d M P I r u n t i m e . " )
endif ( )
endif ( )
@ -269,8 +247,8 @@ else()
w h i c h d i f f e r s f r o m t h e l o c a t i o n o f M P I C C a n d / o r M P I F C w h i c h a r e i n
w h i c h d i f f e r s f r o m t h e l o c a t i o n o f M P I C C a n d / o r M P I F C w h i c h a r e i n
\ " $ { M P I C C _ D I R } \ " a n d \ " $ { M P I F C _ D I R } , \ " r e s p e c t i v e l y .
\ " $ { M P I C C _ D I R } \ " a n d \ " $ { M P I F C _ D I R } , \ " r e s p e c t i v e l y .
T h i s i s l i k e l y i n d i c a t i v e o f a p r o b l e m . I f b u i l d i n g w i t h ` . / i n s t a l l . s h ` p l e a s e r e p o r t
T h i s i s l i k e l y i n d i c a t i v e o f a p r o b l e m . I f b u i l d i n g w i t h ` . / i n s t a l l . s h ` p l e a s e r e p o r t
t h i s t o t h e Op e n C o a r r a y s d e v e l o p e r s b y f i l i n g a n e w i s s u e a t :
t h i s t o t h e PS B L A S d e v e l o p e r s b y f i l i n g a n e w i s s u e a t :
h t t p s : / / g i t h u b . c o m / s o u r c e r y i n s t i t u t e / Op e n C o a r r a y s / i s s u e s / n e w " )
h t t p s : / / g i t h u b . c o m / s o u r c e r y i n s t i t u t e / PS B L A S / i s s u e s / n e w " )
endif ( )
endif ( )
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -281,7 +259,7 @@ if( (MPI_C_LINK_FLAGS MATCHES "noexecstack") OR (MPI_Fortran_LINK_FLAGS MATCHES
" T h e ` n o e x e c s t a c k ` l i n k e r f l a g w a s f o u n d i n t h e M P I _ < l a n g > _ L I N K _ F L A G S v a r i a b l e . T h i s i s
" T h e ` n o e x e c s t a c k ` l i n k e r f l a g w a s f o u n d i n t h e M P I _ < l a n g > _ L I N K _ F L A G S v a r i a b l e . T h i s i s
k n o w n t o c a u s e s e g m e n t a t i o n f a u l t s f o r s o m e F o r t r a n c o d e s . S e e , e . g . ,
k n o w n t o c a u s e s e g m e n t a t i o n f a u l t s f o r s o m e F o r t r a n c o d e s . S e e , e . g . ,
h t t p s : / / g c c . g n u . o r g / b u g z i l l a / s h o w _ b u g . c g i ? i d = 7 1 7 2 9 o r
h t t p s : / / g c c . g n u . o r g / b u g z i l l a / s h o w _ b u g . c g i ? i d = 7 1 7 2 9 o r
h t t p s : / / g i t h u b . c o m / s o u r c e r y i n s t i t u t e / Op e n C o a r r a y s / i s s u e s / 3 1 7 .
h t t p s : / / g i t h u b . c o m / s o u r c e r y i n s t i t u t e / PS B L A S / i s s u e s / 3 1 7 .
` n o e x e c s t a c k ` i s b e i n g r e p l a c e d w i t h ` e x e c s t a c k ` "
` n o e x e c s t a c k ` i s b e i n g r e p l a c e d w i t h ` e x e c s t a c k ` "
)
)
@ -403,11 +381,7 @@ unset(OLD_INCLUDES)
unset ( OLD_LIBRARIES )
unset ( OLD_LIBRARIES )
if ( ( NOT MPI_Fortran_MODULE_COMPILES ) AND ( NOT MPI_Fortran_INCLUDE_COMPILES ) )
if ( ( NOT MPI_Fortran_MODULE_COMPILES ) AND ( NOT MPI_Fortran_INCLUDE_COMPILES ) )
message ( WARNING "It appears that the Fortran MPI compiler is not working. "
message ( WARNING "It appears that the Fortran MPI compiler is not working. " )
" F o r O p e n C o a r r a y s A w a r e c o m p i l e r s , t h i s m a y b e i r r e l a v e n t : "
" T h e s r c / e x t e n s i o n s / o p e n c o a r r a y s . F 9 0 m o d u l e w i l l b e d i s a b l e d , b u t i t i s "
" p o s s i b l e t h a t t h e b u i l d w i l l s u c c e e d , d e s p i t e t h i s f i s h y c i r c u m s t a n c e . "
)
endif ( )
endif ( )
if ( MPI_Fortran_MODULE_COMPILES )
if ( MPI_Fortran_MODULE_COMPILES )
@ -415,7 +389,7 @@ if ( MPI_Fortran_MODULE_COMPILES )
else ( )
else ( )
message ( WARNING "It appears that MPI was built with a different Fortran compiler. "
message ( WARNING "It appears that MPI was built with a different Fortran compiler. "
" I t i s p o s s i b l e t h a t t h i s m a y c a u s e u n p r e d i c t a b l e b e h a v i o r . T h e b u i l d w i l l c o n t i n u e "
" I t i s p o s s i b l e t h a t t h i s m a y c a u s e u n p r e d i c t a b l e b e h a v i o r . T h e b u i l d w i l l c o n t i n u e "
" u s i n g ` m p i f . h ` B U T p l e a s e r e p o r t a n y s u s p i c i o u s b e h a v i o r t o t h e Op e n C o a r r a y s "
" u s i n g ` m p i f . h ` B U T p l e a s e r e p o r t a n y s u s p i c i o u s b e h a v i o r t o t h e PS B L A S "
" d e v e l o p e r s . "
" d e v e l o p e r s . "
)
)
endif ( )
endif ( )
@ -433,8 +407,8 @@ include_directories(BEFORE ${MPI_C_INCLUDE_PATH} ${MPI_Fortran_INCLUDE_PATH})
# U s e s t a n d a r d i z e d G N U i n s t a l l d i r e c t o r y c o n v e n t i o n s
# U s e s t a n d a r d i z e d G N U i n s t a l l d i r e c t o r y c o n v e n t i o n s
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
include ( GNUInstallDirs )
include ( GNUInstallDirs )
set ( mod_dir_tail "${ OpenCoarrays _dist_string}_${CMAKE_Fortran_COMPILER_ID}-${CMAKE_Fortran_COMPILER_VERSION}")
set ( mod_dir_tail "${ PSBLAS _dist_string}_${CMAKE_Fortran_COMPILER_ID}-${CMAKE_Fortran_COMPILER_VERSION}")
set ( CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}/${ OpenCoarrays _dist_string}-tests")
set ( CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}/${ PSBLAS _dist_string}-tests")
set ( CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}" )
set ( CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}" )
set ( CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}" )
set ( CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}" )
@ -447,7 +421,7 @@ install(FILES "${CMAKE_SOURCE_DIR}/doc/man/man1/caf.1" "${CMAKE_SOURCE_DIR}/doc/
C O M P O N E N T d o c u m e n t a t i o n )
C O M P O N E N T d o c u m e n t a t i o n )
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# D e f i n e m a c r o f o r c o m p i l i n g w i t h ca f wr a p p e r s c r i p t
# D e f i n e m a c r o f o r c o m p i l i n g w i t h wr a p p e r s c r i p t
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function ( caf_compile_executable target main_depend )
function ( caf_compile_executable target main_depend )
foreach ( includedir IN LISTS MPI_Fortran_INCLUDE_PATH )
foreach ( includedir IN LISTS MPI_Fortran_INCLUDE_PATH )
@ -477,9 +451,9 @@ enable_testing()
find_program ( SHELLCHECK_EXE shellcheck
find_program ( SHELLCHECK_EXE shellcheck
D O C " P a t h t o s h e l l c h e c k e x e c u t a b l e f o r l i n t i n g s c r i p t s "
D O C " P a t h t o s h e l l c h e c k e x e c u t a b l e f o r l i n t i n g s c r i p t s "
)
)
if ( CAF_RUN_DEVELOPER_TESTS OR $ENV{ OPENCOARRAY S_DEVELOPER} )
if ( MPI_RUN_DEVELOPER_TESTS OR $ENV{ PSBLA S_DEVELOPER} )
if ( NOT SHELLCHECK_EXE )
if ( NOT SHELLCHECK_EXE )
message ( AUTHOR_WARNING " OpenCoarrays developers should install shellcheck to test/lint all shell scripts.
message ( AUTHOR_WARNING " PSBLAS developers should install shellcheck to test/lint all shell scripts.
S e e h t t p s : / / g i t h u b . c o m / k o a l a m a n / s h e l l c h e c k # i n s t a l l i n g f o r i n f o o n o b t a i n i n g s h e l l c h e c k . " )
S e e h t t p s : / / g i t h u b . c o m / k o a l a m a n / s h e l l c h e c k # i n s t a l l i n g f o r i n f o o n o b t a i n i n g s h e l l c h e c k . " )
endif ( )
endif ( )
endif ( )
endif ( )
@ -489,7 +463,7 @@ function(lint_script script_dir script_name)
add_test ( NAME "shellcheck:${script_name}"
add_test ( NAME "shellcheck:${script_name}"
C O M M A N D $ { S H E L L C H E C K _ E X E } - x " $ { s c r i p t _ d i r } / $ { s c r i p t _ n a m e } "
C O M M A N D $ { S H E L L C H E C K _ E X E } - x " $ { s c r i p t _ d i r } / $ { s c r i p t _ n a m e } "
W O R K I N G _ D I R E C T O R Y " $ { C M A K E _ S O U R C E _ D I R } " )
W O R K I N G _ D I R E C T O R Y " $ { C M A K E _ S O U R C E _ D I R } " )
elseif ( CAF_RUN_DEVELOPER_TESTS OR $ENV{ OPENCOARRAY S_DEVELOPER} )
elseif ( MPI_RUN_DEVELOPER_TESTS OR $ENV{ PSBLA S_DEVELOPER} )
message ( AUTHOR_WARNING "test: shellcheck:${script_name} not run because shellcheck not installed." )
message ( AUTHOR_WARNING "test: shellcheck:${script_name} not run because shellcheck not installed." )
endif ( )
endif ( )
endfunction ( )
endfunction ( )
@ -525,39 +499,39 @@ define_property(TARGET
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# R e c u r s e i n t o t h e s r c d i r e c t o r y
# R e c u r s e i n t o t h e s r c d i r e c t o r y
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
include_directories ( BEFORE ${ CMAKE_CURRENT_SOURCE_DIR } /src )
# include_directories ( BEFORE ${ CMAKE_CURRENT_SOURCE_DIR } /src )
add_subdirectory ( src )
# add_subdirectory ( src )
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# P u b l i c i z e i n s t a l l e d l o c a t i o n t o o t h e r C M a k e p r o j e c t s
# P u b l i c i z e i n s t a l l e d l o c a t i o n t o o t h e r C M a k e p r o j e c t s
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
install ( EXPORT OpenCoarrays Targets
install ( EXPORT PSBLAS Targets
N A M E S P A C E
N A M E S P A C E
Op e n C o a r r a y s : :
PS B L A S : :
D E S T I N A T I O N
D E S T I N A T I O N
" $ { C M A K E _ I N S T A L L _ L I B D I R } / c m a k e / op e n c o a r r a y s "
" $ { C M A K E _ I N S T A L L _ L I B D I R } / c m a k e / ps b l a s "
)
)
include ( CMakePackageConfigHelpers ) # s t a n d a r d C M a k e m o d u l e
include ( CMakePackageConfigHelpers ) # s t a n d a r d C M a k e m o d u l e
write_basic_package_version_file (
write_basic_package_version_file (
" $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / Op e n C o a r r a y s C o n f i g V e r s i o n . c m a k e "
" $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / PS B L A S C o n f i g V e r s i o n . c m a k e "
V E R S I O N " $ { op e n c o a r r a y s _ V E R S I O N } "
V E R S I O N " $ { ps b l a s _ V E R S I O N } "
C O M P A T I B I L I T Y A n y N e w e r V e r s i o n
C O M P A T I B I L I T Y A n y N e w e r V e r s i o n
)
)
configure_file ( "${CMAKE_SOURCE_DIR}/cmake/pkg/ OpenCoarrays Config.cmake.in"
configure_file ( "${CMAKE_SOURCE_DIR}/cmake/pkg/ PSBLAS Config.cmake.in"
" $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / C M a k e F i l e s / Op e n C o a r r a y s C o n f i g . c m a k e " @ O N L Y )
" $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / C M a k e F i l e s / PS B L A S C o n f i g . c m a k e " @ O N L Y )
install (
install (
F I L E S
F I L E S
" $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / C M a k e F i l e s / Op e n C o a r r a y s C o n f i g . c m a k e "
" $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / C M a k e F i l e s / PS B L A S C o n f i g . c m a k e "
" $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / Op e n C o a r r a y s C o n f i g V e r s i o n . c m a k e "
" $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / PS B L A S C o n f i g V e r s i o n . c m a k e "
D E S T I N A T I O N
D E S T I N A T I O N
" $ { C M A K E _ I N S T A L L _ L I B D I R } / c m a k e / op e n c o a r r a y s "
" $ { C M A K E _ I N S T A L L _ L I B D I R } / c m a k e / ps b l a s "
)
)
add_library ( OpenCoarrays INTERFACE )
add_library ( PSBLAS INTERFACE )
target_compile_options ( OpenCoarrays INTERFACE -fcoarray=lib )
# target_compile_options ( PSBLAS INTERFACE -fcoarray=lib )
target_link_libraries ( OpenCoarrays INTERFACE caf_mpi )
# target_link_libraries ( PSBLAS INTERFACE caf_mpi )
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# A d d p o r t a b l e u n i s t a l l c o m m a n d t o m a k e f i l e
# A d d p o r t a b l e u n i s t a l l c o m m a n d t o m a k e f i l e
@ -587,157 +561,45 @@ endif ()
include ( ProcessorCount )
include ( ProcessorCount )
ProcessorCount ( N_CPU )
ProcessorCount ( N_CPU )
function ( add_ caf_test name num_caf_img test_target )
function ( add_ mpi_test name num_mpi_rank test_target )
# F u n c t i o n t o a d d M P I t e s t s .
# F u n c t i o n t o a d d M P I t e s t s .
if ( TARGET ${ test_target } )
if ( TARGET ${ test_target } )
get_target_property ( min_test_ img s ${ test_target } MIN_IMAGES )
get_target_property ( min_test_ rank s ${ test_target } MIN_IMAGES )
elseif ( TARGET build_ ${ test_target } )
elseif ( TARGET build_ ${ test_target } )
get_target_property ( min_test_ img s build_ ${ test_target } MIN_IMAGES )
get_target_property ( min_test_ rank s build_ ${ test_target } MIN_IMAGES )
endif ( )
endif ( )
if ( min_test_ img s)
if ( min_test_ rank s)
if ( num_ caf_img LESS min_test_img s)
if ( num_ mpi_rank LESS min_test_rank s)
message ( FATAL_ERROR "Test ${name} requires ${min_test_ imgs} but was only given ${num_caf _images}" )
message ( FATAL_ERROR "Test ${name} requires ${min_test_ ranks} but was only given ${num_mpi _images}" )
endif ( )
endif ( )
endif ( )
endif ( )
if ( ( ( N_CPU LESS num_ caf_img ) OR ( N_CPU EQUAL 0 ) ) )
if ( ( ( N_CPU LESS num_ mpi_rank ) OR ( N_CPU EQUAL 0 ) ) )
message ( STATUS "Test ${name} is oversubscribed: ${num_ caf_img } CAF images requested with ${N_CPU} system processor available.")
message ( STATUS "Test ${name} is oversubscribed: ${num_ mpi_rank } CAF images requested with ${N_CPU} system processor available.")
if ( openmpi )
if ( openmpi )
if ( min_test_ img s)
if ( min_test_ rank s)
set ( num_ caf_img ${ min_test_img s} )
set ( num_ mpi_rank ${ min_test_rank s} )
elseif ( N_CPU LESS 2 )
elseif ( N_CPU LESS 2 )
set ( num_ caf_img 2 )
set ( num_ mpi_rank 2 )
endif ( )
endif ( )
set ( test_parameters --oversubscribe )
set ( test_parameters --oversubscribe )
message ( STATUS "Open-MPI back end detected, passing --oversubscribe for oversubscribed test, ${name}, with ${num_ caf_img } ranks/images." )
message ( STATUS "Open-MPI back end detected, passing --oversubscribe for oversubscribed test, ${name}, with ${num_ mpi_rank } ranks/images." )
endif ( )
endif ( )
endif ( )
endif ( )
set ( test_parameters -np ${ num_ caf_img } ${ test_parameters } )
set ( test_parameters -np ${ num_ mpi_rank } ${ test_parameters } )
add_test ( NAME ${ name } COMMAND "bash" "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}/ caf run" ${ test_parameters } "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${test_target}" )
add_test ( NAME ${ name } COMMAND "bash" "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}/ mpi run" ${ test_parameters } "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${test_target}" )
set_property ( TEST ${ name } PROPERTY PASS_REGULAR_EXPRESSION "Test passed." )
set_property ( TEST ${ name } PROPERTY PASS_REGULAR_EXPRESSION "Test passed." )
endfunction ( add_caf_test )
endfunction ( add_mpi_test )
# - - - - - - - - - - - - - -
# A d d O C A t e s t s
# - - - - - - - - - - - - - -
if ( opencoarrays_aware_compiler )
if ( CAF_RUN_DEVELOPER_TESTS OR $ENV{ OPENCOARRAYS_DEVELOPER } )
message ( STATUS "Running Developer tests is enabled." )
endif ( )
# U n i t t e s t s t a r g e t i n g e a c h l i b c a f _ m p i f u n c t i o n , a r g u m e n t , a n d b r a n c h o f c o d e
add_caf_test ( initialize_mpi 2 initialize_mpi )
add_caf_test ( register 2 register )
add_caf_test ( register_vector 2 register_vector )
add_caf_test ( register_alloc_vector 2 register_alloc_vector )
add_caf_test ( allocate_as_barrier 2 allocate_as_barrier )
add_caf_test ( allocate_as_barrier_proc 8 allocate_as_barrier_proc )
if ( gfortran_compiler AND ( NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 7.0.0 ) OR ( CAF_RUN_DEVELOPER_TESTS OR $ENV{ OPENCOARRAYS_DEVELOPER } ) )
message ( STATUS "Allocatable components of coarray derived types only supported in GFortran >= 7 with OpenCoarrays > 1.8.4" )
message ( STATUS "(but full support not anticipated until OpenCoarrays 2.0 release)" )
if ( CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 7.0.0 )
message ( AUTHOR_WARNING "Allocatable components of coarray derived type developer tests enabled, despite lack of support in GFortran < 7\n These tests should fail." )
endif ( )
add_caf_test ( register_alloc_comp_1 2 register_alloc_comp_1 )
add_caf_test ( register_alloc_comp_2 2 register_alloc_comp_2 )
add_caf_test ( register_alloc_comp_3 2 register_alloc_comp_3 )
add_caf_test ( async_comp_alloc 6 async_comp_alloc )
add_caf_test ( async_comp_alloc_2 2 async_comp_alloc_2 )
add_caf_test ( comp_allocated_1 2 comp_allocated_1 )
add_caf_test ( comp_allocated_2 2 comp_allocated_2 )
endif ( )
add_caf_test ( get_array 2 get_array )
add_caf_test ( get_self 2 get_self )
add_caf_test ( send_array 2 send_array )
add_caf_test ( get_with_offset_1d 2 get_with_offset_1d )
add_caf_test ( whole_get_array 2 whole_get_array )
add_caf_test ( strided_get 2 strided_get )
add_caf_test ( strided_sendget 3 strided_sendget )
add_caf_test ( co_sum 4 co_sum_test )
add_caf_test ( co_broadcast 4 co_broadcast_test )
add_caf_test ( co_min 4 co_min_test )
add_caf_test ( co_max 4 co_max_test )
add_caf_test ( syncall 8 syncall )
add_caf_test ( syncimages 8 syncimages )
add_caf_test ( syncimages2 8 syncimages2 )
add_caf_test ( duplicate_syncimages 8 duplicate_syncimages )
add_caf_test ( co_reduce 4 co_reduce_test )
add_caf_test ( co_reduce_res_im 4 co_reduce_res_im )
add_caf_test ( co_reduce_string 4 co_reduce_string )
add_caf_test ( syncimages_status 8 syncimages_status )
add_caf_test ( sync_ring_abort_np3 3 sync_image_ring_abort_on_stopped_image )
add_caf_test ( sync_ring_abort_np7 7 sync_image_ring_abort_on_stopped_image )
add_caf_test ( simpleatomics 8 atomics )
# p o s s i b l e l o g i c e r r o r i n t h e f o l l o w i n g t e s t
# add_caf_test ( increment_my_neighbor 32 increment_my_neighbor )
# I n t e g r a t i o n t e s t s v e r i f y i n g t h e u s e o f l i b c a f _ m p i i n a p p l i c a t i o n s
add_caf_test ( hello_multiverse 2 hello_multiverse )
add_caf_test ( coarray_burgers_pde 2 coarray_burgers_pde )
add_caf_test ( co_heat 2 co_heat )
add_caf_test ( asynchronous_hello_world 3 asynchronous_hello_world )
# R e g r e s s i o n t e s t s b a s e d o n r e p o r t e d i s s u e s
if ( ( gfortran_compiler AND ( NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 7.0.0 ) ) OR ( CAF_RUN_DEVELOPER_TESTS OR $ENV{ OPENCOARRAYS_DEVELOPER } ) )
if ( CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 7.0.0 )
message ( AUTHOR_WARNING "Developer tests requested and GFortran < 7: test source-alloc-no-sync may fail" )
endif ( )
# G F o r t r a n P R 7 8 5 0 5 o n l y f i x e d o n t r u n k / g c c 7 , i s s u e # 2 4 3
add_caf_test ( source-alloc-no-sync 8 source-alloc-sync )
endif ( )
# O p e n G C C 7 r e g r e s s i o n s
if ( ( CAF_RUN_DEVELOPER_TESTS OR $ENV{ OPENCOARRAYS_DEVELOPER } ) OR ( gfortran_compiler AND ( CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 7.0.0 ) ) )
add_caf_test ( convert-before-put 3 convert-before-put )
add_caf_test ( put-alloc-comp 2 issue-422-send )
add_caf_test ( get-put-alloc-comp 3 issue-422-send-get )
endif ( )
add_caf_test ( allocatable_p2p_event_post 4 allocatable_p2p_event_post )
# F i x e d G C C 7 r e g r e s s i o n s , s h o u l d r u n o n G C C 6 a n d 7
add_caf_test ( static_event_post_issue_293 3 static_event_post_issue_293 )
# T h e s e co_reduce ( # 172, fixed by PR # 332, addl discussion in PR
# # 3 3 1 ) t e s t s a r e f o r b u g s n o t r e g r e s s i o n s . S h o u l d b e f i x e d i n a l l
# v e r s i o n o f G C C , I b e l e i v e
add_caf_test ( co_reduce-factorial 4 co_reduce-factorial )
add_caf_test ( co_reduce-factorial-int8 4 co_reduce-factorial-int8 )
add_caf_test ( co_reduce-factorial-int64 4 co_reduce-factorial-int64 )
# I M A G E F A I L t e s t s
if ( NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 7.0.0 )
add_caf_test ( image_status_test_1 4 image_status_test_1 )
if ( CAF_ENABLE_FAILED_IMAGES )
if ( ( NOT DEFINED ENV{TRAVIS} ) OR ( CAF_RUN_DEVELOPER_TESTS OR $ENV{ OPENCOARRAYS_DEVELOPER } ) )
add_caf_test ( image_fail_test_1 4 image_fail_test_1 )
set_property ( TEST image_fail_test_1 PROPERTY FAIL_REGULAR_EXPRESSION "Test failed." )
# N o o t h e r w a y t o c h e c k t h a t i m a g e _ f a i l _ t e s t _ 1 p a s s e s .
add_caf_test ( image_fail_and_sync_test_1 4 image_fail_and_sync_test_1 )
add_caf_test ( image_fail_and_sync_test_2 4 image_fail_and_sync_test_2 )
add_caf_test ( image_fail_and_sync_test_3 4 image_fail_and_sync_test_3 )
add_caf_test ( image_fail_and_status_test_1 4 image_fail_and_status_test_1 )
add_caf_test ( image_fail_and_failed_images_test_1 4 image_fail_and_failed_images_test_1 )
add_caf_test ( image_fail_and_stopped_images_test_1 4 image_fail_and_stopped_images_test_1 )
add_caf_test ( image_fail_and_get_test_1 4 image_fail_and_get_test_1 )
endif ( )
endif ( )
endif ( )
else ( )
add_test ( co_sum_extension test-co_sum-extension.sh )
set_property ( TEST co_sum_extension PROPERTY PASS_REGULAR_EXPRESSION "Test passed." )
add_test ( co_broadcast_extension test-co_broadcast-extension.sh )
set_property ( TEST co_broadcast_extension PROPERTY PASS_REGULAR_EXPRESSION "Test passed." )
add_test ( co_min_extension test-co_min-extension.sh )
set_property ( TEST co_min_extension PROPERTY PASS_REGULAR_EXPRESSION "Test passed." )
add_test ( co_max_extension test-co_max-extension.sh )
# - - - - - - - - - - - - - - - - -
set_property ( TEST co_max_extension PROPERTY PASS_REGULAR_EXPRESSION "Test passed." )
# A d d P S B L A S t e s t s
# - - - - - - - - - - - - - - - - -
add_test ( co_reduce_extension test-co_reduce-extension.sh )
if ( MPI_RUN_DEVELOPER_TESTS OR $ENV{ PSBLAS_DEVELOPER } )
set_property( TEST co_reduce_extension PROPERTY PASS_REGULAR_EXPRESSION "Test passed." )
message ( STATUS "Running Developer tests is enabled." )
endif ( )
endif ( )
include ( cmake/AddInstallationScriptTest.cmake )
# U n i t t e s t s t a r g e t i n g e a c h f u n c t i o n , a r g u m e n t , a n d b r a n c h o f c o d e
add_installation_script_test ( installation-scripts.sh src/tests/installation/ )
# add_mpi_test ( initialize_mpi 2 initialize_mpi )
# include ( cmake/AddInstallationScriptTest.cmake )
# add_installation_script_test ( installation-scripts.sh src/tests/installation/ )