pure, llvm 2.4 and Mac OS X

3 views
Skip to first unread message

Ryan Schmidt

unread,
Nov 13, 2008, 7:01:01 AM11/13/08
to pure...@googlegroups.com
Greetings. In MacPorts we've been using a development version of llvm
2.3 (at revision 53722) which has been building pure just fine. But
llvm 2.4 final has now been released and pure does not fare so well
with it (this is on Mac OS X 10.5.5 Intel with Xcode 3.1.1):


interpreter.hh: In member function 'llvm::LoadInst* Env::CreateLoadGEP
(llvm::Value*, llvm::Value*, const char*)':
interpreter.hh:201: error: 'builder' was not declared in this scope
interpreter.hh: In member function 'llvm::LoadInst* Env::CreateLoadGEP
(llvm::Value*, llvm::Value*, llvm::Value*, const char*)':
interpreter.hh:204: error: 'builder' was not declared in this scope
interpreter.hh: In member function 'llvm::LoadInst* Env::CreateLoadGEP
(llvm::Value*, llvm::Value*, llvm::Value*, llvm::Value*, const char*)':
interpreter.hh:208: error: 'builder' was not declared in this scope
interpreter.hh:181: error: invalid use of template-name
'llvm::IRBuilder' without an argument list
interpreter.hh: In member function 'llvm::Value* Env::CreateGEP
(llvm::Value*, llvm::Value*, const char*)':
interpreter.hh:189: error: 'builder' was not declared in this scope
interpreter.hh: In member function 'llvm::Value* Env::CreateGEP
(llvm::Value*, llvm::Value*, llvm::Value*, const char*)':
interpreter.hh:193: error: 'builder' was not declared in this scope
interpreter.hh: In member function 'llvm::Value* Env::CreateGEP
(llvm::Value*, llvm::Value*, llvm::Value*, llvm::Value*, const char*)':
interpreter.hh:198: error: 'builder' was not declared in this scope
interpreter.hh: In member function 'llvm::LoadInst* Env::CreateLoadGEP
(llvm::Value*, llvm::Value*, const char*)':
interpreter.hh:201: error: 'builder' was not declared in this scope
interpreter.hh: In member function 'llvm::LoadInst* Env::CreateLoadGEP
(llvm::Value*, llvm::Value*, llvm::Value*, const char*)':
interpreter.hh:204: error: 'builder' was not declared in this scope
interpreter.hh: In member function 'llvm::LoadInst* Env::CreateLoadGEP
(llvm::Value*, llvm::Value*, llvm::Value*, llvm::Value*, const char*)':
interpreter.hh:208: error: 'builder' was not declared in this scope
interpreter.hh: At global scope:
interpreter.hh:541: error: using-declaration for non-member at class
scope
interpreter.hh:541: error: expected ';' before '&' token
interpreter.hh:542: error: expected `;' before 'pure_expr'
interpreter.hh: At global scope:
interpreter.hh:541: error: using-declaration for non-member at class
scope
interpreter.hh:541: error: expected ';' before '&' token
interpreter.hh:542: error: expected `;' before 'pure_expr'
make: *** [expr.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** [pure.o] Error 1

Albert Graef

unread,
Nov 13, 2008, 4:42:45 PM11/13/08
to pure...@googlegroups.com
Ryan Schmidt wrote:
> Greetings. In MacPorts we've been using a development version of llvm
> 2.3 (at revision 53722) which has been building pure just fine. But
> llvm 2.4 final has now been released and pure does not fare so well
> with it (this is on Mac OS X 10.5.5 Intel with Xcode 3.1.1):

Hi Ryan,

yes it seems that the builder interface has changed once again; at least
IRBuilder takes new template parameters now.

I haven't installed LLVM 2.4 yet, will do so asap. In the meantime, can
you please check whether the following workaround helps?

interpreter.hh: change line 97:

#define Builder llvm::IRBuilder

to:

#define Builder llvm::IRBuilder<>

Albert

--
Dr. Albert Gr"af
Dept. of Music-Informatics, University of Mainz, Germany
Email: Dr.G...@t-online.de, a...@muwiinfa.geschichte.uni-mainz.de
WWW: http://www.musikinformatik.uni-mainz.de/ag

Ryan Schmidt

unread,
Nov 13, 2008, 4:53:46 PM11/13/08
to pure...@googlegroups.com

On Nov 13, 2008, at 15:42, Albert Graef wrote:

> I haven't installed LLVM 2.4 yet, will do so asap. In the meantime,
> can
> you please check whether the following workaround helps?
>
> interpreter.hh: change line 97:
>
> #define Builder llvm::IRBuilder
>
> to:
>
> #define Builder llvm::IRBuilder<>

That does build! Thanks.

However, it does make it no longer build with the previous
development version of llvm (whose llvm-config conveniently also
identifies it as version 2.4 (well, 2.4svn)). :) But, probably better
to support the final released version of llvm.


