Windows: Support for Clingo and dependencies (#30690)

Make it possible to install the Clingo package on Windows; this
also provides a means to use Clingo with Spack on Windows.

This includes

* A new "winbison" package: Windows has a port of bison and flex where
  the two packages are grouped together. Clingo dependencies have been
  updated to use winbison on Windows and bison elsewhere (this avoids
  complicating the existin bison/flex packages until we can add support
  for implied virtuals).
* The CMake build system was incorrectly converting CMAKE_INSTALL_PREFIX
  to POSIX format.
* The re2c package has been modified to use CMake on Windows; for now
  this is done by overloading the configure/build/install methods to
  perform CMake-appropriate operations; the package should be refactored
  once support for multiple build systems in one Package is available.
This commit is contained in:
John W. Parent
2022-09-28 11:54:00 -04:00
committed by GitHub
parent db2565cb53
commit 650a668a9d
9 changed files with 130 additions and 16 deletions

View File

@@ -3,6 +3,7 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.compiler import UnsupportedCompilerFlag
from spack.package import *
@@ -45,14 +46,22 @@ class Clingo(CMakePackage):
with when("@spack,master"):
depends_on("re2c@0.13:", type="build")
depends_on("bison@2.5:", type="build")
depends_on("bison@2.5:", type="build", when="platform=linux")
depends_on("bison@2.5:", type="build", when="platform=darwin")
depends_on("bison@2.5:", type="build", when="platform=cray")
with when("platform=windows"):
depends_on("re2c@0.13:", type="build")
depends_on("winbison@2.4.12:")
with when("+python"):
extends("python")
depends_on("python", type=("build", "link", "run"))
# Clingo 5.5.0 supports Python 3.6 or later and needs CFFI
depends_on("python@3.6.0:", type=("build", "link", "run"), when="@5.5.0:")
depends_on("py-cffi", type=("build", "run"), when="@5.5.0:")
depends_on("py-cffi", type=("build", "run"), when="@5.5.0: platform=darwin")
depends_on("py-cffi", type=("build", "run"), when="@5.5.0: platform=linux")
depends_on("py-cffi", type=("build", "run"), when="@5.5.0: platform=cray")
patch("python38.patch", when="@5.3:5.4.0")