unable to build cuda 7.0 samples on linux with clang - linux

I'm trying to build cuda samples version 7.0 on linux (redhat 7) using clang. Cuda 5.5, 6.0, 6.5 samples can be successfully built with clang, but when i'm trying to build 7.0 samples - the following error appears:
/usr/local/cuda-7.0/bin/nvcc -ccbin /usr/local/bin/clang++ -I../../common/inc -m64 -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -o simplePrintf.o -c simplePrintf.cu
nvcc fatal : Host compiler targets unsupported OS.
make: *** [simplePrintf.o] Error 1
My params from makefile:
HOST_COMPILER=/usr/local/bin/clang++
TARGET_OS=linux
TARGET_ARCH=x86_64
HOST_ARCH=x86_64
Any help would be appreciated.
Thanks.

clang isn't a supported compiler on linux for CUDA.
You can discover the supported configurations here

As pointed out, clang is not supported. In my case, changing it to usr/bin/g++ did the trick.

Related

How to install Mingw-w64 cross compiler GNU 7.3.0 on linux

How to install Mingw-w64 cross compiler GNU 7.3.0 on linux?
I could install it for C Compiler and CXX Compiler the GNU version 4.9.0. But the does not work with this version.
Edit:
if I run CMake (cmake -DCMAKE_TOOLCHAIN_FILE=/home/mingw/toolchain.mingw64.cmake ../src-gen) I get the following output below.
x86_64-w64-mingw32-g++: error: unrecognized command line option -std=c++14
If I run all this commands on Windows 10 with Mingw 64 GNU 7.3.0 with Msys64 could be generated and the build runs without errors.
I thought, the problem is the version from my compiler in Linux?

How to modify the DWARF version of G++ compiled debugging information

I'm compiling a library using g++, using following parameters:
g++ -gdwarf-2 -std=c++0x -m32 -Dunix=1 -Dlinux=1 -D_JAVA=1 -DNDEBUG=1 -I...
Although I'm using specific DWARF version 2, the investigation of my core-file keeps on giving following error message:
Dwarf Error: wrong version in compilation unit header (is 4, should be 2)
Does anybody know what I can do?
I'm working with following versions:
Platform version : CentOS 5.2
g++ version : g++ (GCC) 4.1.1 20070105 (Red Hat 4.1.1-52)
gdb version : GNU gdb Red Hat Linux (6.5-37.el5rh)
It is not possible to update the platform.
For your information: meanwhile I've found this URL (http://www.delorie.com/gnu/docs/gdb/gdb_17.html), which explains that sometimes it might be a bad idea to mix debugging information with optimisation flags.
As a result, I have removed the optimisation flag (although it was "-O0", and I have used "g++ -gdwarf-2 -g3" (as mentioned in the URL), but still no improvement.
Meanwhile I've solved the problem, by updating my GDB (and related) processes.

clang++ as drop-in g++ replacement

I'm trying to use clang++ as drop-in replacement for G++. I'm compiling for AArch64, but for linking, clang seems to invoke the native (x86) /usr/bin/ld instead of that from AArch64 GCC suite. The clang command line looks like:
clang++ -target aarch64-linux-gnu -v \
-gcc-toolchain /path/to/aarch64/gcc \
--sysroot=/path/to/aarch64/gcc/aarch64-linux-gnu/libc \
<some other options> <obj files>
And from the verbose output, I get:
Ubuntu clang version 3.4-1ubuntu3 (tags/RELEASE_34/final) (based on LLVM 3.4)
Target: aarch64--linux-gnu
Thread model: posix
Found candidate GCC installation: /path/to/aarch64/gcc/lib/gcc/aarch64-linux-gnu/4.9.3
Selected GCC installation: /path/to/aarch64/gcc/lib/gcc/aarch64-linux-gnu/4.9.3
"/usr/bin/ld" --sysroot=/path/to/aarch64/gcc/aarch64-linux-gnu/libc ...
I don't get why clang got around choosing the native linker. The link fails for obvious reasons that object files are AArch64 ELF. Compilation lines similar to the above, but they go OK.
Any thoughts?
PS: I'm a novice clang user
I managed to find a solution: GCC accepts -B option to point to the search path where it'd try to locate the utilities. It turns out--although not documented--that clang too accepts this option. For me, having -B point to AArch64 binutils solved the problem. Another suggestion was to add the AArch64 binutils in $PATH.

GCC keeps saying -mfpu=neon is an unrecognoized command

I am compiling code to run on an arm neon and the make files have the following command line included.
-mcpu=cortex-a9 -march=armv7 -mfpu=neon -DARM_NEON
The details of GCC version are as follows:
gcc (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4
However when I try to compile, gcc keeps throwing the following error:
gcc: warning: '-mcpu=' is deprecated; use '-mtune=' or '-march=' instead
gcc: error: unrecognized command line option '-mfpu=neon'
I am pretty sure that the code could be compiled previously. Though a long time ago. Could it be changes in version of GCC? or is it do with 32 bit and 64 bit compilers?
I was trying to cross compile for an arm processor on my intel x86_64 Ubuntu machine. I needed to add the configuration for the host in the makefiles and use arm-linux-gnueabihf-gcc instead of gcc.

how to cross compile zthread for ios 5.1

how to cross compile zthread for ios 5.1 , any one can help me ?
http://www.cnblogs.com/maadiah/archive/2012/04/06/2434591.html
and
http://www.haogongju.net/art/1382733
i try the links way , but fail with this error.
./configure --prefix=/usr/local/iphone --build=arm-apple-darwin10 --enable-static=yes --enable-shared=no CC=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc CFLAGS="-arch armv7 -pipe -mdynamic-no-pic -std=c99 -Wno-trigraphs -fpascal-strings -O2 -Wreturn-type -Wunused-variable -fmessage-length=0 -fvisibility=hidden -miphoneos-version-min=3.2 -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/usr/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk" CPP=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-g++-4.2 AR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ar LDFLAGS="-arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk -miphoneos-version-min=3.2"
got the errorlog :
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.9~22/src/configure --disable-checking --enable-werror --prefix=/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.9~22/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
llvm-g++-4.2: error trying to exec '/usr/bin/../llvm-gcc-4.2/bin/arm-apple-darwin11-llvm-g++-4.2': execvp: No such file or directory
configure:2222: error: C++ compiler cannot create executables
all log is :
I also experienced this error for another project. It's because now Xcode 4.3 became an app installed in the /Applications folder (and no more under /Developer) and all paths changed.
First: did you install the Xcode Command-Line tools? You can verify it opening the menu "XCode-->Preferences-->Downloads".
After having installed them, you should find all the compiler commands under:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/llvm-gcc-4.2/bin/

Resources