From 6e3c411d1e845fa7f4e09d39ce0824ff419f968d Mon Sep 17 00:00:00 2001 From: whitequark Date: Fri, 9 Oct 2015 14:26:31 +0300 Subject: [PATCH 1/9] conda: add pyelftools recipe. --- conda/pyelftools/bld.bat | 1 + conda/pyelftools/build.sh | 1 + conda/pyelftools/meta.yaml | 24 ++++++++++++++++++++++++ 3 files changed, 26 insertions(+) create mode 100644 conda/pyelftools/bld.bat create mode 100644 conda/pyelftools/build.sh create mode 100644 conda/pyelftools/meta.yaml diff --git a/conda/pyelftools/bld.bat b/conda/pyelftools/bld.bat new file mode 100644 index 000000000..39b5e1fee --- /dev/null +++ b/conda/pyelftools/bld.bat @@ -0,0 +1 @@ +%PYTHON% setup.py install diff --git a/conda/pyelftools/build.sh b/conda/pyelftools/build.sh new file mode 100644 index 000000000..5a5aeeb48 --- /dev/null +++ b/conda/pyelftools/build.sh @@ -0,0 +1 @@ +$PYTHON setup.py install diff --git a/conda/pyelftools/meta.yaml b/conda/pyelftools/meta.yaml new file mode 100644 index 000000000..5b64122a9 --- /dev/null +++ b/conda/pyelftools/meta.yaml @@ -0,0 +1,24 @@ +package: + name: pyelftools + version: 0.23 + +source: + git_url: https://github.com/eliben/pyelftools.git + git_tag: v0.23 + +build: + number: 1 + +requirements: + build: + - python + - setuptools + +test: + imports: + - elftools + +about: + home: https://github.com/eliben/pyelftools.git + license: Public domain + summary: 'Library for analyzing ELF files and DWARF debugging information' From 354c3c8244ef44e1c5a2088facdc3bdb99ee89b4 Mon Sep 17 00:00:00 2001 From: whitequark Date: Fri, 9 Oct 2015 15:01:03 +0300 Subject: [PATCH 2/9] conda: fix pyelftools dependencies. --- conda/pyelftools/meta.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/conda/pyelftools/meta.yaml b/conda/pyelftools/meta.yaml index 5b64122a9..f65b271dd 100644 --- a/conda/pyelftools/meta.yaml +++ b/conda/pyelftools/meta.yaml @@ -7,12 +7,14 @@ source: git_tag: v0.23 build: - number: 1 + number: 0 requirements: build: - python - setuptools + run: + - python test: imports: From 06d5a0f58ddebf2228aa1a827f5b48282f48f50d Mon Sep 17 00:00:00 2001 From: whitequark Date: Fri, 9 Oct 2015 15:05:12 +0300 Subject: [PATCH 3/9] conda: add README. --- conda/README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 conda/README.md diff --git a/conda/README.md b/conda/README.md new file mode 100644 index 000000000..e37f241c8 --- /dev/null +++ b/conda/README.md @@ -0,0 +1,18 @@ +Uploading conda packages (Python 3.5) +===================================== + +Preparing: + + 1. [Install miniconda][miniconda] + 2. `conda update -q conda` + 3. `conda install conda-build` + 4. `conda create -q -n py35 python=3.5` + 5. `conda config --add channels https://conda.anaconda.org/m-labs/channel/dev` + +Building: + + 1. `source activate py35` + 2. `conda build pkgname --python 3.5`; this command displays a path to the freshly built package + 3. `anaconda upload -c main -c dev` + +[miniconda]: http://conda.pydata.org/docs/install/quick.html#linux-miniconda-install From 87b573c8131d1961d466428a9ad9a5f69d20bf57 Mon Sep 17 00:00:00 2001 From: whitequark Date: Fri, 9 Oct 2015 15:21:50 +0300 Subject: [PATCH 4/9] travis: use main conda m-labs channel. --- .travis/get-anaconda.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis/get-anaconda.sh b/.travis/get-anaconda.sh index 790a723ad..bf76e2fa3 100755 --- a/.travis/get-anaconda.sh +++ b/.travis/get-anaconda.sh @@ -10,4 +10,4 @@ conda update -q conda conda info -a conda install conda-build jinja2 conda create -q -n py35 python=$TRAVIS_PYTHON_VERSION -conda config --add channels https://conda.anaconda.org/m-labs/channel/dev +conda config --add channels https://conda.anaconda.org/m-labs/channel/main From 0cc8f19b6b441b323b8ab7647c53595029c33e1e Mon Sep 17 00:00:00 2001 From: whitequark Date: Fri, 9 Oct 2015 16:14:13 +0300 Subject: [PATCH 5/9] travis: expand matrix to run a build with BUILD_SOC=0. BUILD_SOC=1 build takes over 40 minutes, most of them spent in Xilinx tools, which means all the other changes cannot be tested quickly. --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2271bbd2e..e2e7a4033 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,8 +4,10 @@ python: sudo: false env: global: - - BUILD_SOC=1 - secure: "DUk/Ihg8KbbzEgPF0qrHqlxU8e8eET9i/BtzNvFddIGX4HP/P2qz0nk3cVkmjuWhqJXSbC22RdKME9qqPzw6fJwJ6dpJ3OR6dDmSd7rewavq+niwxu52PVa+yK8mL4yf1terM7QQ5tIRf+yUL9qGKrZ2xyvEuRit6d4cFep43Ws=" + matrix: + - BUILD_SOC=0 + - BUILD_SOC=1 before_install: - mkdir -p $HOME/.mlabs - if [ $TRAVIS_PULL_REQUEST != false ]; then BUILD_SOC=0; fi From a9230d33f2e9ec627974546fd02754e7b52e977d Mon Sep 17 00:00:00 2001 From: whitequark Date: Fri, 9 Oct 2015 16:27:04 +0300 Subject: [PATCH 6/9] conda: skip bitstream builds if BUILD_SOC=0. --- .travis.yml | 10 +++++++--- .travis/get-xilinx.sh | 2 +- conda/artiq/build.sh | 12 ++++++------ 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index e2e7a4033..7ed278574 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,7 @@ before_install: - if [ $BUILD_SOC -ne 0 ]; then ./.travis/get-xilinx.sh; fi - . ./.travis/get-toolchain.sh - . ./.travis/get-anaconda.sh + - echo "BUILD_SOC=$BUILD_SOC" >> $HOME/.mlabs/build_settings.sh - source $HOME/miniconda/bin/activate py35 - conda install -q pip coverage anaconda-client migen cython - pip install coveralls @@ -24,9 +25,12 @@ script: - coverage run --source=artiq setup.py test - make -C doc/manual html after_success: - - anaconda -q login --hostname $(hostname) --username $binstar_login --password $binstar_password - - if [ "$TRAVIS_BRANCH" == "master" ]; then anaconda -q upload --user $binstar_login --channel dev --force $HOME/miniconda/conda-bld/linux-64/artiq-*.tar.bz2; fi - - anaconda -q logout + - | + if [ "$TRAVIS_BRANCH" == "master" -a $BUILD_SOC -eq 1 ]; then + anaconda -q login --hostname $(hostname) --username $binstar_login --password $binstar_password + anaconda -q upload --user $binstar_login --channel dev --force $HOME/miniconda/conda-bld/linux-64/artiq-*.tar.bz2 + anaconda -q logout + fi - coveralls notifications: email: diff --git a/.travis/get-xilinx.sh b/.travis/get-xilinx.sh index ccb6a5059..0f37893b3 100755 --- a/.travis/get-xilinx.sh +++ b/.travis/get-xilinx.sh @@ -30,7 +30,7 @@ git clone https://github.com/fallen/impersonate_macaddress make -C impersonate_macaddress # Tell mibuild where Xilinx toolchains are installed # and feed it the mac address corresponding to the license -cat > $HOME/.mlabs/build_settings.sh << EOF +cat >> $HOME/.mlabs/build_settings.sh << EOF MISOC_EXTRA_VIVADO_CMDLINE="-Ob vivado_path $HOME/Xilinx/Vivado" MISOC_EXTRA_ISE_CMDLINE="-Ob ise_path $HOME/opt/Xilinx/" export MACADDR=$macaddress diff --git a/conda/artiq/build.sh b/conda/artiq/build.sh index 959e8a692..4d574de48 100755 --- a/conda/artiq/build.sh +++ b/conda/artiq/build.sh @@ -20,14 +20,14 @@ mkdir -p $BIN_PREFIX/kc705 $BIN_PREFIX/pipistrello cd $SRC_DIR/misoc; $PYTHON make.py -X ../soc -t artiq_kc705 build-headers build-bios; cd - make -C soc/runtime clean runtime.fbi -cd $SRC_DIR/misoc; $PYTHON make.py -X ../soc -t artiq_kc705 $MISOC_EXTRA_VIVADO_CMDLINE build-bitstream; cd - +[ "$BUILD_SOC" != "0" ] && (cd $SRC_DIR/misoc; $PYTHON make.py -X ../soc -t artiq_kc705 $MISOC_EXTRA_VIVADO_CMDLINE build-bitstream) # install KC705 NIST_QC1 binaries mkdir -p $BIN_PREFIX/kc705/nist_qc1 cp soc/runtime/runtime.fbi $BIN_PREFIX/kc705/nist_qc1/ cp $SRC_DIR/misoc/software/bios/bios.bin $BIN_PREFIX/kc705/ -cp $SRC_DIR/misoc/build/artiq_kc705-nist_qc1-kc705.bit $BIN_PREFIX/kc705/ +[ "$BUILD_SOC" != "0" ] && cp $SRC_DIR/misoc/build/artiq_kc705-nist_qc1-kc705.bit $BIN_PREFIX/kc705/ wget http://sionneau.net/artiq/binaries/kc705/flash_proxy/bscan_spi_kc705.bit mv bscan_spi_kc705.bit $BIN_PREFIX/kc705/ @@ -35,13 +35,13 @@ mv bscan_spi_kc705.bit $BIN_PREFIX/kc705/ cd $SRC_DIR/misoc; $PYTHON make.py -X ../soc -t artiq_pipistrello build-headers build-bios; cd - make -C soc/runtime clean runtime.fbi -cd $SRC_DIR/misoc; $PYTHON make.py -X ../soc -t artiq_pipistrello $MISOC_EXTRA_ISE_CMDLINE build-bitstream; cd - +[ "$BUILD_SOC" != "0" ] && (cd $SRC_DIR/misoc; $PYTHON make.py -X ../soc -t artiq_pipistrello $MISOC_EXTRA_ISE_CMDLINE build-bitstream) # install Pipistrello binaries cp soc/runtime/runtime.fbi $BIN_PREFIX/pipistrello/ cp $SRC_DIR/misoc/software/bios/bios.bin $BIN_PREFIX/pipistrello/ -cp $SRC_DIR/misoc/build/artiq_pipistrello-nist_qc1-pipistrello.bit $BIN_PREFIX/pipistrello/ +[ "$BUILD_SOC" != "0" ] && cp $SRC_DIR/misoc/build/artiq_pipistrello-nist_qc1-pipistrello.bit $BIN_PREFIX/pipistrello/ wget https://people.phys.ethz.ch/~robertjo/bscan_spi_lx45_csg324.bit mv bscan_spi_lx45_csg324.bit $BIN_PREFIX/pipistrello/ @@ -49,13 +49,13 @@ mv bscan_spi_lx45_csg324.bit $BIN_PREFIX/pipistrello/ cd $SRC_DIR/misoc; $PYTHON make.py -X ../soc -t artiq_kc705 -s NIST_QC2 build-headers; cd - make -C soc/runtime clean runtime.fbi -cd $SRC_DIR/misoc; $PYTHON make.py -X ../soc -t artiq_kc705 -s NIST_QC2 $MISOC_EXTRA_VIVADO_CMDLINE build-bitstream; cd - +[ "$BUILD_SOC" != "0" ] && (cd $SRC_DIR/misoc; $PYTHON make.py -X ../soc -t artiq_kc705 -s NIST_QC2 $MISOC_EXTRA_VIVADO_CMDLINE build-bitstream) # install KC705 NIST_QC2 binaries mkdir -p $BIN_PREFIX/kc705/nist_qc2 cp soc/runtime/runtime.fbi $BIN_PREFIX/kc705/nist_qc2/ -cp $SRC_DIR/misoc/build/artiq_kc705-nist_qc2-kc705.bit $BIN_PREFIX/kc705/ +[ "$BUILD_SOC" != "0" ] && cp $SRC_DIR/misoc/build/artiq_kc705-nist_qc2-kc705.bit $BIN_PREFIX/kc705/ cp artiq/frontend/artiq_flash.sh $PREFIX/bin From db061bc43dc8047529e69ec4852122f5b039a3cb Mon Sep 17 00:00:00 2001 From: whitequark Date: Fri, 9 Oct 2015 20:17:57 +0300 Subject: [PATCH 7/9] Revert "travis: use main conda m-labs channel." This reverts commit 87b573c8131d1961d466428a9ad9a5f69d20bf57. --- .travis/get-anaconda.sh | 2 +- conda/artiq/meta.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis/get-anaconda.sh b/.travis/get-anaconda.sh index bf76e2fa3..790a723ad 100755 --- a/.travis/get-anaconda.sh +++ b/.travis/get-anaconda.sh @@ -10,4 +10,4 @@ conda update -q conda conda info -a conda install conda-build jinja2 conda create -q -n py35 python=$TRAVIS_PYTHON_VERSION -conda config --add channels https://conda.anaconda.org/m-labs/channel/main +conda config --add channels https://conda.anaconda.org/m-labs/channel/dev diff --git a/conda/artiq/meta.yaml b/conda/artiq/meta.yaml index 6dacc0293..e96b8d4bb 100644 --- a/conda/artiq/meta.yaml +++ b/conda/artiq/meta.yaml @@ -31,7 +31,7 @@ requirements: - python >=3.5.0 - setuptools - numpy - - migen + - migen 0.0 - pyelftools - binutils-or1k-linux run: From a05d04b0167a399908959a25beecc0e044507d59 Mon Sep 17 00:00:00 2001 From: whitequark Date: Fri, 9 Oct 2015 22:50:51 +0300 Subject: [PATCH 8/9] conda: add missing recipes. [ci skip] --- conda/chardet/bld.bat | 2 ++ conda/chardet/build.sh | 1 + conda/chardet/meta.yaml | 33 +++++++++++++++++++++++++++++++++ conda/dateutil/bld.bat | 1 + conda/dateutil/build.sh | 1 + conda/dateutil/meta.yaml | 30 ++++++++++++++++++++++++++++++ conda/sphinx-argparse/bld.bat | 1 + conda/sphinx-argparse/build.sh | 1 + conda/sphinx-argparse/meta.yaml | 28 ++++++++++++++++++++++++++++ 9 files changed, 98 insertions(+) create mode 100644 conda/chardet/bld.bat create mode 100644 conda/chardet/build.sh create mode 100644 conda/chardet/meta.yaml create mode 100644 conda/dateutil/bld.bat create mode 100644 conda/dateutil/build.sh create mode 100644 conda/dateutil/meta.yaml create mode 100644 conda/sphinx-argparse/bld.bat create mode 100644 conda/sphinx-argparse/build.sh create mode 100644 conda/sphinx-argparse/meta.yaml diff --git a/conda/chardet/bld.bat b/conda/chardet/bld.bat new file mode 100644 index 000000000..c40a9bbef --- /dev/null +++ b/conda/chardet/bld.bat @@ -0,0 +1,2 @@ +"%PYTHON%" setup.py install +if errorlevel 1 exit 1 diff --git a/conda/chardet/build.sh b/conda/chardet/build.sh new file mode 100644 index 000000000..5a5aeeb48 --- /dev/null +++ b/conda/chardet/build.sh @@ -0,0 +1 @@ +$PYTHON setup.py install diff --git a/conda/chardet/meta.yaml b/conda/chardet/meta.yaml new file mode 100644 index 000000000..e9b7c795c --- /dev/null +++ b/conda/chardet/meta.yaml @@ -0,0 +1,33 @@ +package: + name: chardet + version: 2.2.1 + +source: + fn: chardet-2.2.1.tar.gz + url: https://pypi.python.org/packages/source/c/chardet/chardet-2.2.1.tar.gz + md5: 4a758402eaefd0331bdedc7ecb6f452c + +build: + entry_points: + - chardetect = chardet.chardetect:main + number: 0 + +requirements: + build: + - python + - setuptools + + run: + - python + +test: + # Python imports + imports: + - chardet + + commands: + - chardetect run_test.py + +about: + home: https://github.com/chardet/chardet + license: GNU Library or Lesser General Public License (LGPL) diff --git a/conda/dateutil/bld.bat b/conda/dateutil/bld.bat new file mode 100644 index 000000000..39b5e1fee --- /dev/null +++ b/conda/dateutil/bld.bat @@ -0,0 +1 @@ +%PYTHON% setup.py install diff --git a/conda/dateutil/build.sh b/conda/dateutil/build.sh new file mode 100644 index 000000000..5a5aeeb48 --- /dev/null +++ b/conda/dateutil/build.sh @@ -0,0 +1 @@ +$PYTHON setup.py install diff --git a/conda/dateutil/meta.yaml b/conda/dateutil/meta.yaml new file mode 100644 index 000000000..fd9d40a3e --- /dev/null +++ b/conda/dateutil/meta.yaml @@ -0,0 +1,30 @@ +package: + name: dateutil + version: 2.4.2 + +source: + fn: python-dateutil-2.4.2.tar.gz + url: https://pypi.python.org/packages/source/p/python-dateutil/python-dateutil-2.4.2.tar.gz + md5: 4ef68e1c485b09e9f034e10473e5add2 + +build: + number: 0 + +requirements: + build: + - python + - setuptools + - six >=1.5 + run: + - python + - six >=1.5 + +test: + imports: + - dateutil + - dateutil.zoneinfo + +about: + home: https://dateutil.readthedocs.org + license: BSD + summary: 'Extensions to the standard Python datetime module' diff --git a/conda/sphinx-argparse/bld.bat b/conda/sphinx-argparse/bld.bat new file mode 100644 index 000000000..39b5e1fee --- /dev/null +++ b/conda/sphinx-argparse/bld.bat @@ -0,0 +1 @@ +%PYTHON% setup.py install diff --git a/conda/sphinx-argparse/build.sh b/conda/sphinx-argparse/build.sh new file mode 100644 index 000000000..5a5aeeb48 --- /dev/null +++ b/conda/sphinx-argparse/build.sh @@ -0,0 +1 @@ +$PYTHON setup.py install diff --git a/conda/sphinx-argparse/meta.yaml b/conda/sphinx-argparse/meta.yaml new file mode 100644 index 000000000..6ead92292 --- /dev/null +++ b/conda/sphinx-argparse/meta.yaml @@ -0,0 +1,28 @@ +package: + name: sphinx-argparse + version: 0.1.13 + +source: + fn: sphinx-argparse-0.1.13.tar.gz + url: https://pypi.python.org/packages/source/s/sphinx-argparse/sphinx-argparse-0.1.13.tar.gz + md5: 5ec84e75e1c4b2ae7ca5fb92a6abd738 + +build: + number: 0 + +requirements: + build: + - python + - setuptools + - sphinx + run: + - python + - sphinx + +test: + imports: + - sphinxarg + +about: + license: MIT + summary: 'Sphinx extension that automatically documents argparse commands and options' From 6d0ec2f01d5bbdd55db0158edd1a1c03959e8f76 Mon Sep 17 00:00:00 2001 From: whitequark Date: Sat, 10 Oct 2015 03:50:58 +0300 Subject: [PATCH 9/9] travis: export llvm-or1k lib/ in LD_LIBRARY_PATH. The llvm-or1k build that is currently used is dynamically linked, and in case llvmlite-artiq is linked with this llvm-or1k, this is necessary to run ARTIQ. --- .travis/get-toolchain.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.travis/get-toolchain.sh b/.travis/get-toolchain.sh index 73c268d0a..9b62ad225 100755 --- a/.travis/get-toolchain.sh +++ b/.travis/get-toolchain.sh @@ -19,11 +19,10 @@ do done export PATH=$PWD/packages/usr/local/llvm-or1k/bin:$PWD/packages/usr/local/bin:$PWD/packages/usr/bin:$PATH -export LD_LIBRARY_PATH=$PWD/packages/usr/lib/x86_64-linux-gnu:$PWD/packages/usr/local/x86_64-unknown-linux-gnu/or1k-elf/lib:$LD_LIBRARY_PATH +export LD_LIBRARY_PATH=$PWD/packages/usr/local/llvm-or1k/lib:$PWD/packages/usr/lib/x86_64-linux-gnu:$PWD/packages/usr/local/x86_64-unknown-linux-gnu/or1k-elf/lib:$LD_LIBRARY_PATH -echo "export LD_LIBRARY_PATH=$PWD/packages/usr/lib/x86_64-linux-gnu:$PWD/packages/usr/local/x86_64-unknown-linux-gnu/or1k-elf/lib:\$LD_LIBRARY_PATH" >> $HOME/.mlabs/build_settings.sh echo "export PATH=$PWD/packages/usr/local/llvm-or1k/bin:$PWD/packages/usr/local/bin:$PWD/packages/usr/bin:\$PATH" >> $HOME/.mlabs/build_settings.sh +echo "export LD_LIBRARY_PATH=$PWD/packages/usr/local/llvm-or1k/lib:$PWD/packages/usr/lib/x86_64-linux-gnu:$PWD/packages/usr/local/x86_64-unknown-linux-gnu/or1k-elf/lib:\$LD_LIBRARY_PATH" >> $HOME/.mlabs/build_settings.sh -or1k-linux-as --version llc --version clang --version