Skip to content

Commit

Permalink
Merge pull request #21 from jgillis/master
Browse files Browse the repository at this point in the history
Add an option to retain underscore suffix for blas/lapack
  • Loading branch information
felixlen committed Jul 19, 2023
2 parents 0998af9 + c7632b8 commit bc4160b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ option(TRLIB_BUILD_PYTHON2 OFF)
option(TRLIB_BUILD_PYTHON3 OFF)
option(TRLIB_BUILD_MEX OFF)

option(TRLIB_BLAS_LAPACK_UNDERSCORE_SUFFIX OFF)

if(TRLIB_BLAS_LAPACK_UNDERSCORE_SUFFIX)
add_compile_definitions(TRLIB_BLAS_LAPACK_UNDERSCORE_SUFFIX)
endif()

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/CMakeModules/")

add_subdirectory(include)
Expand Down
4 changes: 2 additions & 2 deletions src/trlib_private.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include <string.h>
#include <time.h>

#ifdef _WIN32
#if defined(_WIN32) && !defined(TRLIB_BLAS_LAPACK_UNDERSCORE_SUFFIX)
// blas
void daxpy(trlib_int_t *n, trlib_flt_t *alpha, trlib_flt_t *x, trlib_int_t *incx, trlib_flt_t *y, trlib_int_t *incy);
void dscal(trlib_int_t *n, trlib_flt_t *alpha, trlib_flt_t *x, trlib_int_t *incx);
Expand Down Expand Up @@ -80,7 +80,7 @@
#define TRLIB_DURATION_SUB(X, Y, Z)
#endif
#define TRLIB_RETURN(X) { TRLIB_DURATION(verystart, end, timing[0]) return X; }
#ifdef _WIN32
#if defined(_WIN32) && !defined(TRLIB_BLAS_LAPACK_UNDERSCORE_SUFFIX)
#define TRLIB_DCOPY(...) { TRLIB_TIC(start) dcopy(__VA_ARGS__); TRLIB_DURATION_SUB(start, end, timing[1]) }
#define TRLIB_DAXPY(...) { TRLIB_TIC(start) daxpy(__VA_ARGS__); TRLIB_DURATION_SUB(start, end, timing[2]) }
#define TRLIB_DSCAL(...) { TRLIB_TIC(start) dscal(__VA_ARGS__); TRLIB_DURATION_SUB(start, end, timing[3]) }
Expand Down

0 comments on commit bc4160b

Please sign in to comment.