Skip to content

Instantly share code, notes, and snippets.

@benkolera
Last active August 2, 2018 06:14
Show Gist options
  • Save benkolera/0d371c45fd4042d7267ec6770c0fe602 to your computer and use it in GitHub Desktop.
Save benkolera/0d371c45fd4042d7267ec6770c0fe602 to your computer and use it in GitHub Desktop.
{ nixpkgs ? import <unstable> {} }:
with nixpkgs;
let
hpkgs = pkgs.haskell.packages.ghc843;
nlopt-new = hpkgs.mkDerivation {
pname = "nlopt-haskell";
version = "0.1.2.0";
src = fetchFromGitHub {
owner = "peddie";
repo = "nlopt-haskell";
rev = "dd8c88334a91e51598beecfd02165a1810890c43";
sha256 = "1bmb53a3k4scr8higwihz2nrf1r4041sxxr1gg8xfajzy03n0qmd";
};
libraryHaskellDepends = (with hpkgs; [base vector ]);
testHaskellDepends = (with hpkgs; [ base vector ]);
librarySystemDepends = [ pkgs.nlopt ];
homepage = "https://github.com/peddie/nlopt-haskell";
description = "Low-level bindings to the NLOPT optimization library";
license = stdenv.lib.licenses.bsd3.fullName;
};
hmatrix-nlopt-new = hpkgs.mkDerivation {
pname = "hmatrix-nlopt";
version = "0.1.2.0";
src = fetchFromGitHub {
owner = "peddie";
repo = "hmatrix-nlopt";
rev = "e13a471599d5fca318d4bfc9417d1156bea3bb5";
sha256 = "01bn12d90f8gfrw2fgq2yrpwh8p8wz0w922vvh716vjn2g647x5q";
};
libraryHaskellDepends = (with hpkgs; [base hmatrix nlopt-new vector ]);
testHaskellDepends = (with hpkgs; [ base doctest ]);
homepage = "https://github.com/peddie/hmatrix-nlopt";
description = "Interface HMatrix with the NLOPT minimizer";
license = stdenv.lib.licenses.bsd3.fullName;
};
in
hpkgs.ghcWithPackages (ps: with ps; [
hmatrix-nlopt-new
hmpfr
hmatrix-gsl
])
bkolera at bkolera-qfpl in ~/src
$ nix-shell foo.nix
these derivations will be built:
/nix/store/ycbnq392z7mlf80dxaq00bbs114xjzvd-nlopt-haskell-0.1.2.0.drv
/nix/store/rra0napxymax5891f1ch9807s1adg4xb-hmatrix-nlopt-0.1.2.0.drv
these paths will be fetched (0.20 MiB download, 0.67 MiB unpacked):
/nix/store/5pb4a6hv8lc2vfr44ab4mhbljd500csw-pkg-config-0.29.2
copying path '/nix/store/5pb4a6hv8lc2vfr44ab4mhbljd500csw-pkg-config-0.29.2' from 'https://cache.nixos.org'...
building '/nix/store/ycbnq392z7mlf80dxaq00bbs114xjzvd-nlopt-haskell-0.1.2.0.drv'...
setupCompilerEnvironmentPhase
Build with /nix/store/yc8an71h8cah8w6fw0xykjxl68a8j1h7-ghc-8.4.3.
ignoring (possibly broken) abi-depends field for packages
ignoring (possibly broken) abi-depends field for packages
unpacking sources
unpacking source archive /nix/store/60nn7y797cr1h163940pihaz0944q2cp-source
source root is source
patching sources
compileBuildDriverPhase
setupCompileFlags: -package-db=/tmp/nix-build-nlopt-haskell-0.1.2.0.drv-0/setup-package.conf.d -j1 -threaded
[1 of 1] Compiling Main ( Setup.hs, /tmp/nix-build-nlopt-haskell-0.1.2.0.drv-0/Main.o )
Linking Setup ...
configuring
configureFlags: --verbose --prefix=/nix/store/l1388id5jlqgxmd956q6xpzk47ayfrlh-nlopt-haskell-0.1.2.0 --libdir=$prefix/lib/$compiler --libsubdir=$pkgid --docdir=/nix/store/jp3fri9dqc1icgmkq0p02gqli3icylix-nlopt-haskell-0.1.2.0-doc/share/doc/nlopt-haskell-0.1.2.0 --with-gcc=gcc --package-db=/tmp/nix-build-nlopt-haskell-0.1.2.0.drv-0/package.conf.d --ghc-option=-j1 --disable-split-objs --enable-library-profiling --profiling-detail=all-functions --disable-profiling --enable-shared --disable-coverage --enable-static --disable-executable-dynamic --enable-tests --enable-library-vanilla --enable-library-for-ghci --ghc-option=-split-sections --extra-lib-dirs=/nix/store/3cnh0n698w18l5g933wrx22zvkhcj8ik-ncurses-6.1/lib --extra-lib-dirs=/nix/store/bi9nx8f8kl8apgd544hkx2dsvlvr4zix-gmp-6.1.2/lib --extra-include-dirs=/nix/store/6h03g9qbl61nrk8w96hwxagsf6x27jr3-nlopt-2.4.2/include --extra-lib-dirs=/nix/store/6h03g9qbl61nrk8w96hwxagsf6x27jr3-nlopt-2.4.2/lib --extra-include-dirs=/nix/store/6h03g9qbl61nrk8w96hwxagsf6x27jr3-nlopt-2.4.2/include --extra-lib-dirs=/nix/store/6h03g9qbl61nrk8w96hwxagsf6x27jr3-nlopt-2.4.2/lib
Using Parsec parser
Configuring nlopt-haskell-0.1.2.0...
Flags chosen: link-nlopt-cxx=False
Dependency base >=4.9 && <4.12: using base-4.11.1.0
Dependency nlopt-haskell -any: using nlopt-haskell-0.1.2.0
Dependency vector >=0.10: using vector-0.12.0.1
Source component graph:
component lib
component test:example dependency lib
Configured component graph:
component nlopt-haskell-0.1.2.0-3osgsBKgEB2HQ2KpjTkJB8
include base-4.11.1.0
include vector-0.12.0.1-4awQG9XUvVEBfJgKGHBhOb
component nlopt-haskell-0.1.2.0-50eiALsSh97ICTnTiZeJsZ-example
include base-4.11.1.0
include nlopt-haskell-0.1.2.0-3osgsBKgEB2HQ2KpjTkJB8
include vector-0.12.0.1-4awQG9XUvVEBfJgKGHBhOb
Linked component graph:
unit nlopt-haskell-0.1.2.0-3osgsBKgEB2HQ2KpjTkJB8
include base-4.11.1.0
include vector-0.12.0.1-4awQG9XUvVEBfJgKGHBhOb
Numeric.Optimization.NLOPT.Bindings=nlopt-haskell-0.1.2.0-3osgsBKgEB2HQ2KpjTkJB8:Numeric.Optimization.NLOPT.Bindings
unit nlopt-haskell-0.1.2.0-50eiALsSh97ICTnTiZeJsZ-example
include base-4.11.1.0
include nlopt-haskell-0.1.2.0-3osgsBKgEB2HQ2KpjTkJB8
include vector-0.12.0.1-4awQG9XUvVEBfJgKGHBhOb
Ready component graph:
definite nlopt-haskell-0.1.2.0-3osgsBKgEB2HQ2KpjTkJB8
depends base-4.11.1.0
depends vector-0.12.0.1-4awQG9XUvVEBfJgKGHBhOb
definite nlopt-haskell-0.1.2.0-50eiALsSh97ICTnTiZeJsZ-example
depends base-4.11.1.0
depends nlopt-haskell-0.1.2.0-3osgsBKgEB2HQ2KpjTkJB8
depends vector-0.12.0.1-4awQG9XUvVEBfJgKGHBhOb
Using Cabal-2.2.0.1 compiled by ghc-8.4
Using compiler: ghc-8.4.3
Using install prefix:
/nix/store/l1388id5jlqgxmd956q6xpzk47ayfrlh-nlopt-haskell-0.1.2.0
Executables installed in:
/nix/store/l1388id5jlqgxmd956q6xpzk47ayfrlh-nlopt-haskell-0.1.2.0/bin
Libraries installed in:
/nix/store/l1388id5jlqgxmd956q6xpzk47ayfrlh-nlopt-haskell-0.1.2.0/lib/ghc-8.4.3/nlopt-haskell-0.1.2.0
Dynamic Libraries installed in:
/nix/store/l1388id5jlqgxmd956q6xpzk47ayfrlh-nlopt-haskell-0.1.2.0/lib/ghc-8.4.3/x86_64-linux-ghc-8.4.3
Private executables installed in:
/nix/store/l1388id5jlqgxmd956q6xpzk47ayfrlh-nlopt-haskell-0.1.2.0/libexec/x86_64-linux-ghc-8.4.3/nlopt-haskell-0.1.2.0
Data files installed in:
/nix/store/l1388id5jlqgxmd956q6xpzk47ayfrlh-nlopt-haskell-0.1.2.0/share/x86_64-linux-ghc-8.4.3/nlopt-haskell-0.1.2.0
Documentation installed in:
/nix/store/jp3fri9dqc1icgmkq0p02gqli3icylix-nlopt-haskell-0.1.2.0-doc/share/doc/nlopt-haskell-0.1.2.0
Configuration files installed in:
/nix/store/l1388id5jlqgxmd956q6xpzk47ayfrlh-nlopt-haskell-0.1.2.0/etc
No alex found
Using ar found on system at:
/nix/store/1hi76hr87bd1y1q1qjk0lv8nmcjip1c8-binutils-2.30/bin/ar
No c2hs found
No cpphs found
No doctest found
Using gcc version 7.3.0 given by user at:
/nix/store/wkfafgwgs1na5f808wybs8l6v8yjrvqz-gcc-wrapper-7.3.0/bin/gcc
Using ghc version 8.4.3 found on system at:
/nix/store/yc8an71h8cah8w6fw0xykjxl68a8j1h7-ghc-8.4.3/bin/ghc
Using ghc-pkg version 8.4.3 found on system at:
/nix/store/yc8an71h8cah8w6fw0xykjxl68a8j1h7-ghc-8.4.3/bin/ghc-pkg
No ghcjs found
No ghcjs-pkg found
No greencard found
Using haddock version 2.20.0 found on system at:
/nix/store/yc8an71h8cah8w6fw0xykjxl68a8j1h7-ghc-8.4.3/bin/haddock
No happy found
Using haskell-suite found on system at: haskell-suite-dummy-location
Using haskell-suite-pkg found on system at: haskell-suite-pkg-dummy-location
No hmake found
Using hpc version 0.67 found on system at:
/nix/store/yc8an71h8cah8w6fw0xykjxl68a8j1h7-ghc-8.4.3/bin/hpc
Using hsc2hs version 0.68.3 found on system at:
/nix/store/yc8an71h8cah8w6fw0xykjxl68a8j1h7-ghc-8.4.3/bin/hsc2hs
Using hscolour version 1.24 found on system at:
/nix/store/j40fckvgigyfglrjw6p9xkm5iljgvisf-hscolour-1.24.4/bin/HsColour
No jhc found
Using ld found on system at:
/nix/store/d2r0ha0m1sk9bsh29snnbprfyhgmwllv-binutils-wrapper-2.30/bin/ld
No lhc found
No lhc-pkg found
Using pkg-config version 0.29.2 found on system at:
/nix/store/5pb4a6hv8lc2vfr44ab4mhbljd500csw-pkg-config-0.29.2/bin/pkg-config
Using runghc version 8.4.3 found on system at:
/nix/store/yc8an71h8cah8w6fw0xykjxl68a8j1h7-ghc-8.4.3/bin/runghc
Using strip version 2.30 found on system at:
/nix/store/1hi76hr87bd1y1q1qjk0lv8nmcjip1c8-binutils-2.30/bin/strip
Using tar found on system at:
/nix/store/igrs1ns8i2vc1lifapyjxpn6xc53hk1k-gnutar-1.30/bin/tar
No uhc found
Setup: Missing dependency on a foreign library:
* Missing (or bad) C library: nlopt
This problem can usually be solved by installing the system package that
provides this library (you may need the "-dev" version). If the library is
already installed but in a non-standard location then you can use the flags
--extra-include-dirs= and --extra-lib-dirs= to specify where it is.If the
library file does exist, it may contain errors that are caught by the C
compiler at the preprocessing stage. In this case you can re-run configure
with the verbosity flag -v3 to see the error messages.
builder for '/nix/store/ycbnq392z7mlf80dxaq00bbs114xjzvd-nlopt-haskell-0.1.2.0.drv' failed with exit code 1
error: build of '/nix/store/rra0napxymax5891f1ch9807s1adg4xb-hmatrix-nlopt-0.1.2.0.drv', '/nix/store/ycbnq392z7mlf80dxaq00bbs114xjzvd-nlopt-haskell-0.1.2.0.drv' failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment