Skip to content

Commit 8fe3555

Browse files
ericlarsmmuetzel
authored andcommitted
ILP support
long's in windows are 4 bytes (MSVS, intel compilers). Use int64_t and int32_t to ensure 8 byte integers for ILP interface. support 8 byte integer flag for intel ifort compiler
1 parent 3efbf96 commit 8fe3555

File tree

5 files changed

+27
-6
lines changed

5 files changed

+27
-6
lines changed

lapack-netlib/CBLAS/include/cblas.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#ifndef CBLAS_H
22
#define CBLAS_H
33
#include <stddef.h>
4+
#include <stdint.h>
45

56

67
#ifdef __cplusplus
@@ -11,9 +12,9 @@ extern "C" { /* Assume C declarations for C++ */
1112
* Enumerated and derived types
1213
*/
1314
#ifdef WeirdNEC
14-
#define CBLAS_INDEX long
15+
#define CBLAS_INDEX int64_t
1516
#else
16-
#define CBLAS_INDEX int
17+
#define CBLAS_INDEX int32_t
1718
#endif
1819

1920
typedef enum {CblasRowMajor=101, CblasColMajor=102} CBLAS_LAYOUT;

lapack-netlib/CBLAS/include/cblas_f77.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#ifndef CBLAS_F77_H
1010
#define CBLAS_F77_H
1111

12+
#include <stdint.h>
13+
1214
#ifdef CRAY
1315
#include <fortran.h>
1416
#define F77_CHAR _fcd
@@ -17,8 +19,12 @@
1719
#define F77_STRLEN(a) (_fcdlen)
1820
#endif
1921

22+
#ifndef F77_INT
2023
#ifdef WeirdNEC
21-
#define F77_INT long
24+
#define F77_INT int64_t
25+
#else
26+
#define F77_INT int32_t
27+
#endif
2228
#endif
2329

2430
#ifdef F77_CHAR

lapack-netlib/CMAKE/CheckLAPACKCompilerFlags.cmake

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,19 @@ macro( CheckLAPACKCompilerFlags )
1414

1515
set( FPE_EXIT FALSE )
1616

17+
# FORTRAN ILP default
18+
if ( FORTRAN_ILP )
19+
if( CMAKE_Fortran_COMPILER_ID STREQUAL "Intel" )
20+
if ( WIN32 )
21+
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /integer-size:64")
22+
else ()
23+
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -integer-size 64")
24+
endif()
25+
else()
26+
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdefault-integer-8")
27+
endif()
28+
endif()
29+
1730
# GNU Fortran
1831
if( CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" )
1932
if( "${CMAKE_Fortran_FLAGS}" MATCHES "-ffpe-trap=[izoupd]")

lapack-netlib/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ if(BUILD_INDEX64)
5353
set(LAPACKELIB "lapacke64")
5454
set(TMGLIB "tmglib64")
5555
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWeirdNEC -DLAPACK_ILP64 -DHAVE_LAPACK_CONFIG_H")
56-
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdefault-integer-8")
56+
set(FORTRAN_ILP TRUE)
5757
else()
5858
set(BLASLIB "blas")
5959
set(CBLASLIB "cblas")

lapack-netlib/LAPACKE/include/lapacke_config.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,13 @@ extern "C" {
4949
#endif /* __cplusplus */
5050

5151
#include <stdlib.h>
52+
#include <stdint.h>
5253

5354
#ifndef lapack_int
5455
#if defined(LAPACK_ILP64)
55-
#define lapack_int long
56+
#define lapack_int int64_t
5657
#else
57-
#define lapack_int int
58+
#define lapack_int int32_t
5859
#endif
5960
#endif
6061

0 commit comments

Comments
 (0)