Commit ea52c33a authored by Mccaskey, Alex's avatar Mccaskey, Alex
Browse files

updating manylinux build to include xacc-dwave



Signed-off-by: Mccaskey, Alex's avatarAlex McCaskey <mccaskeyaj@ornl.gov>
parent b6fee221
Pipeline #43692 failed with stages
in 5 minutes and 8 seconds
...@@ -51,6 +51,18 @@ RUN export PATH=$PATH:/opt/devtools-6.2/bin \ ...@@ -51,6 +51,18 @@ RUN export PATH=$PATH:/opt/devtools-6.2/bin \
&& /opt/_internal/cpython-3.6.4/bin/python /xacc/tools/wheels/null_rpaths.py -v repair dist/xacc_rigetti-$rigettiVersion-${python_version_str}-linux_x86_64.whl \ && /opt/_internal/cpython-3.6.4/bin/python /xacc/tools/wheels/null_rpaths.py -v repair dist/xacc_rigetti-$rigettiVersion-${python_version_str}-linux_x86_64.whl \
&& cp wheelhouse/xacc_rigetti-$rigettiVersion-${python_version_str}-manylinux1_x86_64.whl /all_wheels && cp wheelhouse/xacc_rigetti-$rigettiVersion-${python_version_str}-manylinux1_x86_64.whl /all_wheels
RUN export PATH=$PATH:/opt/devtools-6.2/bin \
&& cd / && git clone --recursive https://github.com/ornl-qci/xacc-dwave && cd xacc-dwave \
&& export myPython=/opt/python/${python_version_str}/bin/python \
&& export dwaveVersion=$($myPython -c "import os; print(open(os.path.join(os.getcwd(), 'VERSION')).read().strip())") \
&& PYTHONPATH=/xacc/build/lib.linux-x86_64-${python_version}/xacc \
$myPython setup.py build -t tmp \
&& mkdir -p build/lib.linux-x86_64-${python_version}/xacc/lib \
&& PYTHONPATH=/xacc/build/lib.linux-x86_64-${python_version}/xacc \
$myPython setup.py bdist_wheel --skip-build \
&& /opt/_internal/cpython-3.6.4/bin/python /xacc/tools/wheels/null_rpaths.py -v repair dist/xacc_dwave-$dwaveVersion-${python_version_str}-linux_x86_64.whl \
&& cp wheelhouse/xacc_dwave-$dwaveVersion-${python_version_str}-manylinux1_x86_64.whl /all_wheels
RUN export PATH=$PATH:/opt/devtools-6.2/bin \ RUN export PATH=$PATH:/opt/devtools-6.2/bin \
&& cd / && git clone --recursive https://github.com/ornl-qci/xacc-ibm && cd xacc-ibm \ && cd / && git clone --recursive https://github.com/ornl-qci/xacc-ibm && cd xacc-ibm \
&& export myPython=/opt/python/${python_version_str}/bin/python \ && export myPython=/opt/python/${python_version_str}/bin/python \
......
#!/bin/bash
for version in cp37-cp37m cp36-cp36m cp35-cp35m cp34-cp34m cp33-cp33m
do
export ver=`case $version in "cp36-cp36m") echo 3.6 ;; "cp37-cp37m") echo 3.7 ;; "cp35-cp35m") echo 3.5 ;; "cp34-cp34m") echo 3.4 ;; "cp33-cp33m") echo 3.3 ;; "cp27-cp27m") echo 2.7 ;; "cp27-cp27mu") echo 2.7 ;; *) echo "invalid";; esac`
docker build -t xacc/wheels --build-arg python_version_str=${version} --build-arg python_version=${ver} . --no-cache
tmpid=$(docker run -d xacc/wheels bash -c "mkdir extract; cd extract ; mv /all_wheels/*.whl /extract ") && sleep 5 && docker cp $tmpid:/extract . && docker rm -v $tmpid
cd extract && mkdir -p ${version} && mv *.whl ${version}/ && cd ${version}
testid=$(docker run -d --rm python:3.6 bash -c "tail -f /dev/null") && for wheel in *; do docker cp $wheel $testid:/ ; done && docker exec -it $testid bash -c "python -m pip install *.whl && python -c \"import xacc; xacc.Initialize()\"" && docker stop $testid
cd ../../
done
...@@ -31,7 +31,7 @@ public: ...@@ -31,7 +31,7 @@ public:
const std::string name() const override { return "improved-sampling"; } const std::string name() const override { return "improved-sampling"; }
const std::string description() const override { return ""; } const std::string description() const override { return ""; }
virtual std::shared_ptr<options_description> getOptions() { std::shared_ptr<options_description> getOptions() override {
auto desc = std::make_shared<options_description>(); auto desc = std::make_shared<options_description>();
desc->add_options()("sampler-n-execs", value<std::string>(), ""); desc->add_options()("sampler-n-execs", value<std::string>(), "");
return desc; return desc;
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
namespace xacc { namespace xacc {
namespace quantum { namespace quantum {
class ROErrorDecorator : public AcceleratorDecorator { class ROErrorDecorator : public AcceleratorDecorator {
public: public:
...@@ -32,7 +32,7 @@ public: ...@@ -32,7 +32,7 @@ public:
const std::string name() const override { return "ro-error"; } const std::string name() const override { return "ro-error"; }
const std::string description() const override { return ""; } const std::string description() const override { return ""; }
virtual std::shared_ptr<options_description> getOptions() { std::shared_ptr<options_description> getOptions() override {
auto desc = std::make_shared<options_description>(); auto desc = std::make_shared<options_description>();
desc->add_options()("ro-error-p10s", value<std::string>(), ""); desc->add_options()("ro-error-p10s", value<std::string>(), "");
return desc; return desc;
......
...@@ -27,7 +27,7 @@ public: ...@@ -27,7 +27,7 @@ public:
ConditionalFunction(int qbit) ConditionalFunction(int qbit)
: GateFunction("conditional_" + std::to_string(qbit)), qbitIdx(qbit) {} : GateFunction("conditional_" + std::to_string(qbit)), qbitIdx(qbit) {}
void addInstruction(InstPtr instruction) { void addInstruction(InstPtr instruction) override {
instruction->disable(); instruction->disable();
instructions.push_back(instruction); instructions.push_back(instruction);
} }
...@@ -42,7 +42,7 @@ public: ...@@ -42,7 +42,7 @@ public:
} }
} }
const std::string toString(const std::string &bufferVarName) { return ""; } const std::string toString(const std::string &bufferVarName) override { return ""; }
DEFINE_VISITABLE() DEFINE_VISITABLE()
}; };
......
#!/bin/bash
set -e
mkdir -p $HOME/wheelhouse
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
function clone {
git clone --recursive https://github.com/ornl-qci/$1
}
git clone --recursive https://github.com/eclipse/xacc
clone xacc-rigetti
clone xacc-ibm
clone xacc-vqe
clone tnqvm
clone xacc-dwave
for version in 3.4.7 3.5.4 3.6.4 3.7.0
do
pyenv virtualenv $version xacc-$version
pyenv activate xacc-$version
python --version
python -m pip install --upgrade pip
python -m pip install wheel ipopo configparser
export libPath=$(python -c "import distutils.util; print(distutils.util.get_platform())")
echo $libPath
cd xacc
export ver=`case $version in "3.6.4") echo 3.6 ;; "3.5.4") echo 3.5 ;; "3.5.0") echo 3.5 ;; "3.4.7") echo 3.4 ;; "3.3.7") echo 3.3 ;; "2.7.14") echo 2.7 ;; *) echo "invalid";; esac`
export verstr=`case $ver in "3.6") echo "cp36-cp36m" ;; "3.5") echo "cp35-cp35m" ;; "3.4") echo "cp34-cp34m" ;; "3.3") echo "cp33-cp33m" ;; "2.7") echo "cp27-cp27mu" ;; *) echo "invalid";; esac`
# ------------------- XACC BUILD ------------------#
python setup.py build -t tmp_build --executable="/usr/bin/env python"
export buildPath=build/lib.$libPath-$ver
echo "./xacc" >> build/lib.$libPath-$ver/xacc.pth
python setup.py bdist_wheel --skip-build
mv dist/*.whl $HOME/wheelhouse/
export prefix="build\/lib."
export suffix="-$ver"
export arch=$(echo $libPath | sed -e "s/^$prefix//" -e "s/$suffix$//" | sed -e 's/-/_/g' | sed -e 's/\./_/g')
echo $arch
echo $verstr
which python
export xaccdir=$(pwd)
# ---------------- RIGETTI BUILD -------------------#
cd ../xacc-rigetti
PYTHONPATH=../xacc/$buildPath/xacc python setup.py build -t tmp_build --executable="/usr/bin/env python"
python setup.py bdist_wheel --skip-build
mv dist/*.whl $HOME/wheelhouse/
# ---------------- DWAVE BUILD -------------------#
cd ../xacc-dwave
PYTHONPATH=../xacc/$buildPath/xacc python setup.py build -t tmp_build --executable="/usr/bin/env python"
python setup.py bdist_wheel --skip-build
mv dist/*.whl $HOME/wheelhouse/
# ---------------- IBM BUILD -------------------#
cd ../xacc-ibm
PYTHONPATH=../xacc/$buildPath/xacc python setup.py build -t tmp_build --executable="/usr/bin/env python"
python setup.py bdist_wheel --skip-build
mv dist/*.whl $HOME/wheelhouse/
# ---------------- TNQVM BUILD -------------------#
cd ../tnqvm
PYTHONPATH=../xacc/$buildPath/xacc python setup.py build -t tmp_build --executable="/usr/bin/env python"
python setup.py bdist_wheel --skip-build
mv dist/*.whl $HOME/wheelhouse/
# ---------------- VQE BUILD -------------------#
cd ../xacc-vqe
PYTHONPATH=../xacc/$buildPath/xacc python setup.py build -t tmp_build --executable="/usr/bin/env python"
python setup.py bdist_wheel --skip-build
mv dist/*.whl $HOME/wheelhouse/
cd ..
#python -m pip uninstall -y xacc
source deactivate
pyenv uninstall -f xacc-$version
done
...@@ -90,7 +90,7 @@ s = setup( ...@@ -90,7 +90,7 @@ s = setup(
long_description='XACC provides a language and hardware agnostic programming framework for hybrid classical-quantum applications.', long_description='XACC provides a language and hardware agnostic programming framework for hybrid classical-quantum applications.',
ext_modules=[CMakeExtension('xacc')], ext_modules=[CMakeExtension('xacc')],
install_requires=['ipopo', 'configparser'], install_requires=['ipopo', 'configparser'],
extras_require={'all':['xacc-rigetti','xacc-ibm','tnqvm','xacc-vqe']}, extras_require={'all':['xacc-rigetti','xacc-ibm','tnqvm','xacc-vqe','xacc-dwave']},
cmdclass={'build_ext':CMakeBuild}, cmdclass={'build_ext':CMakeBuild},
#scripts=['tools/framework/xacc-framework'], #scripts=['tools/framework/xacc-framework'],
zip_safe=False zip_safe=False
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment