Skip to content

Instantly share code, notes, and snippets.

@idontgetoutmuch
Created September 29, 2019 07:11
Show Gist options
  • Select an option

  • Save idontgetoutmuch/81aa1f4601724292edcb3dba8d78a772 to your computer and use it in GitHub Desktop.

Select an option

Save idontgetoutmuch/81aa1f4601724292edcb3dba8d78a772 to your computer and use it in GitHub Desktop.
{ nixpkgs ? import <nixpkgs> { config.allowUnfree = true; config.allowBroken = true; }, compiler ? "default", doBenchmark ? false }:
let
inherit (nixpkgs) pkgs;
f = { mkDerivation, accelerate, accelerate-fft
, accelerate-llvm-native, base, Chart, Chart-cairo, Chart-diagrams
, clock, diagrams-cairo, diagrams-lib, formatting, hedgehog, HUnit
, lens-accelerate, stdenv, tasty, tasty-hedgehog, vector
}:
mkDerivation {
pname = "chebApprox";
version = "0.1.0.0";
src = nixpkgs.fetchgit {
url = https://github.com/DeifiliaTo/chebApprox;
rev = "30f1b1d4ab33dfbcba061cdc3d6e224a0d1e7146";
sha256 = "01w9yxx6djhgdhagdswkshdda6mkypvy0ajfrwyr0swrbkx6rrw5";
};
isLibrary = true;
isExecutable = true;
libraryHaskellDepends = [
accelerate accelerate-llvm-native base clock formatting hedgehog
tasty tasty-hedgehog vector
];
executableHaskellDepends = [
accelerate accelerate-fft accelerate-llvm-native base Chart
Chart-cairo Chart-diagrams diagrams-cairo diagrams-lib HUnit
lens-accelerate
];
homepage = "https://github.com/DeifiliaTo/chebApprox";
description = "Function approximation";
license = stdenv.lib.licenses.bsd3;
};
my-accelerate = pkgs.haskellPackages.accelerate.overrideAttrs (oldAttrs: rec {
# src = nixpkgs.fetchgit {
# url = https://github.com/tmcdonell/accelerate;
# rev = "a7b685352330ebf7d8794aed64663a9ee92dcdab";
# sha256 = "01w9yxx6djhgdhagdswkshdda6mkypvy0ajfrwyr0swrbkx6rrw5";
# };
src = ../accelerate;
version = "1.3.0.0";
doCheck = false;
});
haskellPackages = if compiler == "default"
then pkgs.haskellPackages
else pkgs.haskell.packages.${compiler};
myHaskellPackages = haskellPackages.override {
overrides = self: super: with pkgs.haskell.lib; {
accelerate-llvm-native = dontCheck super.accelerate-llvm-native;
accelerate-llvm-ptx = dontCheck super.accelerate-llvm-ptx;
accelerate-fft = dontCheck super.accelerate-fft;
accelerate = my-accelerate;
};
};
variant = if doBenchmark then pkgs.haskell.lib.doBenchmark else pkgs.lib.id;
drv = variant (myHaskellPackages.callPackage f {});
in
if pkgs.lib.inNixShell then drv.env else drv
@idontgetoutmuch

Copy link
Copy Markdown
Author
sundials@sundials:~/chebApprox$ nix-shell
these derivations will be built:
  /nix/store/f1fys4k09vs4iha2agrdm889xpxjnb4p-accelerate-1.2.0.1.drv
  /nix/store/1mvl4qp3g4762ajf5myglss0c458dw30-accelerate-llvm-1.2.0.1.drv
  /nix/store/yvq0vv0vd0g09zhap27ykg12jswk5j1s-lens-accelerate-0.2.0.0.drv
  /nix/store/z291241ayl2b3fval89clrdx6i8h5rzz-accelerate-llvm-native-1.2.0.1.drv
  /nix/store/zgnydsxalihrc42yig7p32r9hj52lk3y-accelerate-llvm-ptx-1.2.0.1.drv
  /nix/store/ykn97xjrfj6vi40527xp1zwm3d0irvga-accelerate-fft-1.2.0.0.drv
  /nix/store/z18c8lxrry8nai3hha9sk56a71jrgm1d-ghc-8.6.5-with-packages.drv
building '/nix/store/f1fys4k09vs4iha2agrdm889xpxjnb4p-accelerate-1.2.0.1.drv'...
setupCompilerEnvironmentPhase
Build with /nix/store/44zyylbbhabj2d62f7lbb6wmjlllcv10-ghc-8.6.5.
unpacking sources
unpacking source archive /nix/store/fckavr187s1a1mbd0nwzx8hvlhdml467-accelerate
source root is accelerate
patching sources
compileBuildDriverPhase
setupCompileFlags: -package-db=/build/setup-package.conf.d -j2 -threaded
[1 of 1] Compiling Main             ( Setup.hs, /build/Main.o )
Linking Setup ...
configuring
configureFlags: --verbose --prefix=/nix/store/00cgal5vjn4961bda0b190d9rfzyh40n-accelerate-1.2.0.1 --libdir=$prefix/lib/$compiler --libsubdir=$abi/$libname --docdir=/nix/store/9fqk030bvx87khl156j1ixrp03lvf738-accelerate-1.2.0.1-doc/share/doc/accelerate-1.2.0.1 --with-gcc=gcc --package-db=/build/package.conf.d --ghc-option=-j2 --disable-split-objs --enable-library-profiling --profiling-detail=exported-functions --disable-profiling --enable-shared --disable-coverage --enable-static --disable-executable-dynamic --enable-tests --disable-benchmarks --enable-library-vanilla --disable-library-for-ghci --ghc-option=-split-sections --extra-lib-dirs=/nix/store/58zg3ya4ap9s13sjkgv1v6ga2q5s2g5w-ncurses-6.1-20190112/lib --extra-lib-dirs=/nix/store/rr52rxkzn8w4pidxp8g49649yysa726h-libffi-3.2.1/lib --extra-lib-dirs=/nix/store/vdw4zkdvdcpca3bn0z7i3a2na48pr38a-gmp-6.1.2/lib --extra-lib-dirs=/nix/store/44zyylbbhabj2d62f7lbb6wmjlllcv10-ghc-8.6.5/lib
Using Parsec parser
Configuring accelerate-1.3.0.0...
CallStack (from HasCallStack):
  die', called at libraries/Cabal/Cabal/Distribution/Simple/Configure.hs:950:20 in Cabal-2.4.0.1:Distribution.Simple.Configure
  configureFinalizedPackage, called at libraries/Cabal/Cabal/Distribution/Simple/Configure.hs:460:12 in Cabal-2.4.0.1:Distribution.Simple.Configure
  configure, called at libraries/Cabal/Cabal/Distribution/Simple.hs:596:20 in Cabal-2.4.0.1:Distribution.Simple
  confHook, called at libraries/Cabal/Cabal/Distribution/Simple/UserHooks.hs:67:5 in Cabal-2.4.0.1:Distribution.Simple.UserHooks
  confHook, called at libraries/Cabal/Cabal/Distribution/Simple/UserHooks.hs:67:5 in Cabal-2.4.0.1:Distribution.Simple.UserHooks
  configureAction, called at libraries/Cabal/Cabal/Distribution/Simple.hs:178:19 in Cabal-2.4.0.1:Distribution.Simple
  defaultMainHelper, called at libraries/Cabal/Cabal/Distribution/Simple.hs:124:42 in Cabal-2.4.0.1:Distribution.Simple
  defaultMainWithHooks, called at src/Distribution/Extra/Doctest.hs:135:27 in cabal-doctest-1.0.6-JO6c4A1pILcGBoq3P7Luma:Distribution.Extra.Doctest
Setup: Encountered missing dependencies:
prettyprinter >=1.2, prettyprinter-ansi-terminal >=1.0

builder for '/nix/store/f1fys4k09vs4iha2agrdm889xpxjnb4p-accelerate-1.2.0.1.drv' failed with exit code 1
cannot build derivation '/nix/store/z18c8lxrry8nai3hha9sk56a71jrgm1d-ghc-8.6.5-with-packages.drv': 1 dependencies couldn't be built
error: build of '/nix/store/z18c8lxrry8nai3hha9sk56a71jrgm1d-ghc-8.6.5-with-packages.drv' failed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment