From 8002302a318a8d4611440569e7869acdbf1c36ce Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Thu, 31 Mar 2011 21:25:08 +0000 Subject: [PATCH] Add CLooG, an alternative to CLooG-PPL based on the integer set library, an optional dependency for GCC 4.6.0 svn path=/nixpkgs/trunk/; revision=26635 --- pkgs/development/libraries/cloog/default.nix | 76 ++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 78 insertions(+) create mode 100644 pkgs/development/libraries/cloog/default.nix diff --git a/pkgs/development/libraries/cloog/default.nix b/pkgs/development/libraries/cloog/default.nix new file mode 100644 index 000000000000..93af6d18b144 --- /dev/null +++ b/pkgs/development/libraries/cloog/default.nix @@ -0,0 +1,76 @@ +{ fetchurl, stdenv, gmp, isl, static ? false }: + +let + staticFlags = + assert static -> isl.dontDisableStatic == true; + if static then "--enable-static --disable-shared" else ""; + +in + +stdenv.mkDerivation rec { + name = "cloog-0.16.2"; + + src = fetchurl { + url = "http://www.bastoul.net/cloog/pages/download/count.php3?url=./${name}.tar.gz"; + sha256 = "1w9n9lsq18k65fywwbbvhkgl917053w1kvqw0xhlwcma0v59m6mx"; + }; + + buildInputs = [ gmp ]; + + propagatedBuildInputs = [ isl ]; + + configureFlags = "--with-isl=system --with-isl-prefix=${isl}" + staticFlags; + + dontDisableStatic = if static then true else false; + + crossAttrs = { + configureFlags = "--with-isl=system --with-isl-prefix=${isl.hostDrv}" + staticFlags; + }; + + doCheck = true; + + meta = { + description = "CLooG, the Chunky Loop Generator"; + + longDescription = '' + CLooG is a free software library to generate code for scanning + Z-polyhedra. That is, it finds a code (e.g., in C, FORTRAN...) that + reaches each integral point of one or more parameterized polyhedra. + CLooG has been originally written to solve the code generation problem + for optimizing compilers based on the polytope model. Nevertheless it + is used now in various area e.g., to build control automata for + high-level synthesis or to find the best polynomial approximation of a + function. CLooG may help in any situation where scanning polyhedra + matters. While the user has full control on generated code quality, + CLooG is designed to avoid control overhead and to produce a very + effective code. + ''; + + homepage = http://www.cloog.org/; + + license = "GPLv2+"; + + maintainers = [ stdenv.lib.maintainers.shlevy ]; + + /* Leads to an ICE on Cygwin: + + make[3]: Entering directory `/tmp/nix-build-9q5gw5m37q5l4f0kjfv9ar8fsc9plk27-ppl-0.10.2.drv-1/ppl-0.10.2/src' + /bin/sh ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -I.. -I../src -g -O2 -frounding-math -W -Wall -c -o Box.lo Box.cc + libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -I.. -I../src -g -O2 -frounding-math -W -Wall -c Box.cc -DDLL_EXPORT -DPIC -o .libs/Box.o + In file included from checked.defs.hh:595, + from Checked_Number.defs.hh:27, + from Coefficient.types.hh:15, + from Coefficient.defs.hh:26, + from Box.defs.hh:28, + from Box.cc:24: + checked.inlines.hh: In function `Parma_Polyhedra_Library::Result Parma_Polyhedra_Library::Checked::input_generic(Type&, std::istream&, Parma_Polyhedra_Library::Rounding_Dir)': + checked.inlines.hh:607: internal compiler error: in invert_truthvalue, at fold-const.c:2719 + Please submit a full bug report, + with preprocessed source if appropriate. + See for instructions. + make[3]: *** [Box.lo] Error 1 + + */ + platforms = stdenv.lib.platforms.allBut "i686-cygwin"; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 5968ccd32f7a..fd4a518d4e52 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -489,6 +489,8 @@ let usb_modeswitch = callPackage ../development/tools/misc/usb-modeswitch { }; + cloog = callPackage ../development/libraries/cloog { }; + cloogppl = callPackage ../development/libraries/cloog-ppl { }; convmv = callPackage ../tools/misc/convmv { };