llvm-clang

No type named 'unique_ptr' in namespace 'std' when compiling under LLVM/Clang

本小妞迷上赌 提交于 2019-12-18 05:18:12
问题 I'm catching a compile error when attempting to use unique_ptr on Apple platforms with -std=c++11 : $ make c++ -std=c++11 -DNDEBUG -g2 -O3 -fPIC -march=native -Wall -Wextra -pipe -c 3way.cpp In file included ... ./smartptr.h:23:27: error: no type named 'unique_ptr' in namespace 'std' using auto_ptr = std::unique_ptr<T>; ~~~~~^ ./smartptr.h:23:37: error: expected ';' after alias declaration using auto_ptr = std::unique_ptr<T>; According to Marshall Clow, who I consider an expert on the C++

Compiling CUDA with clang

醉酒当歌 提交于 2019-12-17 20:43:08
问题 I am new to LLVM. I heard that clang supports CUDA. How do I compile CUDA using clang? Do I have to make some config changes or include any specific header files? I couldn't find any information on this on the web. Is it possible at all? Right now when I try to compile a dummy cuda program with clang as clang -I /usr/local/cuda/include filename.cu I get the following error unknown type name '__global__' __global__ void nothing(int *A) any help is appreciated! btw i am running it in a mac. 回答1

Clang(LLVM) compile with frameworks

假如想象 提交于 2019-12-17 13:26:52
问题 I am using: clang -ObjC -framework UIKit -o /var/compiled/c /Documents/Source/main.m In OS X terminal. I also tried UIKit.framework, but I am getting Fatal Error: 'UIKit/UIKit.h' not found with both. Any suggestions? Thanks 回答1: Compiling for iOS without using Xcode is not easy. In your case, you're trying to use an iOS framework but you're using neither the iOS toolchain's compiler nor the iOS SDK. If you look at the compile transcript for an Xcode project you'll see some of the flags that

Clang doesn't see basic headers

风流意气都作罢 提交于 2019-12-17 10:56:30
问题 I've tried to compile simple hello world on Fedora 20 with Clang, and I get the following output: d.cpp:1:10: fatal error: 'iostream' file not found #include <iostream> I don't have any idea how to resolve it. 回答1: Point 3 solved the problem for me. 1. Had the same issue, fedora 21::clang 3.5.0: clang++ -std=c++14 -pedantic -Wall test_01.cpp -o test_01 -v 2. ignoring nonexistent directory "/usr/lib/gcc/i686-redhat-linux/4.9.2/include" #include "..." search starts here: #include <...> search

Is it possible to run clang with llc flags

 ̄綄美尐妖づ 提交于 2019-12-14 02:01:09
问题 Is there a way to run the clang and add llc flags ? I want to use "-print-after-all", "-print-before-all", "-debug-only" ... without having to use the .bc file in between. 回答1: Additional arguments can be passed to LLVM's option parser with -mllvm . For your scenario this would look something like this: clang [...] -mllvm -print-after-all 来源: https://stackoverflow.com/questions/37700766/is-it-possible-to-run-clang-with-llc-flags

openmp not linking correctly when compiling with clang

混江龙づ霸主 提交于 2019-12-14 01:28:58
问题 I have built clang 4.0 from source on Ubuntu 16.04 and am trying to compile a simple OpenMP program but receive the following errors. /tmp/test-7f2c7c.o: In function `main': /home/me/sf_shared/test.c:(.text+0x52): undefined reference to `__kmpc_fork_call' /tmp/test-7f2c7c.o: In function `.omp_outlined.': /home/me/sf_shared/test.c:(.text+0xd9): undefined reference to `__kmpc_for_static_init_4' /home/me/sf_shared/test.c:(.text+0x16d): undefined reference to `__kmpc_for_static_fini' clang-4.0:

iOS mixed dynamic framework - bridge objc headers with private module

蓝咒 提交于 2019-12-14 00:22:41
问题 In regards to a "dynamic framework" target, I need to bridge internal (private) objective-c headers to my swift counterparts. From my understanding I need to use a private module. Some of these swift counterparts are bridged back to objective-c using the @objc class TheClass syntax. I've gone ahead and created a module.modulemap and a module.private.modulemap file in a directory under $SRCROOT and added the "necessary" flags to the build settings. SWIFT_INCLUDE_PATHS =>$(SRCROOT)/... I've

-fobjc-nonfragile-abi2 on LLVM compiler 2.0: unknow argument?

ⅰ亾dé卋堺 提交于 2019-12-13 07:27:24
问题 I tried to built my project on Xcode with the LLVM compiler 2.0 and it gives this error: error: unknown argument: '-fobjc-nonfragile-abi2' I'm not familiar with the LLVM compilers, does anyone has a solution? Removing the argument doesn't solve my problem, because my code has errors in that situation. 回答1: That option is no longer necessary as it is the default setting now in the latest version of LLVM. 回答2: From clang man page: % man 1 clang ... Driver Options -Xclang arg Pass arg to the

Error on clang (XCode 5.0.2) with std::functional that has more than three parameter

无人久伴 提交于 2019-12-13 06:21:40
问题 I'm stuck with a problem considering clang's behavior with c++ std::functional implementation. Well first things first: Here is some code that I'm trying to compile under MacOs Mavericks with XCode 5.0.2 #include <functional> #include <ostream> typedef std::function< std::ostream& (const void*, std::ostream&, uint32_t&, bool) > my_fancy_functor; static void doSomething(const my_fancy_functor fcn) { //... do something } This results in a "Semantic Error" that holds the following text: Implicit

llvm Linking CXX shared library ../../lib/libLTO.so undefiened refernece to target

可紊 提交于 2019-12-13 03:46:15
问题 i tried to install tiramisu compiler and once trying install it's sub-modules ( (ISL, LLVM and Halide) by using this command dina@dina-VBox:~/tiramisu$ ./utils/scripts/install_submodules.sh ./ i get the error Done installing isl #### Installing LLVM #### cd .//3rdParty/llvm .//utils/scripts/functions.sh: line 6: cd: .//3rdParty/llvm: No such file or directory and to fix it i used the command shared on the answer here ./utils/scripts/install_submodules.sh $PWD it worked better then the first