{"action":"created","issue":{"url":"https://api.github.com/repos/bscarlet/llvm-general/issues/156","labels_url":"https://api.github.com/repos/bscarlet/llvm-general/issues/156/labels{/name}","comments_url":"https://api.github.com/repos/bscarlet/llvm-general/issues/156/comments","events_url":"https://api.github.com/repos/bscarlet/llvm-general/issues/156/events","html_url":"https://github.com/bscarlet/llvm-general/issues/156","id":112003225,"number":156,"title":"Install on Windows: Missing dependencies on foreign libraries","user":{"login":"coder-mike","id":2261100,"avatar_url":"https://avatars.githubusercontent.com/u/2261100?v=3","gravatar_id":"","url":"https://api.github.com/users/coder-mike","html_url":"https://github.com/coder-mike","followers_url":"https://api.github.com/users/coder-mike/followers","following_url":"https://api.github.com/users/coder-mike/following{/other_user}","gists_url":"https://api.github.com/users/coder-mike/gists{/gist_id}","starred_url":"https://api.github.com/users/coder-mike/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coder-mike/subscriptions","organizations_url":"https://api.github.com/users/coder-mike/orgs","repos_url":"https://api.github.com/users/coder-mike/repos","events_url":"https://api.github.com/users/coder-mike/events{/privacy}","received_events_url":"https://api.github.com/users/coder-mike/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-10-18T06:04:38Z","updated_at":"2015-10-22T11:20:37Z","closed_at":null,"body":"When I try to install llvm-general 3.6.0.0 in Windows, I get the error \"Missing dependencies on foreign libraries\", as seen below:\r\n\r\n    $ cabal install ./llvm-general\r\n    Resolving dependencies...\r\n    Configuring llvm-general-3.6.0.0...\r\n    Failed to install llvm-general-3.6.0.0\r\n    Build log ( C:\\Users\\elecm.DESKTOP-JQGRHSF\\AppData\\Roaming\\cabal\\logs\\llvm-general-3.6.0.0.log ):\r\n    Configuring llvm-general-3.6.0.0...\r\n    setup.exe: Missing dependencies on foreign libraries:\r\n    * Missing C libraries: LLVMOption, LLVMIRReader, LLVMAsmParser, gtest_main,\r\n    gtest, LLVMInterpreter, LLVMXCoreDisassembler, LLVMXCoreCodeGen,\r\n    LLVMXCoreDesc, LLVMXCoreInfo, LLVMXCoreAsmPrinter, LLVMSystemZDisassembler,\r\n    LLVMSystemZCodeGen, LLVMSystemZAsmParser, LLVMSystemZDesc, LLVMSystemZInfo,\r\n    LLVMSystemZAsmPrinter, LLVMSparcDisassembler, LLVMSparcCodeGen,\r\n    LLVMSparcAsmParser, LLVMSparcDesc, LLVMSparcInfo, LLVMSparcAsmPrinter,\r\n    LLVMR600CodeGen, LLVMR600AsmParser, LLVMR600Desc, LLVMR600Info,\r\n    LLVMR600AsmPrinter, LLVMPowerPCDisassembler, LLVMPowerPCCodeGen,\r\n    LLVMPowerPCAsmParser, LLVMPowerPCDesc, LLVMPowerPCInfo, LLVMPowerPCAsmPrinter,\r\n    LLVMNVPTXCodeGen, LLVMNVPTXDesc, LLVMNVPTXInfo, LLVMNVPTXAsmPrinter,\r\n    LLVMMSP430CodeGen, LLVMMSP430Desc, LLVMMSP430Info, LLVMMSP430AsmPrinter,\r\n    LLVMMipsDisassembler, LLVMMipsCodeGen, LLVMMipsAsmParser, LLVMMipsDesc,\r\n    LLVMMipsInfo, LLVMMipsAsmPrinter, LLVMHexagonDisassembler, LLVMHexagonCodeGen,\r\n    LLVMHexagonDesc, LLVMHexagonInfo, LLVMCppBackendCodeGen, LLVMCppBackendInfo,\r\n    LLVMARMDisassembler, LLVMARMCodeGen, LLVMARMAsmParser, LLVMARMDesc,\r\n    LLVMARMInfo, LLVMARMAsmPrinter, LLVMAArch64Disassembler, LLVMAArch64CodeGen,\r\n    LLVMAArch64AsmParser, LLVMAArch64Desc, LLVMAArch64Info, LLVMAArch64AsmPrinter,\r\n    LLVMAArch64Utils, LLVMTableGen, LLVMX86Disassembler, LLVMX86AsmParser,\r\n    LLVMMCJIT, LLVMExecutionEngine, LLVMRuntimeDyld, LLVMInstrumentation,\r\n    LLVMX86CodeGen, LLVMX86Desc, LLVMX86Info, LLVMMCDisassembler,\r\n    LLVMX86AsmPrinter, LLVMX86Utils, LLVMSelectionDAG, LLVMAsmPrinter, LLVMLTO,\r\n    LLVMCodeGen, LLVMObjCARCOpts, LLVMLinker, LLVMipo, LLVMVectorize,\r\n    LLVMScalarOpts, LLVMProfileData, LLVMInstCombine, LLVMTransformUtils, LLVMipa,\r\n    LLVMAnalysis, LLVMTarget, LLVMBitWriter, LLVMDebugInfo, LLVMObject,\r\n    LLVMMCParser, LLVMMC, LLVMBitReader, LLVMCore, LLVMLineEditor, LLVMSupport,\r\n    tinfo\r\n    This problem can usually be solved by installing the system packages that\r\n    provide these libraries (you may need the \"-dev\" versions). If the libraries\r\n    are already installed but in a non-standard location then you can use the\r\n    flags --extra-include-dirs= and --extra-lib-dirs= to specify where they are.\r\n    cabal.exe: Error: some packages failed to install:\r\n    llvm-general-3.6.0.0 failed during the configure step. The exception was:\r\n    ExitFailure 1\r\n\r\n(this is after building LLVM using MinGW, and adding the LLVM `bin` directory to my `PATH`)\r\n\r\nThe libraries that it lists as missing are present on my system, for example this is where the `LLVMAsmParser` file that it lists above is:\r\n\r\n    C:\\LLVM-3.6\\llvm-3.6.2.cmake.gcc\\lib\\libLLVMAsmParser.a\r\n\r\nThe LLVM `bin` directory is in my PATH, and invoking `llvm-config --libdir` yields the correct path to these libraries (I state this because I think that `setup.hs` seems to use this information to find the libraries):\r\n\r\n    $ llvm-config --libdir\r\n    C:/LLVM-3.6/llvm-3.6.2.cmake.gcc//lib\r\n\r\nI've tried a number of solutions, but for the most part they give the same error.\r\n\r\nI've tried to add the `extra-include-dirs` options, as per [issue 76](https://github.com/bscarlet/llvm-general/issues/76):\r\n\r\n    $ cabal install ./llvm-general --extra-include-dirs=C:/LLVM-3.6/llvm-3.6.2.cmake.gcc/include --extra-include-dirs=C:/LLVM-3.6/llvm-3.6.2.cmake.gcc/lib \r\n    ...\r\n    (same error)\r\n\r\nI also tried to execute `mingw32-make install` first, as per the same issue.\r\n\r\nI also tried adding `--extra-lib-dirs=C:/LLVM-3.6/llvm-3.6.2.cmake.gcc/lib`, as instructed by the error message itself.\r\n\r\nI also tried defining environment variables `C_INCLUDE_PATH` and `LIBRARY_PATH` to new directories, as per [here](https://github.com/haskell/cabal/issues/2705), and copying the libs and includes into those directories.\r\n\r\nI've also tried manually editing the cabal file to add extra `include-dirs` and `extra-lib-dirs`, as listed in [the Cabal FAQ](https://wiki.haskell.org/Cabal/FAQ) in the section about build errors in Windows. The addition to the cabal file looks like this:\r\n\r\n    ...\r\n    include-dirs: src\r\n    include-dirs: C:/LLVM-3.6/llvm-3.6.2.src/include\r\n    include-dirs: C:/LLVM-3.6/llvm-3.6.2.cmake.gcc/include\r\n\r\n    extra-lib-dirs: C:/LLVM-3.6/llvm-3.6.2.cmake.gcc/lib\r\n    ...\r\n\r\n(and I tried a few variations such as using double-backslash instead of forward slash, using quotes, and grouping all three `include-dirs` into one section with indentation).\r\n\r\nIn the above attempts, I was trying to install llvm-general from code downloaded directly from the llvm-general git repository. But I've also tried to install it from Hackage by just issuing the command `cabal install llvm-general`, including llvm-general versions 3.4.5.4 and 3.5.1.0, with corresponding LLVM versions 3.4 and 3.5.2 respectively. \r\n\r\nI've built LLVM 3.6.2 (and the other versions) using cmake and MinGW (GCC 4.8.1) - and I adjust the PATH each time I changed to try a different version. By default LLVM seems to build the static libraries and executables, and it seems to me that by default `llvm-general` will use statically-linked libraries as well, which is ideal for me. (I did also start down the road of trying to build a shared LLVM library, but the build wasn't successful anyway).\r\n\r\nI also tried with a build of LLVM using Visual Studio 2015. The build went fine, but outputs slightly different static library files, such as \"LLVMAsmParser.lib\" instead of \"libLLVMAsmParser.a\". I can't find any documentation that states which form I actually need. But nevertheless neither has worked so far.\r\n\r\nI apologize if I'm missing something obvious, since I'm new to both Haskell and LLVM, and this is my first Haskell project. I've been struggling to solve this problem for 3 weeks now, and am looking forward to any possible direction.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/bscarlet/llvm-general/issues/comments/150184584","html_url":"https://github.com/bscarlet/llvm-general/issues/156#issuecomment-150184584","issue_url":"https://api.github.com/repos/bscarlet/llvm-general/issues/156","id":150184584,"user":{"login":"bscarlet","id":4196463,"avatar_url":"https://avatars.githubusercontent.com/u/4196463?v=3","gravatar_id":"","url":"https://api.github.com/users/bscarlet","html_url":"https://github.com/bscarlet","followers_url":"https://api.github.com/users/bscarlet/followers","following_url":"https://api.github.com/users/bscarlet/following{/other_user}","gists_url":"https://api.github.com/users/bscarlet/gists{/gist_id}","starred_url":"https://api.github.com/users/bscarlet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bscarlet/subscriptions","organizations_url":"https://api.github.com/users/bscarlet/orgs","repos_url":"https://api.github.com/users/bscarlet/repos","events_url":"https://api.github.com/users/bscarlet/events{/privacy}","received_events_url":"https://api.github.com/users/bscarlet/received_events","type":"User","site_admin":false},"created_at":"2015-10-22T11:20:37Z","updated_at":"2015-10-22T11:20:37Z","body":"No, I think you've got a good case to bring to the Cabal folks now."}}