bscarlet / llvm-general

Rich LLVM bindings for Haskell (with transfer of LLVM IR to and from C++, detailed compilation pass control, etc.)
http://hackage.haskell.org/package/llvm-general
132 stars 38 forks source link

Installation fails on Windows #76

Closed khyperia closed 11 years ago

khyperia commented 11 years ago

I built LLVM with MinGW, added the LLVM bin directory to my PATH, then attempted to install llvm-general. Please let me know what information you need or if I should try anything, I'm unsure of all what you need. Here is the cabal log for installing llvm-general.

Resolving dependencies...
[1 of 1] Compiling Main             ( C:\Users\Evan\AppData\Local\Temp\llvm-general-3.3.8.2-4684\llvm-general-3.3.8.2\Setup.hs, C:\Users\Evan\AppData\Local\Temp\llvm-general-3.3.8.2-4684\llvm-general-3.3.8.2\dist\setup\Main.o )
Linking C:\Users\Evan\AppData\Local\Temp\llvm-general-3.3.8.2-4684\llvm-general-3.3.8.2\dist\setup\setup.exe ...
Configuring llvm-general-3.3.8.2...
Building llvm-general-3.3.8.2...
Preprocessing library llvm-general-3.3.8.2...
InstructionDefs.hsc:18:37: fatal error: llvm/Config/llvm-config.h: No such file or directory
compilation terminated.
compiling dist\build\LLVM\General\Internal\FFI\InstructionDefs_hsc_make.c failed (exit code 1)
command was: C:\Haskell\2013.2.0.0\mingw\bin\gcc.exe -c dist\build\LLVM\General\Internal\FFI\InstructionDefs_hsc_make.c -o dist\build\LLVM\General\Internal\FFI\InstructionDefs_hsc_make.o -Wl,--hash-size=31 -Wl,--reduce-memory-overheads -D__GLASGOW_HASKELL__=706 -Dmingw32_BUILD_OS -Dmingw32_HOST_OS -Di386_BUILD_ARCH -Di386_HOST_ARCH -Isrc -IC:/Users/Evan/llvm/build/Release+Asserts/include -D_DEBUG -D__NO_CTYPE_INLINE -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -Idist\build\autogen -include dist\build\autogen\cabal_macros.h -Idist\build\autogen -include dist\build\autogen\cabal_macros.h -Idist\build\autogen -include dist\build\autogen\cabal_macros.h -Idist\build\autogen -include dist\build\autogen\cabal_macros.h -Idist\build\autogen -include dist\build\autogen\cabal_macros.h -Idist\build\autogen -include dist\build\autogen\cabal_macros.h -Idist\build\autogen -include dist\build\autogen\cabal_macros.h -Idist\build\autogen -include dist\build\autogen\cabal_macros.h -Idist\build\autogen -include dist\build\autogen\cabal_macros.h -Idist\build\autogen -include dist\build\autogen\cabal_macros.h -IC:\Haskell\2013.2.0.0\lib\bytestring-0.10.0.2\include -Idist\build\autogen -include dist\build\autogen\cabal_macros.h -Idist\build\autogen -include dist\build\autogen\cabal_macros.h -Idist\build\autogen -include dist\build\autogen\cabal_macros.h -IC:\Haskell\2013.2.0.0\lib\base-4.6.0.1\include -Idist\build\autogen -include dist\build\autogen\cabal_macros.h -Idist\build\autogen -include dist\build\autogen\cabal_macros.h -Idist\build\autogen -include dist\build\autogen\cabal_macros.h -IC:\Haskell\2013.2.0.0\lib/include -Idist\build\autogen -include dist\build\autogen\cabal_macros.h -IC:\Haskell\2013.2.0.0/lib/include/
Failed to install llvm-general-3.3.8.2
cabal: Error: some packages failed to install:
llvm-general-3.3.8.2 failed during the building phase. The exception was:
ExitFailure 1
khyperia commented 11 years ago

I resolved the problem by using the following command to install the package -

C:\Users\Evan> cabal install llvm-general --extra-include-dirs=C:\Users\Evan\llvm\build\include --extra-include-dirs=C:\Users\Evan\llvm\include

(If someone else happens across this post, replace "C:\Users\Evan\llvm \build" of the first include with the build directory, and "C:\Users\Evan\llvm" of the second with the SVN unpack location)

Also, I was just informed that the problem was probably that I did not run "make install" in the llvm build directory. Try this first before doing the above solution.