Skip to content

Conversation

devonhollowood
Copy link

This makes it so the created .dylib contains all the right links.

This makes it so the created .dylib contains all the right links
@devonhollowood
Copy link
Author

I was having some trouble using this library on OSX. I'm fairly certain the issue is that the .dylib created by stack does not contain the correct shared libraries. Evidence:

$ otool -L /Users/devon/.stack/snapshots/x86_64-osx/lts-7.2/8.0.1/lib/x86_64-osx-ghc-8.0.1/symengine-0.1.2.0-CFDO5GoFnPYANnt609mDOk/libHSsymengine-0.1.2.0-CFDO5GoFnPYANnt609mDOk-ghc8.0.1.dylib
/Users/devon/.stack/snapshots/x86_64-osx/lts-7.2/8.0.1/lib/x86_64-osx-ghc-8.0.1/symengine-0.1.2.0-CFDO5GoFnPYANnt609mDOk/libHSsymengine-0.1.2.0-CFDO5GoFnPYANnt609mDOk-ghc8.0.1.dylib:
    @rpath/libHSsymengine-0.1.2.0-CFDO5GoFnPYANnt609mDOk-ghc8.0.1.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/local/opt/ghc/lib/ghc-8.0.1/base-4.9.0.0/libHSbase-4.9.0.0-ghc8.0.1.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/local/opt/ghc/lib/ghc-8.0.1/integer-gmp-1.0.0.1/libHSinteger-gmp-1.0.0.1-ghc8.0.1.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/local/opt/ghc/lib/ghc-8.0.1/ghc-prim-0.5.0.0/libHSghc-prim-0.5.0.0-ghc8.0.1.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)

This should contain libgmp, libgmpxx, and libsymengine, but doesn't. After adding these libraries to the library's extra-libraries field in the .cabal file, however, I get the following:

otool -L ./.stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build/libHSsymengine-0.1.2.0-DbMBk8QwvdmDiTyLqHFdAz-ghc7.10.2.dylib
./.stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build/libHSsymengine-0.1.2.0-DbMBk8QwvdmDiTyLqHFdAz-ghc7.10.2.dylib:
    @rpath/libHSsymengine-0.1.2.0-DbMBk8QwvdmDiTyLqHFdAz-ghc7.10.2.dylib (compatibility version 0.0.0, current version 0.0.0)
    libsymengine.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/local/opt/gmp/lib/libgmpxx.4.dylib (compatibility version 10.0.0, current version 10.1.0)
    /usr/local/opt/gmp/lib/libgmp.10.dylib (compatibility version 14.0.0, current version 14.1.0)
    @rpath/libHSbase-4.8.1.0-GDytRqRVSUX7zckgKqJjgw-ghc7.10.2.dylib (compatibility version 0.0.0, current version 0.0.0)
    @rpath/libHSinteger-gmp-1.0.0.0-2aU3IZNMF9a7mQ0OzsZ0dS-ghc7.10.2.dylib (compatibility version 0.0.0, current version 0.0.0)
    @rpath/libHSghc-prim-0.4.0.0-8TmvWUcS1U1IKHT0levwg3-ghc7.10.2.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)

I believe this to be correct, and indeed when I load it up with stack ghci it works, whereas it did not before.

By the way, let me know if you want me to do anything else as part of the contribution process. This library's CONTRIBUTING section is still TODO so I wasn't sure what the process was.

@isuruf
Copy link
Member

isuruf commented Oct 27, 2016

Thanks. @bollu, master is failing. Any idea, why?

About the CONTRIBUTING, if you are fine with licensing the code under the repo's LICENSE, that's it.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants