JuliaInterop / Cxx.jl

The Julia C++ Interface
Other
760 stars 107 forks source link

How to build Cxx on Travis #385

Closed wbhart closed 4 years ago

wbhart commented 6 years ago

Does anyone know how to build Cxx on Travis (as a prereq for another project).

As Cxx is building, I get a lot of "g++: internal compiler error: Killed (program cc1plus)" errors, which presumably indicates it is running out of memory and or trying to use too many cores.

Is this a known issue? Is there a known workaround?

wbhart commented 6 years ago

We discovered that one has to use a flag to make use of prebuilt binaries. However, Cxx still needs to build a small component, which fails to link on Linux, with the message below. We are installing the version of binutils needed and setting the path, as specified in the .travis.yml file for Cxx.jl. But the linker still fails.

g++-6 -shared -fPIC -Lbuild/clang-3.9.1/lib -L/home/travis/julia/bin/../lib -L/home/travis/julia/bin/../lib/julia -ljulia-debug -lLLVM -o usr/lib/libcxxffi-debug.so -Wl,--whole-archive -lclangFrontendTool -lclangBasic -lclangLex -lclangDriver -lclangFrontend -lclangParse -lclangAST -lclangASTMatchers -lclangSema -lclangAnalysis -lclangEdit -lclangRewriteFrontend -lclangRewrite -lclangSerialization -lclangStaticAnalyzerCheckers -lclangStaticAnalyzerCore -lclangStaticAnalyzerFrontend -lclangTooling -lclangToolingCore -lclangCodeGen -lclangARCMigrate -lclangFormat -Wl,--no-whole-archive build/bootstrap.o 
/usr/bin/x86_64-linux-gnu-ld: build/clang-3.9.1/lib/libclangBasic.a(Targets.cpp.o): unrecognized relocation (0x2a) in section `.text._ZNK12_GLOBAL__N_113PPCTargetInfo32useFloat128ManglingForLongDoubleEv'
/usr/bin/x86_64-linux-gnu-ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
make: *** [usr/lib/libcxxffi.so] Error 1
make: *** Waiting for unfinished jobs....
/usr/bin/x86_64-linux-gnu-ld: build/clang-3.9.1/lib/libclangBasic.a(Targets.cpp.o): unrecognized relocation (0x2a) in section `.text._ZNK12_GLOBAL__N_113PPCTargetInfo32useFloat128ManglingForLongDoubleEv'
/usr/bin/x86_64-linux-gnu-ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
make: *** [usr/lib/libcxxffi-debug.so] Error 1
wbhart commented 6 years ago

Here is our .travis.yml, in case anyone can spot what we are missing:

https://github.com/wbhart/Singular.jl/blob/master/.travis.yml

wbhart commented 6 years ago

I think the relative path build/clang-3.9.1/lib may be incorrect when Cxx is built from another package. Perhaps it needs to be made an absolute path when building libcxxffi.so?

Gnimuc commented 5 years ago

Cxx's build system has been switched to BB2. Now it uses pre-built binaries on Travis.

Gnimuc commented 4 years ago

Now, source-build has also been improved in #450, which means it's possible to build on CI.