Brent Fulgham | 1 Jul 2006 04:59

Re: Problem building on Mac OS X


On Jun 30, 2006, at 6:33 AM, Andrew Wilkinson wrote:

On 6/30/06, Brent Fulgham <bfulgham <at> mac.com> wrote:
Attempting to build with gcc 4.0 on OS X fails with the following
errors.  Has anyone else successfully built on OS X?


Hi,

Yhc is currently in the process of moving towards using scons for the build process rather than make. Can you try building using scons? You might need to install scons first ( www.scons.org) then simply type 'scons'.

I suspect it will still fail as the errors look to be coming from the fact that you're missing libgmp, but it would be useful to check.

Erg!  That's even worse.

Must I have certain environment variables defined?  All I did was install the DarwinPorts package of 'scons' and ran it.

Thanks,

-Brent

scons: Reading SConscript files ...
AttributeError: 'module' object has no attribute 'ArAction':
  File "SConstruct", line 7:
    hsenv = Environment(tools = ["default", "haskell"], toolpath=["./build/tools/"], ENV = {'PATH' : os.environ['PATH']})
  File "/opt/local/lib/scons-0.96.91/SCons/Memoize.py", line 819:
    klassdict['__init__'] = lambda self, *args, **kw: newinit(self, args, kw)
  File ".../SCons/Memoizer-init-lambda</opt/local/lib/scons-0.96.91/SCons/Memoize.py>", line 1:
    None
  File "/opt/local/lib/scons-0.96.91/SCons/Memoize.py", line 778:
    apply(actual_init, (self,)+args, kw)
  File "/opt/local/lib/scons-0.96.91/SCons/Memoize.py", line 1:
    """Memoizer
  File "/opt/local/lib/scons-0.96.91/SCons/Memoize.py", line 781:
    apply(super(cls, self).__init__, args, kw)
  File "/opt/local/lib/scons-0.96.91/SCons/Memoize.py", line 819:
    klassdict['__init__'] = lambda self, *args, **kw: newinit(self, args, kw)
  File ".../SCons/Memoizer-init-lambda</opt/local/lib/scons-0.96.91/SCons/Environment.py>", line 471:
    None
  File "/opt/local/lib/scons-0.96.91/SCons/Memoize.py", line 778:
    apply(actual_init, (self,)+args, kw)
  File "/opt/local/lib/scons-0.96.91/SCons/Environment.py", line 517:
    apply_tools(self, tools, toolpath)
  File "/opt/local/lib/scons-0.96.91/SCons/Environment.py", line 133:
    env.Tool(tool)
  File "/opt/local/lib/scons-0.96.91/SCons/Environment.py", line 1091:
    tool(self)
  File "/opt/local/lib/scons-0.96.91/SCons/Tool/__init__.py", line 128:
    apply(self.generate, ( env, ) + args, kw)
  File "./build/tools/haskell.py", line 163:
    haskellLibrary = SCons.Builder.Builder(action = SCons.Defaults.ArAction,
Chaz:~/Projects/Yhc/yhc-devel brent$ 




_______________________________________________
Yhc mailing list
Yhc <at> haskell.org
http://www.haskell.org//mailman/listinfo/yhc
Brent Fulgham | 1 Jul 2006 05:02
Picon

Re: Problem building on Mac OS X


On Jun 30, 2006, at 6:41 AM, Malcolm Wallace wrote:

> Brent Fulgham <bfulgham <at> mac.com> wrote:
>
>> Attempting to build with gcc 4.0 on OS X fails with the following
>> errors.  Has anyone else successfully built on OS X?
>
> Not yet.  The problem you encountered seems to be the case- 
> insensitivity
> of the MacOS file system.  obj/FFI.o is overwriting obj/ffi.o.
>
> But my build does not even get that far.  I have a couple of different
> errors, earlier in the build, when first trying to compile the libffi
> component:
>
>     make -C libffi -f ConfigAndMake.makefile
>     ln -s libffi/config-ml.in ../config-ml.in  # HACK for broken  
> configure
>     sh ./configure
>     checking build system type... powerpc-apple-darwin8.6.0
>     [...output of configure...]
>     make
>     make "AR_FLAGS=" "CC_FOR_BUILD=" "CFLAGS=-g -O2" "CXXFLAGS="  
> "CFLAGS_FOR_BUILD=" "CFLAGS_FOR_TARGET=" "INSTALL=/usr/bin/install - 
> c" "INSTALL_DATA=/usr/bin/install -c -m 644" "INSTALL_PROGRAM=/usr/ 
> bin/install -c" "INSTALL_SCRIPT=/usr/bin/install -c" "JC1FLAGS="  
> "LDFLAGS=" "LIBCFLAGS=" "LIBCFLAGS_FOR_TARGET=" "MAKE=make"  
> "MAKEINFO=/bin/sh /Users/malcolm/Haskell/yhc-devel/src/runtime/ 
> libffi/missing --run makeinfo " "PICFLAG=" "PICFLAG_FOR_TARGET="  
> "RUNTESTFLAGS=" "SHELL=/bin/sh" "exec_prefix=/usr/local" "infodir=/ 
> usr/local/info" "libdir=/usr/local/lib" "prefix=/usr/local" "AR=ar"  
> "AS=as" "CC=gcc" "CXX=g++" "LD=ld" "NM=" "RANLIB=ranlib" "DESTDIR="  
> all-recursive
>     Making all in include
>     cat: ../../gcc/BASE-VER: No such file or directory
>     make[5]: Nothing to be done for `all'.
>     Making all in testsuite
>     make[5]: Nothing to be done for `all'.
>     make[5]: execvp: /Users/malcolm/Haskell/yhc-devel/src/runtime/ 
> libffi/install-sh: Permission denied

I ran into that, too.  The problems here are threefold:

1.  The install-sh and other libtool stuff does not have the execute  
permissions set.
2.  The "gcc/BASE-VER" does not get created for some reason.
3.  The libtool stuff may not be correct for Mac OS.

I did the following:

(a)  I chmod'd the various "install-sh" scripts.
(b)  I created a "src/runtime/gcc" directory, and created a file  
called "BASE-VER" containing the text '4'.
(c)  I updated the libtool scripts with the current stuff from the  
Mac OS developer tools, then when that didn't work I erased the  
directory and re-got everything from darcs.

Don't know if that will help, but it might get you a few steps  
farther...

Thanks,

-Brent
Brent Fulgham | 4 Jul 2006 07:10

Re: Problem building on Mac OS X


On Jul 2, 2006, at 10:20 PM, Goetz Isenmann wrote:

>>   File "./build/tools/haskell.py", line 163:
>>     haskellLibrary = SCons.Builder.Builder(action =
>> SCons.Defaults.ArAction,
>> Chaz:~/Projects/Yhc/yhc-devel brent$
>
> I had to change
>
> {
> hunk ./build/tools/haskell.py 163
> -    haskellLibrary = SCons.Builder.Builder(action =  
> SCons.Defaults.ArAction,
> +    haskellLibrary = SCons.Builder.Builder(action =  
> SCons.Action.Action("$ARCOM"),
> }
>
> to build with scons 0.96.92 (on freebsd).
> -- 
> Goetz Isenmann

Thank you -- this helped quite a bit.

I did get a bit further:

ghc -i./src/compiler98 -idepends/cpphs -c depends/cpphs/Text/ 
ParserCombinators/HuttonMeijer.hs -o depends/cpphs/Text/ 
ParserCombinators/HuttonMeijer.o
Getting dependencies for src/compiler98/Bind.hs.
An error ocurred running `ghc -M -optdep-f -optdepsrc/ 
compiler98/.Bind.hs.dep src/compiler98/Bind.hs`:
 >Could not find module `RenameLib':
 >  use -v to see a list of the files searched for
 >  (imported from src/compiler98/Bind.hs)
 >
Dependencies will not be calculated.
ghc -i./src/compiler98 -idepends/cpphs -c src/compiler98/Bind.hs -o  
src/compiler98/Bind.o

src/compiler98/Bind.hs:11:0:
     Failed to load interface for `State':
         Could not find module `State': use -v to see a list of the  
files searched for
scons: *** [src/compiler98/Bind.o] Error 1
scons: building terminated because of errors.
Chaz:~/Projects/Yhc/yhc-devel brent$

=======
Details:

Chaz:~/Projects/Yhc/yhc-devel brent$ ghc -v
Glasgow Haskell Compiler, Version 6.4.2, for Haskell 98, compiled by  
GHC version 6.4.2
Using package config file: /opt/local/lib/ghc-6.4.2/package.conf
Using package config file: /Users/brent/.ghc/powerpc-darwin-6.4.2/ 
package.conf
Hsc static flags: -static
*** Deleting temp files
Deleting:
ghc-6.4.2: no input files
Usage: For basic information, try the `--help' option.
Chaz:~/Projects/Yhc/yhc-devel brent$
Neil Mitchell | 5 Jul 2006 22:42
Picon
Gravatar

Error building on Windows

Hi,

I have problems when building yhc under Windows at home:

Getting dependencies for depends\filepath\System\FilePath.hs.
ghc -i./src/compiler98 -idepends/cpphs -idepends/filepath -c depends\filepath\Sy
stem\FilePath.hs -o depends\filepath\System\FilePath.obj
Getting dependencies for src\compiler98\Bind.obj.
Getting dependencies for src\compiler98\Bind.hs.
...
Getting dependencies for src\compiler98\Make.lhs.
Getting dependencies for src\compiler98\Derive\Eval.hs.
scons: *** [Errno 2] No such file or directory: 'src\\compiler98\\Bind.obj'
scons: building terminated because of errors.

It shouldn't be getting dependancies for a .obj, then it fails later on.

With a scons clean I still get this bug.

Thanks

Neil
Isaac | 6 Jul 2006 00:38
Favicon

What does Yhc need (error, ffi.h not found)

Trying scons on a freshly darcs'd yhc from today, I got an error, see:
http://paste.lisp.org/display/22129
or, to include the relevant parts of the output here:

gcc -I. -c -o src/runtime/BCKernel/external.o
src/runtime/BCKernel/external.c
In file included from src/runtime/BCKernel/types.h:5,
                 from src/runtime/BCKernel/hashtable.h:4,
                 from src/runtime/BCKernel/module.h:18,
                 from src/runtime/BCKernel/external.h:4,
                 from src/runtime/BCKernel/external.c:1:
src/runtime/BCKernel/platform.h:103:17: ffi.h: No such file or directory
scons: *** [src/runtime/BCKernel/external.o] Error 1
scons: building terminated because of errors.

On IRC, ndm suggested that "libffi" was needed; after "emerge libffi"
the error still happened -- so, me being on gentoo-linux ppc, ndm on
Windows, referred me to this list. I'm trying to find out what is
actually needed to successfully compile Yhc (now, for me, at least).
Andrew Wilkinson | 6 Jul 2006 15:19
Picon

Re: Error building on Windows

This has been fixed in darcs.

Thanks for the report.

Andrew
Thomas Shackell | 6 Jul 2006 15:44
Picon

Re: What does Yhc need (error, ffi.h not found)

Hi Isaac,

can you build any program using ffi.h? e.g.

--- test.c ------------

#include <ffi.h>

int main(){ return 0; }

-----------------------

gcc -c test.c

cheers

Tom

Isaac wrote:
> Trying scons on a freshly darcs'd yhc from today, I got an error, see:
> http://paste.lisp.org/display/22129
> or, to include the relevant parts of the output here:
> 
> gcc -I. -c -o src/runtime/BCKernel/external.o
> src/runtime/BCKernel/external.c
> In file included from src/runtime/BCKernel/types.h:5,
>                  from src/runtime/BCKernel/hashtable.h:4,
>                  from src/runtime/BCKernel/module.h:18,
>                  from src/runtime/BCKernel/external.h:4,
>                  from src/runtime/BCKernel/external.c:1:
> src/runtime/BCKernel/platform.h:103:17: ffi.h: No such file or directory
> scons: *** [src/runtime/BCKernel/external.o] Error 1
> scons: building terminated because of errors.
> 
> On IRC, ndm suggested that "libffi" was needed; after "emerge libffi"
> the error still happened -- so, me being on gentoo-linux ppc, ndm on
> Windows, referred me to this list. I'm trying to find out what is
> actually needed to successfully compile Yhc (now, for me, at least).
> _______________________________________________
> Yhc mailing list
> Yhc <at> haskell.org
> http://www.haskell.org//mailman/listinfo/yhc
Isaac | 6 Jul 2006 18:21
Favicon

Re: What does Yhc need (error, ffi.h not found)

Yes, I can compile that program "test.c" with gcc -c test.c
Just to test, without darcs-pulling anything, I re-ran scons on yhc, and
it worked to a greater extent than before (then erroring with:
/usr/lib/gcc/powerpc-unknown-linux-gnu/3.4.4/../../../../powerpc-unknown-linux-gnu/bin/ld:
cannot find -lffi
)
There must have been something temporary affecting that (my computer was
rebooted in between).

After darcs pull, scons errored:

scons: warning: Ignoring missing SConscript
'src/packages/yhc-base-1.0/YHC/Runtime/SConscript'
File "src/packages/yhc-base-1.0/YHC/SConscript", line 9, in ?
TypeError: iteration over non-sequence:
  File "Sconstruct", line 47:
    yhi_objs, yhcfiles, library, testerfiles = SConscript("src/SConscript")
  File "/usr/lib/scons/SCons/Script/SConscript.py", line 581:
    return apply(method, args, kw)
  File "/usr/lib/scons/SCons/Script/SConscript.py", line 508:
    return apply(_SConscript, [self.fs,] + files, {'exports' : exports})
  File "/usr/lib/scons/SCons/Script/SConscript.py", line 239:
    exec _file_ in stack[-1].globals
  File "src/SConscript", line 7:
    yhc_lib = SConscript("packages/SConscript")
  File "/usr/lib/scons/SCons/Script/SConscript.py", line 581:
    return apply(method, args, kw)
  File "/usr/lib/scons/SCons/Script/SConscript.py", line 508:
    return apply(_SConscript, [self.fs,] + files, {'exports' : exports})
  File "/usr/lib/scons/SCons/Script/SConscript.py", line 239:
    exec _file_ in stack[-1].globals
  File "src/packages/SConscript", line 3:
    yhcobjs = SConscript("yhc-base-1.0/SConscript")
  File "/usr/lib/scons/SCons/Script/SConscript.py", line 581:
    return apply(method, args, kw)
  File "/usr/lib/scons/SCons/Script/SConscript.py", line 508:
    return apply(_SConscript, [self.fs,] + files, {'exports' : exports})
  File "/usr/lib/scons/SCons/Script/SConscript.py", line 239:
    exec _file_ in stack[-1].globals
  File "src/packages/yhc-base-1.0/SConscript", line 55:
    objs += SConscript("YHC/SConscript")
  File "/usr/lib/scons/SCons/Script/SConscript.py", line 581:
    return apply(method, args, kw)
  File "/usr/lib/scons/SCons/Script/SConscript.py", line 508:
    return apply(_SConscript, [self.fs,] + files, {'exports' : exports})
  File "/usr/lib/scons/SCons/Script/SConscript.py", line 239:
    exec _file_ in stack[-1].globals
  File "src/packages/yhc-base-1.0/YHC/SConscript", line 9:
    objs += SConscript("Runtime/SConscript")

darcs unpull'ing only those new patches that didn't look like they had
to do with ffi, scons then reached the same "cannot find -lffi" error.

Thomas Shackell wrote:
> Hi Isaac,
> 
> can you build any program using ffi.h? e.g.
> 
> --- test.c ------------
> 
> #include <ffi.h>
> 
> int main(){ return 0; }
> 
> -----------------------
> 
> gcc -c test.c
> 
> 
> cheers
> 
> Tom
> 
> 
> Isaac wrote:
>> Trying scons on a freshly darcs'd yhc from today, I got an error, see:
>> http://paste.lisp.org/display/22129
>> or, to include the relevant parts of the output here:
>>
>> gcc -I. -c -o src/runtime/BCKernel/external.o
>> src/runtime/BCKernel/external.c
>> In file included from src/runtime/BCKernel/types.h:5,
>>                  from src/runtime/BCKernel/hashtable.h:4,
>>                  from src/runtime/BCKernel/module.h:18,
>>                  from src/runtime/BCKernel/external.h:4,
>>                  from src/runtime/BCKernel/external.c:1:
>> src/runtime/BCKernel/platform.h:103:17: ffi.h: No such file or directory
>> scons: *** [src/runtime/BCKernel/external.o] Error 1
>> scons: building terminated because of errors.
>>
>> On IRC, ndm suggested that "libffi" was needed; after "emerge libffi"
>> the error still happened -- so, me being on gentoo-linux ppc, ndm on
>> Windows, referred me to this list. I'm trying to find out what is
>> actually needed to successfully compile Yhc (now, for me, at least).
>> _______________________________________________
>> Yhc mailing list
>> Yhc <at> haskell.org
>> http://www.haskell.org//mailman/listinfo/yhc
> 
Thomas Shackell | 7 Jul 2006 13:26
Picon

Re: What does Yhc need (error, ffi.h not found)


Isaac wrote:
> Yes, I can compile that program "test.c" with gcc -c test.c
> Just to test, without darcs-pulling anything, I re-ran scons on yhc, and
> it worked to a greater extent than before (then erroring with:
> /usr/lib/gcc/powerpc-unknown-linux-gnu/3.4.4/../../../../powerpc-unknown-linux-gnu/bin/ld:
> cannot find -lffi
> )
> There must have been something temporary affecting that (my computer was
> rebooted in between).

does gcc test.c -lffi work? :-)

> After darcs pull, scons errored:

<snip scons error>

sorry my fault, forgot to add a file to the repo when I made a change.

thanks :-)

Tom
Isaac | 7 Jul 2006 14:34
Favicon

Re: What does Yhc need (error, ffi.h not found)

:) no, adding -lffi to the test doesn't work:

/usr/lib/gcc/powerpc-unknown-linux-gnu/3.4.4/../../../../powerpc-unknown-linux-gnu/bin/ld:
cannot find -lffi
collect2: ld returned 1 exit status

And now that the scons has been fixed up, it gives me, as expected,

Checking for ffi_call() in C library ffi... no
YHC requires LibFFI to be installed and working.

In case the information helps:  the version of libffi (it seemed like) I
installed was 3.4.3, corresponding to the GCC release of that version
number (indeed, using its source code). (Although it's very probably
irrelevant, I'm using GCC 3.4.4 as my C compiler.)

Now looking around, I found /usr/lib/libffi -- it's a directory!
$ ls -lR /usr/lib/libffi/
/usr/lib/libffi/:
total 48
-rw-r--r--  1 root root 19970 Jul  5 17:31 libffi.a
-rwxr-xr-x  1 root root   722 Jul  5 17:31 libffi.la
lrwxrwxrwx  1 root root    15 Jul  5 17:31 libffi.so -> libffi.so.3.0.0
lrwxrwxrwx  1 root root    15 Jul  5 17:31 libffi.so.3 ->libffi.so.3.0.0
-rwxr-xr-x  1 root root 18640 Jul  5 17:31 libffi.so.3.0.0
drwxr-xr-x  2 root root  4096 Jul  5 17:31 nof

/usr/lib/libffi/nof:
total 52
-rw-r--r--  1 root root 21386 Jul  5 17:31 libffi.a
-rwxr-xr-x  1 root root   726 Jul  5 17:31 libffi.la
lrwxrwxrwx  1 root root    15 Jul  5 17:31 libffi.so -> libffi.so.3.0.0
lrwxrwxrwx  1 root root    15 Jul  5 17:31 libffi.so.3 ->libffi.so.3.0.0
-rwxr-xr-x  1 root root 21104 Jul  5 17:31 libffi.so.3.0.0

[a couple spaces deleted to keep the lines from wrapping]

I don't know how much of this setup is Gentoo-specific, though, and I
don't know how libffi would generically be installed (e.g. starting from
the source tarball) in general.

Thomas Shackell wrote:
> 
> 
> Isaac wrote:
>> Yes, I can compile that program "test.c" with gcc -c test.c
>> Just to test, without darcs-pulling anything, I re-ran scons on yhc, and
>> it worked to a greater extent than before (then erroring with:
>> /usr/lib/gcc/powerpc-unknown-linux-gnu/3.4.4/../../../../powerpc-unknown-linux-gnu/bin/ld:
>>
>> cannot find -lffi
>> )
>> There must have been something temporary affecting that (my computer was
>> rebooted in between).
> 
> does gcc test.c -lffi work? :-)
> 
>> After darcs pull, scons errored:
> 
> <snip scons error>
> 
> sorry my fault, forgot to add a file to the repo when I made a change.
> 
> thanks :-)
> 
> 
> Tom
> 

Gmane