
I'm having trouble getting started with building yhc on MacOS. The configure step does not get very far: $ ./configure --prefix=/sw checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for __gmpz_init in -lgmp... no configure: error: cannot find libgmp However, I do have libgmp installed, in /sw/lib, and my LD_LIBRARY_PATH variable points to that directory. Any ideas? Regards, Malcolm

Malcolm Wallace wrote:
checking for __gmpz_init in -lgmp... no configure: error: cannot find libgmp
However, I do have libgmp installed, in /sw/lib, and my LD_LIBRARY_PATH variable points to that directory. Any ideas?
Malcolm, I had the same problem with the darwinports version of libgmp. IIRC, I solved it by installing a hand-compiled version of libgmp into /usr/local. At least, I think that's what fixed it - I was messing around with various different things, and then it suddenly compiled. Mike.

Hi,
the autoconf script uses
AC_CHECK_LIB(gmp, __gmpz_init)
which is the recommended way to check for GMP of versions >= 3 according
to http://swox.com/gmp/manual/Autoconf.html
Which version of libgmp do you have? and if you write a trivial program
like:
#include
I'm having trouble getting started with building yhc on MacOS. The configure step does not get very far:
$ ./configure --prefix=/sw checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for __gmpz_init in -lgmp... no configure: error: cannot find libgmp
However, I do have libgmp installed, in /sw/lib, and my LD_LIBRARY_PATH variable points to that directory. Any ideas?
Regards, Malcolm _______________________________________________ Yhc mailing list Yhc@haskell.org http://haskell.org/mailman/listinfo/yhc

Which version of libgmp do you have?
libgmp.3.3.3.dylib
#include
int main(){ mpz_t m; mpz_init(m); return 0; } does it compile with gcc -o delete-me
-lgmp
No. It seems that I need to add -I/sw/bin and -L/sw/lib for gcc to find the header file and link library (respectively). I did think that gcc would respect the LD_LIBRARY_PATH convention for finding the library archive, but it doesn't seem to do so on this machine. However, I'm not aware of any standard environment mechanism to extend the #include search path. Are there options I can give to autoconf to pass a set of gcc flags into all invocations? Regards, Malcolm

Malcolm Wallace wrote:
No. It seems that I need to add -I/sw/bin and -L/sw/lib for gcc to find the header file and link library (respectively). I did think that gcc would respect the LD_LIBRARY_PATH convention for finding the library archive, but it doesn't seem to do so on this machine. However, I'm not aware of any standard environment mechanism to extend the #include search path. Are there options I can give to autoconf to pass a set of gcc flags into all invocations?
LIBRARY_PATH and C_INCLUDE_PATH :-) Cheers Tom

... Also of note is that LD_LIBRARY_PATH is the path where the OS looks when dynamically loading libraries at runtime (on dlopen to be precise). I suspect what you need to set is LIBRARY_PATH, since that's the variable gcc uses to decide where to look for libraries: http://gcc.gnu.org/onlinedocs/gcc/Environment-Variables.html cheers Tom Malcolm Wallace wrote:
I'm having trouble getting started with building yhc on MacOS. The configure step does not get very far:
$ ./configure --prefix=/sw checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for __gmpz_init in -lgmp... no configure: error: cannot find libgmp
However, I do have libgmp installed, in /sw/lib, and my LD_LIBRARY_PATH variable points to that directory. Any ideas?
Regards, Malcolm _______________________________________________ Yhc mailing list Yhc@haskell.org http://haskell.org/mailman/listinfo/yhc

OK, next problem. Configure works fine, and 'make' builds the compiler proper. But building the prelude fails with: make -C src/prelude ../../inst/bin/yhc -d ../../inst/prelude System.hs Warning: the environment variable YHC_BASE_PATH is not set Fail: user error (Can't open any of: NHC/FFI.hi /include/NHC/FFI.hi when trying to read NHC.FFI. ) Regards, Malcolm

This is (almost certainly) simply because the stable repository is out of date :-) I'm guessing that that's what you're using. I've pulled the changes from the development one. Tom Malcolm Wallace wrote:
OK, next problem. Configure works fine, and 'make' builds the compiler proper. But building the prelude fails with:
make -C src/prelude ../../inst/bin/yhc -d ../../inst/prelude System.hs Warning: the environment variable YHC_BASE_PATH is not set Fail: user error (Can't open any of: NHC/FFI.hi /include/NHC/FFI.hi when trying to read NHC.FFI. )
Regards, Malcolm _______________________________________________ Yhc mailing list Yhc@haskell.org http://haskell.org/mailman/listinfo/yhc

Thomas Shackell
This is (almost certainly) simply because the stable repository is out of date :-) I'm guessing that that's what you're using. I've pulled the changes from the development one.
A fresh 'darcs pull' found 169 new patches. :-) The build now appears to make the runtime system first. (I'm assuming that I can ignore warnings about the dependency files *.d not existing yet, because it then seems to create them immediately afterwards.) But now it falls over when attempting to build the compiler proper: make -C src/compiler98 ghc -cpp --make Main -o ../../inst/bin/yhc Chasing modules from: Main ./Make.lhs: Can't find module Data.Map Indeed, my installation of ghc-6.2.2 does not have a module Data.Map in the base package. Should autoconf have insisted on a version of ghc>=6.4? Is there anyway I can tell the config process to use an explicit ghc-6.4, rather than plain ghc? (I need to keep plain ghc as 6.2.2 for other projects.) Regards, Malcolm
participants (3)
-
Malcolm Wallace
-
Mike Dodds
-
Thomas Shackell