-
Notifications
You must be signed in to change notification settings - Fork 12
Build llvmlite with MSYS2
valtron edited this page May 18, 2017
·
1 revision
This assumes you have set up MSYS2 and you have LLVM installed in $LLVM
. Replace all paths accordingly.
- Download llvmlite source into
$SRC
- Edit
$SRC/ffi/build.py
:- Change
subprocess.check_call(['cmake', ...
tosubprocess.check_call(['cmake', '-G', generator, '-D', 'LLVM_DIR=$LLVM/lib/cmake/llvm', cmake_dir])
- Before
print("Trying generator %r" % (generator,))
, addgenerator = 'MinGW Makefiles'
- Change
shutil.copy(os.path.join(build_dir, config, 'llvmlite.dll'), target_dir)
toshutil.copy(os.path.join(build_dir, 'libllvmlite.dll'), os.path.join(target_dir, 'llvmlite.dll'))
- Change
- Edit
$SRC/ffi/CMakeLists.txt
:- After
llvm_map_components_to_libnames(llvm_libs all)
, add linelist(REMOVE_ITEM llvm_libs "LTO")
- After
- Create
$SRC/build.sh
PATH="/c/Windows/system32:$DEV/msys64/mingw64/bin" PYTHON="wherever your python.exe happens to be" $PYTHON setup.py build $PYTHON setup.py install
cd $SRC
- Run
sh build.sh
-
cd ..
; run tests:python -m llvmlite.tests