making with profiling, 6.4.1, cabal-1.1.3

Serge D. Mechveliani mechvel at botik.ru
Mon Oct 3 09:02:50 EDT 2005


People, 

I need help on making for profiling,
and cannot decide whether the question is on GHC or on Cabal.

I have  ghc-6.4.1,  and  Cabal-1.1.3-September-12  
installed in my user directory, under Debian Linux,
and need to make a project for profiling.

        ghci -package Cabal 
says
 ...
 Loading package base-1.0 ... linking ... done.
 ...
 Loading package Cabal-1.1.3 ... linking ... done.


I start with a contrived example project of  M1.hs, M2.hs, Main.hs:

---------------------------------------
module M1 where  m1 = True
 
module M2 where  import M1;  m2 = m1 && m1

Main.hs:  import M2l;        main = putStr $ shows m2 "\n"
---------------------------------------

For this,          ghc --make -prof -auto-all Main

works as needed -- without packages.
Now, try to make a package for profiling:

foo.cabal:
  name:            foo
  version:         1.0
  build-depends:   base, haskell98, data
  exposed-modules: M2
  other-modules:   M1
  ghc-options:     -prof -auto-all -hisuf p_hi -osuf p_o

The aim is to build  foo  (of M2)  as a library, then to make Main 
under the package  foo,  and with profiling.

Then,  runhaskell Setup configure --ghc --prefix=$source/inst
       runhaskell Setup build

produces a report 

-------------------------------------------------------------------
...
configure: Using compiler: /home/mechvel/ghc/6.4.1/inst/bin/ghc
configure: Compiler flavor: GHC
configure: Compiler version: 6.4.1
configure: Using package tool: /home/mechvel/ghc/6.4.1/inst/bin/ghc-pkg
configure: No haddock found
configure: Using happy: /usr/bin/happy
configure: Using alex: /usr/bin/alex
configure: Using hsc2hs: /home/mechvel/ghc/6.4.1/inst/bin/hsc2hs
configure: No c2hs found
configure: No cpphs found
configure: No greencard found
configure: Dependency base-any: using base-1.0
configure: Dependency haskell98-any: using haskell98-1.0
configure: Dependency data-any: using data-1.0

scico:~/t> make build

runhaskell Setup.hs build
Preprocessing library foo-1.0...
Building foo-1.0...
Chasing modules from: M2,M1
Skipping  M1               ( M1.hs, dist/build/M1.p_o )
Skipping  M2               ( M2.hs, dist/build/M2.p_o )
/usr/bin/ar: creating dist/build/libHSfoo-1.0.a
/usr/bin/ar: dist/build/M2.o: No such file or directory
make: *** [build] Error 1
-------------------------------------------------------------------

The directory   ~/t/dist/build   contains at this moment

  M1.p_hi  M1.p_o  M2.p_hi  M2.p_o  Main.p_hi  Main.p_o

, and indeed, no  M2.o  file.

If I remove  -hisuf p_hi -osuf p_o

(by the way, why should the user think of these wise suffixes,
maybe,  -prof  should be sufficient?
), 
then it reports  ... 
                 /usr/bin/ld: cannot find -lHSfoo-1.0_p
                 collect2: ld returned 1 exit status

What I am missing, please?
Thank you in advance for the help.

-----------------
Serge Mechveliani
mechvel at botik.ru


More information about the Libraries mailing list