JuliaLang / julia

The Julia Programming Language
https://julialang.org/
MIT License
45.6k stars 5.48k forks source link

julia doesn't build on Fedora 16 #434

Closed jchia closed 12 years ago

jchia commented 12 years ago

I got the following error:

config.status: executing tools/sample/Makefile commands llvm[3]: Compiling APFloat.cpp for Release build In file included from APFloat.cpp:15: In file included from /home/josh.chia/julia/external/llvm-3.0/include/llvm/ADT/APFloat.h:104: In file included from /home/josh.chia/julia/external/llvm-3.0/include/llvm/ADT/APInt.h:18: In file included from /home/josh.chia/julia/external/llvm-3.0/include/llvm/ADT/ArrayRef.h:13: In file included from /home/josh.chia/julia/external/llvm-3.0/include/llvm/ADT/SmallVector.h:18: In file included from /usr/include/c++/4.6.2/algorithm:61: /usr/include/c++/4.6.2/bits/stl_algobase.h:378:43: error: unexpected type name '_ValueTypeI': expected expression const bool simple = (is_trivial(_ValueTypeI) ^ /usr/include/c++/4.6.2/bits/stl_algobase.h:383:40: error: non-type template argument of type 'const bool' is not an integral constant expression return std::copy_move<_IsMove, simple, ^~~~ ...

Apparently CLANG has som problems. Is there a way to not use CLANG? If not, how do we fix this error? I'm on commit 3c3e0a of julia.

g2boojum commented 12 years ago

Looks like there's an upstream bug for this: https://bugzilla.redhat.com/show_bug.cgi?id=729308.

JeffBezanson commented 12 years ago

Thanks for tracking that down. Is clang the default compiler on fedora 16?

g2boojum commented 12 years ago

I assume that gcc is, but I'm not sure.

JeffBezanson commented 12 years ago

USECLANG=0 is the default for us, so gcc should work. @jchia can you try gcc?

StefanKarpinski commented 12 years ago

We should also make sure to work with Clang, but this appears to be a Clang bug rather than us doing something wrong.

jckarter commented 12 years ago

Clang++ is kind of sensitive in its libstdc++ compatibility. If Fedora also ships with LLVM's libc++, you might try installing that and building with clang++ -stdlib=libc++ instead.

jchia commented 12 years ago

In my Make.inc, I already have USEGCC=1, USECLANG=0. I'm not sure how to keep clang out of the picture. Here's a bigger context of the error messages:

$ make checking for clang... clang checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether clang accepts -g... yes ... config.status: executing projects/Makefile commands config.status: executing bindings/Makefile commands config.status: executing bindings/ocaml/Makefile.ocaml commands === configuring in projects/sample (/home/josh.chia/julia/external/llvm-3.0/projects/sample) configure: running /bin/sh ./configure '--prefix=/home/josh.chia/julia/external/root' '--disable-threads' '--enable-optimized' '--disable-profiling' '--disable-assertions' '--enable-shared' '--enable-targets=x86,x86_64' '--disable-bindings' '--disable-docs' --cache-file=/dev/null --srcdir=. configure: creating ./config.status config.status: creating Makefile.common config.status: executing setup commands config.status: executing Makefile commands config.status: executing lib/Makefile commands config.status: executing lib/sample/Makefile commands config.status: executing tools/Makefile commands config.status: executing tools/sample/Makefile commands llvm[3]: Compiling APFloat.cpp for Release build In file included from APFloat.cpp:15: In file included from /home/josh.chia/julia/external/llvm-3.0/include/llvm/ADT/APFloat.h:104: In file included from /home/josh.chia/julia/external/llvm-3.0/include/llvm/ADT/APInt.h:18: In file included from /home/josh.chia/julia/external/llvm-3.0/include/llvm/ADT/ArrayRef.h:13: In file included from /home/josh.chia/julia/external/llvm-3.0/include/llvm/ADT/SmallVector.h:18: In file included from /usr/include/c++/4.6.2/algorithm:61: /usr/include/c++/4.6.2/bits/stl_algobase.h:378:43: error: unexpected type name '_ValueTypeI': expected expression const bool simple = (is_trivial(_ValueTypeI) ^

JeffBezanson commented 12 years ago

Ah, this gives me an idea. Try making this change:

diff --git a/external/Makefile b/external/Makefile
index baff743..d43607d 100644
--- a/external/Makefile
+++ b/external/Makefile
@@ -69,7 +69,7 @@ llvm-$(LLVM_VER)/configure: llvm-$(LLVM_VER).tar.gz
        touch $@
 $(LLVM_OBJ_SOURCE): llvm-$(LLVM_VER)/configure
        cd llvm-$(LLVM_VER) && \
-       ./configure --prefix=$(abspath $(EXTROOT)) --disable-threads --enable-optimized --disable-profiling --disable-assertions --enable-shared --enable-targets=x86,x86_64 --disable-bindings --disable-docs && \
+       ./configure --prefix=$(abspath $(EXTROOT)) --disable-threads --enable-optimized --disable-profiling --disable-assertions --enable-shared --enable-targets=x86,x86_64 --disable-bindings --disable-docs CC=gcc CXX=g++ && \
        $(MAKE)
 $(LLVM_OBJ_TARGET): $(LLVM_OBJ_SOURCE)
        $(MAKE) -C llvm-$(LLVM_VER) install

I added CC=gcc CXX=g++ to the configure command for llvm.

jchia commented 12 years ago

Jeff's patch seems to work. I could build and start Julia.