简体   繁体   中英

Possible to ensure that profiling libraries are installed when installing GHC 7.8?

I'm going to install GHC on a fresh copy of Ubuntu and I'm wondering: How can I ensure that profiling libraries are installed for the core libraries (eg, text , unordered-containers )?

I'm aware of the changing the profiling option in cabal's .config file but my understanding is that this only ensures that profiling libraries are installed for those packages that I install AFTER setting up cabal (see italicized text in update below).

(I inadvertently blew up my Ubuntu vbox last night as a result of trying to retroactively install profiling libraries for installed GHC packages. It led to the existing packages not working, which led to me trying to uninstall GHC, which led to...KABOOM!)

UPDATE: I've installed GHC and am now at the point where I'm about to install cabal . I've confirmed my suspicion that I'm facing a "chicken-and-an-egg" dilemma: In order to get the initial cabal config file (in which I can set profiling option as True), I need to install cabal. However, installing cabal results in the installation of core packages (eg, text, unordered-containers) BEFORE I get a chance to make the change in the cabal config file.

SOLVED: As per Daniel Wagner's suggestion (thanks!), I made a couple of modifications to the bootstrap.sh script file (I unfortunately didn't have my old cabal or I would've followed his other suggestion). As reference for future readers, the beginning of my bootstrap.sh file looked like this (after the changes):

#VERBOSE
DEFAULT_CONFIGURE_OPTS="--enable-library-profiling --enable-shared"
EXTRA_CONFIGURE_OPTS=${EXTRA_CONFIGURE_OPTS-$DEFAULT_CONFIGURE_OPTS}
#EXTRA_CONFIGURE_OPTS
#EXTRA_BUILD_OPTS
#EXTRA_INSTALL_OPTS

The preferred solution is to install cabal-install via your package manager. If you have an old version of cabal-install in your package manager, you can then use the old version to install the new version with a config in place, or even specify profiling directly on the command line via cabal install cabal-install --enable-library-profiling .

An alternate solution if you plan to install cabal-install via its bootstrap.sh script is to use the environment variables it provides for configuration. There are four, notated at the top of bootstrap.sh ; the relevant one is EXTRA_CONFIGURE_OPTS , which contents get passed to the configure step of each package's Setup command. So something like this ought to do the trick (though I haven't tested it):

EXTRA_CONFIGURE_OPTS=--enable-library-profiling ./bootstrap.sh

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM