Opened 20 months ago

Last modified 6 weeks ago

#7143 new bug

ghc-7.6.0.20120810-x86_64-windows.exe -> ghc can't figure out LLVM version

Reported by: cetinsert Owned by: dterei
Priority: high Milestone: 7.8.3
Component: Compiler (LLVM) Version: 7.6.1-rc1
Keywords: llvm Cc: shelarcy@…
Operating System: Windows Architecture: Unknown/Multiple
Type of failure: Incorrect warning at compile-time Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

I have downloaded:

ghc: ghc-7.6.0.20120810-x86_64-windows.exe

mingw64: http://www.drangon.org/mingw/mirror.php?num=2&fname=mingw-w64-bin-x86_64-20120807.7z

llvm64: http://www.drangon.org/mingw/mirror.php?num=2&fname=llvm-3.1-w64-bin-x86_64-20120610.7z

my path contains:

/c/ghc/ghc-7.6.0.20120810/bin:/c/Users/Cetin/AppData/Roaming/cabal/bin:/c/llvm/bin:/c/mw64/bin

When I run:

ghc -fllvm --make Main.hs

I get:

[1 of 1] Compiling Main             ( Main.hs, Main.o )

<no location info>:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM

Attached is the output from:

ghc -v3 -fllvm --make Main.hs

for all Main.hs - it mentions:

*** LlVM CodeGen:
Error (figuring out LLVM version): : runInteractiveProcess: invalid argument (Invalid argument)

<no location info>:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM
*** LLVM Optimiser:
"" "C:\Users\Cetin\AppData\Local\Temp\ghc6036_0\ghc6036_0.ll" "-o" "C:\Users\Cetin\AppData\Local\Temp\ghc6036_0\ghc6036_0.bc" "-mem2reg" "--enable-tbaa=true"


Failed: "" "C:\Users\Cetin\AppData\Local\Temp\ghc6036_0\ghc6036_0.ll" "-o" "C:\Users\Cetin\AppData\Local\Temp\ghc6036_0\ghc6036_0.bc" "-mem2reg" "--enable-tb

Attachments (1)

llvm-full-version-check (6.0 KB) - added by cetinsert 20 months ago.
checking versions of llc and opt in the same session as a -v3 compilation with ghc -fllvm

Download all attachments as: .zip

Change History (14)

Changed 20 months ago by cetinsert

checking versions of llc and opt in the same session as a -v3 compilation with ghc -fllvm

comment:1 Changed 20 months ago by cetinsert

  • Summary changed from ghc-7.6.0.20120810-x86_64-windows.exe -> ghc can't figure out LLC version to ghc-7.6.0.20120810-x86_64-windows.exe -> ghc can't figure out LLVM version

comment:2 Changed 20 months ago by igloo

  • Difficulty set to Unknown
  • Milestone set to 7.8.1
  • Priority changed from normal to high

Thanks for the report. I've never tried to use LLVM, but GHC's built-in native-code-generator should work, so I don't think this is urgent. I've therefore milestoned it for 7.8.

comment:3 Changed 20 months ago by dterei

  • Owner set to dterei

Thanks for the report cetinsert, I'll take a look as time permits.

comment:4 Changed 19 months ago by shelarcy

  • Architecture changed from x86_64 (amd64) to Unknown/Multiple
  • Cc shelarcy@… added

Windows 32 bit version causes same problem.

> ghc -info
 [("Project name","The Glorious Glasgow Haskell Compilation System")
 ,("GCC extra via C opts"," -fwrapv")
 ,("C compiler command","$topdir/../mingw/bin/gcc.exe")
 ,("C compiler flags"," -fno-stack-protector  -Wl,--hash-size=31 -Wl,--reduce-me
mory-overheads")
 ,("ar command","$topdir/../mingw/bin/ar.exe")
 ,("ar flags","q")
 ,("ar supports at file","YES")
 ,("touch command","$topdir/touchy.exe")
 ,("dllwrap command","$topdir/../mingw/bin/dllwrap.exe")
 ,("windres command","$topdir/../mingw/bin/windres.exe")
 ,("perl command","$topdir/../perl/perl.exe")
 ,("target os","OSMinGW32")
 ,("target arch","ArchX86")
 ,("target word size","4")
 ,("target has GNU nonexec stack","False")
 ,("target has .ident directive","True")
 ,("target has subsections via symbols","False")
 ,("LLVM llc command","")
 ,("LLVM opt command","")
 ,("Project version","7.6.1")
 ,("Booter version","7.4.2")
 ,("Stage","2")
 ,("Build platform","i386-unknown-mingw32")
 ,("Host platform","i386-unknown-mingw32")
 ,("Target platform","i386-unknown-mingw32")
 ,("Have interpreter","YES")
 ,("Object splitting supported","YES")
 ,("Have native code generator","YES")
 ,("Support SMP","YES")
 ,("Unregisterised","NO")
 ,("Tables next to code","YES")
 ,("RTS ways","l debug  thr thr_debug thr_l thr_p dyn debug_dyn thr_dyn thr_debu
g_dyn")
 ,("Leading underscore","YES")
 ,("Debug on","False")
 ,("LibDir","C:\\ghc\\ghc-7.6.1\\lib")
 ,("Global Package DB","C:\\ghc\\ghc-7.6.1\\lib\\package.conf.d")
 ,("Gcc Linker flags","[\"-Wl,--hash-size=31\",\"-Wl,--reduce-memory-overheads\"
]")
 ,("Ld Linker flags","[\"--hash-size=31\",\"--reduce-memory-overheads\"]")
 ]

> ghc -fllvm Main.hs
[1 of 1] Compiling Main             ( Main.hs, Main.o )

<no location info>:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM

I used GHC 7.6.1 with LLVM official site's LLVM 2.9 binary.

> llc --version
Low Level Virtual Machine (http://llvm.org/):
  llvm version 2.9
  Optimized build.
  Built Apr  6 2011 (03:41:01).
  Host: i386-pc-mingw32
  Host CPU: i686

comment:5 Changed 17 months ago by igloo

  • Component changed from Compiler to Compiler (LLVM)

comment:6 Changed 15 months ago by shelarcy

comment:7 Changed 9 months ago by schyler

I believe I suffer from this bug also, and so does my friend who recently installed a fresh MinGW + Haskell Platform and can't get it to work. Punting.

Last edited 9 months ago by schyler (previous) (diff)

comment:8 Changed 9 months ago by schyler

Using the HP ghc on Windows you get an error like this (even if llc and opt are directly callable from the *same* command line):

<no location info>:
    Warning: Couldn't figure out LLVM version!
             Make sure you have installed LLVM

This occurs with all versions of llvm.

ghc --info is interesting:

 [("Project name","The Glorious Glasgow Haskell Compilation System")
 ,("GCC extra via C opts"," -fwrapv")
 ,("C compiler command","$topdir/../mingw/bin/gcc.exe")
 ,("C compiler flags"," -fno-stack-protector  -Wl,--hash-size=31 -Wl,--reduce-memory-overheads")
 ,("ar command","$topdir/../mingw/bin/ar.exe")
 ,("ar flags","q")
 ,("ar supports at file","YES")
 ,("touch command","$topdir/touchy.exe")
 ,("dllwrap command","$topdir/../mingw/bin/dllwrap.exe")
 ,("windres command","$topdir/../mingw/bin/windres.exe")
 ,("perl command","$topdir/../perl/perl.exe")
 ,("target os","OSMinGW32")
 ,("target arch","ArchX86")
 ,("target word size","4")
 ,("target has GNU nonexec stack","False")
 ,("target has .ident directive","True")
 ,("target has subsections via symbols","False")
 ,("LLVM llc command","")
 ,("LLVM opt command","")
 ,("Project version","7.6.3")
 ,("Booter version","7.4.1")
 ,("Stage","2")
 ,("Build platform","i386-unknown-mingw32")
 ,("Host platform","i386-unknown-mingw32")
 ,("Target platform","i386-unknown-mingw32")
 ,("Have interpreter","YES")
 ,("Object splitting supported","YES")
 ,("Have native code generator","YES")
 ,("Support SMP","YES")
 ,("Unregisterised","NO")
 ,("Tables next to code","YES")
 ,("RTS ways","l debug  thr thr_debug thr_l thr_p dyn debug_dyn thr_dyn thr_debug_dyn")
 ,("Leading underscore","YES")
 ,("Debug on","False")
 ,("LibDir","C:\\Program Files (x86)\\Haskell Platform\\2013.2.0.0\\lib")
 ,("Global Package DB","C:\\Program Files (x86)\\Haskell Platform\\2013.2.0.0\\lib\\package.conf.d")
 ,("Gcc Linker flags","[\"-Wl,--hash-size=31\",\"-Wl,--reduce-memory-overheads\"]")
 ,("Ld Linker flags","[\"--hash-size=31\",\"--reduce-memory-overheads\"]")
 ]

For some reason the commands to interface with llc/opt are empty. I was able to work around it by doing this;

alias ghc-llvm="ghc -pgmlo opt -pgmlc llc -fllvm"

... and then using ghc-llvm whenever I wanted to use llvm. This works perfectly.

The 64-bit GHC from GHC HQ has the same problem, and the same workaround works for me.

Last edited 9 months ago by schyler (previous) (diff)

comment:9 Changed 9 months ago by carter

the relevant bit being that the windows build doesn't have the llvm cli operations named

 ,("LLVM llc command","")
 ,("LLVM opt command","")

comment:10 follow-up: Changed 9 months ago by carter

schyler, could you confirm that editing the relevant fields in your GHC settings file fixes things

comment:11 in reply to: ↑ 10 ; follow-up: Changed 9 months ago by schyler

Replying to carter:

schyler, could you confirm that editing the relevant fields in your GHC settings file fixes things

Confirming llvm 3.4svn and 2.9 on path work perfectly with the settings file fix.

comment:12 Changed 7 months ago by schyler

Punting for fix.

comment:13 in reply to: ↑ 11 Changed 6 weeks ago by is7s

Replying to schyler:

Replying to carter:

schyler, could you confirm that editing the relevant fields in your GHC settings file fixes things

Confirming llvm 3.4svn and 2.9 on path work perfectly with the settings file fix.

Where is the GHC settings file located on Windows?

Note: See TracTickets for help on using tickets.