summaryrefslogtreecommitdiffstats
path: root/Tests/FindLAPACK
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/FindLAPACK')
-rw-r--r--Tests/FindLAPACK/Test/CMakeLists.txt6
-rw-r--r--Tests/FindLAPACK/Test/main.c9
2 files changed, 14 insertions, 1 deletions
diff --git a/Tests/FindLAPACK/Test/CMakeLists.txt b/Tests/FindLAPACK/Test/CMakeLists.txt
index 21b1303..f5d5a73 100644
--- a/Tests/FindLAPACK/Test/CMakeLists.txt
+++ b/Tests/FindLAPACK/Test/CMakeLists.txt
@@ -4,12 +4,18 @@ include(CTest)
find_package(LAPACK REQUIRED)
+if(NOT BLA_SIZEOF_INTEGER)
+ set(BLA_SIZEOF_INTEGER 4)
+endif()
+
add_executable(test_tgt main.c)
target_link_libraries(test_tgt LAPACK::LAPACK)
+target_compile_definitions(test_tgt PUBLIC BLA_SIZEOF_INTEGER=${BLA_SIZEOF_INTEGER})
add_test(NAME test_tgt COMMAND test_tgt)
add_executable(test_var main.c)
target_link_libraries(test_var PRIVATE ${LAPACK_LIBRARIES})
+target_compile_definitions(test_var PUBLIC BLA_SIZEOF_INTEGER=${BLA_SIZEOF_INTEGER})
add_test(NAME test_var COMMAND test_var)
if((BLA_VENDOR STREQUAL "Intel10_64lp") OR
diff --git a/Tests/FindLAPACK/Test/main.c b/Tests/FindLAPACK/Test/main.c
index 04eedea..dd33fb3 100644
--- a/Tests/FindLAPACK/Test/main.c
+++ b/Tests/FindLAPACK/Test/main.c
@@ -1,7 +1,14 @@
#include <assert.h>
+#include <stdint.h>
#include <string.h>
-typedef int blas_int;
+#if BLA_SIZEOF_INTEGER == 4
+typedef int32_t blas_int;
+#elif BLA_SIZEOF_INTEGER == 8
+typedef int64_t blas_int;
+#else
+# error BLA_SIZEOF_INTEGER is not declared!
+#endif
// declare what parts of the lapack C-API we need
void dgesv_(blas_int*, blas_int*, double*, blas_int*, blas_int*, double*,