llvm configuration error

I’ve compiled llvm several times, but this is the first time I saw this error when I was trying to compile it in a cluster.

checking tool compatibility… configure: error: g++|clang++|icc required but not found

I am pretty sure g++ is installed and in the path. I then downloaded clang++ binary and set path. The error was still there.

OS: opensuse 10.1
gcc, g++ version: 4.2.3

Any idea?

Bo

what about icc?

Are you saying this is this the first time you’ve tried to compile it on the cluster?

It’s easy to determine if g++ is installed and in the PATH – just get a console on the cluster and type “g++”. However, AFAIK cluster nodes are not usually configured for software development, are they? Typically you build your code locally and then job it out to the cluster?

Greg

The problem was solved by setting environment variable CXX. But somehow a new one came. The gcc is installed in /usr/local/gcc-4.2.3. I managed to change

clang/lib/Frontend/InitHeaderSearch.cpp

clang/lib/Driver/ToolChains.cpp

to force clang use the crt lib for that version. For details, plz see http://www.advogato.org/person/redi/diary/228.html.

So now I have no problem of using clang to compile a trivial C program of 20 lines. When I tried to compile programs of spec2006, such as bzip2 or mcf, the following erros showed up.

clang spec.o blocksort.o bzip2.o bzlib.o compress.o crctable.o decompress.o huffman.o randtable.o -o bzip2
blocksort.o: In function gnu_dev_major': /usr/include/sys/sysmacros.h:44: multiple definition of gnu_dev_major’
spec.o:/usr/include/sys/sysmacros.h:44: first defined here
blocksort.o: In function gnu_dev_makedev': /usr/include/sys/sysmacros.h:56: multiple definition of gnu_dev_makedev’
spec.o:/usr/include/sys/sysmacros.h:56: first defined here
blocksort.o: In function gnu_dev_minor': /usr/include/sys/sysmacros.h:50: multiple definition of gnu_dev_minor’
spec.o:/usr/include/sys/sysmacros.h:50: first defined here
bzip2.o: In function gnu_dev_major': /usr/include/sys/sysmacros.h:44: multiple definition of gnu_dev_major’
spec.o:/usr/include/sys/sysmacros.h:44: first defined here
bzip2.o: In function gnu_dev_makedev': /usr/include/sys/sysmacros.h:56: multiple definition of gnu_dev_makedev’
spec.o:/usr/include/sys/sysmacros.h:56: first defined here
bzip2.o: In function gnu_dev_minor': /usr/include/sys/sysmacros.h:50: multiple definition of gnu_dev_minor’
spec.o:/usr/include/sys/sysmacros.h:50: first defined here
bzlib.o: In function gnu_dev_major': /usr/include/sys/sysmacros.h:44: multiple definition of gnu_dev_major’
spec.o:/usr/include/sys/sysmacros.h:44: first defined here
bzlib.o: In function gnu_dev_makedev': /usr/include/sys/sysmacros.h:56: multiple definition of gnu_dev_makedev’
spec.o:/usr/include/sys/sysmacros.h:56: first defined here
bzlib.o: In function gnu_dev_minor': /usr/include/sys/sysmacros.h:50: multiple definition of gnu_dev_minor’
spec.o:/usr/include/sys/sysmacros.h:50: first defined here
compress.o: In function gnu_dev_major': /usr/include/sys/sysmacros.h:44: multiple definition of gnu_dev_major’
spec.o:/usr/include/sys/sysmacros.h:44: first defined here
compress.o: In function gnu_dev_makedev': /usr/include/sys/sysmacros.h:56: multiple definition of gnu_dev_makedev’
spec.o:/usr/include/sys/sysmacros.h:56: first defined here
compress.o: In function gnu_dev_minor': /usr/include/sys/sysmacros.h:50: multiple definition of gnu_dev_minor’
spec.o:/usr/include/sys/sysmacros.h:50: first defined here
crctable.o: In function gnu_dev_major': /usr/include/sys/sysmacros.h:44: multiple definition of gnu_dev_major’
spec.o:/usr/include/sys/sysmacros.h:44: first defined here
crctable.o: In function gnu_dev_makedev': /usr/include/sys/sysmacros.h:56: multiple definition of gnu_dev_makedev’
spec.o:/usr/include/sys/sysmacros.h:56: first defined here
crctable.o: In function gnu_dev_minor': /usr/include/sys/sysmacros.h:50: multiple definition of gnu_dev_minor’
spec.o:/usr/include/sys/sysmacros.h:50: first defined here
decompress.o: In function gnu_dev_major': /usr/include/sys/sysmacros.h:44: multiple definition of gnu_dev_major’
spec.o:/usr/include/sys/sysmacros.h:44: first defined here
decompress.o: In function gnu_dev_makedev': /usr/include/sys/sysmacros.h:56: multiple definition of gnu_dev_makedev’
spec.o:/usr/include/sys/sysmacros.h:56: first defined here
decompress.o: In function gnu_dev_minor': /usr/include/sys/sysmacros.h:50: multiple definition of gnu_dev_minor’
spec.o:/usr/include/sys/sysmacros.h:50: first defined here
huffman.o: In function gnu_dev_major': /usr/include/sys/sysmacros.h:44: multiple definition of gnu_dev_major’
spec.o:/usr/include/sys/sysmacros.h:44: first defined here
huffman.o: In function gnu_dev_makedev': /usr/include/sys/sysmacros.h:56: multiple definition of gnu_dev_makedev’
spec.o:/usr/include/sys/sysmacros.h:56: first defined here
huffman.o: In function gnu_dev_minor': /usr/include/sys/sysmacros.h:50: multiple definition of gnu_dev_minor’
spec.o:/usr/include/sys/sysmacros.h:50: first defined here
randtable.o: In function gnu_dev_major': /usr/include/sys/sysmacros.h:44: multiple definition of gnu_dev_major’
spec.o:/usr/include/sys/sysmacros.h:44: first defined here
randtable.o: In function gnu_dev_makedev': /usr/include/sys/sysmacros.h:56: multiple definition of gnu_dev_makedev’
spec.o:/usr/include/sys/sysmacros.h:56: first defined here
randtable.o: In function gnu_dev_minor': /usr/include/sys/sysmacros.h:50: multiple definition of gnu_dev_minor’
spec.o:/usr/include/sys/sysmacros.h:50: first defined here
clang: error: linker command failed with exit code 1 (use -v to see invocation)
gmake: *** [bzip2] Error 1

Any suggestion would be greatly appreciated.

Bo

Your headers are outdated/wrong; as a workaround, you can specify
-std=gnu89 to clang. http://llvm.org/bugs/show_bug.cgi?id=5960 tracks
this issue.

-Eli