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

[RX] rename shared libraries #2573

Merged
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
26 changes: 13 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -488,39 +488,39 @@ if(CUDA_FOUND)
if(CUDA_COMPILER STREQUAL "clang")
# build device code with clang
add_library(
xmrstak_cuda_backend
xmrstakrx_cuda_backend
SHARED
${CUDASRCFILES}
)
set_target_properties(xmrstak_cuda_backend PROPERTIES COMPILE_FLAGS ${CLANG_BUILD_FLAGS})
set_target_properties(xmrstak_cuda_backend PROPERTIES LINKER_LANGUAGE CXX)
set_target_properties(xmrstakrx_cuda_backend PROPERTIES COMPILE_FLAGS ${CLANG_BUILD_FLAGS})
set_target_properties(xmrstakrx_cuda_backend PROPERTIES LINKER_LANGUAGE CXX)
set_source_files_properties(${CUDASRCFILES} PROPERTIES LANGUAGE CXX)
else()
# build device code with nvcc
cuda_add_library(
xmrstak_cuda_backend
xmrstakrx_cuda_backend
SHARED
${CUDASRCFILES}
)
endif()

set(CUDA_LIBRARIES ${CUDA_LIBRARIES})

target_link_libraries(xmrstak_cuda_backend ${CUDA_LIBRARIES})
target_link_libraries(xmrstak_cuda_backend xmr-stak-backend)
target_link_libraries(xmrstakrx_cuda_backend ${CUDA_LIBRARIES})
target_link_libraries(xmrstakrx_cuda_backend xmr-stak-backend)
endif()

# compile AMD backend
if(OpenCL_FOUND)
file(GLOB OPENCLSRCFILES
"xmrstak/backend/amd/amd_gpu/*.cpp"
"xmrstak/backend/amd/*.cpp")
add_library(xmrstak_opencl_backend
add_library(xmrstakrx_opencl_backend
SHARED
${OPENCLSRCFILES}
)
target_link_libraries(xmrstak_opencl_backend ${OpenCL_LIBRARY} )
target_link_libraries(xmrstak_opencl_backend xmr-stak-backend)
target_link_libraries(xmrstakrx_opencl_backend ${OpenCL_LIBRARY} )
target_link_libraries(xmrstakrx_opencl_backend xmr-stak-backend)
endif()

# compile final binary
Expand Down Expand Up @@ -548,19 +548,19 @@ if( NOT CMAKE_INSTALL_PREFIX STREQUAL PROJECT_BINARY_DIR )
RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/${EXECUTABLE_OUTPUT_PATH}")
if(CUDA_FOUND)
if(WIN32)
install(TARGETS xmrstak_cuda_backend
install(TARGETS xmrstakrx_cuda_backend
RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/${LIBRARY_OUTPUT_PATH}")
else()
install(TARGETS xmrstak_cuda_backend
install(TARGETS xmrstakrx_cuda_backend
LIBRARY DESTINATION "${CMAKE_INSTALL_PREFIX}/${LIBRARY_OUTPUT_PATH}")
endif()
endif()
if(OpenCL_FOUND)
if(WIN32)
install(TARGETS xmrstak_opencl_backend
install(TARGETS xmrstakrx_opencl_backend
RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/${LIBRARY_OUTPUT_PATH}")
else()
install(TARGETS xmrstak_opencl_backend
install(TARGETS xmrstakrx_opencl_backend
LIBRARY DESTINATION "${CMAKE_INSTALL_PREFIX}/${LIBRARY_OUTPUT_PATH}")
endif()
endif()
Expand Down
10 changes: 3 additions & 7 deletions xmrstak/backend/backendConnector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,14 @@ bool BackendConnector::self_test()

std::vector<iBackend*>* BackendConnector::thread_starter(miner_work& pWork)
{

//randomX_global_ctx::inst();
//randomX_global_ctx::inst();

std::vector<iBackend*>* pvThreads = new std::vector<iBackend*>;

#ifndef CONF_NO_OPENCL
if(params::inst().useAMD)
{
const std::string backendName = xmrstak::params::inst().openCLVendor;
plugin amdplugin;
amdplugin.load(backendName, "xmrstak_opencl_backend");
amdplugin.load(backendName, "xmrstakrx_opencl_backend");
std::vector<iBackend*>* amdThreads = amdplugin.startBackend(static_cast<uint32_t>(pvThreads->size()), pWork, environment::inst());
size_t numWorkers = 0u;
if(amdThreads != nullptr)
Expand All @@ -88,9 +84,9 @@ std::vector<iBackend*>* BackendConnector::thread_starter(miner_work& pWork)

plugin nvidiaplugin;
#ifdef XMRSTAK_DEV_RELEASE
std::vector<std::string> libNames = {"xmrstak_cuda_backend_cuda10_0", "xmrstak_cuda_backend"};
std::vector<std::string> libNames = {"xmrstakrx_cuda_backend_cuda10_0", "xmrstakrx_cuda_backend"};
#else
std::vector<std::string> libNames = {"xmrstak_cuda_backend"};
std::vector<std::string> libNames = {"xmrstakrx_cuda_backend"};
#endif
size_t numWorkers = 0u;

Expand Down