Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BLAS] Fix symbol conflicts between backends and reference #251

Merged
merged 4 commits into from
Nov 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ endif()

if(DEFINED REF_BLAS_ROOT)
find_file(REF_BLAS_LIBNAME NAMES blas.dll libblas.so HINTS ${REF_BLAS_ROOT} PATH_SUFFIXES lib lib64)
find_file(REF_CBLAS_LIBNAME NAMES cblas.dll libcblas.so HINTS ${REF_BLAS_ROOT} PATH_SUFFIXES lib lib64)
endif()

# Add source directory and output to bin/
Expand Down
1 change: 1 addition & 0 deletions src/config.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@
#cmakedefine ENABLE_NETLIB_BACKEND
#cmakedefine BUILD_SHARED_LIBS
#cmakedefine REF_BLAS_LIBNAME "@REF_BLAS_LIBNAME@"
#cmakedefine REF_CBLAS_LIBNAME "@REF_CBLAS_LIBNAME@"

#endif
12 changes: 9 additions & 3 deletions tests/unit_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ set(blas_TEST_LIST
blas_batch
blas_extensions)

set(blas_TEST_LINK ${CBLAS_LINK})
set(blas_TEST_LINK "")
mkrainiuk marked this conversation as resolved.
Show resolved Hide resolved

# LAPACK config
set(lapack_TEST_LIST
Expand Down Expand Up @@ -146,21 +146,27 @@ foreach(domain ${TARGET_DOMAINS})

string(TOUPPER ${domain} DOMAIN_PREFIX)

if(domain STREQUAL "blas")
set(TEST_LD_LIBRARY_PATH ${CMAKE_BINARY_DIR}/lib:${CBLAS_LIB_DIR}:$ENV{LD_LIBRARY_PATH})
else()
set(TEST_LD_LIBRARY_PATH ${CMAKE_BINARY_DIR}/lib:$ENV{LD_LIBRARY_PATH})
endif()

if(BUILD_SHARED_LIBS)
set_target_properties(test_main_${domain}_rt
PROPERTIES BUILD_RPATH $<TARGET_FILE_DIR:onemkl>)
# Find individual tests within executable
gtest_discover_tests(test_main_${domain}_rt
PROPERTIES BUILD_RPATH ${CMAKE_BINARY_DIR}/lib
PROPERTIES ENVIRONMENT LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib:$ENV{LD_LIBRARY_PATH}
PROPERTIES ENVIRONMENT LD_LIBRARY_PATH=${TEST_LD_LIBRARY_PATH}
PROPERTIES TEST_PREFIX ${DOMAIN_PREFIX}/RT/
DISCOVERY_TIMEOUT 30
)
endif()

gtest_discover_tests(test_main_${domain}_ct
PROPERTIES BUILD_RPATH ${CMAKE_BINARY_DIR}/lib
PROPERTIES ENVIRONMENT LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib:$ENV{LD_LIBRARY_PATH}
PROPERTIES ENVIRONMENT LD_LIBRARY_PATH=${TEST_LD_LIBRARY_PATH}
PROPERTIES TEST_PREFIX ${DOMAIN_PREFIX}/CT/
DISCOVERY_TIMEOUT 30
)
Expand Down
Loading