Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Julia does not build with gcc 5.0 development versions #10201

Closed
nalimilan opened this issue Feb 14, 2015 · 14 comments
Closed

Julia does not build with gcc 5.0 development versions #10201

nalimilan opened this issue Feb 14, 2015 · 14 comments
Labels
domain:building Build system, or building Julia or its dependencies

Comments

@nalimilan
Copy link
Member

I see this with current release-0.3 branch when building the Fedora package with LLVM 3.5. Looks like we need to backport one or several commits (master builds fine).

gcc -march=x86-64 -m64 -DJL_SYSTEM_IMAGE_PATH="../lib64/julia/sys.ji" -DJULIA_TARGET_ARCH=x86-64 -DSYSTEM_LLVM -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -std=gnu99 -pipe -fPIC -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -O3 -ggdb3 -falign-functions -momit-leaf-frame-pointer -I/builddir/build/BUILD/julia/src -I/builddir/build/BUILD/julia/src/support -I/builddir/build/BUILD/julia/build/usr/include -Wall -Wno-strict-aliasing -fno-omit-frame-pointer -c repl.c -o repl.o
g++ -march=x86-64 -m64 -O3 -ggdb3 -falign-functions -momit-leaf-frame-pointer -I/builddir/build/BUILD/julia/src -I/builddir/build/BUILD/julia/src/support -I/builddir/build/BUILD/julia/build/usr/include -Wall -Wno-strict-aliasing -fno-omit-frame-pointer repl.o -o /builddir/build/BUILD/julia/build/usr/bin/julia -L/builddir/build/BUILD/julia/build/usr/lib64/julia -L/builddir/build/BUILD/julia/build/usr/lib64 -L/builddir/build/BUILD/julia/build/usr/lib64 -ljulia -Wl,-Bdynamic -Wl,--no-whole-archive -ldl -lrt -lpthread -Wl,--export-dynamic -Wl,--version-script=/builddir/build/BUILD/julia/src/julia.expmap -Wl,--no-whole-archive -lunwind-generic -lunwind -L/usr/lib64/llvm -lLLVM-3.5.0 -Wl,-rpath,$ORIGIN/../lib64/julia -Wl,-rpath,$ORIGIN/../lib64 -Wl,-z,origin
/builddir/build/BUILD/julia/build/usr/lib64/libjulia.so: undefined reference to `llvm::TargetRegistry::lookupTarget(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)'
/builddir/build/BUILD/julia/build/usr/lib64/libjulia.so: undefined reference to `llvm::LoopPass::createPrinterPass(llvm::raw_ostream&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
/builddir/build/BUILD/julia/build/usr/lib64/libjulia.so: undefined reference to `llvm::EngineBuilder::selectTarget(llvm::Triple const&, llvm::StringRef, llvm::StringRef, llvm::SmallVectorImpl<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > const&)'
/builddir/build/BUILD/julia/build/usr/lib64/libjulia.so: undefined reference to `llvm::raw_fd_ostream::raw_fd_ostream(char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, llvm::sys::fs::OpenFlags)'

https://copr-be.cloud.fedoraproject.org/results/nalimilan/julia-nightlies/fedora-rawhide-x86_64/julia-0.3.6-0.20150212.fc21/build.log

@tkelman
Copy link
Contributor

tkelman commented Feb 14, 2015

As mentioned here #10058 (comment) I'm pretty sure this is unique to USE_SYSTEM_LLVM or maybe using LLVM as a shared library.

@tkelman
Copy link
Contributor

tkelman commented Feb 14, 2015

I can't reproduce this on Ubuntu 14.04, even using shared-library system LLVM 3.5.0. What's the easiest way to reproduce the copr build environment, Docker container maybe?

@vtjnash
Copy link
Sponsor Member

vtjnash commented Feb 15, 2015

it's perhaps worth noting that llvm35 is not a supported configuration for release-0.3, and llvm36 support is still a work-in-progress on master (#9336)

@tkelman
Copy link
Contributor

tkelman commented Feb 15, 2015

Yes but it appears to be what distributions (Debian, Fedora, probably others) are all using because LLVM 3.3 is no longer available in those repositories.

@nalimilan
Copy link
Member Author

Actually the same error started to appear on master builds today, and I also get it with 0.3.5. I think it may have to do with the introduction of gcc 5.0 in Fedora rawhide. Maybe it's not even related to LLVM 3.5.

A new development version is coming soon, I'll check whether the failure is gone with it. I guess I should file a bug against Fedora/gcc -- except if you think Julia might be doing something wrong that the new gcc merely unveiled.

@nalimilan nalimilan added the domain:building Build system, or building Julia or its dependencies label Feb 15, 2015
@nalimilan nalimilan changed the title release-0.3 does not build with LLVM 3.5 Julia does not build with gcc 5.0 development versions Feb 15, 2015
@nalimilan
Copy link
Member Author

Filed a bug in Fedora, let's see what they say: https://bugzilla.redhat.com/show_bug.cgi?id=1192930

@tkelman
Copy link
Contributor

tkelman commented Feb 16, 2015

Oh, right, I missed the __cxx11 at first glance. I bet it's the GCC 5 ABI change (http://developerblog.redhat.com/2015/02/10/gcc-5-in-fedora/), we probably need to build libjulia with -std=c++11 now. I think llvm-config --cxxflags would have included that but llvm-config --cflags does not.

@nalimilan
Copy link
Member Author

I've tried adding -std=c++11 to calls to all g++ calls, doesn't fix the problem:
https://kojipkgs.fedoraproject.org//work/tasks/406/8950406/build.log

But I may well have missed something.

@tkelman
Copy link
Contributor

tkelman commented Feb 16, 2015

Hrm, maybe -D_GLIBCXX_USE_CXX11_ABI=0 then? (or =1?) Do we know which way the LLVM 3.5 package was built?

@nalimilan
Copy link
Member Author

I think you nailed it. LLVM was built with gcc 4.9, and on Fedora rawhide (to be F23) -D_GLIBCXX_USE_CXX11_ABI=1 is the default now. So the situation is a temporarily broken since packages have not been rebuilt yet, as the focus is on F22 (to be released this spring). The build works fine on F22 where -D_GLIBCXX_USE_CXX11_ABI=0 is still the default. I'm currently rebuilding LLVM with -D_GLIBCXX_USE_CXX11_ABI=1 to see whether Julia builds fine with it on rawhide. If it works then I guess there's no bug.

@nalimilan
Copy link
Member Author

The LLVM build fails on rawhide, so I cannot check. Let's say it works and leave the LLVM Fedora maintainers sort this out.

Do you think adding -std=c++11 would be good anyway, or should we close this bug?

@tkelman
Copy link
Contributor

tkelman commented Feb 16, 2015

We might end up needing it at some point after upgrading to LLVM 3.5, I'm not sure yet.

@nalimilan
Copy link
Member Author

OK, we'll see at that point then.

@nalimilan
Copy link
Member Author

Good news, Julia builds just fine now that LLVM has been rebuilt with -D_GLIBCXX_USE_CXX11_ABI=1. So no changes needed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:building Build system, or building Julia or its dependencies
Projects
None yet
Development

No branches or pull requests

3 participants