Skip to content

Commit a112e0a

Browse files
committed
Merge branch 'release/3.11.0'
2 parents c6e04d6 + 83ca800 commit a112e0a

File tree

122 files changed

+1361
-377
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+1361
-377
lines changed

‎CMakeLists.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#
1212
# -DCMAKE_INSTALL_PREFIX=/path/to/install
1313

14-
cmake_minimum_required( VERSION 3.11.0 FATAL_ERROR )
14+
cmake_minimum_required( VERSION 3.18 FATAL_ERROR )
1515

1616
set( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH} )
1717

‎cmake/FindARMPL.cmake‎

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# (C) Copyright 2011- ECMWF.
2+
#
3+
# This software is licensed under the terms of the Apache Licence Version 2.0
4+
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
5+
# In applying this licence, ECMWF does not waive the privileges and immunities
6+
# granted to it by virtue of its status as an intergovernmental organisation
7+
# nor does it submit to any jurisdiction.
8+
9+
# - Try to find ARMPL
10+
# Once done this will define
11+
#
12+
# ARMPL_FOUND - system has ARM Performance Libraries
13+
# ARMPL_INCLUDE_DIRS - the ARMPL include directories
14+
# ARMPL_LIBRARIES - link these to use ARMPL
15+
#
16+
# The following paths will be searched with priority if set in CMake or env
17+
#
18+
# ARMPLROOT - root directory of the ARMPL installation
19+
# ARMPL_PATH - root directory of the ARMPL installation
20+
# ARMPL_ROOT - root directory of the ARMPL installation
21+
22+
option( ARMPL_PARALLEL "if armpl shoudl be parallel" OFF )
23+
24+
if( ARMPL_PARALLEL )
25+
26+
set( __armpl_lib_suffix "_mp" )
27+
28+
find_package(Threads)
29+
30+
else()
31+
32+
set( __armpl_lib_suffix "" )
33+
34+
endif()
35+
36+
# Search with priority for ARMPLROOT, ARMPL_PATH and ARMPL_ROOT if set in CMake or env
37+
find_path(ARMPL_INCLUDE_DIR armpl.h
38+
PATHS ${ARMPLROOT} ${ARMPL_PATH} ${ARMPL_ROOT} ${ARMPL_DIR} $ENV{ARMPLROOT} $ENV{ARMPL_PATH} $ENV{ARMPL_ROOT} $ENV{ARMPL_DIR}
39+
PATH_SUFFIXES include NO_DEFAULT_PATH)
40+
41+
find_path(ARMPL_INCLUDE_DIR armpl.h
42+
PATH_SUFFIXES include)
43+
44+
if( ARMPL_INCLUDE_DIR ) # use include dir to find libs
45+
46+
set( ARMPL_INCLUDE_DIRS ${ARMPL_INCLUDE_DIR} )
47+
48+
find_library( ARMPL_LIB
49+
PATHS ${ARMPLROOT} ${ARMPL_PATH} ${ARMPL_ROOT} ${ARMPL_DIR} $ENV{ARMPLROOT} $ENV{ARMPL_PATH} $ENV{ARMPL_ROOT} $ENV{ARMPL_DIR}
50+
PATH_SUFFIXES "lib"
51+
NAMES armpl_lp64${__armpl_lib_suffix} )
52+
53+
if( ARMPL_LIB )
54+
set( ARMPL_LIBRARIES ${ARMPL_LIB} )
55+
endif()
56+
57+
endif()
58+
59+
include(FindPackageHandleStandardArgs)
60+
61+
find_package_handle_standard_args( ARMPL DEFAULT_MSG
62+
ARMPL_LIBRARIES ARMPL_INCLUDE_DIRS )
63+
64+
mark_as_advanced( ARMPL_INCLUDE_DIR ARMPL_LIB )

‎cmake/FindFFTW.cmake‎

Lines changed: 98 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,14 @@
2828
#
2929
# * Find MKL implementation via FFTW_ENABLE_MKL
3030
#
31-
# * If FFTW_ENABLE_MKL is explicitely set to ON, only MKL is considered
32-
# * If FFTW_ENABLE_MKL is explictely set to OFF, MKL will not be considered
33-
# * If FFTW_ENABLE_MKL is undefined, MKL is preferred unless ENABLE_MKL is explicitely set to OFF
31+
# * If FFTW_ENABLE_MKL is explicitly set to ON, only MKL is considered
32+
# * If FFTW_ENABLE_MKL is explicitly set to OFF, MKL will not be considered
33+
# * If FFTW_ENABLE_MKL is undefined, MKL is preferred unless ENABLE_MKL is explicitly set to OFF
3434
# * Note: MKLROOT environment variable helps to detect MKL (See FindMKL.cmake)
3535
#
36-
# * Find official FFTW impelementation
36+
# * Find ARMPL or NVPL implementations, via FFTW_ENABLE_ARMPL or FFTW_ENABLE_NVPL, with behaviour as for MKL
37+
#
38+
# * Find official FFTW implementation
3739
#
3840
# * FFTW_ROOT variable / environment variable helps to detect FFTW
3941
#
@@ -72,6 +74,8 @@
7274
# :FFTW_LIBRARIES: User overriden FFTW libraries
7375
# :FFTW_INCLUDE_DIRS: User overriden FFTW includes directories
7476
# :FFTW_ENABLE_MKL: User requests use of MKL implementation
77+
# :FFTW_ENABLE_ARMPL: User requests use of ARMPL implementation
78+
# :FFTW_ENABLE_NVPL: User requests use of NVPL implementation
7579
#
7680
##############################################################################
7781

@@ -150,6 +154,96 @@ if( NOT FFTW_FOUND_ALL_COMPONENTS )
150154
endif()
151155
endif()
152156

157+
### Check ARMPL
158+
FFTW_CHECK_ALL_COMPONENTS()
159+
if( NOT FFTW_FOUND_ALL_COMPONENTS )
160+
161+
if( NOT DEFINED FFTW_ENABLE_ARMPL AND NOT DEFINED ENABLE_ARMPL )
162+
set( FFTW_ENABLE_ARMPL ON )
163+
set( FFTW_FindARMPL_OPTIONS QUIET )
164+
elseif( FFTW_ENABLE_ARMPL )
165+
set( FFTW_ARMPL_REQUIRED TRUE )
166+
elseif( ENABLE_ARMPL AND NOT DEFINED FFTW_ENABLE_ARMPL )
167+
set( FFTW_ENABLE_ARMPL ON )
168+
endif()
169+
170+
if( FFTW_ENABLE_ARMPL )
171+
if( NOT ARMPL_FOUND )
172+
find_package( ARMPL ${FFTW_FindARMPL_OPTIONS} )
173+
endif()
174+
if( ARMPL_FOUND )
175+
if( NOT FFTW_INCLUDE_DIRS )
176+
set( FFTW_INCLUDE_DIRS ${ARMPL_INCLUDE_DIRS} )
177+
endif()
178+
if( NOT FFTW_LIBRARIES )
179+
set( FFTW_LIBRARIES ${ARMPL_LIBRARIES} )
180+
endif()
181+
182+
foreach( _component ${FFTW_FIND_COMPONENTS} )
183+
set( FFTW_${_component}_FOUND TRUE )
184+
set( FFTW_${_component}_LIBRARIES ${ARMPL_LIBRARIES} )
185+
endforeach()
186+
else()
187+
if( FFTW_ARMPL_REQUIRED )
188+
if( FFTW_FIND_REQUIRED )
189+
message(CRITICAL "FindFFTW: ARMPL required, but was not found" )
190+
else()
191+
if( NOT FFTW_ARMPL_FIND_QUIETLY )
192+
message(STATUS "FindFFTW: ARMPL required, but was not found" )
193+
endif()
194+
set( FFTW_FOUND FALSE )
195+
return()
196+
endif()
197+
endif()
198+
endif()
199+
endif()
200+
endif()
201+
202+
### Check NVPL
203+
FFTW_CHECK_ALL_COMPONENTS()
204+
if( NOT FFTW_FOUND_ALL_COMPONENTS )
205+
206+
if( NOT DEFINED FFTW_ENABLE_NVPL AND NOT DEFINED ENABLE_NVPL )
207+
set( FFTW_ENABLE_NVPL ON )
208+
set( FFTW_FindNVPL_OPTIONS QUIET )
209+
elseif( FFTW_ENABLE_NVPL )
210+
set( FFTW_NVPL_REQUIRED TRUE )
211+
elseif( ENABLE_NVPL AND NOT DEFINED FFTW_ENABLE_NVPL )
212+
set( FFTW_ENABLE_NVPL ON )
213+
endif()
214+
215+
if( FFTW_ENABLE_NVPL )
216+
if( NOT NVPL_FOUND )
217+
find_package( NVPL ${FFTW_FindNVPL_OPTIONS} )
218+
endif()
219+
if( NVPL_FOUND )
220+
if( NOT FFTW_INCLUDE_DIRS )
221+
set( FFTW_INCLUDE_DIRS ${NVPL_INCLUDE_DIRS} )
222+
endif()
223+
if( NOT FFTW_LIBRARIES )
224+
set( FFTW_LIBRARIES ${NVPL_LIBRARIES} )
225+
endif()
226+
227+
foreach( _component ${FFTW_FIND_COMPONENTS} )
228+
set( FFTW_${_component}_FOUND TRUE )
229+
set( FFTW_${_component}_LIBRARIES ${NVPL_LIBRARIES} )
230+
endforeach()
231+
else()
232+
if( FFTW_NVPL_REQUIRED )
233+
if( FFTW_FIND_REQUIRED )
234+
message(CRITICAL "FindFFTW: NVPL required, but NVPL was not found" )
235+
else()
236+
if( NOT FFTW_NVPL_FIND_QUIETLY )
237+
message(STATUS "FindFFTW: NVPL required, but NVPL was not found" )
238+
endif()
239+
set( FFTW_FOUND FALSE )
240+
return()
241+
endif()
242+
endif()
243+
endif()
244+
endif()
245+
endif()
246+
153247
### Standard FFTW
154248
if( (NOT FFTW_ROOT) AND EXISTS $ENV{FFTW_ROOT} )
155249
set( FFTW_ROOT $ENV{FFTW_ROOT} )

