Difficulties installing LLVM bindings

Hi Haskell-Cafe, I can't get the LLVM bindings for Haskell to install. Does anyone know what I might need to do? Has anyone seen this error before? Here's the problem: (Installing from latest darcs source) llvm-haskell aran$ cabal install Resolving dependencies... ...snip... checking for unistd.h... yes checking llvm-c/Core.h usability... yes checking llvm-c/Core.h presence... yes checking for llvm-c/Core.h... yes checking for LLVMModuleCreateWithName in -lLLVMCore... no configure: error: could not find LLVM C bindings cabal: Error: some packages failed to install: llvm-0.7.0.1 failed during the configure step. The exception was: exit: ExitFailure 1 I've got the latest LLVM (from source) installed using the default "sudo make install", i.e. into /usr/local. Using cabal install --configure-option --with-llvm-prefix=/usr/local doesn't change the result. LLVM is indeed based in /usr/local. The binaries are in /usr/local/bin/, libLLVM*.a is in /usr/local/lib, etc. Google just shows that this error has cropped up a couple times before. I tried manually disabling the check in the configure script but then generating code fails with massive run-time errors that look like link problems. I'm on an up-to-date Snow Leopard, using the latest llvm bindings from darcs, cabal-install 0.8.0, cabal library 1.8.0.2, ghc 6.12.1, and LLVM from svn. LLVM works fine from C++, at least. I worked through the Kaleidoscope tutorial and a few hand-coded .ll files without a hitch. Have you seen anything like this before? Any tips or things to try? I can't think of what magic setting I'm missing. Thanks, Aran

On Fri, Apr 09, 2010 at 01:38:21PM -0400, Aran Donohue wrote:
Have you seen anything like this before? Any tips or things to try? I can't think of what magic setting I'm missing.
Do you have llvm-config on your path? $ llvm-config I have in the past installed the LLVM bindings with a $HOME installation of LLVM, so /usr/local shouldn't be a problem. HTH, -- Felipe.

On 9 April 2010 18:38, Aran Donohue
Hi Haskell-Cafe, I can't get the LLVM bindings for Haskell to install. Does anyone know what I might need to do? Has anyone seen this error before? Here's the problem: (Installing from latest darcs source)
I just tried this on my Mac and got the same problem. The problem is described in config.log: """ configure:3659: g++ -o conftest -g -O2 -I/usr/local/include -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -m32 -L/usr/local/lib -lpthread -lm conftest.c -lLLVMCore -lLLVMSupport -lLLVMSystem >&5 ld: warning: in /usr/local/lib/libLLVMCore.a, file is not of required architecture ld: warning: in /usr/local/lib/libLLVMSupport.a, file is not of required architecture ld: warning: in /usr/local/lib/libLLVMSystem.a, file is not of required architecture Undefined symbols: "_LLVMModuleCreateWithName", referenced from: _main in cc5D6X0z.o """ So perhaps LLVM needs to be built universal or something? Cheers, Max

Bryan said a while ago that Manuel Chakravarty had some Mac related
patches for LLVM, don't know if they have been integrated yet.
On 9 April 2010 23:11, Max Bolingbroke
On 9 April 2010 18:38, Aran Donohue
wrote: Hi Haskell-Cafe, I can't get the LLVM bindings for Haskell to install. Does anyone know what I might need to do? Has anyone seen this error before? Here's the problem: (Installing from latest darcs source)
I just tried this on my Mac and got the same problem. The problem is described in config.log:
""" configure:3659: g++ -o conftest -g -O2 -I/usr/local/include -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -m32 -L/usr/local/lib -lpthread -lm conftest.c -lLLVMCore -lLLVMSupport -lLLVMSystem >&5 ld: warning: in /usr/local/lib/libLLVMCore.a, file is not of required architecture ld: warning: in /usr/local/lib/libLLVMSupport.a, file is not of required architecture ld: warning: in /usr/local/lib/libLLVMSystem.a, file is not of required architecture Undefined symbols: "_LLVMModuleCreateWithName", referenced from: _main in cc5D6X0z.o """
So perhaps LLVM needs to be built universal or something?
Cheers, Max _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- Push the envelope. Watch it bend.

Thomas---The new Mac patches have been integrated in the version I'm using,
according to the darcs log.
Thanks Felipe---indeed, llvm-config is on the path.
Max---I had the same realization about config.log. I managed to get past it
by forcing the Haskell-LLVM build into 64-bit mode, but that led to new
problems with ghc-pkg. I think we need to rebuild LLVM forcing 32-mode, but
I haven't yet found the results of this. I'd love to hear what you did if
you manage to get it going and compile programs.
Thanks,
Aran
On Fri, Apr 9, 2010 at 7:07 PM, Thomas Schilling
Bryan said a while ago that Manuel Chakravarty had some Mac related patches for LLVM, don't know if they have been integrated yet.
On 9 April 2010 23:11, Max Bolingbroke
wrote: On 9 April 2010 18:38, Aran Donohue
wrote: Hi Haskell-Cafe, I can't get the LLVM bindings for Haskell to install. Does anyone know what I might need to do? Has anyone seen this error before? Here's the problem: (Installing from latest darcs source)
I just tried this on my Mac and got the same problem. The problem is described in config.log:
""" configure:3659: g++ -o conftest -g -O2 -I/usr/local/include -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -m32 -L/usr/local/lib -lpthread -lm conftest.c -lLLVMCore -lLLVMSupport -lLLVMSystem >&5 ld: warning: in /usr/local/lib/libLLVMCore.a, file is not of required architecture ld: warning: in /usr/local/lib/libLLVMSupport.a, file is not of required architecture ld: warning: in /usr/local/lib/libLLVMSystem.a, file is not of required architecture Undefined symbols: "_LLVMModuleCreateWithName", referenced from: _main in cc5D6X0z.o """
So perhaps LLVM needs to be built universal or something?
Cheers, Max _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- Push the envelope. Watch it bend.

On 10 April 2010 03:18, Aran Donohue
problems with ghc-pkg. I think we need to rebuild LLVM forcing 32-mode, but I haven't yet found the results of this. I'd love to hear what you did if you manage to get it going and compile programs.
My LLVM checkout was still recompiling when I sent that email, but it's now finished and it fixed the problem. All you need to do is compile LLVM as follows: $ UNIVERSAL=1 make Then "make install" the result. That made the LLVM bindings configure and compile fine for me. Cheers, Max

UNIVERSAL=1 worked for me too. Is there a way for cabal install to detect if
LLVM wasn't built with this required flag and give a more informative error
message?
Aran
On Sat, Apr 10, 2010 at 2:28 AM, Max Bolingbroke wrote: On 10 April 2010 03:18, Aran Donohue problems with ghc-pkg. I think we need to rebuild LLVM forcing 32-mode,
but
I haven't yet found the results of this. I'd love to hear what you did if
you manage to get it going and compile programs. My LLVM checkout was still recompiling when I sent that email, but
it's now finished and it fixed the problem. All you need to do is compile LLVM as follows: $ UNIVERSAL=1 make Then "make install" the result. That made the LLVM bindings configure
and compile fine for me. Cheers,
Max

To actually build the examples, I also needed to remove references to the
addCondPropagation optimization pass. I don't know why. I attached the darcs
patch I'm using.
Aran
On Sat, Apr 10, 2010 at 4:42 PM, Aran Donohue
UNIVERSAL=1 worked for me too. Is there a way for cabal install to detect if LLVM wasn't built with this required flag and give a more informative error message?
Aran
On Sat, Apr 10, 2010 at 2:28 AM, Max Bolingbroke < batterseapower@hotmail.com> wrote:
On 10 April 2010 03:18, Aran Donohue
wrote: problems with ghc-pkg. I think we need to rebuild LLVM forcing 32-mode, but I haven't yet found the results of this. I'd love to hear what you did if you manage to get it going and compile programs.
My LLVM checkout was still recompiling when I sent that email, but it's now finished and it fixed the problem.
All you need to do is compile LLVM as follows:
$ UNIVERSAL=1 make
Then "make install" the result. That made the LLVM bindings configure and compile fine for me.
Cheers, Max
participants (4)
-
Aran Donohue
-
Felipe Lessa
-
Max Bolingbroke
-
Thomas Schilling