diff --git a/.appveyor.yml b/.appveyor.yml index e6cc8abe7..c4a53813c 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -73,7 +73,6 @@ build_script: bash -c "cd /c/projects/cmake-cookbook-no-symlinks && pipenv run python testing/collect_tests.py 'chapter-11/recipe-04'" && bash -c "cd /c/projects/cmake-cookbook-no-symlinks && pipenv run python testing/collect_tests.py 'chapter-11/recipe-05'" ) else ( - bash -c "cd /c/projects/cmake-cookbook-no-symlinks && pipenv run python testing/collect_tests.py 'chapter-14/recipe-*'" && bash -c "cd /c/projects/cmake-cookbook-no-symlinks && pipenv run python testing/collect_tests.py 'chapter-01/recipe-*'" && bash -c "cd /c/projects/cmake-cookbook-no-symlinks && pipenv run python testing/collect_tests.py 'chapter-02/recipe-*'" && bash -c "cd /c/projects/cmake-cookbook-no-symlinks && pipenv run python testing/collect_tests.py 'chapter-03/recipe-*'" && @@ -86,7 +85,8 @@ build_script: bash -c "cd /c/projects/cmake-cookbook-no-symlinks && pipenv run python testing/collect_tests.py 'chapter-10/recipe-*'" && bash -c "cd /c/projects/cmake-cookbook-no-symlinks && pipenv run python testing/collect_tests.py 'chapter-11/recipe-0[1-3]'" && bash -c "cd /c/projects/cmake-cookbook-no-symlinks && pipenv run python testing/collect_tests.py 'chapter-12/recipe-*'" && - bash -c "cd /c/projects/cmake-cookbook-no-symlinks && pipenv run python testing/collect_tests.py 'chapter-13/recipe-*'" + bash -c "cd /c/projects/cmake-cookbook-no-symlinks && pipenv run python testing/collect_tests.py 'chapter-13/recipe-*'" && + bash -c "cd /c/projects/cmake-cookbook-no-symlinks && pipenv run python testing/collect_tests.py 'chapter-14/recipe-*'" ) deploy: off diff --git a/.circleci/config.yml b/.circleci/config.yml index 7fb449076..14cec9a4b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -47,7 +47,7 @@ variables: pipenv run python testing/collect_tests.py 'chapter-08/recipe-*' && pipenv run python testing/collect_tests.py 'chapter-09/recipe-*' && pipenv run python testing/collect_tests.py 'chapter-10/recipe-*' && - pipenv run python testing/collect_tests.py 'chapter-11/recipe-0[1,3]' && + pipenv run python testing/collect_tests.py 'chapter-11/recipe-0[1-3]' && pipenv run python testing/collect_tests.py 'chapter-12/recipe-*' && pipenv run python testing/collect_tests.py 'chapter-13/recipe-*' && pipenv run python testing/collect_tests.py 'chapter-14/recipe-*' diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..73a5e4bea --- /dev/null +++ b/.editorconfig @@ -0,0 +1,23 @@ +# EditorConfig is awesome: https://EditorConfig.org + +# top-most EditorConfig file +root = true + +[*] +charset = utf-8 +insert_final_newline = true +trim_trailing_whitespace = true +indent_style = space + +[*.py] +indent_size = 4 + +[*.{c,h,cpp,hpp,f90,F90}] +indent_size = 2 + +[*.rst] +indent_size = 3 +tab_size = 3 + +[*.yml] +indent_size = 2 diff --git a/.travis.yml b/.travis.yml index 3b7f4effb..4e4fa6ddc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,42 +10,44 @@ matrix: sources: - ubuntu-toolchain-r-test packages: + - chrpath - doxygen - g++-7 - g++-mingw-w64 + - gcc-7 - gcc-mingw-w64 - - gfortran - gfortran-7 - gfortran-mingw-w64 - graphviz - libatlas-dev - - libboost1.55-all-dev + - libboost-filesystem-dev + - libboost-python-dev + - libboost-test-dev - liblapack-dev - liblapacke-dev - libopenmpi-dev - - libpython3-all-dev + - libpython3.5-dev - libzmq3-dev - openmpi-bin - pkg-config - - python3 - - python3-dev + - python3.5-dev - rpm - uuid-dev env: - - CMAKE_VERSION="3.11.2" + - CMAKE_VERSION="3.12.1" - CMAKE_GENERATOR="Unix Makefiles" - BUILDFLAGS="VERBOSE=1" - os: linux addons: *1 env: - - CMAKE_VERSION="3.11.2" + - CMAKE_VERSION="3.12.1" - CMAKE_GENERATOR="Unix Makefiles" - BUILDFLAGS="VERBOSE=1" - ANACONDA_TESTS_ONLY=1 - os: linux addons: *1 env: - - CMAKE_VERSION="3.11.2" + - CMAKE_VERSION="3.12.1" - CMAKE_GENERATOR="Ninja" - BUILDFLAGS="-v" - os: linux @@ -89,7 +91,7 @@ cache: pip: true directories: - $HOME/Deps/cmake/3.5.2 - - $HOME/Deps/cmake/3.11.2 + - $HOME/Deps/cmake/3.12.1 - $HOME/Deps/eigen - $HOME/Deps/ninja - $HOME/Deps/conda @@ -101,10 +103,17 @@ env: - LANG="en_US.UTF-8" - LANGUAGE="en_US.UTF-8" - PYTHONIOENCODING=UTF-8 + # Invalidate PYENV_ROOT + - PYENV_ROOT=$HOME/fuffa before_install: # Dependencies are downloaded in $HOME/Downloads and installed in $HOME/Deps - mkdir -p $HOME/Downloads $HOME/Deps + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then + export PYTHON3="/usr/bin/python3.5"; + else + export PYTHON3="/usr/local/bin/python3"; + fi install: - ./testing/dependencies/travis/install.sh @@ -113,33 +122,33 @@ install: - ./testing/dependencies/travis/anaconda.sh - ./testing/dependencies/travis/eigen.sh - export PATH=$HOME/Deps/cmake/$CMAKE_VERSION/bin${PATH:+:$PATH} - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then - pipenv install --python `type -P python3.4`; - else - pipenv install --three; - fi + - pipenv install --python $PYTHON3 - pipenv run python --version before_script: - - test -n $CC && unset CC - - test -n $CXX && unset CXX - - test -n $FC && unset FC + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then + test -n $CC && unset CC && export CC=gcc-7; + test -n $CXX && unset CXX && export CXX=g++-7; + test -n $FC && unset FC && export FC=gfortran-7; + else + test -n $CC && unset CC && export CC=gcc; + test -n $CXX && unset CXX && export CXX=g++; + test -n $FC && unset FC && export FC=gfortran; + fi script: - ./testing/dependencies/report_versions.sh - if [[ "$ANACONDA_TESTS_ONLY" == 1 ]]; then - travis_wait 20 pipenv run python testing/collect_tests.py 'chapter-11/recipe-04'; + travis_wait 20 pipenv run python testing/collect_tests.py 'chapter-11/recipe-04' && travis_wait 20 pipenv run python testing/collect_tests.py 'chapter-11/recipe-05'; else - pipenv run python testing/collect_tests.py 'chapter-0[1-7]/recipe-*'; - pipenv run python testing/collect_tests.py 'chapter-08/recipe-0(1|3|4|6)'; - travis_wait 30 pipenv run python testing/collect_tests.py 'chapter-08/recipe-0(2|5)'; - pipenv run python testing/collect_tests.py 'chapter-10/recipe-*'; - pipenv run python testing/collect_tests.py 'chapter-11/recipe-01*'; - pipenv run python testing/collect_tests.py 'chapter-11/recipe-02'; - pipenv run python testing/collect_tests.py 'chapter-11/recipe-03'; - pipenv run python testing/collect_tests.py 'chapter-12/recipe-*'; - pipenv run python testing/collect_tests.py 'chapter-13/recipe-*'; + pipenv run python testing/collect_tests.py 'chapter-0[1-7]/recipe-*' && + pipenv run python testing/collect_tests.py 'chapter-08/recipe-0[1|3-5]' && + travis_wait 30 pipenv run python testing/collect_tests.py 'chapter-08/recipe-02' && + pipenv run python testing/collect_tests.py 'chapter-09/recipe-*' && + pipenv run python testing/collect_tests.py 'chapter-10/recipe-*' && + pipenv run python testing/collect_tests.py 'chapter-11/recipe-0[1-3]' && + pipenv run python testing/collect_tests.py 'chapter-12/recipe-*' && + pipenv run python testing/collect_tests.py 'chapter-13/recipe-*' && pipenv run python testing/collect_tests.py 'chapter-14/recipe-*'; - pipenv run python testing/collect_tests.py 'chapter-15/recipe-*'; fi diff --git a/Pipfile b/Pipfile index 93d0547db..e7a6d6acf 100644 --- a/Pipfile +++ b/Pipfile @@ -13,14 +13,8 @@ colorama = "*" cython = "*" docopt = "*" numpy = "*" -pathlib = "*" -pycodestyle = "*" pyyaml = "*" sphinx = "*" -sphinx-rtd-theme = "*" -sphinxcontrib-bibtex = "*" -typing = "*" - [dev-packages] diff --git a/Pipfile.lock b/Pipfile.lock index 3f8fd4dac..419858cdc 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,20 @@ { "_meta": { "hash": { - "sha256": "2119c25ff7ff299852c9bb7bd3b03689f8332009a775d8dfc4780394b6e40b89" + "sha256": "620c45be4c55bea470fdc39b72b5e32813431d8bd39e85be8ab5ea1ac0096ebe" + }, + "host-environment-markers": { + "implementation_name": "cpython", + "implementation_version": "3.6.6", + "os_name": "posix", + "platform_machine": "x86_64", + "platform_python_implementation": "CPython", + "platform_release": "4.14.67", + "platform_system": "Linux", + "platform_version": "#1-NixOS SMP Fri Aug 24 11:09:23 UTC 2018", + "python_full_version": "3.6.6", + "python_version": "3.6", + "sys_platform": "linux" }, "pipfile-spec": 6, "requires": {}, @@ -30,61 +43,59 @@ }, "breathe": { "hashes": [ - "sha256:76e1f3706efeda2610d9a8e7b421d2877ff0654a3fe6d3190a8686536111a684", - "sha256:df5d2edd1cee0045082e550d68bca5ee6bd3a8da009d51212bd0b2fa201ab808" + "sha256:17b0aa0569ede04e04d45d27bd4e2353bfaddbee9a28cb01781c8493ef9971d0", + "sha256:e94370b8b607a32d9611ed8246e635f02c21dc6847f04e888a00f66a12694eff" ], - "index": "pypi", - "version": "==4.9.1" + "version": "==4.10.0" }, "certifi": { "hashes": [ - "sha256:13e698f54293db9f89122b0581843a782ad0934a4fe0172d2a980ba77fc61bb7", - "sha256:9fa520c1bacfb634fa7af20a76bcbd3d5fb390481724c597da32c719a7dca4b0" + "sha256:456048c7e371c089d0a77a5212fb37a2c2dce1e24146e3b7e0261736aaeaa22a", + "sha256:376690d6f16d32f9d1fe8932551d80b23e9d393a8578c5633a2ed39a64861638" ], - "version": "==2018.4.16" + "version": "==2018.8.24" }, "cffi": { "hashes": [ - "sha256:151b7eefd035c56b2b2e1eb9963c90c6302dc15fbd8c1c0a83a163ff2c7d7743", - "sha256:1553d1e99f035ace1c0544050622b7bc963374a00c467edafac50ad7bd276aef", "sha256:1b0493c091a1898f1136e3f4f991a784437fac3673780ff9de3bcf46c80b6b50", - "sha256:2ba8a45822b7aee805ab49abfe7eec16b90587f7f26df20c71dd89e45a97076f", - "sha256:3bb6bd7266598f318063e584378b8e27c67de998a43362e8fce664c54ee52d30", - "sha256:3c85641778460581c42924384f5e68076d724ceac0f267d66c757f7535069c93", - "sha256:3eb6434197633b7748cea30bf0ba9f66727cdce45117a712b29a443943733257", - "sha256:495c5c2d43bf6cebe0178eb3e88f9c4aa48d8934aa6e3cddb865c058da76756b", - "sha256:4c91af6e967c2015729d3e69c2e51d92f9898c330d6a851bf8f121236f3defd3", - "sha256:57b2533356cb2d8fac1555815929f7f5f14d68ac77b085d2326b571310f34f6e", - "sha256:770f3782b31f50b68627e22f91cb182c48c47c02eb405fd689472aa7b7aa16dc", + "sha256:87f37fe5130574ff76c17cab61e7d2538a16f843bb7bca8ebbc4b12de3078596", + "sha256:1553d1e99f035ace1c0544050622b7bc963374a00c467edafac50ad7bd276aef", + "sha256:151b7eefd035c56b2b2e1eb9963c90c6302dc15fbd8c1c0a83a163ff2c7d7743", + "sha256:edabd457cd23a02965166026fd9bfd196f4324fe6032e866d0f3bd0301cd486f", + "sha256:ba5e697569f84b13640c9e193170e89c13c6244c24400fc57e88724ef610cd31", "sha256:79f9b6f7c46ae1f8ded75f68cf8ad50e5729ed4d590c74840471fc2823457d04", + "sha256:b0f7d4a3df8f06cf49f9f121bead236e328074de6449866515cea4907bbc63d6", + "sha256:4c91af6e967c2015729d3e69c2e51d92f9898c330d6a851bf8f121236f3defd3", "sha256:7a33145e04d44ce95bcd71e522b478d282ad0eafaf34fe1ec5bbd73e662f22b6", - "sha256:857959354ae3a6fa3da6651b966d13b0a8bed6bbc87a0de7b38a549db1d2a359", - "sha256:87f37fe5130574ff76c17cab61e7d2538a16f843bb7bca8ebbc4b12de3078596", "sha256:95d5251e4b5ca00061f9d9f3d6fe537247e145a8524ae9fd30a2f8fbce993b5b", - "sha256:9d1d3e63a4afdc29bd76ce6aa9d58c771cd1599fbba8cf5057e7860b203710dd", - "sha256:a36c5c154f9d42ec176e6e620cb0dd275744aa1d804786a71ac37dc3661a5e95", - "sha256:a6a5cb8809091ec9ac03edde9304b3ad82ad4466333432b16d78ef40e0cce0d5", - "sha256:ae5e35a2c189d397b91034642cb0eab0e346f776ec2eb44a49a459e6615d6e2e", - "sha256:b0f7d4a3df8f06cf49f9f121bead236e328074de6449866515cea4907bbc63d6", "sha256:b75110fb114fa366b29a027d0c9be3709579602ae111ff61674d28c93606acca", - "sha256:ba5e697569f84b13640c9e193170e89c13c6244c24400fc57e88724ef610cd31", + "sha256:ae5e35a2c189d397b91034642cb0eab0e346f776ec2eb44a49a459e6615d6e2e", + "sha256:fdf1c1dc5bafc32bc5d08b054f94d659422b05aba244d6be4ddc1c72d9aa70fb", + "sha256:9d1d3e63a4afdc29bd76ce6aa9d58c771cd1599fbba8cf5057e7860b203710dd", "sha256:be2a9b390f77fd7676d80bc3cdc4f8edb940d8c198ed2d8c0be1319018c778e1", - "sha256:ca1bd81f40adc59011f58159e4aa6445fc585a32bb8ac9badf7a2c1aa23822f2", - "sha256:d5d8555d9bfc3f02385c1c37e9f998e2011f0db4f90e250e5bc0c0a85a813085", + "sha256:ed01918d545a38998bfa5902c7c00e0fee90e957ce036a4000a88e3fe2264917", + "sha256:857959354ae3a6fa3da6651b966d13b0a8bed6bbc87a0de7b38a549db1d2a359", + "sha256:2ba8a45822b7aee805ab49abfe7eec16b90587f7f26df20c71dd89e45a97076f", + "sha256:a36c5c154f9d42ec176e6e620cb0dd275744aa1d804786a71ac37dc3661a5e95", "sha256:e55e22ac0a30023426564b1059b035973ec82186ddddbac867078435801c7801", - "sha256:e90f17980e6ab0f3c2f3730e56d1fe9bcba1891eeea58966e89d352492cc74f4", + "sha256:3eb6434197633b7748cea30bf0ba9f66727cdce45117a712b29a443943733257", "sha256:ecbb7b01409e9b782df5ded849c178a0aa7c906cf8c5a67368047daab282b184", - "sha256:ed01918d545a38998bfa5902c7c00e0fee90e957ce036a4000a88e3fe2264917", - "sha256:edabd457cd23a02965166026fd9bfd196f4324fe6032e866d0f3bd0301cd486f", - "sha256:fdf1c1dc5bafc32bc5d08b054f94d659422b05aba244d6be4ddc1c72d9aa70fb" + "sha256:770f3782b31f50b68627e22f91cb182c48c47c02eb405fd689472aa7b7aa16dc", + "sha256:d5d8555d9bfc3f02385c1c37e9f998e2011f0db4f90e250e5bc0c0a85a813085", + "sha256:3c85641778460581c42924384f5e68076d724ceac0f267d66c757f7535069c93", + "sha256:ca1bd81f40adc59011f58159e4aa6445fc585a32bb8ac9badf7a2c1aa23822f2", + "sha256:3bb6bd7266598f318063e584378b8e27c67de998a43362e8fce664c54ee52d30", + "sha256:a6a5cb8809091ec9ac03edde9304b3ad82ad4466333432b16d78ef40e0cce0d5", + "sha256:57b2533356cb2d8fac1555815929f7f5f14d68ac77b085d2326b571310f34f6e", + "sha256:495c5c2d43bf6cebe0178eb3e88f9c4aa48d8934aa6e3cddb865c058da76756b", + "sha256:e90f17980e6ab0f3c2f3730e56d1fe9bcba1891eeea58966e89d352492cc74f4" ], - "index": "pypi", "version": "==1.11.5" }, "chardet": { "hashes": [ - "sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae", - "sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691" + "sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691", + "sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae" ], "version": "==3.0.4" }, @@ -93,53 +104,52 @@ "sha256:463f8483208e921368c9f306094eb6f725c6ca42b0f97e313cb5d5512459feda", "sha256:48eb22f4f8461b1df5734a074b57042430fb06e1d61bd1e11b078c0fe6d7a1f1" ], - "index": "pypi", "version": "==0.3.9" }, "cython": { "hashes": [ - "sha256:01487236575df8f17b46982071438dce4f7eaf8acc8fb99fca3510d343cd7a28", - "sha256:0671d17c7a27634d6819246e535241b951141ed0e3f6f2a6d618fd32344dae3e", - "sha256:0e6190d6971c46729f712dd7307a9c0a8c027bfa5b4d8f2edef106b01759926c", - "sha256:202587c754901d0678bd6ff89c707f099987928239049a528470c06c6c922cf8", - "sha256:345197ba9278cf6a914cb7421dc665a0531a219b0072abf6b0cebfdf68e75725", - "sha256:3a296b8d6b02f0e01ab04bedea658f43eef5ad2f8e586a820226ead1a677d9b1", - "sha256:484572a2b22823a967be106137a93f7d634db116b3f7accb37dbd760eda2fa9f", - "sha256:4c67c9c803e50ceff32cc5e4769c50fc8ae8df9c4e5cc592ce8310b5a1076d23", - "sha256:539038087c321911745fc2e77049209b1231300d481cb4d682b2f95c724814b3", - "sha256:58113e0683c3688594c112103d7e9f2d0092fd2d8297a220240bea22e184dfdd", - "sha256:65cb25ca4284804293a2404d1be3b5a98818be21a72791649bacbcfa4e431d41", - "sha256:699e765da2580e34b08473fc0acef3a2d7bcb7f13eb29401cd25236bcf000080", - "sha256:6b54c3470810cea49a8be90814d05c5325ceb9c5bf429fd86c36fc1b32dfc157", - "sha256:71ac1629e4eae2ed329be8caf45efea10bfe1af3d8767e12e64b83e4ea5a3250", - "sha256:722c179d3df8677f3daf45b1a2764678ed4f0aaddbaa7211a8a08ebfd907c0db", - "sha256:76ac2b08d3d956d77b574bb43cbf1d37bd58b9d50c04ba281303e695854ebc46", - "sha256:7eff1157be9e26bf7494288c89979ca69d593a009e2c7420a739e2cf1e0635f5", - "sha256:99546c8696d27d0efa639c77b2f8af6e61dc3a5073caae4f27ffd991ca926f42", - "sha256:a0c263b31d335f29c11f4a9e98fbcd908d0731d4ea99bfd27c1c47caaeb4ca2e", - "sha256:a29c66292605bff962adc26530c030607aa699206b12dfb84f131b0454e15df4", - "sha256:aed9f33b19d542eea56c38ef3862ca56147f7903648156cd57eabb0fe47c35d6", - "sha256:b57e733dd8871d2cc7358c2e0fe33027453afffbcd0ea6a537f54877cad5131c", - "sha256:d9272dd71ab78e87fa34a0a59bbd6acc9a9c0005c834a6fc8457ff9619dc6795", - "sha256:e9d5671bcbb90a41b0832fcb3872fcbaca3d68ff11ea09724dd6cbdf31d947fb", - "sha256:ee54646afb2b73b293c94cf079682d18d404ebd6c01122dc3980f111aec2d8ae", - "sha256:f16a87197939977824609005b73f9ebb291b9653a14e5f27afc1c5d6f981ba39" - ], - "index": "pypi", - "version": "==0.28.4" + "sha256:13c73e2ffa93a615851e03fad97591954d143b5b62361b9adef81f46a31cd8ef", + "sha256:9ec27681c5b1b457aacb1cbda5db04aa28b76da2af6e1e1fd15f233eafe6a0b0", + "sha256:13eab5a2835a84ff62db343035603044c908d2b3b6eec09d67fdf9970acf7ac9", + "sha256:022592d419fc754509d0e0461eb2958dbaa45fb60d51c8a61778c58994edbe36", + "sha256:ae4784f040a3313c8bd00c8d04934b7ade63dc59692d8f00a5235be8ed72a445", + "sha256:e22f21cf92a9f8f007a280e3b3462c886d9068132a6c698dec10ad6125e3ca1e", + "sha256:b2ba8310ebd3c0e0b884d5e95bbd99d467d6af922acd1e44fe4b819839b2150e", + "sha256:ef86de9299e4ab2ebb129fb84b886bf40b9aced9807c6d6d5f28b46fb905f82c", + "sha256:183b35a48f58862c4ec1e821f07bb7b1156c8c8559c85c32ae086f28947474eb", + "sha256:693a8619ef066ece055ed065a15cf440f9d3ebd1bca60e87ea19144833756433", + "sha256:87e57b5d730cfab225d95e7b23abbc0c6f77598bd66639e93c73ce8afbae6f38", + "sha256:07659f4c57582104d9486c071de512fbd7e087a3a630535298442cc0e20a3f5a", + "sha256:cdbb917e41220bd3812234dbe59d15391adbc2c5d91ae11a5273aab9e32ba7ec", + "sha256:32de8637f5e6c5a76667bc7c8fc644bd9314dc19af36db8ce30a0b92ada0f642", + "sha256:660eeb6870687fd3eda91e00ba4e72220545c254c8c4d967fd0c910f4fbb8cbc", + "sha256:9400e5db8383346b0694a3e794d8bded18a27b21123516dcdf4b79d7ec28e98b", + "sha256:ee7a9614d51fe16e32ca5befe72e0808baff481791728449d0b17c8b0fe29eb9", + "sha256:827d3a91b7a7c31ce69e5974496fd9a8ba28eb498b988affb66d0d30de11d934", + "sha256:ea5c16c48e561f4a6f6b8c24807494b77a79e156b8133521c400f22ca712101b", + "sha256:4172c183ef4fb2ace6a29cdf7fc9200c5a471a7f775ff691975b774bd9ed3ad2", + "sha256:c78ad0df75a9fc03ab28ca1b950c893a208c451a18f76796c3e25817d6994001", + "sha256:d2223a80c623e2a8e97953ab945dfaa9385750a494438dcb55562eb1ddd9565a", + "sha256:553956ec06ecbd731ef0c538eb28a5b46bedea7ab89b18237ff28b4b99d65eee", + "sha256:2f526b0887128bf20ab2acc905a975f62b5a04ab2f63ecbe5a30fc28285d0e0c", + "sha256:f3e4860f5458a9875caa3de65e255720c0ed2ce71f0bcdab02497b32104f9db8", + "sha256:759c799e9ef418f163b5412e295e14c0a48fe3b4dcba9ab8aab69e9f511cfefd", + "sha256:fc6c20a8ac22202a779ad4c59756647be0826993d2151a03c015e76d2368ae5f", + "sha256:b64575241f64f6ec005a4d4137339fb0ba5e156e826db2fdb5f458060d9979e0" + ], + "version": "==0.28.5" }, "docopt": { "hashes": [ "sha256:49b3a825280bd66b3aa83585ef59c4a8c82f2c8a522dbe754a8bc8d08c85c491" ], - "index": "pypi", "version": "==0.6.2" }, "docutils": { "hashes": [ + "sha256:7a4bd47eaf6596e1295ecb11361139febe29b084a87bf005bf899f9a42edc3c6", "sha256:02aec4bd92ab067f6ff27a38a38a41173bf01bed8f89157768c1573f53e474a6", - "sha256:51e64ef2ebfb29cae1faa133b3710143496eca21c530f3f71424d77687764274", - "sha256:7a4bd47eaf6596e1295ecb11361139febe29b084a87bf005bf899f9a42edc3c6" + "sha256:51e64ef2ebfb29cae1faa133b3710143496eca21c530f3f71424d77687764274" ], "version": "==0.14" }, @@ -164,13 +174,6 @@ ], "version": "==2.10" }, - "latexcodec": { - "hashes": [ - "sha256:3abc5cdbe4b6344c04a62db98bf30a2f3bc8f5bb9040296aafa39c8eeb737523", - "sha256:9607d9d260654eb607c54a8b8c991e4406008605c383ded4f4034522dc0bad7d" - ], - "version": "==1.0.5" - }, "markupsafe": { "hashes": [ "sha256:a6be69091dac236ea9c6bc7d012beab42010fa914c459791d627dad4910eb665" @@ -179,44 +182,36 @@ }, "numpy": { "hashes": [ - "sha256:07379fe0b450f6fd6e5934a9bc015025bb4ce1c8fbed3ca8bef29328b1bc9570", - "sha256:085afac75bbc97a096744fcfc97a4b321c5a87220286811e85089ae04885acdd", - "sha256:2d6481c6bdab1c75affc0fc71eb1bd4b3ecef620d06f2f60c3f00521d54be04f", - "sha256:2df854df882d322d5c23087a4959e145b953dfff2abe1774fec4f639ac2f3160", - "sha256:381ad13c30cd1d0b2f3da8a0c1a4aa697487e8bb0e9e0cbeb7439776bcb645f8", - "sha256:385f1ce46e08676505b692bfde918c1e0b350963a15ef52d77691c2cf0f5dbf6", - "sha256:4130e5ae16c656b7de654dc5e595cfeb85d3a4b0bb0734d19c0dce6dc7ee0e07", - "sha256:4d278c2261be6423c5e63d8f0ceb1b0c6db3ff83f2906f4b860db6ae99ca1bb5", - "sha256:51c5dcb51cf88b34b7d04c15f600b07c6ccbb73a089a38af2ab83c02862318da", - "sha256:589336ba5199c8061239cf446ee2f2f1fcc0c68e8531ee1382b6fc0c66b2d388", - "sha256:5ae3564cb630e155a650f4f9c054589848e97836bebae5637240a0d8099f817b", - "sha256:5edf1acc827ed139086af95ce4449b7b664f57a8c29eb755411a634be280d9f2", - "sha256:6b82b81c6b3b70ed40bc6d0b71222ebfcd6b6c04a6e7945a936e514b9113d5a3", - "sha256:6c57f973218b776195d0356e556ec932698f3a563e2f640cfca7020086383f50", - "sha256:758d1091a501fd2d75034e55e7e98bfd1370dc089160845c242db1c760d944d9", - "sha256:8622db292b766719810e0cb0f62ef6141e15fe32b04e4eb2959888319e59336b", - "sha256:8b8dcfcd630f1981f0f1e3846fae883376762a0c1b472baa35b145b911683b7b", - "sha256:91fdd510743ae4df862dbd51a4354519dd9fb8941347526cd9c2194b792b3da9", - "sha256:97fa8f1dceffab782069b291e38c4c2227f255cdac5f1e3346666931df87373e", - "sha256:9b705f18b26fb551366ab6347ba9941b62272bf71c6bbcadcd8af94d10535241", - "sha256:9d69967673ab7b028c2df09cae05ba56bf4e39e3cb04ebe452b6035c3b49848e", - "sha256:9e1f53afae865cc32459ad211493cf9e2a3651a7295b7a38654ef3d123808996", - "sha256:a4a433b3a264dbc9aa9c7c241e87c0358a503ea6394f8737df1683c7c9a102ac", - "sha256:baadc5f770917ada556afb7651a68176559f4dca5f4b2d0947cd15b9fb84fb51", - "sha256:c725d11990a9243e6ceffe0ab25a07c46c1cc2c5dc55e305717b5afe856c9608", - "sha256:d696a8c87315a83983fc59dd27efe034292b9e8ad667aeae51a68b4be14690d9", - "sha256:e1864a4e9f93ddb2dc6b62ccc2ec1f8250ff4ac0d3d7a15c8985dd4e1fbd6418", - "sha256:e1d18421a7e2ad4a655b76e65d549d4159f8874c18a417464c1d439ee7ccc7cd" - ], - "index": "pypi", - "version": "==1.14.5" - }, - "oset": { - "hashes": [ - "sha256:4c1fd7dec96eeff9d3260995a8e37f9f415d0bdb79975f57824e68716ac8f904" - ], - "markers": "python_version != '3.0.*' and python_version != '3.2.*' and python_version >= '2.7' and python_version != '3.3.*' and python_version != '3.1.*'", - "version": "==0.1.3" + "sha256:5e359e9c531075220785603e5966eef20ccae9b3b6b8a06fdfb66c084361ce92", + "sha256:419e6faee16097124ee627ed31572c7e80a1070efa25260b78097cca240e219a", + "sha256:719b6789acb2bc86ea9b33a701d7c43dc2fc56d95107fd3c5b0a8230164d4dfb", + "sha256:62d55e96ec7b117d3d5e618c15efcf769e70a6effaee5842857b64fb4883887a", + "sha256:df0b02c6705c5d1c25cc35c7b5d6b6f9b3b30833f9d178843397ae55ecc2eebb", + "sha256:dae8618c0bcbfcf6cf91350f8abcdd84158323711566a8c5892b5c7f832af76f", + "sha256:a3bd01d6d3ed3d7c06d7f9979ba5d68281f15383fafd53b81aa44b9191047cf8", + "sha256:1c362ad12dd09a43b348bb28dd2295dd9cdf77f41f0f45965e04ba97f525b864", + "sha256:83b8fc18261b70f45bece2d392537c93dc81eb6c539a16c9ac994c47fc79f09a", + "sha256:ce75ed495a746e3e78cfa22a77096b3bff2eda995616cb7a542047f233091268", + "sha256:340ec1697d9bb3a9c464028af7a54245298502e91178bddb4c37626d36e197b7", + "sha256:2156a06bd407918df4ac0122df6497a9c137432118f585e5b17d543e593d1587", + "sha256:549f3e9778b148a47f4fb4682955ed88057eb627c9fe5467f33507c536deda9d", + "sha256:378378973546ecc1dfaf9e24c160d683dd04df871ecd2dcc86ce658ca20f92c0", + "sha256:35db8d419345caa4eeaa65cd63f34a15208acd87530a30f0bc25fc84f55c8c80", + "sha256:4287104c24e6a09b9b418761a1e7b1bbde65105f110690ca46a23600a3c606b8", + "sha256:7a70f2b60d48828cba94a54a8776b61a9c2657a803d47f5785f8062e3a9c7c55", + "sha256:e3660744cda0d94b90141cdd0db9308b958a372cfeee8d7188fdf5ad9108ea82", + "sha256:5ee7f3dbbdba0da75dec7e94bd7a2b10fe57a83e1b38e678200a6ad8e7b14fdc", + "sha256:36e8dcd1813ca92ce7e4299120cee6c03adad33d89b54862c1b1a100443ac399", + "sha256:9473ad28375710ab18378e72b59422399b27e957e9339c413bf00793b4b12df0", + "sha256:c81a6afc1d2531a9ada50b58f8c36197f8418ef3d0611d4c1d7af93fdcda764f", + "sha256:98b86c62c08c2e5dc98a9c856d4a95329d11b1c6058cb9b5191d5ea6891acd09", + "sha256:24e4149c38489b51fc774b1e1faa9103e82f73344d7a00ba66f6845ab4769f3f", + "sha256:95b085b253080e5d09f7826f5e27dce067bae813a132023a77b739614a29de6e", + "sha256:361370e9b7f5e44c41eee29f2bb5cb3b755abb4b038bce6d6cbe08db7ff9cb74", + "sha256:f2362d0ca3e16c37782c1054d7972b8ad2729169567e3f0f4e5dd3cdf85f188e", + "sha256:7b9e37f194f8bcdca8e9e6af92e2cbad79e360542effc2dd6b98d63955d8d8a3" + ], + "version": "==1.15.1" }, "packaging": { "hashes": [ @@ -225,34 +220,6 @@ ], "version": "==17.1" }, - "pathlib": { - "hashes": [ - "sha256:6940718dfc3eff4258203ad5021090933e5c04707d5ca8cc9e73c94a7894ea9f" - ], - "index": "pypi", - "version": "==1.0.1" - }, - "pybtex": { - "hashes": [ - "sha256:af8a6c7c74954ad305553b118d2757f68bc77c5dd5d5de2cc1fd16db90046000" - ], - "version": "==0.21" - }, - "pybtex-docutils": { - "hashes": [ - "sha256:920ae9850750dd61abe00d9fd88f4a5f9099e40af0b84b2119b8b44a479115d2", - "sha256:e4b075641c1d68a3e98a6d73ad3d029293fcf9e0773512315ef9c8482f251337" - ], - "version": "==0.2.1" - }, - "pycodestyle": { - "hashes": [ - "sha256:cbc619d09254895b0d12c2c691e237b2e91e9b2ecf5e84c26b35400f93dcfb83", - "sha256:cbfca99bd594a10f674d0cd97a3d802a1fdef635d4361e1a2658de47ed261e3a" - ], - "index": "pypi", - "version": "==2.4.0" - }, "pycparser": { "hashes": [ "sha256:99a8ca03e29851d96616ad0404b4aad7d9ee16f25c9f9708a11faf2810f7b226" @@ -268,8 +235,13 @@ }, "pyparsing": { "hashes": [ + "sha256:fee43f17a9c4087e7ed1605bd6df994c6173c1e977d7ade7b651292fab2bd010", "sha256:0832bcf47acd283788593e7a0f542407bd9550a55a8a8435214a1960e04bcb04", - "sha256:fee43f17a9c4087e7ed1605bd6df994c6173c1e977d7ade7b651292fab2bd010" + "sha256:9e8143a3e15c13713506886badd96ca4b579a87fbdf49e550dbfc057d6cb218e", + "sha256:281683241b25fe9b80ec9d66017485f6deff1af5cde372469134b56ca8447a07", + "sha256:b8b3117ed9bdf45e14dcc89345ce638ec7e0e29b2b579fa1ecf32ce45ebac8a5", + "sha256:8f1e18d3fd36c6795bb7e02a39fd05c611ffc2596c1e0d995d34d67630426c18", + "sha256:e4d45427c6e20a59bf4f88c639dcc03ce30d193112047f94012102f235853a58" ], "version": "==2.2.0" }, @@ -282,19 +254,18 @@ }, "pyyaml": { "hashes": [ - "sha256:3d7da3009c0f3e783b2c873687652d83b1bbfd5c88e9813fb7e5b03c0dd3108b", - "sha256:3ef3092145e9b70e3ddd2c7ad59bdd0252a94dfe3949721633e41344de00a6bf", - "sha256:40c71b8e076d0550b2e6380bada1f1cd1017b882f7e16f09a65be98e017f211a", + "sha256:d5eef459e30b09f5a098b9cea68bebfeb268697f78d647bd255a085371ac7f3f", + "sha256:e01d3203230e1786cd91ccfdc8f8454c8069c91bee3962ad93b87a4b2860f537", "sha256:558dd60b890ba8fd982e05941927a3911dc409a63dcb8b634feaa0cda69330d3", + "sha256:d46d7982b62e0729ad0175a9bc7e10a566fc07b224d2c79fafb5e032727eaa04", "sha256:a7c28b45d9f99102fa092bb213aa12e0aaf9a6a1f5e395d36166639c1f96c3a1", - "sha256:aa7dd4a6a427aed7df6fb7f08a580d68d9b118d90310374716ae90b710280af1", "sha256:bc558586e6045763782014934bfaf39d48b8ae85a2713117d16c39864085c613", - "sha256:d46d7982b62e0729ad0175a9bc7e10a566fc07b224d2c79fafb5e032727eaa04", - "sha256:d5eef459e30b09f5a098b9cea68bebfeb268697f78d647bd255a085371ac7f3f", - "sha256:e01d3203230e1786cd91ccfdc8f8454c8069c91bee3962ad93b87a4b2860f537", - "sha256:e170a9e6fcfd19021dd29845af83bb79236068bf5fd4df3327c1be18182b2531" + "sha256:40c71b8e076d0550b2e6380bada1f1cd1017b882f7e16f09a65be98e017f211a", + "sha256:3d7da3009c0f3e783b2c873687652d83b1bbfd5c88e9813fb7e5b03c0dd3108b", + "sha256:e170a9e6fcfd19021dd29845af83bb79236068bf5fd4df3327c1be18182b2531", + "sha256:aa7dd4a6a427aed7df6fb7f08a580d68d9b118d90310374716ae90b710280af1", + "sha256:3ef3092145e9b70e3ddd2c7ad59bdd0252a94dfe3949721633e41344de00a6bf" ], - "index": "pypi", "version": "==3.13" }, "requests": { @@ -306,65 +277,37 @@ }, "six": { "hashes": [ - "sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9", - "sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb" + "sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb", + "sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9" ], "version": "==1.11.0" }, "snowballstemmer": { "hashes": [ - "sha256:919f26a68b2c17a7634da993d91339e288964f93c274f1343e3bbbe2096e1128", - "sha256:9f3bcd3c401c3e862ec0ebe6d2c069ebc012ce142cce209c098ccb5b09136e89" + "sha256:9f3bcd3c401c3e862ec0ebe6d2c069ebc012ce142cce209c098ccb5b09136e89", + "sha256:919f26a68b2c17a7634da993d91339e288964f93c274f1343e3bbbe2096e1128" ], "version": "==1.2.1" }, "sphinx": { "hashes": [ - "sha256:85f7e32c8ef07f4ba5aeca728e0f7717bef0789fba8458b8d9c5c294cad134f3", - "sha256:d45480a229edf70d84ca9fae3784162b1bc75ee47e480ffe04a4b7f21a95d76d" - ], - "index": "pypi", - "version": "==1.7.5" - }, - "sphinx-rtd-theme": { - "hashes": [ - "sha256:aa3e190392e963551432de7df24b8a5fbe5b71a2f4fcd9d5b75808b52ad999e5", - "sha256:de88d637a60371d4f923e06b79c4ba260490c57d2ab5a8316942ab5d9a6ce1bf" - ], - "index": "pypi", - "version": "==0.4.0" - }, - "sphinxcontrib-bibtex": { - "hashes": [ - "sha256:935a44e68cf79dbeaff14a3be757b9bfdf5b917e7239a84a165c76a4b2accfd8", - "sha256:cb9fb4526642fc080204fccd5cd8f41e9e95387278e17b1d6969b1e27c2d3e0c" + "sha256:d719de667218d763e8fd144b7fcfeefd8d434a6201f76bf9f0f0c1fa6f47fcdb", + "sha256:a07050845cc9a2f4026a6035cc8ed795a5ce7be6528bbc82032385c10807dfe7" ], - "index": "pypi", - "version": "==0.4.0" + "version": "==1.7.8" }, "sphinxcontrib-websupport": { "hashes": [ "sha256:68ca7ff70785cbe1e7bccc71a48b5b6d965d79ca50629606c7861a21b206d9dd", "sha256:9de47f375baf1ea07cdb3436ff39d7a9c76042c10a769c52353ec46e4e8fc3b9" ], - "markers": "python_version != '3.0.*' and python_version != '3.2.*' and python_version >= '2.7' and python_version != '3.3.*' and python_version != '3.1.*'", "version": "==1.1.0" }, - "typing": { - "hashes": [ - "sha256:3a887b021a77b292e151afb75323dea88a7bc1b3dfa92176cff8e44c8b68bddf", - "sha256:b2c689d54e1144bbcfd191b0832980a21c2dbcf7b5ff7a66248a60c90e951eb8", - "sha256:d400a9344254803a2368533e4533a4200d21eb7b6b729c173bc38201a74db3f2" - ], - "index": "pypi", - "version": "==3.6.4" - }, "urllib3": { "hashes": [ - "sha256:a68ac5e15e76e7e5dd2b8f94007233e01effe3e50e8daddf69acfd81cb686baf", - "sha256:b5725a0bd4ba422ab0e66e89e030c806576753ea3ee08554382c14e685d117b5" + "sha256:b5725a0bd4ba422ab0e66e89e030c806576753ea3ee08554382c14e685d117b5", + "sha256:a68ac5e15e76e7e5dd2b8f94007233e01effe3e50e8daddf69acfd81cb686baf" ], - "markers": "python_version < '4' and python_version >= '2.6' and python_version != '3.0.*' and python_version != '3.2.*' and python_version != '3.3.*' and python_version != '3.1.*'", "version": "==1.23" } }, diff --git a/chapter-09/recipe-04/cxx-example/menu.yml b/chapter-09/recipe-04/cxx-example/menu.yml index c6953c09c..15a67b1f7 100644 --- a/chapter-09/recipe-04/cxx-example/menu.yml +++ b/chapter-09/recipe-04/cxx-example/menu.yml @@ -3,7 +3,7 @@ appveyor-vs: - VERBOSE_OUTPUT: 'True' definitions: - BOOST_ROOT: 'C:\Libraries\boost_1_67_0' - - CMAKE_CXX_FLAGS: '-DBOOST_ALL_NO_LIB' + - CMAKE_CXX_FLAGS: '-DBOOST_ALL_NO_LIB' - CMAKE_BUILD_TYPE: 'Release' - CMAKE_CONFIGURATION_TYPES: 'Release' # fails because packaged boost only provides python27 @@ -24,6 +24,13 @@ circle-pgi: - 'Unix Makefiles' - 'Ninja' +# Boost.Python version on Travis +# links against Python 2.7 +travis-linux: + failing_generators: + - 'Unix Makefiles' + - 'Ninja' + travis-osx: definitions: - BOOST_ROOT: '/usr/local/opt/boost@1.59' diff --git a/chapter-10/recipe-04/cxx-example/CMakeLists.txt b/chapter-10/recipe-04/cxx-example/CMakeLists.txt index 3e1d37d04..4b75c64c5 100644 --- a/chapter-10/recipe-04/cxx-example/CMakeLists.txt +++ b/chapter-10/recipe-04/cxx-example/CMakeLists.txt @@ -89,12 +89,12 @@ install( USE_SOURCE_PERMISSIONS ) -# patch RPATH of executable +# Print RPATH of installed executable and run it if(UNIX) - set(PATCHING_SCRIPT "${CMAKE_CURRENT_LIST_DIR}/cmake/patch_rpath.py") - configure_file(cmake/patch_rpath.cmake.in patch_rpath.cmake @ONLY) + set(PRINT_SCRIPT "${CMAKE_CURRENT_LIST_DIR}/cmake/print_rpath.py") + configure_file(cmake/install_hook.cmake.in install_hook.cmake @ONLY) install( SCRIPT - ${CMAKE_CURRENT_BINARY_DIR}/patch_rpath.cmake + ${CMAKE_CURRENT_BINARY_DIR}/install_hook.cmake ) endif() diff --git a/chapter-10/recipe-04/cxx-example/cmake/install_hook.cmake.in b/chapter-10/recipe-04/cxx-example/cmake/install_hook.cmake.in new file mode 100644 index 000000000..20b037667 --- /dev/null +++ b/chapter-10/recipe-04/cxx-example/cmake/install_hook.cmake.in @@ -0,0 +1,57 @@ +set(_executable ${CMAKE_INSTALL_PREFIX}/@INSTALL_BINDIR@/use_message) + +# Look for chrpath, patchelf, otool +set(_patcher) +list(APPEND _patchers chrpath patchelf otool) +foreach(p IN LISTS _patchers) + find_program(${p}_FOUND + NAMES + ${p} + ) + if(${p}_FOUND) + set(_patcher ${p}) + message(STATUS "ELF patching tool ${_patcher} FOUND") + break() + endif() +endforeach() + +if(NOT _patcher) + message(FATAL_ERROR "ELF patching tool NOT FOUND!\nPlease install one of chrpath, patchelf or otool") +else() + find_package(PythonInterp REQUIRED QUIET) + execute_process( + COMMAND + ${PYTHON_EXECUTABLE} @PRINT_SCRIPT@ "${_patcher}" "${_executable}" + RESULT_VARIABLE _res + OUTPUT_VARIABLE _out + ERROR_VARIABLE _err + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + + if(_res EQUAL 0) + message(STATUS "RPATH for ${_executable} is ${_out}") + else() + message(STATUS "Something went wrong!") + message(STATUS "Standard output from print_rpath.py: ${_out}") + message(STATUS "Standard error from print_rpath.py: ${_err}") + message(FATAL_ERROR "${_patcher} could NOT obtain RPATH for ${_executable}") + endif() +endif() + +# Run use_message from the install directory +execute_process( + COMMAND ${_executable} + RESULT_VARIABLE _res + OUTPUT_VARIABLE _out + ERROR_VARIABLE _err + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + +if(_res EQUAL 0) + message(STATUS "Running ${_executable}:\n ${_out}") +else() + message(STATUS "Something went wrong!") + message(STATUS "Standard output from running ${_executable}:\n ${_out}") + message(STATUS "Standard error from running ${_executable}:\n ${_err}") + message(FATAL_ERROR "Something went wrong with ${_executable}") +endif() diff --git a/chapter-10/recipe-04/cxx-example/cmake/patch_rpath.cmake.in b/chapter-10/recipe-04/cxx-example/cmake/patch_rpath.cmake.in deleted file mode 100644 index 2e85c2e40..000000000 --- a/chapter-10/recipe-04/cxx-example/cmake/patch_rpath.cmake.in +++ /dev/null @@ -1,41 +0,0 @@ -set(STAGED_INSTALL_PREFIX @STAGED_INSTALL_PREFIX@) -set(INSTALL_LIBDIR @INSTALL_LIBDIR@) -set(INSTALL_BINDIR @INSTALL_BINDIR@) -set(PATCHING_SCRIPT @PATCHING_SCRIPT@) - -# Look for patchelf, chrpath, install_tool_name -set(_patcher "") -list(APPEND _patchers patchelf chrpath install_name_tool) -foreach(p IN LISTS _patchers) - find_program(${p}_FOUND - NAMES - ${p} - ) - if(${p}_FOUND) - set(_patcher ${p}) - break() - endif() -endforeach() - -set(_path_to_remove ${STAGED_INSTALL_PREFIX}/${INSTALL_LIBDIR}) -set(_path_to_add "\$ORIGIN/../${INSTALL_LIBDIR}") -set(_elfobj ${CMAKE_INSTALL_PREFIX}/${INSTALL_BINDIR}/use_message) - -find_package(PythonInterp REQUIRED) -execute_process( - COMMAND - ${PYTHON_EXECUTABLE} ${PATCHING_SCRIPT} "${_patcher}" "${_path_to_remove}" "${_path_to_add}" "${_elfobj}" - RESULT_VARIABLE _res - OUTPUT_VARIABLE _out - ERROR_VARIABLE _err - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - -if(_res EQUAL 0) - message(STATUS "RPATH for ${_elfobj} patched using ${_patcher}") -else() - message(STATUS "Something went wrong!") - message(STATUS "Standard output from patch_rpath.py: ${_out}") - message(STATUS "Standard error from patch_rpath.py: ${_err}") - message(FATAL_ERROR "RPATH for ${_elfobj} could NOT be patched using ${_patcher}") -endif() diff --git a/chapter-10/recipe-04/cxx-example/cmake/patch_rpath.py b/chapter-10/recipe-04/cxx-example/cmake/patch_rpath.py deleted file mode 100644 index b1c9bfd33..000000000 --- a/chapter-10/recipe-04/cxx-example/cmake/patch_rpath.py +++ /dev/null @@ -1,70 +0,0 @@ -import functools -import shlex -import subprocess -import sys - - -def streamer(line, *, file_handle=sys.stdout, end='', verbose=True): - """ - Stream a line to file_handle and return the line. - """ - if verbose: - print(line, file=file_handle, end=end) - return line - - -def run_command(*, command): - cmd = shlex.split(command) - stdout_streamer = streamer - stderr_streamer = functools.partial(streamer, file_handle=sys.stderr) - stdout = '' - stderr = '' - with subprocess.Popen( - cmd, - bufsize=1, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - universal_newlines=True) as child: - stdout += ''.join(list(map(stdout_streamer, child.stdout))) - stderr = ''.join(list(map(stderr_streamer, child.stderr))) - - if child.returncode == 0: - streamer('DONE with {}'.format(command), end='\n') - else: - streamer( - '{cmd}\n {out}{err}'.format(cmd=command, out=stdout, err=stderr), - end='\n') - raise subprocess.CalledProcessError(child.returncode, child.args) - - return stdout - - -def main(): - patcher = sys.argv[1] - to_remove = sys.argv[2] - to_add = sys.argv[3] - elfobj = sys.argv[4] - if patcher == 'patchelf': - streamer('Using patchelf', end='\n') - old_rpath = run_command(command='{} --print-rpath {}'.format(patcher, elfobj)) - new_rpath = old_rpath.replace(to_remove, to_add) - _ = run_command(command='{} --set-rpath {} {}'.format(patcher, new_rpath, elfobj)) - _ = run_command(command='{} --shrink-rpath {}'.format(patcher, elfobj)) - _ = run_command(command='{} --print-rpath {}'.format(patcher, elfobj)) - elif patcher == 'chrpath': - streamer('Using chrpath', end='\n') - old_rpath = run_command(command='{} --list {}'.format(patcher, elfobj)) - old_rpath = old_rpath.replace('{}: RUNPATH='.format(elfobj), '') - new_rpath = old_rpath.replace(to_remove, to_add) - _ = run_command(command='{} --replace {} {}'.format(patcher, new_rpath, elfobj)) - _ = run_command(command='{} --list {}'.format(patcher, elfobj)) - elif patcher == 'install_tool_name': - streamer('Using install_tool_name', end='\n') - _ = run_command(command='{} -delete_rpath {} {}'.format(patcher, to_remove, elfobj)) - _ = run_command(command='{} -add_rpath {} {}'.format(patcher, to_add, elfobj)) - else: - raise RuntimeError('Unknown tool {}'.format(sys.argv[1])) - - -if __name__ == "__main__": - main() diff --git a/chapter-10/recipe-04/cxx-example/cmake/print_rpath.py b/chapter-10/recipe-04/cxx-example/cmake/print_rpath.py new file mode 100644 index 000000000..a1e91cf35 --- /dev/null +++ b/chapter-10/recipe-04/cxx-example/cmake/print_rpath.py @@ -0,0 +1,24 @@ +import shlex +import subprocess +import sys + + +def main(): + patcher = sys.argv[1] + elfobj = sys.argv[2] + + tools = {'patchelf': '--print-rpath', 'chrpath': '--list', 'otool': '-L'} + if patcher not in tools.keys(): + raise RuntimeError('Unknown tool {}'.format(patcher)) + cmd = shlex.split('{:s} {:s} {:s}'.format(patcher, tools[patcher], elfobj)) + rpath = subprocess.run( + cmd, + bufsize=1, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + universal_newlines=True) + print(rpath.stdout) + + +if __name__ == "__main__": + main() diff --git a/chapter-11/recipe-01/cxx-example/menu.yml b/chapter-11/recipe-01/cxx-example/menu.yml index f6f0c71d2..c9bf31ffc 100644 --- a/chapter-11/recipe-01/cxx-example/menu.yml +++ b/chapter-11/recipe-01/cxx-example/menu.yml @@ -3,10 +3,30 @@ targets: - test - package +appveyor-vs: + definitions: + - CMAKE_INSTALL_PREFIX: $HOME/Software/chapter-11/recipe-01 + +appveyor-msys: + definitions: + - CMAKE_INSTALL_PREFIX: $HOME/Software/chapter-11/recipe-01 + +travis-linux: + definitions: + - CMAKE_INSTALL_PREFIX: $HOME/Software/chapter-11/recipe-01 + +travis-osx: + definitions: + - CMAKE_INSTALL_PREFIX: $HOME/Software/chapter-11/recipe-01 + +circle-intel: + definitions: + - CMAKE_INSTALL_PREFIX: $HOME/Software/chapter-11/recipe-01 + # Fails to generate imported target for UUID circle-pgi: definitions: - - CMAKE_INSTALL_PREFIX: $HOME/Software/recipe-01 + - CMAKE_INSTALL_PREFIX: $HOME/Software/chapter-11/recipe-01 skip_generators: - 'Unix Makefiles' - 'Ninja' diff --git a/chapter-11/recipe-02/cxx-example/custom.sh b/chapter-11/recipe-02/cxx-example/custom.sh index a569ce72c..35aae7e40 100755 --- a/chapter-11/recipe-02/cxx-example/custom.sh +++ b/chapter-11/recipe-02/cxx-example/custom.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +# It's turtles all the way down + set -eu -o pipefail if [ $# -eq 0 ] ; then @@ -7,21 +9,26 @@ if [ $# -eq 0 ] ; then exit 1 fi -# Remove symlinks -script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" -find "$script_dir" -type l -exec sh -c ' - file=$(basename "$1") - directory=${1%/*} - (cd "$directory" && cp --remove-destination "$(readlink "$file")" "$file")' sh {} ';' - # build directory is provided by the main script build_directory="$1" mkdir -p "${build_directory}" -cd "${build_directory}" -cp ../account/test.py . +script_directory="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" + +cd $build_directory + +# we tar with --dereference and then untar to get rid of symlinks +tar --exclude "build-*" --dereference --directory "${script_directory}" -c -f - . | tar -x + +# Now make a directory where we test the +# install in a virtual environment +mkdir -p venv +mv account/test.py venv -env PIPENV_MAX_DEPTH=1 pipenv install .. +cd venv +export PIPENV_MAX_DEPTH=1 +pipenv install --three .. pipenv run python test.py +pipenv --rm exit $? diff --git a/chapter-11/recipe-03/cxx-example/account/__init__.py b/chapter-11/recipe-03/cxx-example/account/__init__.py index 2b7aa6d11..ccae83967 100644 --- a/chapter-11/recipe-03/cxx-example/account/__init__.py +++ b/chapter-11/recipe-03/cxx-example/account/__init__.py @@ -1,9 +1,10 @@ -from subprocess import check_output -from cffi import FFI import os import sys from configparser import ConfigParser from pathlib import Path +from subprocess import check_output + +from cffi import FFI def get_lib_handle(definitions, header_file, library_file): @@ -28,9 +29,9 @@ def get_lib_handle(definitions, header_file, library_file): _cfg_file = _this_path / 'interface_file_names.cfg' if _cfg_file.exists(): config = ConfigParser() - config.read(_cfg_file) + config.read(str(_cfg_file)) header_file_name = config.get('configuration', 'header_file_name') - _header_file = _this_path / 'include' / header_file_name + _header_file = _this_path / 'include' / header_file_name _header_file = str(_header_file) library_file_name = config.get('configuration', 'library_file_name') _library_file = _this_path / 'lib' / library_file_name @@ -41,10 +42,10 @@ def get_lib_handle(definitions, header_file, library_file): _library_file = os.getenv('ACCOUNT_LIBRARY_FILE') assert _library_file is not None -_lib = get_lib_handle(definitions=['-DACCOUNT_API=', '-DACCOUNT_NOINCLUDE'], - header_file=_header_file, - library_file=_library_file) - +_lib = get_lib_handle( + definitions=['-DACCOUNT_API=', '-DACCOUNT_NOINCLUDE'], + header_file=_header_file, + library_file=_library_file) # we change names to obtain a more pythonic API new = _lib.account_new diff --git a/chapter-11/recipe-03/fortran-example/account/__init__.py b/chapter-11/recipe-03/fortran-example/account/__init__.py index 2b7aa6d11..ccae83967 100644 --- a/chapter-11/recipe-03/fortran-example/account/__init__.py +++ b/chapter-11/recipe-03/fortran-example/account/__init__.py @@ -1,9 +1,10 @@ -from subprocess import check_output -from cffi import FFI import os import sys from configparser import ConfigParser from pathlib import Path +from subprocess import check_output + +from cffi import FFI def get_lib_handle(definitions, header_file, library_file): @@ -28,9 +29,9 @@ def get_lib_handle(definitions, header_file, library_file): _cfg_file = _this_path / 'interface_file_names.cfg' if _cfg_file.exists(): config = ConfigParser() - config.read(_cfg_file) + config.read(str(_cfg_file)) header_file_name = config.get('configuration', 'header_file_name') - _header_file = _this_path / 'include' / header_file_name + _header_file = _this_path / 'include' / header_file_name _header_file = str(_header_file) library_file_name = config.get('configuration', 'library_file_name') _library_file = _this_path / 'lib' / library_file_name @@ -41,10 +42,10 @@ def get_lib_handle(definitions, header_file, library_file): _library_file = os.getenv('ACCOUNT_LIBRARY_FILE') assert _library_file is not None -_lib = get_lib_handle(definitions=['-DACCOUNT_API=', '-DACCOUNT_NOINCLUDE'], - header_file=_header_file, - library_file=_library_file) - +_lib = get_lib_handle( + definitions=['-DACCOUNT_API=', '-DACCOUNT_NOINCLUDE'], + header_file=_header_file, + library_file=_library_file) # we change names to obtain a more pythonic API new = _lib.account_new diff --git a/chapter-14/recipe-03/cxx-example/menu.yml b/chapter-14/recipe-03/cxx-example/menu.yml index 3e1b28765..0b0e94dae 100644 --- a/chapter-14/recipe-03/cxx-example/menu.yml +++ b/chapter-14/recipe-03/cxx-example/menu.yml @@ -10,3 +10,9 @@ appveyor-msys: skip_generators: - 'MSYS Makefiles' - 'Ninja' + +# see: https://github.com/dev-cafe/cmake-cookbook/issues/481 +travis-osx: + failing_generators: + - 'Unix Makefiles' + - 'Ninja' diff --git a/chapter-14/recipe-03/fortran-example/menu.yml b/chapter-14/recipe-03/fortran-example/menu.yml index 632c9a464..e2e400fd0 100644 --- a/chapter-14/recipe-03/fortran-example/menu.yml +++ b/chapter-14/recipe-03/fortran-example/menu.yml @@ -11,12 +11,18 @@ appveyor-msys: - 'MSYS Makefiles' - 'Ninja' +# for 'Unix Makefiles' see: +# https://github.com/dev-cafe/cmake-cookbook/issues/481 travis-linux: failing_generators: + - 'Unix Makefiles' - 'Ninja' +# for 'Unix Makefiles' see: +# https://github.com/dev-cafe/cmake-cookbook/issues/481 travis-osx: failing_generators: + - 'Unix Makefiles' - 'Ninja' # ASan not supported by ifort diff --git a/default.nix b/default.nix index 34484d0fc..8b8382601 100644 --- a/default.nix +++ b/default.nix @@ -29,7 +29,6 @@ in gdb gfortran graphviz - lcov libuuid ninja-kitware openblas @@ -41,7 +40,6 @@ in python3Packages.cython python3Packages.docopt python3Packages.numpy - python3Packages.pycodestyle python3Packages.pyyaml python3Packages.sphinx rpm diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 000000000..083f631e2 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,8 @@ +breathe +cffi +colorama +cython +docopt +numpy +pyyaml +sphinx diff --git a/testing/README.md b/testing/README.md index ff7fc0634..8ed232e34 100644 --- a/testing/README.md +++ b/testing/README.md @@ -83,7 +83,7 @@ targets: ## Running tests on your computer ```shell -$ pipenv install +$ pipenv install --three $ pipenv run python testing/collect_tests.py 'chapter-*/recipe-*' ``` diff --git a/testing/collect_tests.py b/testing/collect_tests.py index c5f1a5f66..28f61cfc8 100644 --- a/testing/collect_tests.py +++ b/testing/collect_tests.py @@ -10,10 +10,9 @@ import colorama import docopt -from packaging import version - from env import (die_hard, get_buildflags, get_ci_environment, get_generator, verbose_output) +from packaging import version from parse import extract_menu_file @@ -234,6 +233,8 @@ def main(arguments): # glob recipes recipes = [r for r in sorted(topdir.glob(arguments['']))] + if not recipes: + raise RuntimeError('Empty list of recipes to test: provide a valid regex') # Set NINJA_STATUS environment variable os.environ['NINJA_STATUS'] = '[Built edge %f of %t in %e sec]' diff --git a/testing/dependencies/report_versions.sh b/testing/dependencies/report_versions.sh index 699898101..965b515dd 100755 --- a/testing/dependencies/report_versions.sh +++ b/testing/dependencies/report_versions.sh @@ -2,7 +2,7 @@ echo "Report versions of whole tool stack" -for tool in cmake make ninja g++ gcc gfortran; do +for tool in cmake make ninja $CXX $CC $FC; do echo "" echo "Checking version of $tool:" $tool --version 2> /dev/null || echo "$tool not available"