From a416eecf463d4463403b68b7655570aec2d3a12c Mon Sep 17 00:00:00 2001 From: gtheler Date: Wed, 28 Jan 2026 11:49:39 -0300 Subject: [PATCH] check deps and check --- README.md | 7 +++++-- deps.sh | 11 ++++++++--- html/check.php | 44 ++++++++++++++++++++++++++++++++++++++++-- html/index.php | 16 +++++++++++++++ html/new/index.php | 17 ++++++++++++++++ solvers/feenox/deps.sh | 2 +- 6 files changed, 89 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 0c1e103..fbe91c7 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,8 @@ SunCAE is a web-based front end and a cloud-based back end to perform finite-element calculations directly on the browser. - * The front end is an HTML client with plain vanilla javascript code (i.e. no Angular, no React, not even jQuery) that provide interactivity by sending JSON-based AJAX request to the server backe end. - * The back end is written in PHP and responds to the client requests by creating the input files, executing the appropriate binaries and returning back 3D data to the client. + * The front end is an HTML client with plain vanilla javascript code (i.e. no Angular, no React, not even jQuery) that provide interactivity by sending JSON-based AJAX request to the server back end. + * The back end is written in PHP and responds to the client requests by creating the input files, executing the appropriate binaries and returning back 3D data to the client (browser). Both front end and back ends are free software, released under the terms of the [AGPLv3](https://www.gnu.org/licenses/agpl-3.0.en.html). See the [licenses table](LICENSES.md) and [licensing details](#licensing) below for more information. @@ -66,6 +66,9 @@ You can use SunCAE either by... For more detailed instructions including setting up production web servers and using virtualization tools (e.g. docker and/or virtual machines) read the [installation guide](doc/INSTALL.md). +> [!TIP] +> If you have trouble getting SunCAE up and running in your server, please state your situation in the [community](https://github.com/seamplex/suncae/discussions). + ### Configuration diff --git a/deps.sh b/deps.sh index 1db9b64..619164c 100755 --- a/deps.sh +++ b/deps.sh @@ -19,9 +19,6 @@ for i in wget tar unzip python3; do fi done -# create gitignored directories -mkdir -p deps bin - # this one needs to be either world writable or owned by the user running the web server # we start with 0777 but a sane admin would change it back to 0744 (or less) if [ ! -d data ]; then @@ -29,6 +26,11 @@ if [ ! -d data ]; then chmod 0777 data fi +# mark that deps.sh has been run (not that it succeeded yet) +touch data/deps-run + +# create gitignored directories +mkdir -p deps bin # Function to compare versions @@ -44,3 +46,6 @@ version_ge() { . meshers/gmsh/deps.sh . solvers/feenox/deps.sh . solvers/ccx/deps.sh + +# mark that deps.sh has been succeeded +touch data/deps-ok diff --git a/html/check.php b/html/check.php index bc1454b..1820c4c 100644 --- a/html/check.php +++ b/html/check.php @@ -1,5 +1,17 @@ + +

+There is something off with your setup. +Please post these results +

+ +\n"; @@ -195,6 +207,34 @@ } // TODO: check python and binary versions match - - } + + +// feenox +if (file_exists("{$bin_dir}/feenox")) { + echo "[good] feenox binary exists
\n"; + echo "[info] " . shell_exec("ls -la {$bin_dir}/feenox") . "
\n"; +} else { + echo "[error] feenox binary does not exist
\n"; + exit(19); +} +$exec_output = []; +exec("{$bin_dir}/feenox --version 2>&1", $exec_output, $err); +// TODO: check version is good enough +if ($err == 0) { + echo "[good] feenox version is {$exec_output[0]}
\n"; +} else { + echo "[error] feenox binary does not work
\n"; + for ($i = 0; $i < count($exec_output); $i++) { + echo "[info] {$exec_output[$i]}
\n"; + } + exit(20); +} + +// great! +touch("{$data_dir}/check-ok"); +?> + +

+[good] all set! Proceed to SunCAE +

diff --git a/html/index.php b/html/index.php index b4103b7..57300ae 100644 --- a/html/index.php +++ b/html/index.php @@ -6,5 +6,21 @@ include("../conf.php"); include("../auths/{$auth}/auth.php"); include("common.php"); + +if (file_exists("{$data_dir}/deps-run") == false) { + echo "run ./deps.sh first, see installation instructions"; + exit(); +} + +if (file_exists("{$data_dir}/deps-run") == false) { + echo "./deps.sh did not succeed, ask for help"; + exit(); +} + +if (file_exists("{$data_dir}/check-ok") == false) { + header("Location: check.php"); + exit(); +} + include("case.php"); include("../uxs/{$ux}/index.php"); diff --git a/html/new/index.php b/html/new/index.php index e78c877..39b9185 100644 --- a/html/new/index.php +++ b/html/new/index.php @@ -6,4 +6,21 @@ include("../../conf.php"); include("../../auths/{$auth}/auth.php"); include("../common.php"); + +if (file_exists("{$data_dir}/deps-run") == false) { + echo "run ./deps.sh first, see installation instructions"; + exit(); +} + +if (file_exists("{$data_dir}/deps-run") == false) { + echo "./deps.sh did not succeed, ask for help"; + exit(); +} + +if (file_exists("{$data_dir}/check-ok") == false) { + header("Location: ../check.php"); + exit(); +} + + include("../../uxs/{$ux}/new.php"); diff --git a/solvers/feenox/deps.sh b/solvers/feenox/deps.sh index 97f8a03..717fd08 100644 --- a/solvers/feenox/deps.sh +++ b/solvers/feenox/deps.sh @@ -1,7 +1,7 @@ #!/bin/false feenox_version=1.2.1 -feenox_version_min=1.72 +feenox_version_min=1.72 # minimum version that supports MESH in PROBLEM # feenox # Function to extract version from binary