2021-01-02 15:10:28 +08:00
|
|
|
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
|
2018-10-08 04:52:23 +08:00
|
|
|
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
2014-01-13 01:19:18 +08:00
|
|
|
#
|
2018-10-08 04:52:23 +08:00
|
|
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
spack test (#15702)
Users can add test() methods to their packages to run smoke tests on
installations with the new `spack test` command (the old `spack test` is
now `spack unit-test`). spack test is environment-aware, so you can
`spack install` an environment and then run `spack test run` to run smoke
tests on all of its packages. Historical test logs can be perused with
`spack test results`. Generic smoke tests for MPI implementations, C,
C++, and Fortran compilers as well as specific smoke tests for 18
packages.
Inside the test method, individual tests can be run separately (and
continue to run best-effort after a test failure) using the `run_test`
method. The `run_test` method encapsulates finding test executables,
running and checking return codes, checking output, and error handling.
This handles the following trickier aspects of testing with direct
support in Spack's package API:
- [x] Caching source or intermediate build files at build time for
use at test time.
- [x] Test dependencies,
- [x] packages that require a compiler for testing (such as library only
packages).
See the packaging guide for more details on using Spack testing support.
Included is support for package.py files for virtual packages. This does
not change the Spack interface, but is a major change in internals.
Co-authored-by: Tamara Dahlgren <dahlgren1@llnl.gov>
Co-authored-by: wspear <wjspear@gmail.com>
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2020-11-18 18:39:02 +08:00
|
|
|
|
2020-05-06 08:37:34 +08:00
|
|
|
import re
|
|
|
|
|
2016-08-10 16:50:00 +08:00
|
|
|
|
2013-02-14 09:50:44 +08:00
|
|
|
class Cmake(Package):
|
2014-10-08 18:07:54 +08:00
|
|
|
"""A cross-platform, open-source build system. CMake is a family of
|
2020-07-31 19:07:48 +08:00
|
|
|
tools designed to build, test and package software.
|
|
|
|
"""
|
2017-01-15 19:16:41 +08:00
|
|
|
homepage = 'https://www.cmake.org'
|
2020-11-20 00:43:52 +08:00
|
|
|
url = 'https://github.com/Kitware/CMake/releases/download/v3.19.0/cmake-3.19.0.tar.gz'
|
2019-01-31 10:24:20 +08:00
|
|
|
maintainers = ['chuckatkins']
|
2014-07-31 14:30:07 +08:00
|
|
|
|
2021-02-04 20:17:32 +08:00
|
|
|
tags = ['build-tools']
|
|
|
|
|
2020-07-31 19:07:48 +08:00
|
|
|
executables = ['^cmake$']
|
2020-05-06 08:37:34 +08:00
|
|
|
|
2021-02-18 17:53:05 +08:00
|
|
|
version('3.19.5', sha256='c432296eb5dec6d71eae15d140f6297d63df44e9ffe3e453628d1dc8fc4201ce')
|
2021-02-10 01:48:34 +08:00
|
|
|
version('3.19.4', sha256='7d0232b9f1c57e8de81f38071ef8203e6820fe7eec8ae46a1df125d88dbcc2e1')
|
|
|
|
version('3.19.3', sha256='3faca7c131494a1e34d66e9f8972ff5369e48d419ea8ceaa3dc15b4c11367732')
|
2020-12-18 03:25:51 +08:00
|
|
|
version('3.19.2', sha256='e3e0fd3b23b7fb13e1a856581078e0776ffa2df4e9d3164039c36d3315e0c7f0')
|
2020-11-26 17:18:22 +08:00
|
|
|
version('3.19.1', sha256='1d266ea3a76ef650cdcf16c782a317cb4a7aa461617ee941e389cb48738a3aba')
|
2020-11-20 00:43:52 +08:00
|
|
|
version('3.19.0', sha256='fdda688155aa7e72b7c63ef6f559fca4b6c07382ea6dca0beb5f45aececaf493')
|
2021-02-18 17:53:05 +08:00
|
|
|
version('3.18.6', sha256='124f571ab70332da97a173cb794dfa09a5b20ccbb80a08e56570a500f47b6600')
|
2021-02-10 01:48:34 +08:00
|
|
|
version('3.18.5', sha256='080bf24b0f73f4bf3ec368d2be1aa59369b9bb1cd693deeb6f18fe553ca74ab4')
|
2020-10-15 21:28:09 +08:00
|
|
|
version('3.18.4', sha256='597c61358e6a92ecbfad42a9b5321ddd801fc7e7eca08441307c9138382d4f77')
|
|
|
|
version('3.18.3', sha256='2c89f4e30af4914fd6fb5d00f863629812ada848eee4e2d29ec7e456d7fa32e5')
|
2020-08-25 08:03:11 +08:00
|
|
|
version('3.18.2', sha256='5d4e40fc775d3d828c72e5c45906b4d9b59003c9433ff1b36a1cb552bbd51d7e')
|
2020-08-04 12:12:07 +08:00
|
|
|
version('3.18.1', sha256='c0e3338bd37e67155b9d1e9526fec326b5c541f74857771b7ffed0c46ad62508')
|
2020-07-24 21:02:08 +08:00
|
|
|
version('3.18.0', sha256='83b4ffcb9482a73961521d2bafe4a16df0168f03f56e6624c419c461e5317e29')
|
2021-02-10 01:48:34 +08:00
|
|
|
version('3.17.5', sha256='8c3083d98fd93c1228d5e4e40dbff2dd88f4f7b73b9fa24a2938627b8bc28f1a')
|
2020-08-31 23:52:18 +08:00
|
|
|
version('3.17.4', sha256='86985d73d0a63ec99c236aab5287316e252164f33d7c4cb160954a980c71f36f')
|
2020-07-01 00:37:06 +08:00
|
|
|
version('3.17.3', sha256='0bd60d512275dc9f6ef2a2865426a184642ceb3761794e6b65bff233b91d8c40')
|
2020-04-28 02:19:10 +08:00
|
|
|
version('3.17.1', sha256='3aa9114485da39cbd9665a0bfe986894a282d5f0882b1dea960a739496620727')
|
2020-04-02 17:06:21 +08:00
|
|
|
version('3.17.0', sha256='b74c05b55115eacc4fa2b77a814981dbda05cdc95a53e279fe16b7b272f00847')
|
2021-02-10 01:48:34 +08:00
|
|
|
version('3.16.9', sha256='1708361827a5a0de37d55f5c9698004c035abb1de6120a376d5d59a81630191f')
|
2020-08-31 23:52:18 +08:00
|
|
|
version('3.16.8', sha256='177434021132686cb901fea7db9fa2345efe48d566b998961594d5cc346ac588')
|
|
|
|
version('3.16.7', sha256='5f49c95a2933b1800f14840f3a389f4cef0b19093985a35053b43f38ec21358f')
|
|
|
|
version('3.16.6', sha256='6f6ff1a197851b0fa8412ff5de602e6717a4eb9509b2c385b08589c4e7a16b62')
|
2020-03-16 15:42:49 +08:00
|
|
|
version('3.16.5', sha256='5f760b50b8ecc9c0c37135fae5fbf00a2fef617059aa9d61c1bb91653e5a8bfc')
|
2020-08-31 23:52:18 +08:00
|
|
|
version('3.16.4', sha256='9bcc8c114d9da603af9512083ed7d4a39911d16105466beba165ba8fe939ac2c')
|
2020-08-13 08:53:55 +08:00
|
|
|
version('3.16.3', sha256='e54f16df9b53dac30fd626415833a6e75b0e47915393843da1825b096ee60668')
|
2019-12-25 00:05:54 +08:00
|
|
|
version('3.16.2', sha256='8c09786ec60ca2be354c29829072c38113de9184f29928eb9da8446a5f2ce6a9')
|
2019-12-14 02:53:19 +08:00
|
|
|
version('3.16.1', sha256='a275b3168fa8626eca4465da7bb159ff07c8c6cb0fb7179be59e12cbdfa725fd')
|
|
|
|
version('3.16.0', sha256='6da56556c63cab6e9a3e1656e8763ed4a841ac9859fefb63cbe79472e67e8c5f')
|
2020-08-31 23:52:18 +08:00
|
|
|
version('3.15.7', sha256='71999d8a14c9b51708847371250a61533439a7331eb7702ac105cfb3cb1be54b')
|
|
|
|
version('3.15.6', sha256='3fa17992ac97d3fc856ffba5d3b10578744ea5b4736818f01e6067f0253b2db5')
|
2019-11-11 18:25:50 +08:00
|
|
|
version('3.15.5', sha256='fbdd7cef15c0ced06bb13024bfda0ecc0dedbcaaaa6b8a5d368c75255243beb4')
|
|
|
|
version('3.15.4', sha256='8a211589ea21374e49b25fc1fc170e2d5c7462b795f1b29c84dd0e984301ed7a')
|
|
|
|
version('3.15.3', sha256='13958243a01365b05652fa01b21d40fa834f70a9e30efa69c02604e64f58b8f5')
|
|
|
|
version('3.15.2', sha256='539088cb29a68e6d6a8fba5c00951e5e5b1a92c68fa38a83e1ed2f355933f768')
|
|
|
|
version('3.15.1', sha256='18dec548d8f8b04d53c60f9cedcebaa6762f8425339d1e2c889c383d3ccdd7f7')
|
|
|
|
version('3.15.0', sha256='0678d74a45832cacaea053d85a5685f3ed8352475e6ddf9fcb742ffca00199b5')
|
2020-08-31 23:52:18 +08:00
|
|
|
version('3.14.7', sha256='9221993e0af3e6d10124d840ff24f5b2f3b884416fca04d3312cb0388dec1385')
|
|
|
|
version('3.14.6', sha256='4e8ea11cabe459308671b476469eace1622e770317a15951d7b55a82ccaaccb9')
|
2019-11-11 18:25:50 +08:00
|
|
|
version('3.14.5', sha256='505ae49ebe3c63c595fa5f814975d8b72848447ee13b6613b0f8b96ebda18c06')
|
|
|
|
version('3.14.4', sha256='00b4dc9b0066079d10f16eed32ec592963a44e7967371d2f5077fd1670ff36d9')
|
|
|
|
version('3.14.3', sha256='215d0b64e81307182b29b63e562edf30b3875b834efdad09b3fcb5a7d2f4b632')
|
|
|
|
version('3.14.2', sha256='a3cbf562b99270c0ff192f692139e98c605f292bfdbc04d70da0309a5358e71e')
|
|
|
|
version('3.14.1', sha256='7321be640406338fc12590609c42b0fae7ea12980855c1be363d25dcd76bb25f')
|
|
|
|
version('3.14.0', sha256='aa76ba67b3c2af1946701f847073f4652af5cbd9f141f221c97af99127e75502')
|
2020-08-31 23:52:18 +08:00
|
|
|
version('3.13.5', sha256='526db6a4b47772d1943b2f86de693e712f9dacf3d7c13b19197c9bef133766a5')
|
2019-10-11 13:44:41 +08:00
|
|
|
version('3.13.4', sha256='fdd928fee35f472920071d1c7f1a6a2b72c9b25e04f7a37b409349aef3f20e9b')
|
|
|
|
version('3.13.3', sha256='665f905036b1f731a2a16f83fb298b1fb9d0f98c382625d023097151ad016b25')
|
|
|
|
version('3.13.2', sha256='c925e7d2c5ba511a69f43543ed7b4182a7d446c274c7480d0e42cd933076ae25')
|
|
|
|
version('3.13.1', sha256='befe1ce6d672f2881350e94d4e3cc809697dd2c09e5b708b76c1dae74e1b2210')
|
|
|
|
version('3.13.0', sha256='4058b2f1a53c026564e8936698d56c3b352d90df067b195cb749a97a3d273c90')
|
|
|
|
version('3.12.4', sha256='5255584bfd043eb717562cff8942d472f1c0e4679c4941d84baadaa9b28e3194')
|
|
|
|
version('3.12.3', sha256='acbf13af31a741794106b76e5d22448b004a66485fc99f6d7df4d22e99da164a')
|
|
|
|
version('3.12.2', sha256='0f97485799e51a7070cc11494f3e02349b0fc3a24cc12b082e737bf67a0581a4')
|
|
|
|
version('3.12.1', sha256='c53d5c2ce81d7a957ee83e3e635c8cda5dfe20c9d501a4828ee28e1615e57ab2')
|
|
|
|
version('3.12.0', sha256='d0781a90f6cdb9049d104ac16a150f9350b693498b9dea8a0331e799db6b9d69')
|
|
|
|
version('3.11.4', sha256='8f864e9f78917de3e1483e256270daabc4a321741592c5b36af028e72bff87f5')
|
|
|
|
version('3.11.3', sha256='287135b6beb7ffc1ccd02707271080bbf14c21d80c067ae2c0040e5f3508c39a')
|
|
|
|
version('3.11.2', sha256='5ebc22bbcf2b4c7a20c4190d42c084cf38680a85b1a7980a2f1d5b4a52bf5248')
|
|
|
|
version('3.11.1', sha256='57bebc6ca4d1d42c6385249d148d9216087e0fda57a47dc5c858790a70217d0c')
|
|
|
|
version('3.11.0', sha256='c313bee371d4d255be2b4e96fd59b11d58bc550a7c78c021444ae565709a656b')
|
|
|
|
version('3.10.3', sha256='0c3a1dcf0be03e40cf4f341dda79c96ffb6c35ae35f2f911845b72dab3559cf8')
|
|
|
|
version('3.10.2', sha256='80d0faad4ab56de07aa21a7fc692c88c4ce6156d42b0579c6962004a70a3218b')
|
|
|
|
version('3.10.1', sha256='7be36ee24b0f5928251b644d29f5ff268330a916944ef4a75e23ba01e7573284')
|
|
|
|
version('3.10.0', sha256='b3345c17609ea0f039960ef470aa099de9942135990930a57c14575aae884987')
|
|
|
|
version('3.9.6', sha256='7410851a783a41b521214ad987bb534a7e4a65e059651a2514e6ebfc8f46b218')
|
|
|
|
version('3.9.4', sha256='b5d86f12ae0072db520fdbdad67405f799eb728b610ed66043c20a92b4906ca1')
|
2020-03-24 08:03:25 +08:00
|
|
|
version('3.9.2', sha256='954a5801a456ee48e76f01107c9a4961677dd0f3e115275bbd18410dc22ba3c1')
|
2019-10-11 13:44:41 +08:00
|
|
|
version('3.9.0', sha256='167701525183dbb722b9ffe69fb525aa2b81798cf12f5ce1c020c93394dfae0f')
|
|
|
|
version('3.8.2', sha256='da3072794eb4c09f2d782fcee043847b99bb4cf8d4573978d9b2024214d6e92d')
|
|
|
|
version('3.8.1', sha256='ce5d9161396e06501b00e52933783150a87c33080d4bdcef461b5b7fd24ac228')
|
|
|
|
version('3.8.0', sha256='cab99162e648257343a20f61bcd0b287f5e88e36fcb2f1d77959da60b7f35969')
|
|
|
|
version('3.7.2', sha256='dc1246c4e6d168ea4d6e042cfba577c1acd65feea27e56f5ff37df920c30cae0')
|
|
|
|
version('3.7.1', sha256='449a5bce64dbd4d5b9517ebd1a1248ed197add6ad27934478976fd5f1f9330e1')
|
|
|
|
version('3.6.1', sha256='28ee98ec40427d41a45673847db7a905b59ce9243bb866eaf59dce0f58aaef11')
|
|
|
|
version('3.6.0', sha256='fd05ed40cc40ef9ef99fac7b0ece2e0b871858a82feade48546f5d2940147670')
|
|
|
|
version('3.5.2', sha256='92d8410d3d981bb881dfff2aed466da55a58d34c7390d50449aa59b32bb5e62a')
|
|
|
|
version('3.5.1', sha256='93d651a754bcf6f0124669646391dd5774c0fc4d407c384e3ae76ef9a60477e8')
|
|
|
|
version('3.5.0', sha256='92c83ad8a4fd6224cf6319a60b399854f55b38ebe9d297c942408b792b1a9efa')
|
|
|
|
version('3.4.3', sha256='b73f8c1029611df7ed81796bf5ca8ba0ef41c6761132340c73ffe42704f980fa')
|
|
|
|
version('3.4.0', sha256='a5b82bf6ace6c481cdb911fd5d372a302740cbefd387e05297cb37f7468d1cea')
|
|
|
|
version('3.3.1', sha256='cd65022c6a0707f1c7112f99e9c981677fdd5518f7ddfa0f778d4cee7113e3d6')
|
|
|
|
version('3.1.0', sha256='8bdc3fa3f2da81bc10c772a6b64cc9052acc2901d42e1e1b2588b40df224aad9')
|
|
|
|
version('3.0.2', sha256='6b4ea61eadbbd9bec0ccb383c29d1f4496eacc121ef7acf37c7a24777805693e')
|
|
|
|
version('2.8.10.2', sha256='ce524fb39da06ee6d47534bbcec6e0b50422e18b62abc4781a4ba72ea2910eb1')
|
2014-10-26 11:25:25 +08:00
|
|
|
|
2021-02-26 16:49:00 +08:00
|
|
|
variant('build_type', default='Release',
|
|
|
|
description='CMake build type',
|
|
|
|
values=('Debug', 'Release', 'RelWithDebInfo', 'MinSizeRel'))
|
|
|
|
|
2019-07-26 01:23:01 +08:00
|
|
|
# Revert the change that introduced a regression when parsing mpi link
|
|
|
|
# flags, see: https://gitlab.kitware.com/cmake/cmake/issues/19516
|
|
|
|
patch('cmake-revert-findmpi-link-flag-list.patch', when='@3.15.0')
|
|
|
|
|
2019-01-31 10:24:20 +08:00
|
|
|
# Fix linker error when using external libs on darwin.
|
|
|
|
# See https://gitlab.kitware.com/cmake/cmake/merge_requests/2873
|
|
|
|
patch('cmake-macos-add-coreservices.patch', when='@3.11.0:3.13.3')
|
|
|
|
|
2019-11-27 00:29:25 +08:00
|
|
|
# Fix builds with XLF + Ninja generator
|
|
|
|
# https://gitlab.kitware.com/cmake/cmake/merge_requests/4075
|
2020-01-22 03:05:42 +08:00
|
|
|
patch('fix-xlf-ninja-mr-4075.patch', sha256="42d8b2163a2f37a745800ec13a96c08a3a20d5e67af51031e51f63313d0dedd1", when="@3.15.5")
|
2019-11-27 00:29:25 +08:00
|
|
|
|
2019-05-17 14:47:58 +08:00
|
|
|
# We default ownlibs to true because it greatly speeds up the CMake
|
|
|
|
# build, and CMake is built frequently. Also, CMake is almost always
|
|
|
|
# a build dependency, and its libs will not interfere with others in
|
|
|
|
# the build.
|
|
|
|
variant('ownlibs', default=True, description='Use CMake-provided third-party libraries')
|
2016-08-02 00:18:48 +08:00
|
|
|
variant('qt', default=False, description='Enables the build of cmake-gui')
|
|
|
|
variant('doc', default=False, description='Enables the generation of html and man page documentation')
|
|
|
|
variant('openssl', default=True, description="Enables CMake's OpenSSL features")
|
|
|
|
variant('ncurses', default=True, description='Enables the build of the ncurses gui')
|
|
|
|
|
2020-08-27 14:51:00 +08:00
|
|
|
# Does not compile and is not covered in upstream CI (yet).
|
2020-04-23 08:41:33 +08:00
|
|
|
conflicts('%gcc platform=darwin',
|
2020-08-27 14:51:00 +08:00
|
|
|
msg='CMake does not compile with GCC on macOS yet, '
|
|
|
|
'please use %apple-clang. '
|
|
|
|
'See: https://gitlab.kitware.com/cmake/cmake/-/issues/21135')
|
2020-04-23 08:41:33 +08:00
|
|
|
|
2020-10-23 05:42:48 +08:00
|
|
|
conflicts('%nvhpc')
|
|
|
|
|
2019-06-10 23:19:26 +08:00
|
|
|
# Really this should conflict since it's enabling or disabling openssl for
|
|
|
|
# CMake's internal copy of curl. Ideally we'd want a way to have the
|
|
|
|
# openssl variant disabled when ~ownlibs but there's not really a way to
|
|
|
|
# tie the values of those togethor, so for now we're just going to ignore
|
|
|
|
# the openssl variant entirely when ~ownlibs
|
|
|
|
# conflicts('~ownlibs', when='+openssl')
|
|
|
|
|
2016-08-25 03:39:05 +08:00
|
|
|
depends_on('curl', when='~ownlibs')
|
|
|
|
depends_on('expat', when='~ownlibs')
|
|
|
|
depends_on('zlib', when='~ownlibs')
|
|
|
|
depends_on('bzip2', when='~ownlibs')
|
|
|
|
depends_on('xz', when='~ownlibs')
|
2020-02-04 00:26:38 +08:00
|
|
|
depends_on('libarchive@3.1.0:', when='~ownlibs')
|
|
|
|
depends_on('libarchive@3.3.3:', when='@3.15.0:~ownlibs')
|
2019-03-08 02:42:24 +08:00
|
|
|
depends_on('libuv@1.0.0:1.10.99', when='@3.7.0:3.10.3~ownlibs')
|
|
|
|
depends_on('libuv@1.10.0:1.10.99', when='@3.11.0:3.11.99~ownlibs')
|
|
|
|
depends_on('libuv@1.10.0:', when='@3.12.0:~ownlibs')
|
2017-08-17 21:17:45 +08:00
|
|
|
depends_on('rhash', when='@3.8.0:~ownlibs')
|
2016-08-02 00:18:48 +08:00
|
|
|
depends_on('qt', when='+qt')
|
2016-03-09 23:46:56 +08:00
|
|
|
depends_on('python@2.7.11:', when='+doc', type='build')
|
2016-08-02 00:18:48 +08:00
|
|
|
depends_on('py-sphinx', when='+doc', type='build')
|
2017-08-17 21:17:45 +08:00
|
|
|
depends_on('openssl', when='+openssl')
|
|
|
|
depends_on('openssl@:1.0.99', when='@:3.6.9+openssl')
|
2016-08-02 00:18:48 +08:00
|
|
|
depends_on('ncurses', when='+ncurses')
|
2013-02-14 09:50:44 +08:00
|
|
|
|
2016-08-05 04:07:43 +08:00
|
|
|
# Cannot build with Intel, should be fixed in 3.6.2
|
|
|
|
# https://gitlab.kitware.com/cmake/cmake/issues/16226
|
|
|
|
patch('intel-c-gnu11.patch', when='@3.6.0:3.6.1')
|
|
|
|
|
2020-07-30 11:17:32 +08:00
|
|
|
# Cannot build with Intel again, should be fixed in 3.17.4 and 3.18.1
|
|
|
|
# https://gitlab.kitware.com/cmake/cmake/-/issues/21013
|
|
|
|
patch('intel-cxx-bootstrap.patch', when='@3.17.0:3.17.3,3.18.0')
|
|
|
|
|
2018-08-03 00:17:15 +08:00
|
|
|
# https://gitlab.kitware.com/cmake/cmake/issues/18232
|
|
|
|
patch('nag-response-files.patch', when='@3.7:3.12')
|
|
|
|
|
2020-05-06 02:02:49 +08:00
|
|
|
# Cray libhugetlbfs and icpc warnings failing CXX tests
|
|
|
|
# https://gitlab.kitware.com/cmake/cmake/-/merge_requests/4698
|
|
|
|
# https://gitlab.kitware.com/cmake/cmake/-/merge_requests/4681
|
|
|
|
patch('ignore_crayxc_warnings.patch', when='@3.7:3.17.2')
|
|
|
|
|
2020-06-05 19:29:36 +08:00
|
|
|
# The Fujitsu compiler requires the '--linkfortran' option
|
|
|
|
# to combine C++ and Fortran programs.
|
|
|
|
patch('fujitsu_add_linker_option.patch', when='%fj')
|
|
|
|
|
2020-10-23 05:42:48 +08:00
|
|
|
# Remove -A from the C++ flags we use when CXX_EXTENSIONS is OFF
|
|
|
|
# Should be fixed in 3.19.
|
|
|
|
# https://gitlab.kitware.com/cmake/cmake/-/merge_requests/5025
|
2020-10-24 00:00:16 +08:00
|
|
|
patch('pgi-cxx-ansi.patch', when='@3.15:3.18.99')
|
2020-10-23 05:42:48 +08:00
|
|
|
|
2021-03-09 02:54:46 +08:00
|
|
|
# Adds CCE v11+ fortran preprocessing definition.
|
|
|
|
# requires Cmake 3.19+
|
|
|
|
# https://gitlab.kitware.com/cmake/cmake/-/merge_requests/5882
|
|
|
|
patch('5882-enable-cce-fortran-preprocessing.patch',
|
|
|
|
sha256='b48396c0e4f61756248156b6cebe9bc0d7a22228639b47b5aa77c9330588ce88',
|
|
|
|
when='@3.19.0:3.19.99')
|
|
|
|
|
2017-08-17 21:17:45 +08:00
|
|
|
conflicts('+qt', when='^qt@5.4.0') # qt-5.4.0 has broken CMake modules
|
2015-08-20 05:18:02 +08:00
|
|
|
|
2018-08-02 07:53:53 +08:00
|
|
|
# https://gitlab.kitware.com/cmake/cmake/issues/18166
|
|
|
|
conflicts('%intel', when='@3.11.0:3.11.4')
|
2019-11-15 06:27:36 +08:00
|
|
|
conflicts('%intel@:14', when='@3.14:',
|
|
|
|
msg="Intel 14 has immature C++11 support")
|
2018-08-02 07:53:53 +08:00
|
|
|
|
2017-08-17 21:17:45 +08:00
|
|
|
phases = ['bootstrap', 'build', 'install']
|
2016-03-09 00:44:21 +08:00
|
|
|
|
2020-05-06 08:37:34 +08:00
|
|
|
@classmethod
|
2020-07-31 19:07:48 +08:00
|
|
|
def determine_version(cls, exe):
|
2020-08-14 14:40:58 +08:00
|
|
|
output = Executable(exe)('--version', output=str, error=str)
|
2020-07-31 19:07:48 +08:00
|
|
|
match = re.search(r'cmake.*version\s+(\S+)', output)
|
|
|
|
return match.group(1) if match else None
|
2020-05-06 08:37:34 +08:00
|
|
|
|
2019-07-23 06:33:40 +08:00
|
|
|
def flag_handler(self, name, flags):
|
|
|
|
if name == 'cxxflags' and self.compiler.name == 'fj':
|
|
|
|
cxx11plus_flags = (self.compiler.cxx11_flag,
|
|
|
|
self.compiler.cxx14_flag)
|
2019-07-24 23:28:22 +08:00
|
|
|
cxxpre11_flags = (self.compiler.cxx98_flag)
|
2019-07-23 06:33:40 +08:00
|
|
|
if any(f in flags for f in cxxpre11_flags):
|
|
|
|
raise ValueError('cannot build cmake pre-c++11 standard')
|
|
|
|
elif not any(f in flags for f in cxx11plus_flags):
|
|
|
|
flags.append(self.compiler.cxx11_flag)
|
|
|
|
return (flags, None, None)
|
2019-07-18 00:49:36 +08:00
|
|
|
|
2017-08-17 21:17:45 +08:00
|
|
|
def bootstrap_args(self):
|
|
|
|
spec = self.spec
|
|
|
|
args = [
|
|
|
|
'--prefix={0}'.format(self.prefix),
|
|
|
|
'--parallel={0}'.format(make_jobs)
|
|
|
|
]
|
2016-08-02 00:18:48 +08:00
|
|
|
|
2016-08-25 03:39:05 +08:00
|
|
|
if '+ownlibs' in spec:
|
|
|
|
# Build and link to the CMake-provided third-party libraries
|
2017-08-17 21:17:45 +08:00
|
|
|
args.append('--no-system-libs')
|
2016-08-25 03:39:05 +08:00
|
|
|
else:
|
|
|
|
# Build and link to the Spack-installed third-party libraries
|
2017-08-17 21:17:45 +08:00
|
|
|
args.append('--system-libs')
|
|
|
|
|
|
|
|
if spec.satisfies('@3.2:'):
|
|
|
|
# jsoncpp requires CMake to build
|
|
|
|
# use CMake-provided library to avoid circular dependency
|
|
|
|
args.append('--no-system-jsoncpp')
|
2016-08-25 03:39:05 +08:00
|
|
|
|
2016-03-02 06:25:57 +08:00
|
|
|
if '+qt' in spec:
|
2017-08-17 21:17:45 +08:00
|
|
|
args.append('--qt-gui')
|
2016-08-02 00:18:48 +08:00
|
|
|
else:
|
2017-08-17 21:17:45 +08:00
|
|
|
args.append('--no-qt-gui')
|
2016-03-02 06:25:57 +08:00
|
|
|
|
2016-03-12 00:51:12 +08:00
|
|
|
if '+doc' in spec:
|
2017-08-17 21:17:45 +08:00
|
|
|
args.append('--sphinx-html')
|
|
|
|
args.append('--sphinx-man')
|
2016-03-02 06:25:57 +08:00
|
|
|
|
2020-01-09 02:17:53 +08:00
|
|
|
# Now for CMake arguments to pass after the initial bootstrap
|
|
|
|
args.append('--')
|
|
|
|
|
2021-02-26 16:49:00 +08:00
|
|
|
args.append('-DCMAKE_BUILD_TYPE={0}'.format(
|
|
|
|
self.spec.variants['build_type'].value))
|
2020-01-09 02:17:53 +08:00
|
|
|
|
2020-02-18 02:26:35 +08:00
|
|
|
# Install CMake correctly, even if `spack install` runs
|
|
|
|
# inside a ctest environment
|
|
|
|
args.append('-DCMake_TEST_INSTALL=OFF')
|
|
|
|
|
2020-01-09 02:17:53 +08:00
|
|
|
# When building our own private copy of curl then we need to properly
|
|
|
|
# enable / disable oepnssl
|
2019-06-10 23:19:26 +08:00
|
|
|
if '+ownlibs' in spec:
|
|
|
|
args.append('-DCMAKE_USE_OPENSSL=%s' % str('+openssl' in spec))
|
2017-08-17 21:17:45 +08:00
|
|
|
|
|
|
|
return args
|
2016-03-02 06:25:57 +08:00
|
|
|
|
2017-08-17 21:17:45 +08:00
|
|
|
def bootstrap(self, spec, prefix):
|
2016-08-02 00:18:48 +08:00
|
|
|
bootstrap = Executable('./bootstrap')
|
2017-08-17 21:17:45 +08:00
|
|
|
bootstrap(*self.bootstrap_args())
|
2016-08-02 00:18:48 +08:00
|
|
|
|
2017-08-17 21:17:45 +08:00
|
|
|
def build(self, spec, prefix):
|
2013-02-14 09:50:44 +08:00
|
|
|
make()
|
2017-08-17 21:17:45 +08:00
|
|
|
|
|
|
|
@run_after('build')
|
|
|
|
@on_package_attributes(run_tests=True)
|
spack test (#15702)
Users can add test() methods to their packages to run smoke tests on
installations with the new `spack test` command (the old `spack test` is
now `spack unit-test`). spack test is environment-aware, so you can
`spack install` an environment and then run `spack test run` to run smoke
tests on all of its packages. Historical test logs can be perused with
`spack test results`. Generic smoke tests for MPI implementations, C,
C++, and Fortran compilers as well as specific smoke tests for 18
packages.
Inside the test method, individual tests can be run separately (and
continue to run best-effort after a test failure) using the `run_test`
method. The `run_test` method encapsulates finding test executables,
running and checking return codes, checking output, and error handling.
This handles the following trickier aspects of testing with direct
support in Spack's package API:
- [x] Caching source or intermediate build files at build time for
use at test time.
- [x] Test dependencies,
- [x] packages that require a compiler for testing (such as library only
packages).
See the packaging guide for more details on using Spack testing support.
Included is support for package.py files for virtual packages. This does
not change the Spack interface, but is a major change in internals.
Co-authored-by: Tamara Dahlgren <dahlgren1@llnl.gov>
Co-authored-by: wspear <wjspear@gmail.com>
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2020-11-18 18:39:02 +08:00
|
|
|
def build_test(self):
|
2017-08-17 21:17:45 +08:00
|
|
|
# Some tests fail, takes forever
|
|
|
|
make('test')
|
|
|
|
|
|
|
|
def install(self, spec, prefix):
|
2013-02-14 09:50:44 +08:00
|
|
|
make('install')
|
2020-06-05 19:25:02 +08:00
|
|
|
|
|
|
|
if spec.satisfies('%fj'):
|
|
|
|
for f in find(self.prefix, 'FindMPI.cmake', recursive=True):
|
|
|
|
filter_file('mpcc_r)', 'mpcc_r mpifcc)', f, string=True)
|
|
|
|
filter_file('mpc++_r)', 'mpc++_r mpiFCC)', f, string=True)
|
|
|
|
filter_file('mpifc)', 'mpifc mpifrt)', f, string=True)
|
spack test (#15702)
Users can add test() methods to their packages to run smoke tests on
installations with the new `spack test` command (the old `spack test` is
now `spack unit-test`). spack test is environment-aware, so you can
`spack install` an environment and then run `spack test run` to run smoke
tests on all of its packages. Historical test logs can be perused with
`spack test results`. Generic smoke tests for MPI implementations, C,
C++, and Fortran compilers as well as specific smoke tests for 18
packages.
Inside the test method, individual tests can be run separately (and
continue to run best-effort after a test failure) using the `run_test`
method. The `run_test` method encapsulates finding test executables,
running and checking return codes, checking output, and error handling.
This handles the following trickier aspects of testing with direct
support in Spack's package API:
- [x] Caching source or intermediate build files at build time for
use at test time.
- [x] Test dependencies,
- [x] packages that require a compiler for testing (such as library only
packages).
See the packaging guide for more details on using Spack testing support.
Included is support for package.py files for virtual packages. This does
not change the Spack interface, but is a major change in internals.
Co-authored-by: Tamara Dahlgren <dahlgren1@llnl.gov>
Co-authored-by: wspear <wjspear@gmail.com>
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2020-11-18 18:39:02 +08:00
|
|
|
|
|
|
|
def test(self):
|
|
|
|
"""Perform smoke tests on the installed package."""
|
|
|
|
spec_vers_str = 'version {0}'.format(self.spec.version)
|
|
|
|
|
|
|
|
for exe in ['ccmake', 'cmake', 'cpack', 'ctest']:
|
|
|
|
reason = 'test version of {0} is {1}'.format(exe, spec_vers_str)
|
|
|
|
self.run_test(exe, ['--version'], [spec_vers_str],
|
|
|
|
installed=True, purpose=reason, skip_missing=True)
|