назначение окружения PATH LD_LIBRARY_PATH
++
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user