@@ -47,6 +47,12 @@ if((NOT (OpenCoarraysVersion MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+")) AND (EXISTS "$
47
47
if (NOT (git_status STREQUAL "0" ))
48
48
set (full_git_describe NOTFOUND )
49
49
endif ()
50
+ # Create a source distribution target using git archive
51
+ # e.g., `make dist` will package a release using current git state
52
+ add_custom_target (dist # OUTPUT "${CMAKE_BINARY_DIR}/${_OC_stem_name}.tar.gz"
53
+ COMMAND "${CMAKE_COMMAND} " -P "${CMAKE_SOURCE_DIR} /cmake/makeDist.cmake" "${CMAKE_SOURCE_DIR} " "${CMAKE_BINARY_DIR} "
54
+ COMMENT "Creating source release asset, ${_OC_stem_name} .tar.gz, from ${git_full_describe} using the `git archive` command."
55
+ VERBATIM )
50
56
else ()
51
57
message ( WARNING "Could not find git executable!" )
52
58
endif ()
@@ -165,6 +171,9 @@ endif()
165
171
if ( gfortran_compiler AND ( NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 7.0.0 ) )
166
172
add_definitions (-DGCC_GE_7 ) # Tell library to build against GFortran 7.x bindings b/c we might be using clang for C
167
173
endif ()
174
+ if ( gfortran_compiler AND ( NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 8.0.0 ) )
175
+ add_definitions (-DGCC_GE_8 ) # Tell library to build against GFortran 8.x bindings w/ descriptor change
176
+ endif ()
168
177
169
178
if (gfortran_compiler )
170
179
set (OLD_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} )
@@ -213,7 +222,7 @@ if ( (NOT MPI_C_FOUND) OR (NOT MPI_Fortran_FOUND) OR (NOT MPIEXEC))
213
222
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR} "
214
223
OUTPUT_VARIABLE DEFAULT_MPICH_INSTALL_LOC
215
224
OUTPUT_QUIET
216
- OUTPUT_STRIP_TRAILING_WHITES_SPACE
225
+ OUTPUT_STRIP_TRAILING_WHITESPACE
217
226
)
218
227
find_program (MY_MPI_EXEC NAMES mpirun mpiexec lamexec srun
219
228
PATHS "${DEFAULT_MPICH_INSTALL_LOC} " ENV PATH
@@ -429,6 +438,14 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}/
429
438
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR} /${CMAKE_INSTALL_LIBDIR} " )
430
439
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR} /${CMAKE_INSTALL_LIBDIR} " )
431
440
441
+ #-----------------
442
+ # Install manpages
443
+ #-----------------
444
+ install (FILES "${CMAKE_SOURCE_DIR} /doc/man/man1/caf.1" "${CMAKE_SOURCE_DIR} /doc/man/man1/cafrun.1"
445
+ DESTINATION "${CMAKE_INSTALL_MANDIR} /man1"
446
+ PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
447
+ COMPONENT documentation )
448
+
432
449
#---------------------------------------------------
433
450
# Define macro for compiling with caf wrapper script
434
451
#---------------------------------------------------
@@ -481,11 +498,30 @@ endfunction()
481
498
# Setup script style testing & enforcement macro
482
499
#-----------------------------------------------
483
500
501
+ find_program (style_pl style.pl "${CMAKE_SOURCE_DIR} /developer-scripts/" )
484
502
function (check_script_style script_full_path )
485
- add_test (NAME "style:${script_full_path} "
486
- COMMAND "${CMAKE_SOURCE_DIR} /developer-scripts/style.pl" "${script_full_path} " )
503
+ if (style_pl )
504
+ add_test (NAME "style:${script_full_path} "
505
+ COMMAND "${style_pl} " "${script_full_path} " )
506
+ endif ()
487
507
endfunction ()
488
508
509
+ #------------------------------------------------------------------------------
510
+ # Add custom properties on targets for controling number of images during tests
511
+ #------------------------------------------------------------------------------
512
+ define_property (TARGET
513
+ PROPERTY MIN_IMAGES
514
+ BRIEF_DOCS "Minimum allowable images for the test <integer>"
515
+ FULL_DOCS "Property to mark executable targets run as tests that they require at least <MIN_IMAGES> images to run"
516
+ )
517
+
518
+ define_property (TARGET
519
+ PROPERTY POWER_2_IMGS
520
+ BRIEF_DOCS "True if test must be run with a power of 2 images (T/F)"
521
+ FULL_DOCS "Property to mark executable targets run as tests that they require 2^n images."
522
+ )
523
+
524
+
489
525
#-------------------------------
490
526
# Recurse into the src directory
491
527
#-------------------------------
@@ -552,20 +588,32 @@ endif ()
552
588
include ( ProcessorCount )
553
589
ProcessorCount (N_CPU )
554
590
function (add_caf_test name num_caf_img test_target )
555
- # Function to add MPI tests.
556
- if ( ((N_CPU LESS num_caf_img ) OR (N_CPU EQUAL 0 )) )
557
- message (STATUS "Test ${name} is oversubscribed: ${num_caf_img} CAF images requested with ${N_CPU} system processor available." )
558
- if ( openmpi )
559
- if ( N_CPU LESS 2 )
560
- set ( num_caf_img 2 )
561
- endif ()
562
- set (test_parameters --oversubscribe )
563
- message ( STATUS "Open-MPI back end detected, passing --oversubscribe for oversubscribed test, ${name} , with ${num_caf_img} ranks/images." )
564
- endif ()
565
- endif ()
566
- set (test_parameters -np ${num_caf_img} ${test_parameters} )
567
- add_test (NAME ${name} COMMAND "${CMAKE_BINARY_DIR} /${CMAKE_INSTALL_BINDIR} /cafrun" ${test_parameters} "${CMAKE_RUNTIME_OUTPUT_DIRECTORY} /${test_target} " )
568
- set_property (TEST ${name} PROPERTY PASS_REGULAR_EXPRESSION "Test passed." )
591
+ # Function to add MPI tests.
592
+ if (TARGET ${test_target} )
593
+ get_target_property (min_test_imgs ${test_target} MIN_IMAGES )
594
+ elseif (TARGET build_${test_target} )
595
+ get_target_property (min_test_imgs build_${test_target} MIN_IMAGES )
596
+ endif ()
597
+ if (min_test_imgs )
598
+ if (num_caf_img LESS min_test_imgs )
599
+ message ( FATAL_ERROR "Test ${name} requires ${min_test_imgs} but was only given ${num_caf_images} " )
600
+ endif ()
601
+ endif ()
602
+ if ( ((N_CPU LESS num_caf_img ) OR (N_CPU EQUAL 0 )) )
603
+ message (STATUS "Test ${name} is oversubscribed: ${num_caf_img} CAF images requested with ${N_CPU} system processor available." )
604
+ if ( openmpi )
605
+ if (min_test_imgs )
606
+ set ( num_caf_img ${min_test_imgs} )
607
+ elseif ( N_CPU LESS 2 )
608
+ set ( num_caf_img 2 )
609
+ endif ()
610
+ set (test_parameters --oversubscribe )
611
+ message ( STATUS "Open-MPI back end detected, passing --oversubscribe for oversubscribed test, ${name} , with ${num_caf_img} ranks/images." )
612
+ endif ()
613
+ endif ()
614
+ set (test_parameters -np ${num_caf_img} ${test_parameters} )
615
+ add_test (NAME ${name} COMMAND "bash" "${CMAKE_BINARY_DIR} /${CMAKE_INSTALL_BINDIR} /cafrun" ${test_parameters} "${CMAKE_RUNTIME_OUTPUT_DIRECTORY} /${test_target} " )
616
+ set_property (TEST ${name} PROPERTY PASS_REGULAR_EXPRESSION "Test passed." )
569
617
endfunction (add_caf_test )
570
618
571
619
#--------------
0 commit comments