назначение окружения PATH LD_LIBRARY_PATH
++
This commit is contained in:
@@ -8,3 +8,5 @@ int maxKernels;
|
||||
int busyKernels;
|
||||
int freeKernels;
|
||||
String dvm_drv;
|
||||
String PATH;
|
||||
String LD_LIBRARY_PATH;
|
||||
|
||||
@@ -91,12 +91,9 @@ public:
|
||||
}
|
||||
|
||||
String getStartCommand() override {
|
||||
String res = workspace + "/run";
|
||||
String res = Task::getStartCommand();
|
||||
if (!environments.isEmpty())
|
||||
res = environments + " " + res;
|
||||
#if DEB
|
||||
printf("START %ld: %s\n", id, res.getCharArray());
|
||||
#endif
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -122,9 +122,13 @@ public:
|
||||
virtual void prepareWorkspace() {}
|
||||
virtual String getLaunchScriptText() = 0;
|
||||
virtual String getStartCommand() {
|
||||
return workspace + "/run";
|
||||
String res = workspace + "/run";
|
||||
if (!PATH.isEmpty())
|
||||
res = "PATH="+String::DQuotes(PATH)+ " " + res;
|
||||
if (!LD_LIBRARY_PATH.isEmpty())
|
||||
res = "LD_LIBRARY_PATH="+String::DQuotes(LD_LIBRARY_PATH)+ " " + res;
|
||||
return res;
|
||||
}
|
||||
|
||||
void createWorkspace() {
|
||||
Utils::Mkdir(workspace);
|
||||
}
|
||||
|
||||
@@ -88,6 +88,14 @@ void set_handlers() {
|
||||
#endif
|
||||
}
|
||||
|
||||
void getEnv_(String& res, const char * name_in){
|
||||
char * value_ = getenv(name_in);
|
||||
if (value_ != NULL){
|
||||
res = String(value_);
|
||||
value_ = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char ** argv)
|
||||
{
|
||||
//+
|
||||
@@ -101,18 +109,20 @@ int main(int argc, char ** argv)
|
||||
freeKernels = maxKernels;
|
||||
busyKernels= 0;
|
||||
//--
|
||||
|
||||
getEnv_(PATH,"PATH");
|
||||
getEnv_(LD_LIBRARY_PATH,"LD_LIBRARY_PATH");
|
||||
//--
|
||||
("PATH="+PATH).println();
|
||||
("LD_LIBRARY_PATH="+LD_LIBRARY_PATH).println();
|
||||
//--
|
||||
#if __cplusplus >= 201703L
|
||||
std::filesystem::current_path(packageWorkspace.getCharArray());
|
||||
#else
|
||||
chdir(packageWorkspace.getCharArray());
|
||||
#endif
|
||||
|
||||
#if DEB
|
||||
userWorkspace.println();
|
||||
packageWorkspace.println();
|
||||
printf("%d\n", maxKernels);
|
||||
#endif
|
||||
|
||||
#ifndef _WIN32
|
||||
int pid = getpid();
|
||||
@@ -120,29 +130,17 @@ int main(int argc, char ** argv)
|
||||
int pid = _getpid();
|
||||
#endif
|
||||
|
||||
#if DEB
|
||||
printf("PID=%d\n", pid);
|
||||
#endif
|
||||
File pidFile("PID", String(pid)+"\n");
|
||||
pidFile.Close();
|
||||
//---
|
||||
File startFile("STARTED", "+");
|
||||
startFile.Close();
|
||||
//---
|
||||
#if DEB
|
||||
printf(">>>>\n");
|
||||
#endif
|
||||
CompilationSupervisor * compilationSupervisor = new CompilationSupervisor();
|
||||
#if DEB
|
||||
printf("%ld\n", compilationSupervisor->getLength());
|
||||
#endif
|
||||
compilationSupervisor->DoWithSchedule(maxKernels);
|
||||
|
||||
RunSupervisor * runSupervisor = new RunSupervisor(compilationSupervisor);
|
||||
#if DEB
|
||||
printf("%ld\n", runSupervisor->getLength());
|
||||
runSupervisor->print();
|
||||
#endif
|
||||
RunSupervisor * runSupervisor = new RunSupervisor(compilationSupervisor);
|
||||
runSupervisor->DoWithSchedule(maxKernels);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
13
|
||||
15
|
||||
Reference in New Issue
Block a user