mirror of
https://github.com/jwinterm/xmr-stak.git
synced 2026-12-02 12:33:56 +01:00
use call prefix to load backends
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "xmrstak/misc/environment.hpp"
|
||||
#include "xmrstak/params.hpp"
|
||||
|
||||
#include <thread>
|
||||
#include <atomic>
|
||||
@@ -36,7 +37,7 @@ struct plugin
|
||||
return;
|
||||
}
|
||||
#else
|
||||
libBackend = dlopen((std::string("./lib") + libName + ".so").c_str(), RTLD_LAZY);
|
||||
libBackend = dlopen((params::inst().executablePrefix + "/lib" + libName + ".so").c_str(), RTLD_LAZY);
|
||||
if(!libBackend)
|
||||
{
|
||||
std::cerr << "WARNING: "<< m_backendName <<" cannot load backend library: " << dlerror() << std::endl;
|
||||
|
||||
@@ -60,7 +60,8 @@ void help()
|
||||
using namespace std;
|
||||
using namespace xmrstak;
|
||||
|
||||
cout<<"Usage: "<<params::inst().executablePrefix<<" [--help|-h] [--benchmark] [-c CONFIGFILE] [CONFIG FILE]"<<endl;
|
||||
cout<<"Usage: "<<params::inst().binaryName<<" [OPTIONS] [CONFIG FILE]"<<endl;
|
||||
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
@@ -85,8 +86,9 @@ int main(int argc, char *argv[])
|
||||
// try windows "\"
|
||||
pos = pathWithName.rfind("\\");
|
||||
}
|
||||
|
||||
params::inst().executablePrefix = std::string(pathWithName, 0, pos);
|
||||
params::inst().binaryName = std::string(pathWithName, pos + 1, std::string::npos);
|
||||
if(params::inst().binaryName.compare(pathWithName) != 0)
|
||||
params::inst().executablePrefix = std::string(pathWithName, 0, pos);
|
||||
|
||||
for(int i = 1; i < argc; ++i)
|
||||
{
|
||||
|
||||
@@ -19,6 +19,7 @@ struct params
|
||||
}
|
||||
|
||||
std::string executablePrefix;
|
||||
std::string binaryName;
|
||||
bool useAMD;
|
||||
bool useNVIDIA;
|
||||
bool useCPU;
|
||||
@@ -33,6 +34,8 @@ struct params
|
||||
std::string configFileCPU;
|
||||
|
||||
params() :
|
||||
binaryName("xmr-stak"),
|
||||
executablePrefix("./"),
|
||||
useAMD(true),
|
||||
useNVIDIA(true),
|
||||
useCPU(true),
|
||||
|
||||
Reference in New Issue
Block a user