summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt4
-rw-r--r--WINCOMPILE.md2
-rw-r--r--backend/BackendConnector.cpp4
-rw-r--r--backend/Plugin.hpp12
-rw-r--r--backend/amd/minethd.cpp8
-rw-r--r--backend/nvidia/autoAdjust.hpp2
-rw-r--r--backend/nvidia/minethd.cpp8
7 files changed, 25 insertions, 15 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6ff459f..8871951 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -390,7 +390,7 @@ if( NOT "${CMAKE_INSTALL_PREFIX}" STREQUAL "${PROJECT_BINARY_DIR}" )
LIBRARY DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")
endif()
endif()
-
+else()
set(WIN_OUTPUT_RELEASE "/Release")
endif()
@@ -400,7 +400,7 @@ install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/opencl"
# avoid overwrite of user defined settings
# install `config.txt`if file not exists in `${CMAKE_INSTALL_PREFIX}/bin`
install(CODE " \
- if(NOT EXISTS ${CMAKE_INSTALL_PREFIX}/bin/config.txt)\n \
+ if(NOT EXISTS ${CMAKE_INSTALL_PREFIX}/bin${WIN_OUTPUT_RELEASE}/config.txt)\n \
file(INSTALL ${CMAKE_CURRENT_SOURCE_DIR}/config.txt \
DESTINATION ${CMAKE_INSTALL_PREFIX}/bin${WIN_OUTPUT_RELEASE})\n \
endif()"
diff --git a/WINCOMPILE.md b/WINCOMPILE.md
index 13bbf9e..f70ecff 100644
--- a/WINCOMPILE.md
+++ b/WINCOMPILE.md
@@ -67,7 +67,7 @@
set CMAKE_PREFIX_PATH=C:\xmr-stak-dep\hwloc;C:\xmr-stak-dep\libmicrohttpd;C:\xmr-stak-dep\openssl
mkdir build
cd build
- cmake -G "Visual Studio 15 2017 Win64" -T v141,host=x64 ..
+ cmake -G "Visual Studio 15 2017 Win64" -T v140,host=x64 ..
cmake --build . --config Release --target install
cd bin\Release
```
diff --git a/backend/BackendConnector.cpp b/backend/BackendConnector.cpp
index 6abc379..f1b71b4 100644
--- a/backend/BackendConnector.cpp
+++ b/backend/BackendConnector.cpp
@@ -63,7 +63,7 @@ std::vector<IBackend*>* BackendConnector::thread_starter(miner_work& pWork)
std::vector<IBackend*>* pvThreads = new std::vector<IBackend*>;
#ifndef CONF_NO_CUDA
- Plugin nvidiaPlugin("NVIDIA", "libxmrstak_cuda_backend");
+ Plugin nvidiaPlugin("NVIDIA", "xmrstak_cuda_backend");
std::vector<IBackend*>* nvidiaThreads = nvidiaPlugin.startBackend(static_cast<uint32_t>(pvThreads->size()), pWork);
pvThreads->insert(std::end(*pvThreads), std::begin(*nvidiaThreads), std::end(*nvidiaThreads));
if(nvidiaThreads->size() == 0)
@@ -71,7 +71,7 @@ std::vector<IBackend*>* BackendConnector::thread_starter(miner_work& pWork)
#endif
#ifndef CONF_NO_OPENCL
- Plugin amdPlugin("AMD", "libxmrstak_opencl_backend");
+ Plugin amdPlugin("AMD", "xmrstak_opencl_backend");
std::vector<IBackend*>* amdThreads = amdPlugin.startBackend(static_cast<uint32_t>(pvThreads->size()), pWork);
pvThreads->insert(std::end(*pvThreads), std::begin(*amdThreads), std::end(*amdThreads));
if(amdThreads->size() == 0)
diff --git a/backend/Plugin.hpp b/backend/Plugin.hpp
index 347d5db..4c85375 100644
--- a/backend/Plugin.hpp
+++ b/backend/Plugin.hpp
@@ -27,14 +27,14 @@ struct Plugin
{
#ifdef WIN32
libBackend = LoadLibrary(TEXT((libName + ".dll").c_str()));
- if (!libBackend)
+ if(!libBackend)
{
std::cerr << "WARNING: "<< m_backendName <<" cannot load backend library: " << (libName + ".dll") << std::endl;
return;
}
#else
- libBackend = dlopen((libName + ".so").c_str(), RTLD_LAZY);
- if (!libBackend)
+ libBackend = dlopen((std::string("lib") + libName + ".so").c_str(), RTLD_LAZY);
+ if(!libBackend)
{
std::cerr << "WARNING: "<< m_backendName <<" cannot load backend library: " << dlerror() << std::endl;
return;
@@ -45,16 +45,16 @@ struct Plugin
fn_starterBackend = (starterBackend_t) GetProcAddress(libBackend, "xmrstak_start_backend");
if (!fn_starterBackend)
{
- std::cerr << "WARNING: backend plugin " << libName << " contains no entry 'xmrstak_start_backend'" << std::endl;
+ std::cerr << "WARNING: backend plugin " << libName << " contains no entry 'xmrstak_start_backend': " <<GetLastError()<< std::endl;
}
#else
// reset last error
dlerror();
fn_starterBackend = (starterBackend_t) dlsym(libBackend, "xmrstak_start_backend");
const char* dlsym_error = dlerror();
- if (dlsym_error)
+ if(dlsym_error)
{
- std::cerr << "WARNING: backend plugin " << libName << " contains no entry 'xmrstak_start_backend'" << std::endl;
+ std::cerr << "WARNING: backend plugin " << libName << " contains no entry 'xmrstak_start_backend': " << dlsym_error << std::endl;
}
#endif
}
diff --git a/backend/amd/minethd.cpp b/backend/amd/minethd.cpp
index 7e3c603..a7b84a7 100644
--- a/backend/amd/minethd.cpp
+++ b/backend/amd/minethd.cpp
@@ -60,11 +60,15 @@ minethd::minethd(miner_work& pWork, size_t iNo, GpuContext* ctx)
oWorkThd = std::thread(&minethd::work_main, this);
}
-extern "C" std::vector<IBackend*>* xmrstak_start_backend(uint32_t threadOffset, miner_work& pWork)
+extern "C" {
+#ifdef WIN32
+__declspec(dllexport)
+#endif
+std::vector<IBackend*>* xmrstak_start_backend(uint32_t threadOffset, miner_work& pWork)
{
return amd::minethd::thread_starter(threadOffset, pWork);
}
-
+} // extern "C"
bool minethd::init_gpus()
{
diff --git a/backend/nvidia/autoAdjust.hpp b/backend/nvidia/autoAdjust.hpp
index 41599b7..0e6c40f 100644
--- a/backend/nvidia/autoAdjust.hpp
+++ b/backend/nvidia/autoAdjust.hpp
@@ -61,7 +61,7 @@ public:
#endif
if( cuda_get_deviceinfo(&ctx) != 1 )
{
- printer::inst()->print_msg(L0, "Setup failed for GPU %d. Exitting.\n", cfg.id);
+ printer::inst()->print_msg(L0, "Setup failed for GPU %d. Exitting.\n", i);
std::exit(0);
}
nvidCtxVec.push_back(ctx);
diff --git a/backend/nvidia/minethd.cpp b/backend/nvidia/minethd.cpp
index 9a331f3..d62728d 100644
--- a/backend/nvidia/minethd.cpp
+++ b/backend/nvidia/minethd.cpp
@@ -105,10 +105,16 @@ bool minethd::self_test()
}
-extern "C" std::vector<IBackend*>* xmrstak_start_backend(uint32_t threadOffset, miner_work& pWork)
+extern "C"
+{
+#ifdef WIN32
+__declspec(dllexport)
+#endif
+std::vector<IBackend*>* xmrstak_start_backend(uint32_t threadOffset, miner_work& pWork)
{
return nvidia::minethd::thread_starter(threadOffset, pWork);
}
+} // extern "C"
std::vector<IBackend*>* minethd::thread_starter(uint32_t threadOffset, miner_work& pWork)
{
OpenPOWER on IntegriCloud