chessai / eigen

Haskell bindings to the Eigen C++ library
Other
16 stars 6 forks source link

Build issues #10

Open osidorkin opened 5 years ago

osidorkin commented 5 years ago

@chessai thank you for taking care of this package. I noticed that build is broken on ubuntu:xenial:

/tmp/stack1/eigen-3.3.4.1/cbits/eigen-sparse.cpp:24:5: error:
         error: ‘unique_ptr’ is not a member of ‘std’
             std::unique_ptr<M> a(new M(rows, cols));
             ^

as well as cabal file is not compatible with LTS Haskell < 12.x due to cabal version mismatch.

osidorkin commented 5 years ago
c++ --version
c++ (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
osidorkin commented 5 years ago
stack --version
Version 1.7.1, Git revision 681c800873816c022739ca7ed14755e85a579565 (5807 commits) x86_64 hpack-0.28.2
chessai commented 5 years ago

Which C++ compiler are you using? Would it be sufficient to add a macro

#if __cplusplus > 199711L
  #define SMART_PTR std::unique_ptr
#else
  #define SMART_PTR std::auto_ptr
#endif

Please check out the branch I have just pushed to here and try to build it: https://github.com/chessai/eigen/tree/auto-unique-ptr-probs

Also, is the stack issue just because the cabal version is too high?

osidorkin commented 5 years ago

Yes. Requested cabal version is available starting from LTS 12.x only.

chessai commented 5 years ago

Because I'm using the cxx-options field, available starting with cabal 2.1, i'll need to change that. I can then reduce the minimum cabal version to 1.10. Doing this right now.

chessai commented 5 years ago

Could you check out the branch I linked and see if it builds for you? I have changed it to permit building with cabal >= 1.10

hvr commented 5 years ago

I don't think it's a good idea to have ancient Stackage LTS snapshots hold back packages using modern version of the cabal spec. It's absurd to me we're currently at LTS 13.x and cabal-version:2.4 (soon cabal-version: 3.0 will be available), and we're supposed to stick to cabal-version: >1.10 because Stackage is incapabale for whatever reasons to support any reasonably recent cabal spec ;-(

And for the record, Ubuntu 16.04 LTS uses

$ gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

and you can see the output of g++ -dM -E -x c++ - < /dev/null over at https://gist.github.com/hvr/82c2c1ef5e9e32e8adb5304a26b63e85

chessai commented 5 years ago

How old is LTS 11? I'm unfamiliar with stack/stackage.

chessai commented 5 years ago

Thinking about it a second further, all tooling should morally be moving away from cabal 1.x, so i'm inclined to agree with @hvr.