diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 3f479d2e..091bd9b0 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -9,6 +9,7 @@
+
diff --git a/src/Visual_DVM_2021/Passes/All/RemoteInitialiseUser.java b/src/Visual_DVM_2021/Passes/All/RemoteInitialiseUser.java
index d790ec54..2353e310 100644
--- a/src/Visual_DVM_2021/Passes/All/RemoteInitialiseUser.java
+++ b/src/Visual_DVM_2021/Passes/All/RemoteInitialiseUser.java
@@ -39,12 +39,27 @@ public class RemoteInitialiseUser extends ConnectionPass_2023 {
}
}
String getPlannerFlags() throws Exception{
+ String res = "";
String command = "g++ -v --help 2> /dev/null | sed -n '/^ *-std=\\([^<][^ ]\\+\\).*/ {s//\\1/p}' | grep c++";
System.out.println(command);
- Pair res = user.connection.performScript(modulesDirectory, command);
- RemoteFile out = res.getKey();
- System.out.println(user.connection.readFromFile(out));
- return "";
+ Pair oe = user.connection.performScript(modulesDirectory, command);
+ RemoteFile outFile = oe.getKey();
+ String out = user.connection.readFromFile(outFile);
+ String [] data = out.split("\n");
+ for (String version: data){
+ System.out.println(Utils.Brackets(version));
+ if (version.equals("c++17")){
+ res = "-std=c++17";
+ break;
+ }else if (version.equals("c++11")){
+ res="-std=c++11";
+ break;
+ }
+ }
+ System.out.println(Utils.Brackets(res));
+ if (res.isEmpty())
+ throw new PassException("На целевой машине отсутствуют с++17 и с++11!");
+ return res;
}
@Override
protected void ServerAction() throws Exception {
@@ -71,7 +86,7 @@ public class RemoteInitialiseUser extends ConnectionPass_2023 {
"CompilationTask.h",
"File.h",
"Global.h",
- "Planner.cpp",
+ "planner.cpp",
"RunSupervisor.h",
"RunTask.h",
"String.h",
@@ -91,21 +106,7 @@ public class RemoteInitialiseUser extends ConnectionPass_2023 {
ShowMessage1("Сборка модулей...");
compileModule("launcher","");
compileModule("starter","");
- getPlannerFlags();
- //compileModule("planner", getPlannerFlags());
- /*
-
- //канал на исполнение независим, поэтому переход в папку отдельный
- Command(
- "cd " + Utils.DQuotes(sftpChannel.pwd()), //нужны ли тут кавычки?
- "g++ " + starter_code + " -o " + starter,
- "g++ " + launcher_code + " -o " + launcher,
- "g++ -O3 -std=c++17 Planner.cpp -o " + planner,
- "chmod 0777 " + starter,
- "chmod 0777 " + launcher,
- "chmod 0777 " + planner
- );
- */
+ compileModule("planner", getPlannerFlags());
//--------------------------------------
RemoteFile info = new RemoteFile(target, Current.getAccount().email);
user.connection.writeToFile("", info);
diff --git a/src/files/Planner.cpp b/src/files/planner.cpp
similarity index 100%
rename from src/files/Planner.cpp
rename to src/files/planner.cpp