-
Notifications
You must be signed in to change notification settings - Fork 296
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
47 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,28 @@ | ||
|
||
PYTHON=python | ||
#optional, just in case you want to override python with ./configurePyCV.sh | ||
-include Makefile.conf | ||
#this makefiles assume that pip and pytest are installed | ||
.PHONY: clean check check_standalone check_python all | ||
|
||
all: pycv_here | ||
|
||
pycv_here: src/*.cpp src/*.h src/pycv/*.py | ||
@echo installing pycv | ||
pip3 install . | ||
touch $@ | ||
$(PYTHON) -m pip install . | ||
@touch $@ | ||
|
||
clean: | ||
pip3 uninstall pycv | ||
rm -fv pycv_here | ||
@$(PYTHON) -m pip uninstall pycv -y | ||
@rm -fv pycv_here | ||
|
||
check_standalone: pycv_here | ||
$(MAKE) -C regtest testclean | ||
$(MAKE) -C regtest checkfail | ||
|
||
#just in case pytest is still not installed we install it before the tests | ||
check_python: pycv_here | ||
pip3 install pytest | ||
pytest -v | ||
@$(PYTHON) -m pip install pytest | ||
@$(PYTHON) -m pytest -v | ||
|
||
check: check_standalone check_python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
|
||
#formatted with shfmtv3.36.0 (https://github.com/mvdan/sh/releases) | ||
|
||
#A simple script to configure PyCV if python does not work | ||
PYTHON="" | ||
if which plumed >/dev/null; then | ||
echo "plumed found" | ||
PYTHON=$(plumed --no-mpi info --configuration | grep 'python_bin=') | ||
PYTHON=${PYTHON#python_bin=} | ||
fi | ||
|
||
if [ -z "$PYTHON" ]; then | ||
echo "python not found using plumed" | ||
echo "serching for available python with plumed module installed" | ||
|
||
for python_bin in python python3 python3.12 python3.11 python3.10 python3.9 python3.8 python3.7; do | ||
if $python_bin -c "import plumed" 2>/dev/null; then | ||
if [ $python_bin != python ]; then | ||
PYTHON=$python_bin | ||
fi | ||
return 1 | ||
fi | ||
done | ||
|
||
fi | ||
|
||
if [ -z "$PYTHON" ]; then | ||
echo "python not found" | ||
exit 1 | ||
fi | ||
|
||
cat <<EOF >Makefile.conf | ||
PYTHON=$(which "$PYTHON") | ||
EOF |