‎cmake/FindNVPL.cmake‎

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# (C) Copyright 2011- ECMWF.
2+
#
3+
# This software is licensed under the terms of the Apache Licence Version 2.0
4+
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
5+
# In applying this licence, ECMWF does not waive the privileges and immunities
6+
# granted to it by virtue of its status as an intergovernmental organisation
7+
# nor does it submit to any jurisdiction.
8+
9+
# - Try to find NVPL
10+
# Once done this will define
11+
#
12+
# NVPL_FOUND - system has Nvidia Performance Libraries
13+
# NVPL_INCLUDE_DIRS - the NVPL include directories
14+
# NVPL_LIBRARIES - link these to use NVPL
15+
#
16+
# The following paths will be searched with priority if set in CMake or env
17+
#
18+
# NVPLROOT - root directory of the NVPL installation
19+
# NVPL_PATH - root directory of the NVPL installation
20+
# NVPL_ROOT - root directory of the NVPL installation
21+
22+
option( NVPL_PARALLEL "if nvpl shoudl be parallel" OFF )
23+
24+
if( NVPL_PARALLEL )
25+
26+
set( __nvpl_lib_suffix "_gomp" )
27+
28+
find_package(Threads)
29+
30+
else()
31+
32+
set( __nvpl_lib_suffix "_seq" )
33+
34+
endif()
35+
36+
# Search with priority for NVPLROOT, NVPL_PATH and NVPL_ROOT if set in CMake or env
37+
find_path(NVPL_INCLUDE_DIR nvpl_blas.h
38+
PATHS ${NVPLROOT} ${NVPL_PATH} ${NVPL_ROOT} $ENV{NVPLROOT} $ENV{NVPL_PATH} $ENV{NVPL_ROOT}
39+
PATH_SUFFIXES include NO_DEFAULT_PATH)
40+
41+
find_path(NVPL_INCLUDE_DIR_FFTW fftw3.h
42+
PATH_SUFFIXES include/nvpl_fftw)
43+
44+
if( NVPL_INCLUDE_DIR ) # use include dir to find libs
45+
46+
set( NVPL_INCLUDE_DIRS ${NVPL_INCLUDE_DIR} ${NVPL_INCLUDE_DIR_FFTW} )
47+
48+
49+
# set(CMAKE_FIND_DEBUG_MODE TRUE)
50+
find_library( NVPL_LIB_BLAS_CORE
51+
PATHS ${NVPLROOT} ${NVPL_PATH} ${NVPL_ROOT} $ENV{NVPLROOT} $ENV{NVPL_PATH} $ENV{NVPL_ROOT}
52+
PATH_SUFFIXES "lib"
53+
NAMES nvpl_blas_core )
54+
55+
find_library( NVPL_LIB_BLAS
56+
PATHS ${NVPLROOT} ${NVPL_PATH} ${NVPL_ROOT} $ENV{NVPLROOT} $ENV{NVPL_PATH} $ENV{NVPL_ROOT}
57+
PATH_SUFFIXES "lib"
58+
NAMES nvpl_blas_lp64${__nvpl_lib_suffix} )
59+
60+
find_library( NVPL_LIB_FFTW
61+
PATHS ${NVPLROOT} ${NVPL_PATH} ${NVPL_ROOT} $ENV{NVPLROOT} $ENV{NVPL_PATH} $ENV{NVPL_ROOT}
62+
PATH_SUFFIXES "lib"
63+
NAMES nvpl_fftw )
64+
65+
# set(CMAKE_FIND_DEBUG_MODE FALSE)
66+
67+
if( NVPL_LIB_BLAS_CORE AND NVPL_LIB_BLAS AND NVPL_LIB_FFTW )
68+
set( NVPL_LIBRARIES ${NVPL_LIB_BLAS_CORE} ${NVPL_LIB_BLAS} ${NVPL_LIB_FFTW} )
69+
endif()
70+
71+
endif()
72+
73+
include(FindPackageHandleStandardArgs)
74+
75+
find_package_handle_standard_args( NVPL DEFAULT_MSG
76+
NVPL_LIBRARIES NVPL_INCLUDE_DIRS )
77+
78+
mark_as_advanced( NVPL_INCLUDE_DIR NVPL_LIB_BLAS NVPL_LIB_FFTW )

