Skip to content
Snippets Groups Projects
Commit 0f76a3d0 authored by Michele Alberti's avatar Michele Alberti
Browse files

Merge branch 'fix/michele/better-wrapper-38' into 'master'

Better python script for faking --version option.

Closes #38

See merge request laiser/caisar!89
parents 5271c953 336841dc
No related branches found
No related tags found
No related merge requests found
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
if [ "$1" = "--version" ]; then if [ "$1" = "--version" ]; then
SCRIPT_DIR=$( dirname -- "$0"; ) SCRIPT_DIR=$( dirname -- "$0"; )
$SCRIPT_DIR/findmodule.py "complete_verifier.abcrown" "dummy-version" $SCRIPT_DIR/dummyversion.py "complete_verifier.abcrown"
else else
python3 -m complete_verifier.abcrown "$@" OMP_NUM_THREADS=1 python3 -m complete_verifier.abcrown "$@"
fi fi
...@@ -23,14 +23,23 @@ ...@@ -23,14 +23,23 @@
import sys import sys
import importlib import importlib
from importlib import import_module
module_name = str(sys.argv[1]) module_name = str(sys.argv[1])
output = str(sys.argv[2])
spec = importlib.util.find_spec(module_name) spec = importlib.util.find_spec(module_name)
if spec is not None: if spec is None:
print(output) # [module_name] cannot be found: most likely, the PYTHONPATH has not been
exit(0) # correctly set up.
else: exit(1)
exit(1)
# [module_name] has been found. However, this is not sufficient to conclude that
# its interpretation/execution will not fail, e.g., due to unmet dependencies.
try:
import_module(module_name)
except ModuleNotFoundError:
exit(1)
print("dummy-version")
exit(0)
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
(package caisar) (package caisar)
(section bin) (section bin)
(files (files
(findmodule.py as findmodule.py) (dummyversion.py as dummyversion.py)
(nnenum.sh as nnenum.sh) (nnenum.sh as nnenum.sh)
(abcrown.sh as abcrown.sh))) (abcrown.sh as abcrown.sh)))
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
if [ "$1" = "--version" ]; then if [ "$1" = "--version" ]; then
SCRIPT_DIR=$( dirname -- "$0"; ) SCRIPT_DIR=$( dirname -- "$0"; )
$SCRIPT_DIR/findmodule.py "nnenum" "dummy-version" $SCRIPT_DIR/dummyversion.py "nnenum.nnenum"
else else
OMP_NUM_THREADS=1 OPENBLAS_NUM_THREADS=1 python3 -m nnenum.nnenum "$@" OMP_NUM_THREADS=1 OPENBLAS_NUM_THREADS=1 python3 -m nnenum.nnenum "$@"
fi fi
...@@ -108,7 +108,7 @@ command = "%e --device cpu --onnx_path %{nnet-onnx} --vnnlib_path %f --timeout % ...@@ -108,7 +108,7 @@ command = "%e --device cpu --onnx_path %{nnet-onnx} --vnnlib_path %f --timeout %
driver = "%{config}/drivers/abcrown.drv" driver = "%{config}/drivers/abcrown.drv"
use_at_auto_level = 1 use_at_auto_level = 1
[ATP abcrown] [ATP abcrown-acas]
name = "alpha-beta-CROWN" name = "alpha-beta-CROWN"
alternative = "ACAS" alternative = "ACAS"
exec = "abcrown.sh" exec = "abcrown.sh"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment