building against gmp in a nonstandard location
Paul Jarc
prj at po.cwru.edu
Thu Mar 20 13:29:26 EDT 2008
Ian Lynagh <igloo at earth.li> wrote:
> On Sun, Mar 16, 2008 at 12:05:03AM -0400, Paul Jarc wrote:
>> make[1]: *** No rule to make target `stage1//package/host/code.dogmap.org/foreign/ghc-6.8.2+spf+0/conf/gmp/include/gmp.h', needed by `stage1/parser/cutils.o'. Stop.
>
> Where is gmp.h actually installed?
/package/host/code.dogmap.org/foreign/ghc-6.8.2+spf+0/conf/gmp/include/gmp.h
> Do you know where this dependency is coming from? Is it
> compiler/.depend-1?
Yes, and .depend-BASE before that. The only difference in .depend-1
is that "stage1/" is prepended. compiler/parser/cutils.c includes
includes/Rts.h, which includes gmp.h. So mkdependC puts that
information in .depend-BASE. I'm sure it doesn't belong there, since
gmp.h isn't part of the GHC source tree, and I guess if it works for
other people, then it must not be there for them (can anyone confirm
that?), but I don't see how it gets filtered out for them.
>> Second attempt: CPPFLAGS, LDFLAGS and mk/build.mk as above, and I also
>> gave --with-gmp-{includes,libraries} to ./configure. This ends with
>> the same error.
>
> What happens if you only use the flags?
Do you mean CPPFLAGS and LDFLAGS, without putting anything in
mk/build.mk or specifying --with-gmp-*? That fails here:
Creating ghcplatform.h...
Done.
../utils/mkdependC/mkdependC -f .depend -- -O -DTABLES_NEXT_TO_CODE -I. -I../rts -- mkDerivedConstants.c
gcc -O -DTABLES_NEXT_TO_CODE -I. -I../rts -c mkDerivedConstants.c -o mkDerivedConstants.o
In file included from Stg.h:150,
from Rts.h:19,
from mkDerivedConstants.c:23:
Regs.h:28:17: error: gmp.h: No such file or directory
In file included from Stg.h:150,
from Rts.h:19,
from mkDerivedConstants.c:23:
Regs.h:121: error: expected specifier-qualifier-list before 'MP_INT'
In file included from mkDerivedConstants.c:23:
Rts.h:203: error: expected ')' before '*' token
Rts.h:204: error: expected ')' before '*' token
mkDerivedConstants.c: In function 'main':
mkDerivedConstants.c:218: error: 'StgRegTable' has no member named 'rRet'
mkDerivedConstants.c:218: error: 'StgRegTable' has no member named 'rRet'
mkDerivedConstants.c:222: error: 'StgRegTable' has no member named 'rmp_tmp1'
mkDerivedConstants.c:223: error: 'StgRegTable' has no member named 'rmp_tmp2'
mkDerivedConstants.c:224: error: 'StgRegTable' has no member named 'rmp_result1'
mkDerivedConstants.c:225: error: 'StgRegTable' has no member named 'rmp_result2'
mkDerivedConstants.c:417: error: 'MP_INT' undeclared (first use in this function)
mkDerivedConstants.c:417: error: (Each undeclared identifier is reported only once
mkDerivedConstants.c:417: error: for each function it appears in.)
mkDerivedConstants.c:418: error: expected expression before ')' token
mkDerivedConstants.c:418: error: expected expression before ')' token
mkDerivedConstants.c:419: error: expected expression before ')' token
mkDerivedConstants.c:419: error: expected expression before ')' token
mkDerivedConstants.c:420: error: expected expression before ')' token
mkDerivedConstants.c:420: error: expected expression before ')' token
mkDerivedConstants.c:422: error: 'mp_limb_t' undeclared (first use in this function)
make[1]: *** [mkDerivedConstants.o] Error 1
make: *** [stage1] Error 1
> This is compiling a C file, so it uses SRC_CC_OPTS instead.
Actually, it would be GHC_CC_OPTS, since it's ghc compiling a C file,
right? I tried adding the -optc-I flags, etc., to GHC_CC_OPTS in
mk/build.mk, and it gets farther now, but still fails:
Configuring hpc-0.5.0.0...
rm -f hpc/GNUmakefile
cp Makefile.local hpc
if ifBuildable/ifBuildable hpc; then \
cd hpc && setup/Setup makefile -f GNUmakefile; \
fi
In file included from /fs/pkgs/mount/package/host/code.dogmap.org/foreign/ghc-6.8.2+spf+3/compile/src/ghc-6.8.2/includes/Stg.h:150,
from /fs/pkgs/mount/package/host/code.dogmap.org/foreign/ghc-6.8.2+spf+3/compile/src/ghc-6.8.2/includes/Rts.h:19,
from Reflect.hsc:18:
/fs/pkgs/mount/package/host/code.dogmap.org/foreign/ghc-6.8.2+spf+3/compile/src/ghc-6.8.2/includes/Regs.h:28:17: error: gmp.h: No such file or directory
This seems to be coming from an invocation of hsc2hs for dependency
generation. I don't know how to add extra options to that invocation,
since it isn't directly in any of the Makefiles. But if it works for
everyone else, I shouldn't need to, either...
paul
More information about the Glasgow-haskell-users
mailing list