flammie / omorfi

Open morphology for Finnish
Other
84 stars 25 forks source link

Centos7 compilation fails due to undefined reference HfstTranducer::lookup_fd #57

Closed TuulaP closed 6 years ago

TuulaP commented 6 years ago

From #56 got bit forwards, but now getting a new error

export PKG_CONFIG_PATH=/work/bin/hfst_v3.14.0/lib/pkgconfig

./configure --prefix=$OMOPATH --with-hfst=/work/bin/hfst_v3.14.0/bin --enable-ftb3 --enable-segmenter --enable-hyphenator --enable-lemmatiser

but something new pops up, and compilation ends to this:

make[1]: Entering directory `/data/tmp/git_asenn2018/omorfi'
Making all in src
make[2]: Entering directory `/data/tmp/git_asenn2018/omorfi/src'
/bin/sh ../libtool  --tag=CXX   --mode=compile g++ -std=gnu++11 -DHAVE_CONFIG_H -I. -I..     -g -O2 -I/work/bin/hfst_v3.14.0/include/hfst/   -g -O2 -MT cpp/libomorfi_la-omorfi.lo -MD -MP -MF cpp/.deps/libomorfi_la-omorfi.Tpo -c -o cpp/libomorfi_la-omorfi.lo `test -f 'cpp/omorfi.cc' || echo './'`cpp/omorfi.cc
libtool: compile:  g++ -std=gnu++11 -DHAVE_CONFIG_H -I. -I.. -g -O2 -I/work/bin/hfst_v3.14.0/include/hfst/ -g -O2 -MT cpp/libomorfi_la-omorfi.lo -MD -MP -MF cpp/.deps/libomorfi_la-omorfi.Tpo -c cpp/omorfi.cc  -fPIC -DPIC -o cpp/.libs/libomorfi_la-omorfi.o
libtool: compile:  g++ -std=gnu++11 -DHAVE_CONFIG_H -I. -I.. -g -O2 -I/work/bin/hfst_v3.14.0/include/hfst/ -g -O2 -MT cpp/libomorfi_la-omorfi.lo -MD -MP -MF cpp/.deps/libomorfi_la-omorfi.Tpo -c cpp/omorfi.cc -o cpp/libomorfi_la-omorfi.o >/dev/null 2>&1
mv -f cpp/.deps/libomorfi_la-omorfi.Tpo cpp/.deps/libomorfi_la-omorfi.Plo
/bin/sh ../libtool  --tag=CXX   --mode=link g++ -std=gnu++11  -g -O2 -I/work/bin/hfst_v3.14.0/include/hfst/   -g -O2 -no-undefined -version-info 0:0:0 -L/work/bin/hfst_v3.14.0/lib -lhfst    -o libomorfi.la -rpath /work/bin/omorfiversiot/06062018/lib cpp/libomorfi_la-omorfi.lo
libtool: link: g++  -fPIC -DPIC -shared -nostdlib /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crti.o /usr/lib/gcc/x86_64-redhat-linux/4.8.5/crtbeginS.o  cpp/.libs/libomorfi_la-omorfi.o   -Wl,-rpath -Wl,/work/bin/hfst_v3.14.0/lib -Wl,-rpath -Wl,/work/bin/hfst_v3.14.0/lib -L/work/bin/hfst_v3.14.0/lib /work/bin/hfst_v3.14.0/lib/libhfst.so -lpthread -ldl -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5 -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/x86_64-redhat-linux/4.8.5/crtendS.o /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crtn.o  -O2 -O2   -Wl,-soname -Wl,libomorfi.so.0 -o .libs/libomorfi.so.0.0.0
libtool: link: (cd ".libs" && rm -f "libomorfi.so.0" && ln -s "libomorfi.so.0.0.0" "libomorfi.so.0")
libtool: link: (cd ".libs" && rm -f "libomorfi.so" && ln -s "libomorfi.so.0.0.0" "libomorfi.so")
libtool: link: ar cru .libs/libomorfi.a  cpp/libomorfi_la-omorfi.o
libtool: link: ranlib .libs/libomorfi.a
libtool: link: ( cd ".libs" && rm -f "libomorfi.la" && ln -s "../libomorfi.la" "libomorfi.la" )
g++ -std=gnu++11 -DHAVE_CONFIG_H -I. -I..     -g -O2 -I/work/bin/hfst_v3.14.0/include/hfst/   -g -O2 -MT cpp/omorfi_lookup-omorfi-lookup.o -MD -MP -MF cpp/.deps/omorfi_lookup-omorfi-lookup.Tpo -c -o cpp/omorfi_lookup-omorfi-lookup.o `test -f 'cpp/omorfi-lookup.cc' || echo './'`cpp/omorfi-lookup.cc
mv -f cpp/.deps/omorfi_lookup-omorfi-lookup.Tpo cpp/.deps/omorfi_lookup-omorfi-lookup.Po
/bin/sh ../libtool  --tag=CXX   --mode=link g++ -std=gnu++11  -g -O2 -I/work/bin/hfst_v3.14.0/include/hfst/   -g -O2   -o omorfi-lookup cpp/omorfi_lookup-omorfi-lookup.o libomorfi.la -L/work/bin/hfst_v3.14.0/lib -lhfst
libtool: link: g++ -std=gnu++11 -g -O2 -I/work/bin/hfst_v3.14.0/include/hfst/ -g -O2 -o .libs/omorfi-lookup cpp/omorfi_lookup-omorfi-lookup.o  ./.libs/libomorfi.so -L/work/bin/hfst_v3.14.0/lib /work/bin/hfst_v3.14.0/lib/libhfst.so -lpthread -ldl -Wl,-rpath -Wl,/work/bin/omorfiversiot/06062018/lib -Wl,-rpath -Wl,/work/bin/hfst_v3.14.0/lib
./.libs/libomorfi.so: undefined reference to `hfst::HfstTransducer::lookup_fd(std::string const&, long) const'
collect2: error: ld returned 1 exit status
make[2]: *** [omorfi-lookup] Error 1
make[2]: Leaving directory `/data/tmp/git_asenn2018/omorfi/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/data/tmp/git_asenn2018/omorfi'
make: *** [all] Error 2
flammie commented 6 years ago

