Skip to content

Instantly share code, notes, and snippets.

@idontgetoutmuch
Created August 19, 2019 13:36
Show Gist options
  • Select an option

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

Select an option

Save idontgetoutmuch/b1f96be4442f7a7721ae0521032b76ea to your computer and use it in GitHub Desktop.
{ mkDerivation, base, blas-ffi, blaze-html, boxes, ChasingBottoms
, comfort-array, data-ref, deepseq, fixed-length
, guarded-allocation, gfortran, hyper, lapack-ffi, lazyio, libiconv, liblapack, monoid-transformer
, netlib-ffi, non-empty, QuickCheck, quickcheck-transformer, random
, semigroups, stdenv, text, tfp, transformers, unique-logic-tf
, utility-ht
}:
mkDerivation {
pname = "lapack";
version = "0.3.1";
src = ./.;
libraryHaskellDepends = [
base blas-ffi blaze-html boxes comfort-array deepseq fixed-length
guarded-allocation hyper lapack-ffi lazyio netlib-ffi non-empty
semigroups text tfp transformers utility-ht
];
librarySystemDepends = [ libiconv liblapack gfortran ];
libraryPkgconfigDepends = [ libiconv liblapack gfortran ];
testPkgconfigDepends = [ libiconv liblapack gfortran];
executablePkgconfigDepends = [ libiconv liblapack gfortran ];
testHaskellDepends = [
base ChasingBottoms comfort-array data-ref monoid-transformer
netlib-ffi non-empty QuickCheck quickcheck-transformer random
semigroups tfp transformers unique-logic-tf utility-ht
];
homepage = "http://hub.darcs.net/thielema/lapack/";
description = "Numerical Linear Algebra using LAPACK";
license = stdenv.lib.licenses.bsd3;
}
@idontgetoutmuch

Copy link
Copy Markdown
Author
[24 of 24] Compiling Main             ( test/Main.hs, dist/build/lapack-test/lapack-test-tmp/Main.o )
Linking dist/build/lapack-test/lapack-test ...
Undefined symbols for architecture x86_64:
  "__gfortran_st_write", referenced from:
      _xerbla_ in liblapack.a(xerbla.f.o)
  "__gfortran_string_len_trim", referenced from:
      _xerbla_ in liblapack.a(xerbla.f.o)
  "__gfortran_transfer_character_write", referenced from:
      _xerbla_ in liblapack.a(xerbla.f.o)
  "__gfortran_transfer_integer_write", referenced from:
      _xerbla_ in liblapack.a(xerbla.f.o)
  "__gfortran_st_write_done", referenced from:
      _xerbla_ in liblapack.a(xerbla.f.o)
  "__gfortran_stop_string", referenced from:
      _xerbla_ in liblapack.a(xerbla.f.o)
  "__gfortran_concat_string", referenced from:
      _cgesvd_ in liblapack.a(cgesvd.f.o)
      _dgesvd_ in liblapack.a(dgesvd.f.o)
      _sgesvd_ in liblapack.a(sgesvd.f.o)
      _zgesvd_ in liblapack.a(zgesvd.f.o)
      _chseqr_ in liblapack.a(chseqr.f.o)
      _ctrtri_ in liblapack.a(ctrtri.f.o)
      _cunmbr_ in liblapack.a(cunmbr.f.o)
      ...
ld: symbol(s) not found for architecture x86_64
clang-7: error: linker command failed with exit code 1 (use -v to see invocation)
`cc' failed in phase `Linker'. (Exit code: 1)
builder for '/nix/store/rndgz40cyb2qmdjx1q508sx6yjckkxqk-lapack-0.3.1.drv' failed with exit code 1
cannot build derivation '/nix/store/3kj8zh7pbfkzjacn9hsbz1l0jdwqf8g0-ghc-8.6.5-with-packages.drv': 1 dependencies couldn't be built
error: build of '/nix/store/3kj8zh7pbfkzjacn9hsbz1l0jdwqf8g0-ghc-8.6.5-with-packages.drv' failed

@idontgetoutmuch

Copy link
Copy Markdown
Author

On linux (ubuntu) I get this

Linking dist/build/lapack-test/lapack-test ...
/nix/store/mgdjnsrkqgmxqjaqaxgqyqm7fwyi96fk-binutils-2.31.1/bin/ld: /nix/store/8qfdbhycf15g7i9pgj994lki5ijypzdd-liblapack-3.8.0/lib/lib\
lapack.a(xerbla.f.o): undefined reference to symbol '_gfortran_string_len_trim@@GFORTRAN_7'
/nix/store/mgdjnsrkqgmxqjaqaxgqyqm7fwyi96fk-binutils-2.31.1/bin/ld: /nix/store/mdpm4b2w8y5ybrv4rqyg98npvkwj7wg3-gfortran-7.4.0-lib/lib/\
libgfortran.so.4: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
`cc' failed in phase `Linker'. (Exit code: 1)
builder for '/nix/store/fswppn352cdmkbfgnxib70c8wmiv3vdc-lapack-0.3.1.drv' failed with exit code 1
cannot build derivation '/nix/store/2qdnri60wjz8jhh243ipyria3ywjplbf-ghc-8.6.5-with-packages.drv': 1 dependencies couldn't be built
error: build of '/nix/store/2qdnri60wjz8jhh243ipyria3ywjplbf-ghc-8.6.5-with-packages.drv' failed

@freeman42x

Copy link
Copy Markdown

@idontgetoutmuch To fix the issues on Ubuntu I think you need to add the library libgfortran3 to the nix dependencies

@freeman42x

Copy link
Copy Markdown

@idontgetoutmuch or try installing libgfortran3 using apt-get

@freeman42x

Copy link
Copy Markdown

@idontgetoutmuch I think the fix is similar for MacOS, just install libgfortran3 at the OS level or using Nix

@idontgetoutmuch

idontgetoutmuch commented Aug 19, 2019

Copy link
Copy Markdown
Author

Thanks for this but I can't see libgfortran3 in nixpkgs.

@freeman42x

Copy link
Copy Markdown

@idontgetoutmuch as I said, install it using the package manager of MacOS or Ubuntu.

@idontgetoutmuch

Copy link
Copy Markdown
Author

Doesn't that rather defeat the purpose of nix?

@freeman42x

Copy link
Copy Markdown

@idontgetoutmuch "Doesn't that rather defeat the purpose of nix?"

Do you think it is smart to care about getting your work done or is it smart to care about which method (Nix, OS level package manager, Stack, Cabal, etc.) you are using to achieve that goal?

(╯°□°)╯︵ ┻━┻

@idontgetoutmuch

Copy link
Copy Markdown
Author

I agree with your sentiment and I could probably get this working using brew and cabal but that's not the point. Indeed I have got it working in nix without the tests. I probably have some form of OCD where I want to make things work.

@freeman42x

Copy link
Copy Markdown

I probably have some form of OCD where I want to make things work. That's good if you can afford the wasted time. :) I'm having fun like that also, but in my spare time.

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