llvm

Generate LLVM C++ API code as backend

匿名 (未验证) 提交于 2019-12-03 01:56:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: The Online LLVM demo page had an option to generate LLVM C++ API code as backend from a source code. However, that demo page is now disabled. I was wondering how we can do it ourselves using the available LLVM tools. I tried the following clang++ -c -emit-llvm input.cpp -o input.ll llc -march=cpp -o input.ll.cpp input.ll which gives the following error llc: error: invalid target 'cpp'. I am using LLVM/Clang version 3.2. 回答1: The LLVM C++ backend has to be enabled during configuration when building LLVM. It's enabled by default in the

How to cross-compile clang/llvm for iOS?

匿名 (未验证) 提交于 2019-12-03 01:48:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: How to cross-compile clang/llvm for iOS? I need to get libclang (.a or .dylib i believe) to use it via C API in my iOS app. 回答1: # Get LLVM/Clang mkdir llvm curl -O http://llvm.org/releases/3.4/llvm-3.4.src.tar.gz tar xzfv llvm-3.4.src.tar.gz cd llvm-3.4/tools/ curl -O http://llvm.org/releases/3.4/clang-3.4.src.tar.gz tar xzfv clang-3.4.src.tar.gz mv clang-3.4 clang cd .. # Assuming Xcode 5.1 (LLVM 3.5+ requires -stdlib=libc++ as well) export CC="clang -arch armv7 -mios-version-min=5.0 -isysroot /Applications/Xcode.app/Contents/Developer

Error enabling openmp - “ld: library not found for -lgomp” and Clang errors

匿名 (未验证) 提交于 2019-12-03 01:45:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm trying to get openmp to run in my program on Mavericks, however when I try to compile using the flag -fopenmp I get the following error: ld : library not found for - lgomp clang : error : linker command failed with exit code 1 ( use - v to see invocation ) The command I am running is: gcc myProgram . cpp - fopenmp - o myProgram Also, when I run gcc I get Clang warnings which I find to be very strange. And looking into /usr/bin/gcc it does not appear to link to Clang. Any suggestions on how to fix my Clang errors and get openmp

clang segfaults when compiling LLVM IR

匿名 (未验证) 提交于 2019-12-03 01:40:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to compile a LLVM IR file. However, when I try to compile it, I get this stack trace: warning: overriding the module target triple with x86_64-pc-linux-gnu [-Woverride-module] #0 0x00007f415c9179fa llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/usr/lib/llvm-6.0/bin/../lib/libLLVM-6.0.so.1+0x8549fa) #1 0x00007f415c915c76 llvm::sys::RunSignalHandlers() (/usr/lib/llvm-6.0/bin/../lib/libLLVM-6.0.so.1+0x852c76) #2 0x00007f415c915dab (/usr/lib/llvm-6.0/bin/../lib/libLLVM-6.0.so.1+0x852dab) #3 0x00007f415fc65890 __restore_rt (/lib/x86

code examples for learning LLVM backend programming

匿名 (未验证) 提交于 2019-12-03 01:40:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am learning programming LLVM backends. Currently I am interested in analysis passes, later program transformations. (I assume as I will be more fluent with analysis then will be time for program transformations). Could you recommend resources for learning ? (I know LLVM Programmers manual and Dragon Book ;) ). By resources I mean not only tutorials, books, but especially small well-written projects . I'd like to read code examples , compile them and play with them (hack a little bit) to learn more about practical implementation.

Running LLVM file, generated with rustc, with clang

匿名 (未验证) 提交于 2019-12-03 01:39:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to run a .ll file with clang and getting linker errors. I have a file test.rs that simply includes a main function with a println! statement. I generate the LLVM IR with the command rustc --emit=llvm-ir --crate-type=bin test.rs . When I try to run the output test.ll file with clang test.ll I get a linker error: Undefined symbols for architecture x86_64: "std::io::stdio::_print::h178318b95760562a", referenced from: rust_test::main::h84a9713c734a1b45 in rust_test-9ea667.o "_main", referenced from: implicit entry/start for main

Error installing Numba on OS X

匿名 (未验证) 提交于 2019-12-03 01:31:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm unable to install Numba (via pip) on my OS X system. I'm using Python: 2.7.11 (Homebrew) pip: 8.1.1 setuptools: 20.6.7 OS X: 10.11.4 (x86_64) Xcode: 7.3 Xcode CLT: 7.3.0.0.1.1457485338 Clang: 7.3 build 703 and have installed the prerequisites (I think) with brew install llvm git clone https://github.com/numba/llvmlite cd llvmlite LLVM_CONFIG=/usr/local/opt/llvm/bin/llvm-config python setup.py install cd .. rm -rf llvmlite and also tried brew install llvm brew link --force llvm # later: brew unlink llvm cd /usr/local/Cellar/llvm/X.X.X

llvm-gcc-4.2: error

匿名 (未验证) 提交于 2019-12-03 01:30:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: The Project build & runs fine on a real device but a build for the iphone simulator finishes in this error 'llvm-gcc-4.2: error'. Any ideas? llvm - gcc - 4.2 : error trying to exec '/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/../llvm-gcc-4.2/bin/arm-apple-darwin10-llvm-gcc-4.2' : execvp : No such file or directory Command / Developer / Platforms / iPhoneSimulator . platform / Developer / usr / bin / llvm - gcc - 4.2 failed with exit code 255 thx, Fabian 回答1: The first thing to do when things don't make sense is

How to use clang/llvm with Eclipse CDT

匿名 (未验证) 提交于 2019-12-03 01:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Is it possible to use Clang/LLVM with Eclipse CDT and if so, how is it configured to actually make it work? 回答1: I am the main author of the (only) LLVM plug-in for Eclipse CDT. It is still in development so might not be suitable for production environment yet. However feel free to test it to find out if it is suitable for your needs. https://github.com/TuononenP/llvm4eclipsecdt UPDATE The latest version is available via official Eclipse update site: http://download.eclipse.org/releases/mars It is under Programming Languages and is

Is OpenMP available in High Sierra LLVM?

匿名 (未验证) 提交于 2019-12-03 01:27:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: In the default LLVM provided by Apple in macOS 10.13, High Sierra, is OpenMP finally available? It has been available in main LLVM for more than a year now. (another way to ask the question might be what version of LLVM is the new Apple LLVM based on) 回答1: Standard Apple's clang supports OpenMP. They just disabled the driver option. But you can use the frontend option instead this way: clang -Xclang -fopenmp -I -L -lomp Also, you need to set DYLD_LIBRARY_PATH environmental variable: export DYLD_LIBRARY_PATH= How to get/build libomp