It seems to me like it should work (as it works on travis and my computer) but maybe current hfst developers know something more, I'll try to work around a bit since it could be improved.

flammie commented 6 years ago

I have added a mechanism to disable the c++-based tools for now, they are not as advanced as python-based ones and they do not yet have significant efficiency gains either. Add --without-cpp to configure should fix the centos compilation if it's not otherwise easily resolved.

TuulaP commented 6 years ago

Thanks, great it worked now! ☕️

Anyhow I had to drop the --enable-hyphenator, as with it, compilation ended to this error:

/work/bin/hfst_v3.14.0/bin/hfst-fst2fst  -f olw generated/temporary.accept.hfst -o generated/omorfi.accept.hfst
cp -v tokeniser/omorfi.tokenise.pmatch generated/omorfi.tokenise.pmatch
‘tokeniser/omorfi.tokenise.pmatch’ -> ‘generated/omorfi.tokenise.pmatch’
hfst-pmatch2fst  -i generated/omorfi.tokenise.pmatch > generated/omorfi.tokenise.pmatchfst
terminate called after throwing an instance of 'HfstException'
/bin/sh: line 1: 26825 Aborted                 hfst-pmatch2fst -i generated/omorfi.tokenise.pmatch > generated/omorfi.tokenise.pmatchfst
make[2]: *** [generated/omorfi.tokenise.pmatchfst] Error 134
make[2]: Leaving directory `/data/tmp/git_asenn2018/omorfi/src'
make[1]: *** [all-recursive] Error 1

but I'll experiment a bit with different configuration options, so I can proceed, thanks a million!

flammie commented 6 years ago

The hyphenator hasn't been developed much recently, it seems that the old dictionary-based solution is too heavy to be used at all, the rules without dictionary should compile however, and typically this error can be fixed by make clean && make when it's caused by broken make creating corrupt or empty automata binaries.