From b84abd112d263b8d9851aae59e1b1eaca495e40e Mon Sep 17 00:00:00 2001 From: fmckenna Date: Thu, 10 Oct 2024 15:12:41 -0700 Subject: [PATCH] fmk - putting in a shebang to submit script for windows --- modules/performFEM/OpenSees/createOpenSeesDriver.cpp | 7 +++++++ .../performFEM/OpenSeesPy/createOpenSeesPyDriver.cpp | 12 ++++++++++-- modules/performFEM/surrogateGP/createGpDriver.cpp | 7 +++++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/modules/performFEM/OpenSees/createOpenSeesDriver.cpp b/modules/performFEM/OpenSees/createOpenSeesDriver.cpp index b7d9e2ad9..2b9f7792d 100755 --- a/modules/performFEM/OpenSees/createOpenSeesDriver.cpp +++ b/modules/performFEM/OpenSees/createOpenSeesDriver.cpp @@ -121,6 +121,13 @@ int main(int argc, const char **argv) { exit(802); // no random variables allowed } + // put in shebang fow linux + bool isWindows = (osType.compare("Windows") == 0); + bool isRunningLocal = (runType.compare("runningLocal") == 0); + if (!(isWindows && isRunningLocal)) { + workflowDriverFile << "#!/bin/bash\n"; + } + std::string dpreproCommand; std::string openSeesCommand; std::string pythonCommand; diff --git a/modules/performFEM/OpenSeesPy/createOpenSeesPyDriver.cpp b/modules/performFEM/OpenSeesPy/createOpenSeesPyDriver.cpp index f32fa82a8..85280c70d 100644 --- a/modules/performFEM/OpenSeesPy/createOpenSeesPyDriver.cpp +++ b/modules/performFEM/OpenSeesPy/createOpenSeesPyDriver.cpp @@ -123,12 +123,20 @@ int createDriver(int argc, const char **argv) { workflowDriver.append(std::string(".bat")); std::ofstream workflowDriverFile(workflowDriver, std::ios::binary); - + if (!workflowDriverFile.is_open()) { std::cerr << "createOpenSeesPyDriver:: could not create workflow driver file: " << workflowDriver << "\n"; exit(802); // no random variables is allowed } + // put in shebang fow linux + bool isWindows = (osType.compare("Windows") == 0); + bool isRunningLocal = (runType.compare("runningLocal") == 0); + if (!(isWindows && isRunningLocal)) { + workflowDriverFile << "#!/bin/bash\n"; + } + + std::string dpreproCommand; std::string openSeesCommand; std::string pythonCommand; @@ -325,4 +333,4 @@ int main(int argc, const char **argv) { return 0; -} \ No newline at end of file +} diff --git a/modules/performFEM/surrogateGP/createGpDriver.cpp b/modules/performFEM/surrogateGP/createGpDriver.cpp index 85be1d129..0db8e2953 100644 --- a/modules/performFEM/surrogateGP/createGpDriver.cpp +++ b/modules/performFEM/surrogateGP/createGpDriver.cpp @@ -115,6 +115,13 @@ int main(int argc, const char **argv) { exit(802); // no random variables is allowed } + // put in shebang fow linux + bool isWindows = (osType.compare("Windows") == 0); + bool isRunningLocal = (runType.compare("runningLocal") == 0); + if (!(isWindows && isRunningLocal)) { + workflowDriverFile << "#!/bin/bash\n"; + } + std::string dpreproCommand; std::string openSeesCommand; std::string gpCommand;