You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cabal accepts extra-include-dirs field in the file, but 1) it's not working 2) it's not documented 3) seems to be replaced with include-dirs.
EDIT: I wasted an hour trying to fix a linker problem and here's what I found:
Cabal has lib-dirs, include-dirs and libraries fields, and a extra- prefixed version of each. In the user manual:
extra-lib-dirs is documented , but lib-dirs is missing. include-dirs is documented, but extra-include-dirs is missing. extra-libraries is documented, but libraries is missing.
And clearly those are not the same, i.e. extra-lib-dirs and lib-dirs are used differently. (I had to use both in my program to make it working)
I find this insane, that cabal still has problems that shouldn't be problems, which stack solves this perfectly.
How can I help fix this error / how do I solve this anyway? cabal doesn't accept --lib-dirs as a command line parameter either so I really don't know how to tell cabal that I have a library in a non-standard location
I don't really know what is going on with extra-lib-dirs in the package description format, but that was added by ekarttun in a693cd5; the flag was added later by Pepe Iborra in 6040df4.
In any case, the error is not consistent with --extra-lib-dirs not being passed to Cabal, because the error you are getting during compilation is a missing symbol rather than a missing library. So this seems to suggest that the library is not making it to the build in the first place. I can't tell from your Travis log because it doesn't have enough information.
The extra- versions of all are now documented, and it appears the non-extra versions are no longer around/used? Which suggests to me this can be closed... (unless the non-prefixed versions are still there, undocumented, and of some possible use...)
Activity
[-]extra-include-dirs not documented and not working[/-][+]Undocumented fields in the user manual[/+]osa1 commentedon Mar 19, 2015
(also changed the title)
bollu commentedon May 15, 2016
This doesn't work even now AFAIK. I've been trying to write bindings to
SymEngine, and cabal just doesn't accept--extra-lib-dirs. It's frustrating.Here is the travis.yml
Here is a cabal build that is failing
On the other hand, [here is the succeeding stack build](https://travis-
ci.org/symengine/symengine.hs/jobs/130275588) for the same commit.
I find this insane, that cabal still has problems that shouldn't be problems, which stack solves this perfectly.
How can I help fix this error / how do I solve this anyway? cabal doesn't accept
--lib-dirsas a command line parameter either so I really don't know how to tell cabal that I have a library in a non-standard locationezyang commentedon May 15, 2016
I am confused.
cabal configure --extra-lib-dirsworks for me:(look for
-L).I don't really know what is going on with
extra-lib-dirsin the package description format, but that was added by ekarttun in a693cd5; the flag was added later by Pepe Iborra in 6040df4.bollu commentedon May 15, 2016
hm, interesting. And no, I'm not passing it through the
.cabalfile, I'm passing it through thecabal install.Here is the exact
cabal installinvocation: LinkAs I have said, a similar
stack buildworks: LinkThanks a lot for your help, I really appreciate it!
ezyang commentedon May 15, 2016
Can you run this with
-v? I want to see if-lsymengineis being passed to the compiler.And just a random idea, but can you try a more recent version of Cabal/cabal-install?
cabal installpasses--extra-lib-dirsjust fine for me too:In any case, the error is not consistent with
--extra-lib-dirsnot being passed to Cabal, because the error you are getting during compilation is a missing symbol rather than a missing library. So this seems to suggest that the library is not making it to the build in the first place. I can't tell from your Travis log because it doesn't have enough information.bollu commentedon May 15, 2016
@ezyang - Thanks for the help, but I think I figured the issue out.
For the library to link, it supposedly needs to have the other module in the
other-modules.Here's the edited
.cabalfileThe build passes and runs the tests: Here's a
travislogI think the
cabalerror message is terrible though, since it simply tells you the linker fails, but it doesn't tell you why it does.For the sake of documentation, here's how you fix it
Fix for the error
I'm writing the down for SEO, so others can find the solution
Error
Keywords
Solution
other-modulesin your.cabalfile.hs-source-dirspart of the.cabalfileezyang commentedon May 15, 2016
I am very confused by your proposed fix. I don't see any change to
other-modulesin your Cabal file history.bollu commentedon May 15, 2016
@ezyang - Apologies, I pointed you to the
.cabalfile on the wrong branch. I've edited the comment to point to the right one.Here is the link
gbaz commentedon Feb 7, 2018
The
extra-versions of all are now documented, and it appears the non-extra versions are no longer around/used? Which suggests to me this can be closed... (unless the non-prefixed versions are still there, undocumented, and of some possible use...)linearray commentedon Nov 17, 2018
I just checked and
lib-dirsis gone,librariesappears to be gone,include-dirsandextra-include-dirsare here and well-documented. Closing this.