Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use $CONFIGURE_ARGS or configure_ghc #12

Open
JakobBruenker opened this issue Dec 31, 2020 · 3 comments
Open

Use $CONFIGURE_ARGS or configure_ghc #12

JakobBruenker opened this issue Dec 31, 2020 · 3 comments

Comments

@JakobBruenker
Copy link

ghc.nix recommends using ./configure $CONFIGURE_ARGS, and also provides a convenience command configure_ghc which does the same.

It seems like would make sense to recommend one of these here instead of a naked ./configure, which is the case at the moment.

@steshaw
Copy link

steshaw commented Aug 10, 2021

I was curious about that too. I wasn't sure if ghc.dev was out of date compared with the ghc.nix, or if ghc.dev does not recommend using those configure options. FWIW, I just followed the method from Building the Compiler and everything seemed to go okay 👍.

On my machine, the message from nix-shell ../ghc.nix is:

Recommended ./configure arguments (found in $CONFIGURE_ARGS:
or use the configure_ghc command):

  --with-gmp-includes=/nix/store/b8z6nbydvkdflfkk6924zdn9hzxiy45r-gmp-6.2.0-dev/include
  --with-gmp-libraries=/nix/store/1lj2b24v408awrfxw6xxv9spm9023lva-gmp-6.2.0/lib
  --with-curses-libraries=/nix/store/2dfap74q83z6q1kc9ha6ldl4nmqhmc9w-ncurses-6.2/lib
  --with-libnuma-includes=/nix/store/5yi02q15si6cg7w08hs85mvb3fr5pj4x-numactl-2.0.13/include
  --with-libnuma-libraries=/nix/store/5yi02q15si6cg7w08hs85mvb3fr5pj4x-numactl-2.0.13/lib
  --with-libdw-includes=/nix/store/v9cfb4dhh1cy6njixy0b7vxgk56k07bk-elfutils-0.180/include
  --with-libdw-libraries=/nix/store/v9cfb4dhh1cy6njixy0b7vxgk56k07bk-elfutils-0.180/lib
  --enable-dwarf-unwind

The configure_ghc is defined as:

$ typeset -f configure_ghc
configure_ghc () 
{ 
    ./configure $CONFIGURE_ARGS $@
}

A couple of questions:

  • Where do I look to find the configuration that ./configure automatically deciphered.
  • How can I clean build my GHC using configure_ghc as recommended by ghc.nix

@JakobBruenker
Copy link
Author

I just followed the method from Building the Compiler and everything seemed to go okay +1.

Everything works fine as long as you're in the nix-shell. If you try to use the compiled ghc binaries outside of it, they will complain about missing shared libraries (whereas they don't with configure_ghc), though they will still partially work.

@JakobBruenker
Copy link
Author

$CONFIGURE_ARGS is probably better than configure_ghc, since non-nix users should be able to use the former without issues.

One caveat though is that in zsh, one would have to write ${=CONFIGURE_ARGS} instead of $CONFIGURE_ARGS

So, neither option is a silver bullet, unfortunately.

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

No branches or pull requests

2 participants