Skip to content

Commit 0977160

Browse files
committed
Document SUITESPARSE_C_TO_FORTRAN in README.md
Give background for why this configuration parameter is needed, describe its usage and give some hints for when a user might need to set this parameter manually.
1 parent 29fc665 commit 0977160

File tree

2 files changed

+48
-4
lines changed

2 files changed

+48
-4
lines changed

README.md

+24-2
Original file line numberDiff line numberDiff line change
@@ -1072,10 +1072,32 @@ build type). The static libraries will not be built (since
10721072

10731073
If `ON`, use the Fortran compiler to determine how C calls Fortan, and to
10741074
build several optional Fortran routines. If `OFF`, use
1075-
`SUITESPARSE_C_TO_FORTRAN` to define how C calls Fortran (see
1076-
`SuiteSparse_config/cmake_modules/SuiteSparsePolicy.cmake` for details).
1075+
`SUITESPARSE_C_TO_FORTRAN` to define how C calls Fortran.
10771076
Default: `ON`.
10781077

1078+
* `SUITESPARSE_C_TO_FORTRAN`
1079+
1080+
A string that defines how C calls Fortran (i.e., functions exported by the
1081+
BLAS library). This setting is used if no working Fortran compiler could be
1082+
detected or `SUITESPARSE_USE_FORTRAN` is set to `OFF`. This string is to be
1083+
read as the argument list and the body of a preprocessor macro. The first
1084+
argument to that macro is any Fortran function name in lowercase letters.
1085+
The second argument is the same function name in uppercase letters. The body
1086+
defines by which function name Fortran functions are called. This is
1087+
necessary because Fortran is case-insensitive, and different Fortran
1088+
compilers use different name mangling conventions. If a MSVC C/C++ compiler
1089+
is used, this defaults to `"(name,NAME) name"` (i.e., lower case without
1090+
trailing underscore). That is the name mangling convention for the Intel
1091+
Fortran compiler on Windows. If any other C/C++ compilers are used, this
1092+
defaults to `"(name,NAME) name##_"` (i.e., lower case with trailing
1093+
underscore). That is the name mangling convention for most of the commonly
1094+
used Fortran compilers (like `ifx` on platforms other than Windows,
1095+
`gfortran`, `flang`, ...). The latter name mangling convention is also used
1096+
by default by OpenBLAS (independent on the platform or the compiler used to
1097+
build OpenBLAS). You might need to configure with
1098+
`-DSUITESPARSE_C_TO_FORTRAN="(name,NAME) name##_"` if you'd like to build
1099+
SuiteSparse using a MSVC compiler and link to OpenBLAS.
1100+
10791101
Additional options are available for specific packages:
10801102

10811103
* `UMFPACK_USE_CHOLMOD`:

SuiteSparse_config/Config/README.md.in

+24-2
Original file line numberDiff line numberDiff line change
@@ -1072,10 +1072,32 @@ build type). The static libraries will not be built (since
10721072

10731073
If `ON`, use the Fortran compiler to determine how C calls Fortan, and to
10741074
build several optional Fortran routines. If `OFF`, use
1075-
`SUITESPARSE_C_TO_FORTRAN` to define how C calls Fortran (see
1076-
`SuiteSparse_config/cmake_modules/SuiteSparsePolicy.cmake` for details).
1075+
`SUITESPARSE_C_TO_FORTRAN` to define how C calls Fortran.
10771076
Default: `ON`.
10781077

1078+
* `SUITESPARSE_C_TO_FORTRAN`
1079+
1080+
A string that defines how C calls Fortran (i.e., functions exported by the
1081+
BLAS library). This setting is used if no working Fortran compiler could be
1082+
detected or `SUITESPARSE_USE_FORTRAN` is set to `OFF`. This string is to be
1083+
read as the argument list and the body of a preprocessor macro. The first
1084+
argument to that macro is any Fortran function name in lowercase letters.
1085+
The second argument is the same function name in uppercase letters. The body
1086+
defines by which function name Fortran functions are called. This is
1087+
necessary because Fortran is case-insensitive, and different Fortran
1088+
compilers use different name mangling conventions. If a MSVC C/C++ compiler
1089+
is used, this defaults to `"(name,NAME) name"` (i.e., lower case without
1090+
trailing underscore). That is the name mangling convention for the Intel
1091+
Fortran compiler on Windows. If any other C/C++ compilers are used, this
1092+
defaults to `"(name,NAME) name##_"` (i.e., lower case with trailing
1093+
underscore). That is the name mangling convention for most of the commonly
1094+
used Fortran compilers (like `ifx` on platforms other than Windows,
1095+
`gfortran`, `flang`, ...). The latter name mangling convention is also used
1096+
by default by OpenBLAS (independent on the platform or the compiler used to
1097+
build OpenBLAS). You might need to configure with
1098+
`-DSUITESPARSE_C_TO_FORTRAN="(name,NAME) name##_"` if you'd like to build
1099+
SuiteSparse using a MSVC compiler and link to OpenBLAS.
1100+
10791101
Additional options are available for specific packages:
10801102

10811103
* `UMFPACK_USE_CHOLMOD`:

0 commit comments

Comments
 (0)