cabal ignores ld-options?

Frederik Eaton frederik at a5.repetae.net
Sun Apr 22 06:51:49 EDT 2007


On Sun, Apr 22, 2007 at 05:31:31PM +1000, Duncan Coutts wrote:
> On Sun, 2007-04-22 at 00:11 +0100, Frederik Eaton wrote:
> > Hello,
> > 
> > I am trying to get cabal to link an object file with a library.
> 
> Do you mean you want to link to an existing C library? You don't need
> ld-options for that of course, just extra-libraries (and maybe
> extra-lib-dirs).

No, I have an object file which I have compiled with g++, and a
Haskell library which uses symbols from it. I usually just put it on
the ghc command line and that seems to work, but don't know what the
Cabal equivalent of this technique is.

> > I tried naming it in an ld-options: line, but it didn't show up in the
> > arguments to 'ld'. Is this the correct behaviour?
> 
> For a bug report like this it's much more helpful if you give more
> detail on exactly what you did, exactly what happened and what you were
> expecting. In this case for example you could include the output of
> runghc Setup.hs build -v so you and we could see exactly how cabal is
> calling ghc/ld/whatever.
> 
> The ld-options are passed to ghc when it links an executable and they
> also get included in library package registration information.

OK, I've attached my cabal file and a transcript of the verbose
output.

$ grep string vectro.cabal
ld-options: this string never appears anywhere as far as i can tell
$ grep string cabal.out   
[1]$

Thanks,

Frederik

-- 
http://ofb.net/~frederik/
-------------- next part --------------
Setup.hs: Warning: No license-file field.
Configuring vectro-0.2...
configure: searching for ghc in path.
configure: found ghc at /home/frederik/arch/i386/bin/ghc
"/home/frederik/arch/i386/bin/ghc" --numeric-version >tmp22858
configure: looking for package tool: ghc-pkg near compiler in /home/frederik/arch/i386/bin
configure: found package tool in /home/frederik/arch/i386/bin/ghc-pkg
configure: Reading installed packages...
"/home/frederik/arch/i386/bin/ghc-pkg" --user list >tmp22858
configure: Dependency base-any: using base-2.0
configure: Dependency mtl-any: using mtl-1.0
configure: Dependency haskell98-any: using haskell98-1.0
configure: Dependency X11-any: using X11-1.2
configure: Dependency template-haskell-any: using template-haskell-2.0
configure: Dependency futility-base-any: using futility-base-0.1.9
configure: Dependency futility-unix-any: using futility-unix-0.1.9
configure: Using install prefix: /home/frederik
configure: Binaries installed in: /home/frederik/bin
configure: Libraries installed in: /home/frederik/lib/vectro-0.2/ghc-6.6.20070420
configure: Private binaries installed in: /home/frederik/libexec
configure: Data files installed in: /home/frederik/share/vectro-0.2
configure: Using compiler: /home/frederik/arch/i386/bin/ghc
configure: Compiler flavor: GHC
configure: Compiler version: 6.6.20070420
configure: Using package tool: /home/frederik/arch/i386/bin/ghc-pkg
configure: Using ar found on system at: /usr/bin/ar
configure: Using haddock found on system at: /home/frederik/arch/i386/bin/haddock
configure: No pfesetup found
configure: Using ranlib found on system at: /usr/bin/ranlib
configure: Using runghc found on system at: /home/frederik/arch/i386/bin/runghc
configure: Using runhugs found on system at: /usr/bin/runhugs
configure: Using happy: /home/frederik/arch/i386/bin/happy
configure: Using alex: /home/frederik/arch/i386/bin/alex
configure: Using hsc2hs: /home/frederik/arch/i386/bin/hsc2hs
configure: No c2hs found
configure: No cpphs found
configure: No greencard found
Preprocessing library vectro-0.2...
Building vectro-0.2...
/home/frederik/arch/i386/bin/ghc -package-name vectro-0.2 --make -hide-all-packages -i -idist/build/autogen -i. -odir dist/build -hidir dist/build -package base-2.0 -package mtl-1.0 -package haskell98-1.0 -package X11-1.2 -package template-haskell-2.0 -package futility-base-0.1.9 -package futility-unix-0.1.9 Vector.Misc.FloatMisc Vector.Misc.Util Vector Vector.Base Vector.Template Vector.General Vector.Array Vector.Fast Vector.FileIO Vector.Sparse Vector.Sparse.ArrowUtil Vector.Sparse.ForeignImports Vector.Sparse.ForeignUtil Vector.Sparse.Ops Vector.Sparse.Raw Vector.Sparse.RawTypes Vector.Sparse.Stream Vector.Sparse.Wrappers GSL GSL.Base GSL.Utils GSL.Core GSL.Derived GSL.Wrappers GSL.Interface GSL.Instances
[ 1 of 26] Compiling GSL.Core         ( GSL/Core.hs, dist/build/GSL/Core.o )
[ 2 of 26] Compiling GSL.Wrappers     ( GSL/Wrappers.hs, dist/build/GSL/Wrappers.o )
[ 3 of 26] Compiling GSL.Derived      ( GSL/Derived.hs, dist/build/GSL/Derived.o )
[ 4 of 26] Compiling GSL.Interface    ( GSL/Interface.hs, dist/build/GSL/Interface.o )
[ 5 of 26] Compiling GSL.Instances    ( GSL/Instances.hs, dist/build/GSL/Instances.o )
[ 6 of 26] Compiling GSL.Utils        ( GSL/Utils.hs, dist/build/GSL/Utils.o )
[ 7 of 26] Compiling GSL.Base         ( GSL/Base.hs, dist/build/GSL/Base.o )
[ 8 of 26] Compiling GSL              ( GSL.hs, dist/build/GSL.o )
[ 9 of 26] Compiling Vector.Sparse.Ops ( Vector/Sparse/Ops.hs, dist/build/Vector/Sparse/Ops.o )
[10 of 26] Compiling Vector.Sparse.ForeignUtil ( Vector/Sparse/ForeignUtil.hs, dist/build/Vector/Sparse/ForeignUtil.o )
[11 of 26] Compiling Vector.Sparse.RawTypes ( Vector/Sparse/RawTypes.hs, dist/build/Vector/Sparse/RawTypes.o )
[12 of 26] Compiling Vector.Sparse.ForeignImports ( Vector/Sparse/ForeignImports.hs, dist/build/Vector/Sparse/ForeignImports.o )
[13 of 26] Compiling Vector.FileIO    ( Vector/FileIO.hs, dist/build/Vector/FileIO.o )
[14 of 26] Compiling Vector.Sparse.Wrappers ( Vector/Sparse/Wrappers.hs, dist/build/Vector/Sparse/Wrappers.o )
[15 of 26] Compiling Vector.Sparse.Stream ( Vector/Sparse/Stream.hs, dist/build/Vector/Sparse/Stream.o )
[16 of 26] Compiling Vector.Sparse.ArrowUtil ( Vector/Sparse/ArrowUtil.hs, dist/build/Vector/Sparse/ArrowUtil.o )
[17 of 26] Compiling Vector.Sparse.Raw ( Vector/Sparse/Raw.hs, dist/build/Vector/Sparse/Raw.o )
[18 of 26] Compiling Vector.Base      ( Vector/Base.hs, dist/build/Vector/Base.o )
[19 of 26] Compiling Vector.Sparse    ( Vector/Sparse.hs, dist/build/Vector/Sparse.o )

Vector/Sparse.hs:38:0:
    Warning: No explicit method nor default method for `toArray'
	     In the instance declaration for `Vector (Sparse i e_ e) e'

Vector/Sparse.hs:38:0:
    Warning: No explicit method nor default method for `slice'
	     In the instance declaration for `Vector (Sparse i e_ e) e'

Vector/Sparse.hs:38:0:
    Warning: No explicit method nor default method for `unsafeReshape'
	     In the instance declaration for `Vector (Sparse i e_ e) e'

Vector/Sparse.hs:38:0:
    Warning: No explicit method nor default method for `vconst'
	     In the instance declaration for `Vector (Sparse i e_ e) e'

Vector/Sparse.hs:38:0:
    Warning: No explicit method nor default method for `vappend'
	     In the instance declaration for `Vector (Sparse i e_ e) e'

Vector/Sparse.hs:38:0:
    Warning: No explicit method nor default method for `assocs'
	     In the instance declaration for `Vector (Sparse i e_ e) e'
[20 of 26] Compiling Vector.Misc.Util ( Vector/Misc/Util.hs, dist/build/Vector/Misc/Util.o )
[21 of 26] Compiling Vector.Misc.FloatMisc ( Vector/Misc/FloatMisc.hs, dist/build/Vector/Misc/FloatMisc.o )
[22 of 26] Compiling Vector.Array     ( Vector/Array.hs, dist/build/Vector/Array.o )

Vector/Array.hs:28:0:
    Warning: No explicit method nor default method for `vectorUpdate'
	     In the instance declaration for `Vector (AVector e) e'

Vector/Array.hs:28:0:
    Warning: No explicit method nor default method for `!&'
	     In the instance declaration for `Vector (AVector e) e'

Vector/Array.hs:28:0:
    Warning: No explicit method nor default method for `fromAssocs'
	     In the instance declaration for `Vector (AVector e) e'

Vector/Array.hs:28:0:
    Warning: No explicit method nor default method for `fromSortedAssocs'
	     In the instance declaration for `Vector (AVector e) e'

Vector/Array.hs:110:0:
    Warning: No explicit method nor default method for `eigS'
	     In the instance declaration for `FracVector (AVector e) e'

Vector/Array.hs:124:0:
    Warning: No explicit method nor default method for `fromRational'
	     In the instance declaration for `Fractional (AVector e a)'

Vector/Array.hs:128:0:
    Warning: No explicit method nor default method for `logdet''
	     In the instance declaration for `FloatVector (AVector e) e'

Vector/Array.hs:128:0:
    Warning: No explicit method nor default method for `rand'
	     In the instance declaration for `FloatVector (AVector e) e'

Vector/Array.hs:132:0:
    Warning: No explicit method nor default method for `pi'
	     In the instance declaration for `Floating (AVector e a)'

Vector/Array.hs:132:0:
    Warning: No explicit method nor default method for `exp'
	     In the instance declaration for `Floating (AVector e a)'

Vector/Array.hs:132:0:
    Warning: No explicit method nor default method for `log'
	     In the instance declaration for `Floating (AVector e a)'

Vector/Array.hs:132:0:
    Warning: No explicit method nor default method for `sin'
	     In the instance declaration for `Floating (AVector e a)'

Vector/Array.hs:132:0:
    Warning: No explicit method nor default method for `cos'
	     In the instance declaration for `Floating (AVector e a)'

Vector/Array.hs:132:0:
    Warning: No explicit method nor default method for `asin'
	     In the instance declaration for `Floating (AVector e a)'

Vector/Array.hs:132:0:
    Warning: No explicit method nor default method for `atan'
	     In the instance declaration for `Floating (AVector e a)'

Vector/Array.hs:132:0:
    Warning: No explicit method nor default method for `acos'
	     In the instance declaration for `Floating (AVector e a)'

Vector/Array.hs:132:0:
    Warning: No explicit method nor default method for `sinh'
	     In the instance declaration for `Floating (AVector e a)'

Vector/Array.hs:132:0:
    Warning: No explicit method nor default method for `cosh'
	     In the instance declaration for `Floating (AVector e a)'

Vector/Array.hs:132:0:
    Warning: No explicit method nor default method for `asinh'
	     In the instance declaration for `Floating (AVector e a)'

Vector/Array.hs:132:0:
    Warning: No explicit method nor default method for `atanh'
	     In the instance declaration for `Floating (AVector e a)'

Vector/Array.hs:132:0:
    Warning: No explicit method nor default method for `acosh'
	     In the instance declaration for `Floating (AVector e a)'

Vector/Array.hs:135:0:
    Warning: No explicit method nor default method for `xlogyx'
	     In the instance declaration for `FloatMisc (AVector e a)'

Vector/Array.hs:135:0:
    Warning: No explicit method nor default method for `xlog1x'
	     In the instance declaration for `FloatMisc (AVector e a)'

Vector/Array.hs:135:0:
    Warning: No explicit method nor default method for `sigm'
	     In the instance declaration for `FloatMisc (AVector e a)'

Vector/Array.hs:135:0:
    Warning: No explicit method nor default method for `logit'
	     In the instance declaration for `FloatMisc (AVector e a)'

Vector/Array.hs:135:0:
    Warning: No explicit method nor default method for `atan2_'
	     In the instance declaration for `FloatMisc (AVector e a)'

Vector/Array.hs:135:0:
    Warning: No explicit method nor default method for `intPart'
	     In the instance declaration for `FloatMisc (AVector e a)'
[23 of 26] Compiling Vector.Fast      ( Vector/Fast.hs, dist/build/Vector/Fast.o )

Vector/Fast.hs:72:0:
    Warning: No explicit method nor default method for `!&'
	     In the instance declaration for `Vector FVector R'

Vector/Fast.hs:72:0:
    Warning: No explicit method nor default method for `fromAssocs'
	     In the instance declaration for `Vector FVector R'

Vector/Fast.hs:72:0:
    Warning: No explicit method nor default method for `fromSortedAssocs'
	     In the instance declaration for `Vector FVector R'
[24 of 26] Compiling Vector.General   ( Vector/General.hs, dist/build/Vector/General.o )

Vector/General.hs:43:0:
    Warning: No explicit method nor default method for `!&'
	     In the instance declaration for `Vector (GVector e) e'

Vector/General.hs:43:0:
    Warning: No explicit method nor default method for `fromAssocs'
	     In the instance declaration for `Vector (GVector e) e'

Vector/General.hs:43:0:
    Warning: No explicit method nor default method for `fromSortedAssocs'
	     In the instance declaration for `Vector (GVector e) e'
