From d781d77c1730d347f72a589bf91f01db1f3f6c1f Mon Sep 17 00:00:00 2001 From: Luca Soldaini Date: Thu, 7 Jul 2016 15:43:57 -0400 Subject: [PATCH] added installers for python 2 and 3 --- install_python.sh | 20 ++++++++++++++++++++ install_python3.sh | 20 ++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100755 install_python.sh create mode 100755 install_python3.sh diff --git a/install_python.sh b/install_python.sh new file mode 100755 index 0000000..b51b423 --- /dev/null +++ b/install_python.sh @@ -0,0 +1,20 @@ +CURRENT_DIR=`pwd` + +# get the directory of the script (from: http://stackoverflow.com/a/246128) +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done +SCRIPT_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + +cd $SCRIPT_DIR/swig/python +sh prepare.sh +python setup.py.in build_ext --inplace + +mkdir $SCRIPT_DIR/release +cp simstring.py $SCRIPT_DIR/release/ +cp _simstring*.so $SCRIPT_DIR/release/ + +cd $CURRENT_DIR diff --git a/install_python3.sh b/install_python3.sh new file mode 100755 index 0000000..e999f11 --- /dev/null +++ b/install_python3.sh @@ -0,0 +1,20 @@ +CURRENT_DIR=`pwd` + +# get the directory of the script (from: http://stackoverflow.com/a/246128) +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done +SCRIPT_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + +cd $SCRIPT_DIR/swig/python +sh prepare.sh +python3 setup.py.in build_ext --inplace + +mkdir $SCRIPT_DIR/release +cp simstring.py $SCRIPT_DIR/release/ +cp _simstring*.so $SCRIPT_DIR/release/ + +cd $CURRENT_DIR