gap-system / ward

Code generation tool needed for HPC-GAP
Boost Software License 1.0
3 stars 7 forks source link

Ward build fails on Travis CI #29

Closed olexandr-konovalov closed 7 years ago

olexandr-konovalov commented 7 years ago

Duplicate of https://github.com/fingolfin/gap/issues/82 - that is perhaps more relevant here.

In PR https://github.com/fingolfin/gap/pull/81 I am trying to add Travis CI builds with --enable-hpcgap option. Building Lua fails as e.g. in https://travis-ci.org/fingolfin/gap/jobs/211320936 (see below). @rbehrends maybe you have an idea?

+git clone https://github.com/gap-system/ward
Cloning into 'ward'...
remote: Counting objects: 1987, done.
remote: Compressing objects: 100% (40/40), done.
remote: Total 1987 (delta 22), reused 0 (delta 0), pack-reused 1947
Receiving objects: 100% (1987/1987), 6.34 MiB | 0 bytes/s, done.
Resolving deltas: 100% (172/172), done.
Checking connectivity... done.
+cd ward
+./build.sh
SH: rm -rf build
SH: cp -pRf ext build
SH: tools/run-python scons/scons -j 4 -C build/lua-5.1.5 prefix="/home/travis/build/fingolfin/gap/ward/lua" install
scons: Entering directory `/home/travis/build/fingolfin/gap/ward/build/lua-5.1.5'
scons: Reading SConscript files ...
Checking for C library readline... no
Checking for C library dl... no
Checking for C library ncurses... no
Checking for C library m... no
Checking whether linker supports -Wl,-E ... no
scons: done reading SConscript files.
scons: Building targets ...
MakeLuaConf(["include/luaconf.h"], ["src/luaconf.h.in"])
Install file: "src/lauxlib.h" as "/home/travis/build/fingolfin/gap/ward/lua/include/lauxlib.h"
Install file: "src/lua.h" as "/home/travis/build/fingolfin/gap/ward/lua/include/lua.h"
Install file: "etc/lua.hpp" as "/home/travis/build/fingolfin/gap/ward/lua/include/lua.hpp"
gcc -o obj/liolib.o -c -Iinclude -O2 -DLUA_DL_DLOPEN -DLUA_USE_POSIX src/liolib.c
gcc -o obj/lvm.o -c -Iinclude -O2 -DLUA_DL_DLOPEN -DLUA_USE_POSIX src/lvm.c
gcc -o obj/linit.o -c -Iinclude -O2 -DLUA_DL_DLOPEN -DLUA_USE_POSIX src/linit.c
gcc -o obj/print.o -c -Iinclude -O2 -DLUA_DL_DLOPEN -DLUA_USE_POSIX src/print.c
gcc -o obj/lstate.o -c -Iinclude -O2 -DLUA_DL_DLOPEN -DLUA_USE_POSIX src/lstate.c
gcc -o obj/lgc.o -c -Iinclude -O2 -DLUA_DL_DLOPEN -DLUA_USE_POSIX src/lgc.c
gcc -o obj/lparser.o -c -Iinclude -O2 -DLUA_DL_DLOPEN -DLUA_USE_POSIX src/lparser.c
gcc -o obj/lfunc.o -c -Iinclude -O2 -DLUA_DL_DLOPEN -DLUA_USE_POSIX src/lfunc.c
gcc -o obj/lstring.o -c -Iinclude -O2 -DLUA_DL_DLOPEN -DLUA_USE_POSIX src/lstring.c
gcc -o obj/loslib.o -c -Iinclude -O2 -DLUA_DL_DLOPEN -DLUA_USE_POSIX src/loslib.c
gcc -o obj/ldump.o -c -Iinclude -O2 -DLUA_DL_DLOPEN -DLUA_USE_POSIX src/ldump.c
gcc -o obj/lopcodes.o -c -Iinclude -O2 -DLUA_DL_DLOPEN -DLUA_USE_POSIX src/lopcodes.c
gcc -o obj/lua.o -c -Iinclude -O2 -DLUA_DL_DLOPEN -DLUA_USE_POSIX src/lua.c
gcc -o obj/lzio.o -c -Iinclude -O2 -DLUA_DL_DLOPEN -DLUA_USE_POSIX src/lzio.c
gcc -o obj/lobject.o -c -Iinclude -O2 -DLUA_DL_DLOPEN -DLUA_USE_POSIX src/lobject.c
gcc -o obj/ltablib.o -c -Iinclude -O2 -DLUA_DL_DLOPEN -DLUA_USE_POSIX src/ltablib.c
gcc -o obj/ldebug.o -c -Iinclude -O2 -DLUA_DL_DLOPEN -DLUA_USE_POSIX src/ldebug.c
gcc -o obj/loadlib.o -c -Iinclude -O2 -DLUA_DL_DLOPEN -DLUA_USE_POSIX src/loadlib.c
gcc -o obj/lundump.o -c -Iinclude -O2 -DLUA_DL_DLOPEN -DLUA_USE_POSIX src/lundump.c
gcc -o obj/ldblib.o -c -Iinclude -O2 -DLUA_DL_DLOPEN -DLUA_USE_POSIX src/ldblib.c
gcc -o obj/lapi.o -c -Iinclude -O2 -DLUA_DL_DLOPEN -DLUA_USE_POSIX src/lapi.c
gcc -o obj/lmem.o -c -Iinclude -O2 -DLUA_DL_DLOPEN -DLUA_USE_POSIX src/lmem.c
gcc -o obj/lstrlib.o -c -Iinclude -O2 -DLUA_DL_DLOPEN -DLUA_USE_POSIX src/lstrlib.c
gcc -o obj/lcode.o -c -Iinclude -O2 -DLUA_DL_DLOPEN -DLUA_USE_POSIX src/lcode.c
gcc -o obj/lmathlib.o -c -Iinclude -O2 -DLUA_DL_DLOPEN -DLUA_USE_POSIX src/lmathlib.c
gcc -o obj/luac.o -c -Iinclude -O2 -DLUA_DL_DLOPEN -DLUA_USE_POSIX src/luac.c
gcc -o obj/ltm.o -c -Iinclude -O2 -DLUA_DL_DLOPEN -DLUA_USE_POSIX src/ltm.c
gcc -o obj/lbaselib.o -c -Iinclude -O2 -DLUA_DL_DLOPEN -DLUA_USE_POSIX src/lbaselib.c
gcc -o obj/ltable.o -c -Iinclude -O2 -DLUA_DL_DLOPEN -DLUA_USE_POSIX src/ltable.c
gcc -o obj/llex.o -c -Iinclude -O2 -DLUA_DL_DLOPEN -DLUA_USE_POSIX src/llex.c
gcc -o obj/ldo.o -c -Iinclude -O2 -DLUA_DL_DLOPEN -DLUA_USE_POSIX src/ldo.c
gcc -o obj/lauxlib.o -c -Iinclude -O2 -DLUA_DL_DLOPEN -DLUA_USE_POSIX src/lauxlib.c
Install file: "include/luaconf.h" as "/home/travis/build/fingolfin/gap/ward/lua/include/luaconf.h"
Install file: "src/lualib.h" as "/home/travis/build/fingolfin/gap/ward/lua/include/lualib.h"
gcc -o obj/lapi.os -c -Iinclude -O2 -DLUA_DL_DLOPEN -DLUA_USE_POSIX -fPIC src/lapi.c
gcc -o obj/lauxlib.os -c -Iinclude -O2 -DLUA_DL_DLOPEN -DLUA_USE_POSIX -fPIC src/lauxlib.c
gcc -o obj/lbaselib.os -c -Iinclude -O2 -DLUA_DL_DLOPEN -DLUA_USE_POSIX -fPIC src/lbaselib.c
ar rc lib/liblua.a obj/lapi.o obj/lauxlib.o obj/lbaselib.o obj/lcode.o obj/ldblib.o obj/ldebug.o obj/ldo.o obj/ldump.o obj/lfunc.o obj/lgc.o obj/linit.o obj/liolib.o obj/llex.o obj/lmathlib.o obj/lmem.o obj/loadlib.o obj/lobject.o obj/lopcodes.o obj/loslib.o obj/lparser.o obj/lstate.o obj/lstring.o obj/lstrlib.o obj/ltable.o obj/ltablib.o obj/ltm.o obj/lundump.o obj/lvm.o obj/lzio.o obj/print.o
ranlib lib/liblua.a
Install file: "lib/liblua.a" as "/home/travis/build/fingolfin/gap/ward/lua/lib/liblua.a"
gcc -o bin/lua obj/lua.o lib/liblua.a
lib/liblua.a(lmathlib.o): In function `math_tan':
lmathlib.c:(.text+0x9f): undefined reference to `tan'
lib/liblua.a(lmathlib.o): In function `math_tanh':
lmathlib.c:(.text+0xcf): undefined reference to `tanh'
lib/liblua.a(lmathlib.o): In function `math_sqrt':
lmathlib.c:(.text+0x11c): undefined reference to `sqrt'
lib/liblua.a(lmathlib.o): In function `math_sin':
lmathlib.c:(.text+0x13f): undefined reference to `sin'
lib/liblua.a(lmathlib.o): In function `math_sinh':
lmathlib.c:(.text+0x16f): undefined reference to `sinh'
lib/liblua.a(lmathlib.o): In function `math_floor':
lmathlib.c:(.text+0x29f): undefined reference to `floor'
lib/liblua.a(lmathlib.o): In function `math_random':
lmathlib.c:(.text+0x3a5): undefined reference to `floor'
lmathlib.c:(.text+0x3f9): undefined reference to `floor'
lib/liblua.a(lmathlib.o): In function `math_pow':
lmathlib.c:(.text+0x48c): undefined reference to `pow'
lib/liblua.a(lmathlib.o): In function `math_log':
lmathlib.c:(.text+0x50f): undefined reference to `log'
lib/liblua.a(lmathlib.o): In function `math_log10':
lmathlib.c:(.text+0x53f): undefined reference to `log10'
lib/liblua.a(lmathlib.o): In function `math_fmod':
lmathlib.c:(.text+0x60c): undefined reference to `fmod'
lib/liblua.a(lmathlib.o): In function `math_exp':
lmathlib.c:(.text+0x63f): undefined reference to `exp'
lib/liblua.a(lmathlib.o): In function `math_cos':
lmathlib.c:(.text+0x66f): undefined reference to `cos'
lib/liblua.a(lmathlib.o): In function `math_cosh':
lmathlib.c:(.text+0x69f): undefined reference to `cosh'
lib/liblua.a(lmathlib.o): In function `math_ceil':
lmathlib.c:(.text+0x6cf): undefined reference to `ceil'
lib/liblua.a(lmathlib.o): In function `math_atan':
lmathlib.c:(.text+0x6ff): undefined reference to `atan'
lib/liblua.a(lmathlib.o): In function `math_atan2':
lmathlib.c:(.text+0x74c): undefined reference to `atan2'
lib/liblua.a(lmathlib.o): In function `math_asin':
lmathlib.c:(.text+0x77f): undefined reference to `asin'
lib/liblua.a(lmathlib.o): In function `math_acos':
lmathlib.c:(.text+0x7af): undefined reference to `acos'
lib/liblua.a(loadlib.o): In function `ll_loadfunc':
loadlib.c:(.text+0x88a): undefined reference to `dlsym'
loadlib.c:(.text+0x8c9): undefined reference to `dlerror'
loadlib.c:(.text+0x8e9): undefined reference to `dlopen'
loadlib.c:(.text+0x8fc): undefined reference to `dlerror'
lib/liblua.a(loadlib.o): In function `gctm':
loadlib.c:(.text+0xbbc): undefined reference to `dlclose'
lib/liblua.a(lvm.o): In function `Arith':
lvm.c:(.text+0x335): undefined reference to `pow'
lvm.c:(.text+0x364): undefined reference to `floor'
lib/liblua.a(lvm.o): In function `luaV_execute':
lvm.c:(.text+0x223a): undefined reference to `floor'
lvm.c:(.text+0x237a): undefined reference to `pow'
lib/liblua.a(lcode.o): In function `codearith':
lcode.c:(.text+0xf61): undefined reference to `pow'
lcode.c:(.text+0xf89): undefined reference to `floor'
collect2: error: ld returned 1 exit status
scons: *** [bin/lua] Error 1
scons: building terminated because of errors.
Command failed: tools/run-python scons/scons -j 4 -C build/lua-5.1.5 prefix="/home/travis/build/fingolfin/gap/ward/lua" install
rbehrends commented 7 years ago

