Using LLVM with MobaXterm
A simple guide to to getting LLVM to compile in Windows using MobaXterm (and to a lesser extend Cygwin)
**Note: All of the links in this guide open in new windows/tabs.
Setting up the Compilation Environment:
Download MobaXterm from MobaXterm's website here.
Download the following plugins from MobaXterm's Plugins Listing here and place them into your MobaXterm directory:
Gcc, G++, and development tools
(for Compiling LLVM)
Perl
(for Utilities)
Subversion (SVN)
(for the LLVM repository)
Tcl / Tk / Expect
(for the Automated test suite?)
Download the following additional 3rd party plugins from my website here and place them into your MobaXterm directory:
Downloading the Sources:
(see here for details)
Choose a directory were you want to place the LLVM source code.
download the LLVM source code:
cd /path/to/llvm-src-code
svn co https://llvm.org/svn/llvm-project/llvm/trunk llvm
Download the Clang source code:
cd /path/to/llvm-src-code
cd llvm/tools
svn co https://llvm.org/svn/llvm-project/cfe/trunk clang
Compiling LLVM (MobaXterm/Cygwin specific):
Setup the linker to support a large heap size (otherwise debug builds will fail when linking lto and libclang):
peflags --bigaddr=1 /bin/ld
(see here for details)
Setup the build directory:
Choose a directory where you want to compile llvm.
cd /path/to/llvm-build-directory
cmake -DCMAKE_BUILD_TYPE:STRING=Debug /path/to/llvm-source-code
(Change the build type to Release for the non-debug build)
Compiling
make all
make check
peflags --bigaddr=1 /path/to/llvm-build-directory/bin/clang
(for large heap size or it will fail to call its low level driver)
peflags --bigaddr=1 /path/to/llvm-build-directory/bin/clang-x.x
(where x.x is the version number)
Additional Notes:
You will need to run peflags on /bin/ld everytime you start MobaXterm. It would be pertinent to enable a persistent HOME directory in MobaXterm's preferences and add the line to ~/.bash_profile.
You will need to run peflags on clang every time you recompile.
References:
Questions/Comments/Corrections?
See my Contact page.