[25 of 26] Compiling Vector.Template  ( Vector/Template.hs, dist/build/Vector/Template.o )
[26 of 26] Compiling Vector           ( Vector.hs, dist/build/Vector.o )
/home/frederik/arch/i386/bin/ghc -odir dist/build -hidir dist/build -c Vector/Sparse/sparse_lib.cpp
/home/frederik/arch/i386/bin/ghc -odir dist/build -hidir dist/build -c GSL/gslaux.c
GSL/gslaux.c: In function 'detR':

GSL/gslaux.c:570:0:  warning: division by zero
/usr/bin/ar q dist/build/libHSvectro-0.2.a dist/build/Vector/Misc/FloatMisc.o dist/build/Vector/Misc/Util.o dist/build/Vector.o dist/build/Vector/Base.o dist/build/Vector/Template.o dist/build/Vector/General.o dist/build/Vector/Array.o dist/build/Vector/Fast.o dist/build/Vector/FileIO.o dist/build/Vector/Sparse.o dist/build/Vector/Sparse/ArrowUtil.o dist/build/Vector/Sparse/ForeignImports.o dist/build/Vector/Sparse/ForeignUtil.o dist/build/Vector/Sparse/Ops.o dist/build/Vector/Sparse/Raw.o dist/build/Vector/Sparse/RawTypes.o dist/build/Vector/Sparse/Stream.o dist/build/Vector/Sparse/Wrappers.o dist/build/GSL.o dist/build/GSL/Base.o dist/build/GSL/Utils.o dist/build/GSL/Core.o dist/build/GSL/Derived.o dist/build/GSL/Wrappers.o dist/build/GSL/Interface.o dist/build/GSL/Instances.o dist/build/Vector/Sparse/sparse_lib.o dist/build/GSL/gslaux.o dist/build/GSL/Wrappers_stub.o
/usr/bin/ar: creating dist/build/libHSvectro-0.2.a
/usr/bin/ld -r -x -o dist/build/HSvectro-0.2.o.tmp dist/build/Vector/Misc/FloatMisc.o dist/build/Vector/Misc/Util.o dist/build/Vector.o dist/build/Vector/Base.o dist/build/Vector/Template.o dist/build/Vector/General.o dist/build/Vector/Array.o dist/build/Vector/Fast.o dist/build/Vector/FileIO.o dist/build/Vector/Sparse.o dist/build/Vector/Sparse/ArrowUtil.o dist/build/Vector/Sparse/ForeignImports.o dist/build/Vector/Sparse/ForeignUtil.o dist/build/Vector/Sparse/Ops.o dist/build/Vector/Sparse/Raw.o dist/build/Vector/Sparse/RawTypes.o dist/build/Vector/Sparse/Stream.o dist/build/Vector/Sparse/Wrappers.o dist/build/GSL.o dist/build/GSL/Base.o dist/build/GSL/Utils.o dist/build/GSL/Core.o dist/build/GSL/Derived.o dist/build/GSL/Wrappers.o dist/build/GSL/Interface.o dist/build/GSL/Instances.o dist/build/Vector/Sparse/sparse_lib.o dist/build/GSL/gslaux.o dist/build/GSL/Wrappers_stub.o
-------------- next part --------------
Name:               vectro
Version:            0.2
License:            GPL
Author:             Frederik Eaton
Maintainer:         frederik at ofb.net
Stability:          provisional
Homepage:           http://ofb.net/~frederik/stla/
Package-url:        
Synopsis:           Strongly typed linear algebra library
Description:
Category:           Numerical
tested-with:        GHC ==6.4.1
Build-Depends:      base, mtl, haskell98, X11, template-haskell, futility-base, futility-unix
Exposed-modules:    Vector.Misc.FloatMisc, Vector.Misc.Util,
                    Vector, Vector.Base, Vector.Template, 
                    Vector.General, Vector.Array, Vector.Fast,
                    --Vector.Random,
                    Vector.FileIO,
                    Vector.Sparse,
                    Vector.Sparse.ArrowUtil,
                    Vector.Sparse.ForeignImports,
                    Vector.Sparse.ForeignUtil,
                    Vector.Sparse.Ops,
                    Vector.Sparse.Raw,
                    Vector.Sparse.RawTypes,
                    Vector.Sparse.Stream,
                    Vector.Sparse.Wrappers,
                    GSL, GSL.Base, GSL.Utils,
                    GSL.Core, GSL.Derived, GSL.Wrappers,
                    GSL.Interface, GSL.Instances 
C-sources:          Vector/Sparse/sparse_lib.cpp GSL/gslaux.c
extra-libraries:    gsl cblas atlas lapack stdc++ m c
ld-options: this string never appears anywhere as far as i can tell


More information about the Libraries mailing list