diff --git a/bin/abcrown.sh b/bin/abcrown.sh index 2d02c29fb46caad6e549291f986dee3eb7c61cc2..49e54fa0e0bb4af0ba34003a3ea831b8101900e9 100755 --- a/bin/abcrown.sh +++ b/bin/abcrown.sh @@ -23,7 +23,7 @@ if [ "$1" = "--version" ]; then SCRIPT_DIR=$( dirname -- "$0"; ) - $SCRIPT_DIR/findmodule.py "complete_verifier.abcrown" "dummy-version" + $SCRIPT_DIR/dummyversion.py "complete_verifier.abcrown" else - python3 -m complete_verifier.abcrown "$@" + OMP_NUM_THREADS=1 python3 -m complete_verifier.abcrown "$@" fi diff --git a/bin/findmodule.py b/bin/dummyversion.py similarity index 79% rename from bin/findmodule.py rename to bin/dummyversion.py index 4332bb505e607efcdaa617dd787f9f773cdffbbb..55ff02356c894789ca8e200c139da542da3a2a91 100755 --- a/bin/findmodule.py +++ b/bin/dummyversion.py @@ -23,14 +23,23 @@ import sys import importlib +from importlib import import_module module_name = str(sys.argv[1]) -output = str(sys.argv[2]) spec = importlib.util.find_spec(module_name) -if spec is not None: - print(output) - exit(0) -else: - exit(1) +if spec is None: + # [module_name] cannot be found: most likely, the PYTHONPATH has not been + # correctly set up. + 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) diff --git a/bin/dune b/bin/dune index b05c9abcfcdb286a5fae5f216698931c027652a7..1200cd3a31d2380d536e2639b123dfbe71fb1910 100644 --- a/bin/dune +++ b/bin/dune @@ -2,6 +2,6 @@ (package caisar) (section bin) (files - (findmodule.py as findmodule.py) + (dummyversion.py as dummyversion.py) (nnenum.sh as nnenum.sh) (abcrown.sh as abcrown.sh))) diff --git a/bin/nnenum.sh b/bin/nnenum.sh index d58856b5277d9f16fac8dfdd56c72cb25dd210f8..907dfda8b2d87f17eb8494bbe09f96889bfccd94 100755 --- a/bin/nnenum.sh +++ b/bin/nnenum.sh @@ -23,7 +23,7 @@ if [ "$1" = "--version" ]; then SCRIPT_DIR=$( dirname -- "$0"; ) - $SCRIPT_DIR/findmodule.py "nnenum" "dummy-version" + $SCRIPT_DIR/dummyversion.py "nnenum.nnenum" else OMP_NUM_THREADS=1 OPENBLAS_NUM_THREADS=1 python3 -m nnenum.nnenum "$@" fi diff --git a/config/caisar-detection-data.conf b/config/caisar-detection-data.conf index c560676cb7ec899f15364d3a856d6f14f77e86e1..2aeaa83e563a9f2c8dd778b894c566c0eefd7f74 100644 --- a/config/caisar-detection-data.conf +++ b/config/caisar-detection-data.conf @@ -108,7 +108,7 @@ command = "%e --device cpu --onnx_path %{nnet-onnx} --vnnlib_path %f --timeout % driver = "%{config}/drivers/abcrown.drv" use_at_auto_level = 1 -[ATP abcrown] +[ATP abcrown-acas] name = "alpha-beta-CROWN" alternative = "ACAS" exec = "abcrown.sh"