‎cmake/VERSION‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.10.0
1+
3.11.0

‎cmake/determine-nec.F90‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#ifndef __NEC__
2+
#error Not the NEC compiler
3+
#endif
4+
program determine_nec
5+
end program
6+

‎cmake/ecbuild_add_c_flags.cmake‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ include(ecbuild_add_lang_flags)
3737

3838
macro( ecbuild_add_c_flags )
3939
ecbuild_debug("call ecbuild_add_c_flags( ${ARGV} )")
40-
ecbuild_add_lang_flags( ${ARGV} LANG C )
40+
ecbuild_add_lang_flags( FLAGS ${ARGV} LANG C )
4141
endmacro()
4242

4343
macro( cmake_add_c_flags )

‎cmake/ecbuild_add_cxx_flags.cmake‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ include(ecbuild_add_lang_flags)
3737

3838
macro( ecbuild_add_cxx_flags )
3939
ecbuild_debug("call ecbuild_add_cxx_flags( ${ARGV} )")
40-
ecbuild_add_lang_flags( ${ARGV} LANG CXX )
40+
ecbuild_add_lang_flags( FLAGS ${ARGV} LANG CXX )
4141
endmacro()
4242

4343
macro( cmake_add_cxx_flags )

‎cmake/ecbuild_add_fortran_flags.cmake‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ include( CheckFortranCompilerFlag )
4040
include(ecbuild_add_lang_flags)
4141

4242
macro( ecbuild_add_fortran_flags )
43-
ecbuild_debug("call ecbuild_add_fortran_flags( ${ARGV} )")
44-
ecbuild_add_lang_flags( ${ARGV} LANG Fortran )
43+
ecbuild_debug("call ecbuild_add_fortran_flags( ${ARGV} )")
44+
ecbuild_add_lang_flags( FLAGS ${ARGV} LANG Fortran )
4545
endmacro()
4646

4747
macro( cmake_add_fortran_flags )

‎cmake/ecbuild_add_lang_flags.cmake‎

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
#
1818
# Add compiler flags to the CMAKE_${lang}_FLAGS only if supported by compiler. ::
1919
#
20-
# ecbuild_add_lang_flags( <flag1> [ <flag2> ... ]
21-
# LANG [C|CXX|Fortran]
22-
# [ BUILD <build> ]
23-
# [ NAME <name> ]
24-
# [ NO_FAIL ] )
20+
# ecbuild_add_lang_flags( FLAGS <flag1> [ <flag2> ... ]
21+
# LANG [C|CXX|Fortran]
22+
# [ BUILD <build> ]
23+
# [ NAME <name> ]
24+
# [ NO_FAIL ] )
2525
#
2626
# Options
2727
# -------
@@ -40,15 +40,13 @@
4040
#
4141
##############################################################################
4242

43-
function( ecbuild_add_lang_flags _in_flags )
43+
function( ecbuild_add_lang_flags )
4444

4545
ecbuild_debug("call ecbuild_add_lang_flags( ${ARGV} )")
4646

47-
set( _flags ${_in_flags} )
48-
4947
set( options NO_FAIL )
5048
set( single_value_args BUILD NAME LANG )
51-
set( multi_value_args )
49+
set( multi_value_args FLAGS )
5250

5351
cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}" ${_FIRST_ARG} ${ARGN} )
5452

@@ -58,6 +56,20 @@ function( ecbuild_add_lang_flags _in_flags )
5856
ecbuild_critical("ecbuild_add_lang_flags() called without LANG parameter")
5957
endif()
6058

59+
if(DEFINED _PAR_FLAGS)
60+
set(_flags ${_PAR_FLAGS})
61+
else()
62+
list(FIND ARGV FLAGS ARG_FOUND)
63+
if( ARG_FOUND STREQUAL -1 )
64+
ecbuild_critical("ecbuild_add_lang_flags() called without FLAGS parameter")
65+
endif()
66+
return()
67+
endif()
68+
69+
# To handle the case where FLAGS is a list
70+
string( REPLACE ";" " " _flags "${_flags}" )
71+
72+
6173
ecbuild_debug( "CMAKE_${_lang}_COMPILER_LOADED [${CMAKE_${_lang}_COMPILER_LOADED}]" )
6274

6375
if( CMAKE_${_lang}_COMPILER_LOADED )

0 commit comments

Comments
 (0)