diff --git a/bin/dune b/bin/dune index 339aa4209807d0b90d511b948987d63ea51ce7c8..0fe64358fdda03515cf58ec8dfa738cdfc87575b 100644 --- a/bin/dune +++ b/bin/dune @@ -2,5 +2,6 @@ (package caisar) (section bin) (files + (findmodule.py as findmodule.py) (nnenum.sh as nnenum.sh)) ) diff --git a/bin/findmodule.py b/bin/findmodule.py new file mode 100755 index 0000000000000000000000000000000000000000..4332bb505e607efcdaa617dd787f9f773cdffbbb --- /dev/null +++ b/bin/findmodule.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python3 +########################################################################### +# # +# This file is part of CAISAR. # +# # +# Copyright (C) 2022 # +# CEA (Commissariat à l'énergie atomique et aux énergies # +# alternatives) # +# # +# You can redistribute it and/or modify it under the terms of the GNU # +# Lesser General Public License as published by the Free Software # +# Foundation, version 2.1. # +# # +# It is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU Lesser General Public License for more details. # +# # +# See the GNU Lesser General Public License version 2.1 # +# for more details (enclosed in the file licenses/LGPLv2.1). # +# # +########################################################################### + +import sys +import importlib + +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) diff --git a/bin/nnenum.sh b/bin/nnenum.sh index e7d0d4556c6e96735a7d99e2c6fda028153f63ee..4eb5afc6caf515c37b772d37007a7aee8f17b324 100755 --- a/bin/nnenum.sh +++ b/bin/nnenum.sh @@ -22,7 +22,7 @@ ########################################################################### if [ "$1" = "--version" ]; then - echo dummy + findmodule.py "nnenum" "dummy" else OMP_NUM_THREADS=1 OPENBLAS_NUM_THREADS=1 python3 -m nnenum.nnenum "$@" fi diff --git a/tests/pyrat_verify_json.t b/tests/verify_json.t similarity index 100% rename from tests/pyrat_verify_json.t rename to tests/verify_json.t