For some reason, the build cannot find any of the libraries:

Checking for C library readline... no
Checking for C library dl... no
Checking for C library ncurses... no
Checking for C library m... no

Of these, only -lm is essential (that's where the linker errors come from), but it can't find that. Which should be impossible, as the check only tries to compile and link the program int main() { return 0; }.

olexandr-konovalov commented 7 years ago

@rbehrends To compare, it works when built in Jenkins:

+ ./build.sh
scons: Entering directory `/data/gap-jenkins/workspace/GAP-merge-compilers/GAPCOPTS/64build/GAPREADLINE/readline/HPCMODE/hpcgap/label/gcc48/GAP-merge-snapshot/ward/build/lua-5.1.5'
scons: Reading SConscript files ...
Checking for C library readline... yes
Checking for GNU readline headers ... yes
Checking for C library dl... yes
Checking for C header file dlfcn.h... yes
Checking for C library ncurses... yes
Checking for C library m... yes
Checking whether linker supports -Wl,-E ... yes
scons: done reading SConscript files.
scons: Building targets ...
MakeLuaConf(["include/luaconf.h"], ["src/luaconf.h.in"])
...
olexandr-konovalov commented 7 years ago

We have figured out that this is due to different CFLAGS & LDFLAGS, and fixed that by calling

CFLAGS= LDFLAGS= ./build.sh