Skip to content

Commit

Permalink
Merge pull request #624 from ericlars/ifort_ILP
Browse files Browse the repository at this point in the history
ILP windows fix
  • Loading branch information
langou authored Sep 27, 2021
2 parents fe5af11 + d045530 commit 44ecb6a
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 7 deletions.
7 changes: 5 additions & 2 deletions CBLAS/include/cblas.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef CBLAS_H
#define CBLAS_H
#include <stddef.h>
#include <stdint.h>


#ifdef __cplusplus
Expand All @@ -15,10 +16,12 @@ extern "C" { /* Assume C declarations for C++ */
/*
* Integer type
*/
#ifndef CBLAS_INT
#ifdef WeirdNEC
#define CBLAS_INT long
#define CBLAS_INT int64_t
#else
#define CBLAS_INT int
#define CBLAS_INT int32_t
#endif
#endif

typedef enum CBLAS_LAYOUT {CblasRowMajor=101, CblasColMajor=102} CBLAS_LAYOUT;
Expand Down
7 changes: 5 additions & 2 deletions CBLAS/include/cblas_f77.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#define CBLAS_F77_H

#include <stdarg.h>
#include <stdint.h>

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

#ifndef F77_INT
#ifdef WeirdNEC
#define F77_INT long
#define F77_INT int64_t
#else
#define F77_INT int
#define F77_INT int32_t
#endif
#endif

#ifdef F77_CHAR
Expand Down
13 changes: 13 additions & 0 deletions CMAKE/CheckLAPACKCompilerFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,19 @@ macro( CheckLAPACKCompilerFlags )

set( FPE_EXIT FALSE )

# FORTRAN ILP default
if ( FORTRAN_ILP )
if( CMAKE_Fortran_COMPILER_ID STREQUAL "Intel" )
if ( WIN32 )
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /integer-size:64")
else ()
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -integer-size 64")
endif()
else()
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdefault-integer-8")
endif()
endif()

# GNU Fortran
if( CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" )
if( "${CMAKE_Fortran_FLAGS}" MATCHES "-ffpe-trap=[izoupd]")
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ if(BUILD_INDEX64)
set(LAPACKELIB "lapacke64")
set(TMGLIB "tmglib64")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWeirdNEC -DLAPACK_ILP64 -DHAVE_LAPACK_CONFIG_H")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdefault-integer-8")
set(FORTRAN_ILP TRUE)
else()
set(BLASLIB "blas")
set(CBLASLIB "cblas")
Expand Down
5 changes: 3 additions & 2 deletions LAPACKE/include/lapacke_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,13 @@ extern "C" {
#endif /* __cplusplus */

#include <stdlib.h>
#include <stdint.h>

#ifndef lapack_int
#if defined(LAPACK_ILP64)
#define lapack_int long
#define lapack_int int64_t
#else
#define lapack_int int
#define lapack_int int32_t
#endif
#endif

Expand Down

0 comments on commit 44ecb6a

Please sign in to comment.