bison -v -o ./parser.cc parser.yy
/usr/bin/g++-4.0 -O2 -I/mp/include `llvm-config --cppflags` -I. -I. -
c -o matcher.o matcher.cc
/usr/bin/g++-4.0 -O2 -I/mp/include `llvm-config --cppflags` -I. -I. -
c -o symtable.o symtable.cc
/usr/bin/g++-4.0 -O2 -I/mp/include `llvm-config --cppflags` -I. -I. -
c -o util.o util.cc
flex -o ./lexer.cc lexer.ll
rm -f ./etc/pure-mode.el ./etc/pure-mode.el.tmp
sed -e 's,@bindir\@,/mp/bin,g' -e 's,@libdir\@,/mp/lib,g' ./etc/pure-
mode.el.in >./etc/pure-mode.el.tmp
mv ./etc/pure-mode.el.tmp ./etc/pure-mode.el
rm -f ./pure.1 ./pure.1.tmp
sed -e 's,@version\@,0.13,g' ./pure.1.in >./pure.1.tmp
mv ./pure.1.tmp ./pure.1
/usr/bin/g++-4.0 -O2 -I/mp/include `llvm-config --cppflags` -I. -I. -
DPURELIB='"/mp/lib/pure-0.13"' -c -o pure.o pure.cc
/usr/bin/g++-4.0 -O2 -I/mp/include `llvm-config --cppflags` -I. -I. -
c -o expr.o expr.cc
interpreter.hh:181: error: 'llvm::IRBuilder' is not a template
interpreter.hh:181: error: 'llvm::IRBuilder' is not a template
interpreter.hh:541: error: 'llvm::IRBuilder' is not a template
interpreter.hh:541: error: 'llvm::IRBuilder' is not a template


make: *** [pure.o] Error 1
make: *** Waiting for unfinished jobs....

make: *** [expr.o] Error 1


Albert Graef

unread,
Nov 13, 2008, 5:12:17 PM11/13/08
to pure...@googlegroups.com
Ryan Schmidt wrote:
> That does build! Thanks.

Thanks for the report. Does it pass the checks, too?

> However, it does make it no longer build with the previous
> development version of llvm (whose llvm-config conveniently also
> identifies it as version 2.4 (well, 2.4svn)). :) But, probably better
> to support the final released version of llvm.

I'll try to figure out some configure magic to make it work with both
LLVM 2.3 and 2.4, that hopefully also supports anything in between.

Ryan Schmidt

unread,
Nov 14, 2008, 4:38:55 AM11/14/08
to pure...@googlegroups.com

On Nov 13, 2008, at 16:12, Albert Graef wrote:

>
> Ryan Schmidt wrote:
>> That does build! Thanks.
>
> Thanks for the report. Does it pass the checks, too?

I should have checked that earlier. Yes, the checks all pass.


Albert Graef

unread,
Nov 14, 2008, 4:54:05 AM11/14/08
to pure...@googlegroups.com
Albert Graef wrote:
> Ryan Schmidt wrote:
>> However, it does make it no longer build with the previous
>> development version of llvm (whose llvm-config conveniently also
>> identifies it as version 2.4 (well, 2.4svn)). :) But, probably better
>> to support the final released version of llvm.
>
> I'll try to figure out some configure magic to make it work with both
> LLVM 2.3 and 2.4, that hopefully also supports anything in between.

Now in svn (r417). Ryan, I still can't test this myself, so it would be
nice if you can give it another go, thanks.

Ryan Schmidt

unread,
Nov 14, 2008, 5:39:55 AM11/14/08
to pure...@googlegroups.com
On Nov 14, 2008, at 03:54, Albert Graef wrote:

> Albert Graef wrote:
>> Ryan Schmidt wrote:
>>> However, it does make it no longer build with the previous
>>> development version of llvm (whose llvm-config conveniently also
>>> identifies it as version 2.4 (well, 2.4svn)). :) But, probably
>>> better
>>> to support the final released version of llvm.
>>
>> I'll try to figure out some configure magic to make it work with both
>> LLVM 2.3 and 2.4, that hopefully also supports anything in between.
>
> Now in svn (r417). Ryan, I still can't test this myself, so it
> would be
> nice if you can give it another go, thanks.

You drive very well for not being able to see the road. :) r417 works
(all tests pass) with both the new llvm 2.4 final and the old llvm
2.4svn from r53722. Thanks!

Albert Graef

unread,
Nov 14, 2008, 6:19:53 AM11/14/08
to pure...@googlegroups.com
Ryan Schmidt wrote:
> You drive very well for not being able to see the road. :) r417 works
> (all tests pass) with both the new llvm 2.4 final and the old llvm
> 2.4svn from r53722. Thanks!

Thanks. That went rather smoothly, compared to the LLVM 2.2->2.3
transition. ;-)

I also got around installing LLVM 2.4 on my Linux x86-64 box now, and
the Pure trunk appears to work fine with it. (Remember that you have to
configure LLVM 2.4 with --enable-pic on that platform, as before, but
thankfully Cyrille Berger's x86-64 PIC patch isn't needed with LLVM 2.4
any more.)

In the meantime I also bumped the version number in svn to 0.14 and
updated the installation instructions. Will test on Linux x86-32 and
Windows asap.

Jiri Spitz

unread,
Nov 14, 2008, 6:52:29 AM11/14/08
to pure...@googlegroups.com
Albert Graef wrote:
> In the meantime I also bumped the version number in svn to 0.14 and
> updated the installation instructions. Will test on Linux x86-32 and
> Windows asap.
>

Compiles with the MinGW as well but the tests #18 and #20 fail. (Might
be caused by the unix -> dos conversion of log files?).

Jiri

Eddie Rucker

unread,
Nov 14, 2008, 9:19:06 AM11/14/08
to pure...@googlegroups.com
On Fri, 2008-11-14 at 12:52 +0100, Jiri Spitz wrote:
> > In the meantime I also bumped the version number in svn to 0.14 and
> > updated the installation instructions. Will test on Linux x86-32 and
> > Windows asap.

I noticed a speed up in the start up time of pure and a speed up of the
first evaluations in the Pure interpreter using llvm 2.4. JIT
improvements are quite noticeable on my box :)

e.r.

Albert Graef

unread,
Nov 14, 2008, 1:47:19 PM11/14/08
to pure...@googlegroups.com
Jiri Spitz wrote:
> Compiles with the MinGW as well but the tests #18 and #20 fail. (Might
> be caused by the unix -> dos conversion of log files?).

Maybe. Over here everything builds fine with LLVM 2.4 on 32 bit Windows
and all checks except test020.pure pass. (This test is expected to fail
on Windoze because of IEEE 754 incompatibilities in the MSVC runtime.)

Albert Graef

unread,
Nov 14, 2008, 2:08:18 PM11/14/08
to pure...@googlegroups.com
Eddie Rucker wrote:
> I noticed a speed up in the start up time of pure and a speed up of the
> first evaluations in the Pure interpreter using llvm 2.4. JIT
> improvements are quite noticeable on my box :)

Yes, I had the impression, too (although I didn't do any real
measurements yet). It was especially noticeable with my Pd-Pure module
which now loads in Pd *much* faster. It goes without saying that I'm
very happy with the steady improvements of LLVM in that area, as the JIT
seems to take the lion's share of compilation time.

Libor

unread,
Nov 15, 2008, 2:39:36 PM11/15/08
to pure-lang
Congratulations on catching up to the latest version of LLVM!
This is just to report that LLVM 2.4 and Pure compiled just fine
on my little Acer Aspire 1, and passed all 25 tests right away!

Regards,
Libor

On Nov 14, 7:08 pm, Albert Graef <Dr.Gr...@t-online.de> wrote:
> Eddie Rucker wrote:
> > I noticed a speed up in the start up time of pure and a speed up of the
> > first evaluations in the Pure interpreter using llvm 2.4. JIT
> > improvements are quite noticeable on my box :)
>
> Yes, I had the impression, too (although I didn't do any real
> measurements yet). It was especially noticeable with my Pd-Pure module
> which now loads in Pd *much* faster. It goes without saying that I'm
> very happy with the steady improvements of LLVM in that area, as the JIT
> seems to take the lion's share of compilation time.
>
> Albert
>
> --
> Dr. Albert Gr"af
> Dept. of Music-Informatics, University of Mainz, Germany
> Email:  Dr.Gr...@t-online.de, a...@muwiinfa.geschichte.uni-mainz.de
> WWW:    http://www.musikinformatik.uni-mainz.de/ag

Albert Graef

unread,
Nov 16, 2008, 2:32:29 PM11/16/08
to pure...@googlegroups.com
Libor wrote:
> This is just to report that LLVM 2.4 and Pure compiled just fine
> on my little Acer Aspire 1, and passed all 25 tests right away!

Thanks for testing. Meanwhile I've been hacking on the new namespace
support, I'm almost ready to commit this now...

--
Dr. Albert Gr"af
Dept. of Music-Informatics, University of Mainz, Germany

Reply all
Reply to author
Forward
0 new messages