Skip to content

Commit 44ecb6a

Browse files
authored
Merge pull request #624 from ericlars/ifort_ILP
ILP windows fix
2 parents fe5af11 + d045530 commit 44ecb6a

File tree

5 files changed

+27
-7
lines changed

5 files changed

+27
-7
lines changed

CBLAS/include/cblas.h

Lines changed: 5 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
@@ -15,10 +16,12 @@ extern "C" { /* Assume C declarations for C++ */
1516
/*
1617
* Integer type
1718
*/
19+
#ifndef CBLAS_INT
1820
#ifdef WeirdNEC
19-
#define CBLAS_INT long
21+
#define CBLAS_INT int64_t
2022
#else
21-
#define CBLAS_INT int
23+
#define CBLAS_INT int32_t
24+
#endif
2225
#endif
2326

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

CBLAS/include/cblas_f77.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#define CBLAS_F77_H
1111

1212
#include <stdarg.h>
13+
#include <stdint.h>
1314

1415
/* It seems all current Fortran compilers put strlen at end.
1516
* Some historical compilers put strlen after the str argument
@@ -24,10 +25,12 @@
2425
#define F77_STRLEN(a) (_fcdlen)
2526
#endif
2627

28+
#ifndef F77_INT
2729
#ifdef WeirdNEC
28-
#define F77_INT long
30+
#define F77_INT int64_t
2931
#else
30-
#define F77_INT int
32+
#define F77_INT int32_t
33+
#endif
3134
#endif
3235

3336
#ifdef F77_CHAR

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]")

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")

LAPACKE/include/lapacke_config.h

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

4343
#include <stdlib.h>
44+
#include <stdint.h>
4445

4546
#ifndef lapack_int
4647
#if defined(LAPACK_ILP64)
47-
#define lapack_int long
48+
#define lapack_int int64_t
4849
#else
49-
#define lapack_int int
50+
#define lapack_int int32_t
5051
#endif
5152
#endif
5253

0 commit comments

Comments
 (0)