Skip to content

Commit 060dec7

Browse files
authored
Merge branch 'master' into subprocess
2 parents 15689bc + 324e73f commit 060dec7

File tree

121 files changed

+580435
-544986
lines changed

Some content is hidden

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

121 files changed

+580435
-544986
lines changed

.github/workflows/ci_windows.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ jobs:
1313
fail-fast: false
1414
matrix:
1515
include: [
16-
{ msystem: MINGW64, arch: x86_64 },
17-
{ msystem: MINGW32, arch: i686 }
16+
{ msystem: MINGW64, arch: x86_64 }
1817
]
1918
defaults:
2019
run:

.github/workflows/fpm-deployment.yml

+12-1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ jobs:
3838
- run: | # Just for deployment: create stdlib-fpm folder
3939
python config/fypp_deployment.py --deploy_stdlib_fpm
4040
41+
- run: | # Just for deployment: create stdlib-fpm-ilp64 folder
42+
python config/fypp_deployment.py --deploy_stdlib_fpm --with_ilp64
43+
4144
- run: | # Use fpm gnu ci to check xdp and qp
4245
python config/fypp_deployment.py --with_xdp --with_qp
4346
fpm test --profile release --flag '-DWITH_XDP -DWITH_QP'
@@ -48,4 +51,12 @@ jobs:
4851
if: github.event_name != 'pull_request'
4952
with:
5053
BRANCH: stdlib-fpm
51-
FOLDER: stdlib-fpm
54+
FOLDER: stdlib-fpm
55+
56+
# Update and deploy the f90 files generated by github-ci to the `stdlib-fpm-ilp64` branch.
57+
- name: Deploy with 64-bit integer support 🚀
58+
uses: JamesIves/[email protected]
59+
if: github.event_name != 'pull_request'
60+
with:
61+
BRANCH: stdlib-fpm-ilp64
62+
FOLDER: stdlib-fpm-ilp64

CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ list(
6262
"-DWITH_CBOOL=$<BOOL:${WITH_CBOOL}>"
6363
"-DWITH_QP=$<BOOL:${WITH_QP}>"
6464
"-DWITH_XDP=$<BOOL:${WITH_XDP}>"
65+
"-DWITH_ILP64=$<BOOL:${WITH_ILP64}>"
6566
"-DPROJECT_VERSION_MAJOR=${PROJECT_VERSION_MAJOR}"
6667
"-DPROJECT_VERSION_MINOR=${PROJECT_VERSION_MINOR}"
6768
"-DPROJECT_VERSION_PATCH=${PROJECT_VERSION_PATCH}"

README.md

+30-2
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,15 @@ Name | Version | Platform | Architecture
9090
GCC Fortran | 10, 11, 12, 13 | Ubuntu 22.04.2 LTS | x86_64
9191
GCC Fortran | 10, 11, 12, 13 | macOS 12.6.3 (21G419) | x86_64
9292
GCC Fortran (MSYS) | 13 | Windows Server 2022 (10.0.20348 Build 1547) | x86_64
93-
GCC Fortran (MinGW) | 13 | Windows Server 2022 (10.0.20348 Build 1547) | x86_64, i686
93+
GCC Fortran (MinGW) | 13 | Windows Server 2022 (10.0.20348 Build 1547) | x86_64
9494
Intel oneAPI LLVM | 2024.0 | Ubuntu 22.04.2 LTS | x86_64
9595
Intel oneAPI classic | 2023.1 | macOS 12.6.3 (21G419) | x86_64
9696

9797
The following combinations are known to work, but they are not tested in the CI:
9898

9999
Name | Version | Platform | Architecture
100100
--- | --- | --- | ---
101-
GCC Fortran (MinGW) | 9.3.0, 10.2.0, 11.2.0 | Windows 10 | x86_64, i686
101+
GCC Fortran (MinGW) | 9.3.0, 10.2.0, 11.2.0 | Windows 10 | x86_64
102102

103103
We try to test as many available compilers and platforms as possible.
104104
A list of tested compilers which are currently not working and the respective issue are listed below.
@@ -345,6 +345,34 @@ as well as a specification document or ["spec"](https://stdlib.fortran-lang.org/
345345
Some discussions and prototypes of proposed APIs along with a list of popular open source Fortran projects are available on the
346346
[wiki](https://github.com/fortran-lang/stdlib/wiki).
347347

348+
## BLAS and LAPACK
349+
350+
`stdlib` ships full versions of BLAS and LAPACK, for all `real` and `complex` kinds, through generalized interface modules `stdlib_linalg_blas` and `stdlib_linalg_lapack`.
351+
The 32- and 64-bit implementations may be replaced by external optimized libraries if available, which may allow for faster code.
352+
When linking against external BLAS/LAPACK libraries, the user should define macros `STDLIB_EXTERNAL_BLAS` and `STDLIB_EXTERNAL_LAPACK`,
353+
to ensure that the external library version is used instead of the internal implementation.
354+
355+
- In case of a CMake build, the necessary configuration can be added by ensuring both macros are defined:
356+
```
357+
add_compile_definitions(STDLIB_EXTERNAL_BLAS STDLIB_EXTERNAL_LAPACK)
358+
```
359+
- In case of an `fpm` build, the stdlib dependency should be set as follows:
360+
```toml
361+
[dependencies]
362+
stdlib = { git="https://github.com/fortran-lang/stdlib", branch="stdlib-fpm", preprocess.cpp.macros=["STDLIB_EXTERNAL_BLAS", "STDLIB_EXTERNAL_LAPACK"] }
363+
```
364+
365+
Support for 64-bit integer size interfaces of all BLAS and LAPACK procedures may also be enabled
366+
by setting the CMake flag `-DWITH_ILP64=True`. The 64-bit integer version is always built in addition to
367+
the 32-bit integer version, that is always available. Additional macros `STDLIB_EXTERNAL_BLAS_I64` and `STDLIB_EXTERNAL_LAPACK_I64`
368+
may be defined to link against an external 64-bit integer library, such as Intel MKL.
369+
370+
- In case of an `fpm` build, 64-bit integer linear algebra support is given via branch `stdlib-fpm-ilp64`:
371+
```toml
372+
[dependencies]
373+
stdlib = { git="https://github.com/fortran-lang/stdlib", branch="stdlib-fpm-ilp64", preprocess.cpp.macros=["STDLIB_EXTERNAL_BLAS_I64", "STDLIB_EXTERNAL_LAPACK"] }
374+
```
375+
348376
## Contributing
349377

350378
* [Guidelines](CONTRIBUTING.md)

config/CMakeLists.txt

+5
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ if (NOT DEFINED WITH_XDP)
3939
)
4040
set(WITH_XDP ${WITH_XDP} PARENT_SCOPE)
4141
endif()
42+
# Check if WITH_ILP64 is defined; if not, set it to FALSE
43+
if (NOT DEFINED WITH_ILP64)
44+
set(WITH_ILP64 FALSE)
45+
set(WITH_ILP64 ${WITH_ILP64} PARENT_SCOPE)
46+
endif()
4247

4348
# Export a pkg-config file
4449
configure_file(

config/fypp_deployment.py

+20-11
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ def pre_process_fypp(args):
4242
kwd.append("-DWITH_QP=True")
4343
if args.with_xdp:
4444
kwd.append("-DWITH_XDP=True")
45+
if args.with_ilp64:
46+
kwd.append("-DWITH_ILP64=True")
4547

4648
optparser = fypp.get_option_parser()
4749
options, leftover = optparser.parse_args(args=kwd)
@@ -78,32 +80,38 @@ def process_f(file):
7880
return
7981

8082

81-
def deploy_stdlib_fpm():
83+
def deploy_stdlib_fpm(with_ilp64):
8284
"""create the stdlib-fpm folder for backwards compatibility (to be deprecated)
8385
"""
8486
import shutil
8587
prune=(
8688
"test_hash_functions.f90",
8789
"f18estop.f90",
8890
)
89-
if not os.path.exists('stdlib-fpm'+os.sep+'src'):
90-
os.makedirs('stdlib-fpm'+os.sep+'src')
91-
if not os.path.exists('stdlib-fpm'+os.sep+'test'):
92-
os.makedirs('stdlib-fpm'+os.sep+'test')
93-
if not os.path.exists('stdlib-fpm'+os.sep+'example'):
94-
os.makedirs('stdlib-fpm'+os.sep+'example')
91+
92+
if with_ilp64:
93+
base_folder = 'stdlib-fpm-ilp64'
94+
else:
95+
base_folder = 'stdlib-fpm'
96+
97+
if not os.path.exists(base_folder+os.sep+'src'):
98+
os.makedirs(base_folder+os.sep+'src')
99+
if not os.path.exists(base_folder+os.sep+'test'):
100+
os.makedirs(base_folder+os.sep+'test')
101+
if not os.path.exists(base_folder+os.sep+'example'):
102+
os.makedirs(base_folder+os.sep+'example')
95103

96104
def recursive_copy(folder):
97105
for root, _, files in os.walk(folder):
98106
for file in files:
99107
if file not in prune:
100108
if file.endswith((".f90", ".F90", ".dat", ".npy", ".c")):
101-
shutil.copy2(os.path.join(root, file), 'stdlib-fpm'+os.sep+folder+os.sep+file)
109+
shutil.copy2(os.path.join(root, file), base_folder+os.sep+folder+os.sep+file)
102110
recursive_copy('src')
103111
recursive_copy('test')
104112
recursive_copy('example')
105113
for file in ['.gitignore','fpm.toml','LICENSE','VERSION']:
106-
shutil.copy2(file, 'stdlib-fpm'+os.sep+file)
114+
shutil.copy2(file, base_folder+os.sep+file)
107115
return
108116

109117
def fpm_build(args,unknown):
@@ -140,8 +148,9 @@ def fpm_build(args,unknown):
140148
parser.add_argument("--maxrank",type=int, default=4, help="Set the maximum allowed rank for arrays")
141149
parser.add_argument("--with_qp",action='store_true', help="Include WITH_QP in the command")
142150
parser.add_argument("--with_xdp",action='store_true', help="Include WITH_XDP in the command")
151+
parser.add_argument("--with_ilp64",action='store_true', help="Include WITH_ILP64 to build 64-bit integer BLAS/LAPACK")
143152
parser.add_argument("--lnumbering",action='store_true', help="Add line numbering in preprocessed files")
144-
parser.add_argument("--deploy_stdlib_fpm",action='store_true', help="create the stdlib-fpm folder")
153+
parser.add_argument("--deploy_stdlib_fpm",action='store_true', help="create the stdlib-fpm folder")
145154
# external libraries arguments
146155
parser.add_argument("--build", action='store_true', help="Build the project")
147156

@@ -158,7 +167,7 @@ def fpm_build(args,unknown):
158167
# pre process the meta programming fypp files
159168
pre_process_fypp(args)
160169
if args.deploy_stdlib_fpm:
161-
deploy_stdlib_fpm()
170+
deploy_stdlib_fpm(args.with_ilp64)
162171
#==========================================
163172
# build using fpm
164173
if args.build:

config/template.cmake

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
set("@PROJECT_NAME@_WITH_CBOOL" @WITH_CBOOL@)
44
set("@PROJECT_NAME@_WITH_QP" @WITH_QP@)
55
set("@PROJECT_NAME@_WITH_XDP" @WITH_XDP@)
6+
set("@PROJECT_NAME@_WITH_ILP64" @WITH_ILP64@)
67

78
if(NOT TARGET "@PROJECT_NAME@::@PROJECT_NAME@")
89
include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]")

0 commit comments

Comments
 (0)