[LLVMdev] Compiling Kaleidoscope on Windows

Óscar Fuentes ofv at wanadoo.es
Sun Jan 31 06:21:00 PST 2010


Russell Wallace <russell.wallace at gmail.com> writes:

> I don't suppose anyone knows what (or how to find out what) the actual
> command to compile Kaleidoscope is? I followed cmake/nmake down
> through maybe half a dozen levels before getting lost, so I tried to
> develop a compiler invocation from scratch. I got as far as
>
> cl /EHsc /I\d\llvm-2.6\include /I\llvm\include /wd4355 toy.cpp
>
> which successfully generated toy.obj and spat out 86 link time error
> messages -- as expected, it needs the libraries specified.
> cmakelists.txt says set(LLVM_LINK_COMPONENTS core jit interpreter
> native) so I made a guess at the .lib file corresponding to the first
> of these, and tried
>
> cl /EHsc /I\d\llvm-2.6\include /I\llvm\include /wd4355 toy.cpp
> \llvm\lib\llvmcore.lib
>
> in the hope that the number of link time error messages would go
> down... but it actually goes up to 395, and the earlier ones don't
> obviously have anything to do with llvm itself. Any ideas? The first
> few error messages are

Sadly, nmake can't be told to show the full command they execute for
makefiles generated with cmake. Otherwise it would be obvious to know
the involved steps for building a component.

First of all, use /MDd (for debug builds) or /MD (for release builds) on
the command line. The required LLVM libraries can be listed using the
`llvm-config' script on Unix or MinGW. The dependencies are listed too
in

%LLVMSourceRoot%/cmake/modules/LLVMLibDeps.cmake

bus as this is a bit inconvenient to read, here they are for you:

 -lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMMCParser
 -lLLVMX86AsmPrinter -lLLVMX86CodeGen -lLLVMSelectionDAG
 -lLLVMAsmPrinter -lLLVMX86Info -lLLVMInterpreter -lLLVMJIT
 -lLLVMExecutionEngine -lLLVMCodeGen -lLLVMScalarOpts -lLLVMInstCombine
 -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMTarget -lLLVMMC
 -lLLVMCore -lLLVMSupport -lLLVMSystem

Rename -lLIBRARYNAME to \llvm\lib\LIBRARYNAME.lib

HTH.




More information about the llvm-dev mailing list