Jump to content
OpenSplice DDS Forum
mrwangxc

Compilation fails with gcc/g++ 5.3.1 (ubuntu 16.04)

Recommended Posts

mrwangxc   

Trying to compile the openslice 6.7.170523OSS src using a gcc 5.3.1 (default compiler in Ubuntu 16.04) ends up failing with the following message:
make[5]: Entering directory '/home/worker/project/VortexOpenSplice/src/tools/idlpp/bld/x86_64.linux-release'
gcc -static-libgcc -L/home/worker/project/VortexOpenSplice/lib/x86_64.linux-release -std=c99 -D_GNU_SOURCE -DOSPL_LINUX -O3 -fno-strict-aliasing -flto -DNDEBUG -Wall -W -Wno-long-long -Wno-variadic-macros -Werror=uninitialized -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -DDO_HOST_BY_NAME -Wconversion idl_base.o idl_genLiteHelper.o idl_genCxxStreamsImpl.o idl_walk.o idl_registerType.o idl_genLiteISOCxxCopyin.o idl_catsDef.o idl_streamsDef.o idl_genC99Helper.o idl_genSacMeta.o idl_tmplExp.o idl_genCorbaCxxCopyin.o idl_genSajMeta.o idl_genSajType.o idl_genSajHolder.o idl_parser.o idl_genMetaHelper.o idl_genSACSSplDcps.o idl_genISOCxx2Copyout.o idl_genSACSType.o idl_map.o idl_typeSpecifier.o idl_genSACPPType.o idl_genSacTypedClassDefs.o idl_genC99Copyout.o idl_genSplHelper.o idl_genCxxStreamsDefs.o idl_genTypeSize.o idl_genJavaHelper.o idl_genCxxTypedClassImpl.o idl_genIdlHelper.o idl_fileMap.o idl_genISOCxxHeader.o idl_genSacType.o idl_genSACSHelper.o idl_genCxxStreamsIdl.o idl_stacDef.o idl_genSpliceType.o idl_genFaceISOCxx2Tmpl.o idl_scope.o idl_sematicRules.o idl_genISOCxx2Helper.o idl_genSACPPTypeImpl.o idl_genC99Tmpl.o idl_genCorbaCCopyout.o idl_genIdl.o idl_genISOCxx2Header.o idl_dependencies.o idl_genCorbaCHelper.o idl_genLiteCxxCopyout.o idl_genCorbaCCopyin.o idl_main.o idl_genC99Type.o idl_genCorbaJavaHelper.o idl_genCorbaCxxStreamsCcpp.o idl_genCxxTypedClassDefs.o idl_genLiteCxxCopyin.o idl_genCorbaCxxHelper.o idl_genSpliceLoad.o idl_databaseValidation.o idl_keyDef.o idl_dll.o idl_constSpecifier.o idl_genSpliceLiteType.o idl_genSacObjectControl.o idl_genISOCxx2Type.o idl_genCHelper.o idl_genSACPPTypedClassDefs.o idl_genSACSTypedClassDefs.o idl_genLiteISOCxxCopyout.o idl_unsupported.o idl_genTypeDescriptors.o idl_genCxxHelper.o idl_genCorbaCxxCcpp.o idl_genSACPPTypedClassImpl.o idl_genCorbaCxxCopyout.o idl_genSacHelper.o idl_genLanguageHelper.o idl_genSacTypedClassImpl.o idl_genSajTypedClass.o idl_genSpliceDep.o idl_genFaceJava.o -lc -lm -ldl -lpthread -lrt -lddscpp -lddshts -o idlpp
/tmp/ccLuKydl.ltrans0.ltrans.o:In function ‘idl_base_yyparse’:
:(.text+0xcfd4):undefined reference to ‘preprocess_getc’
/tmp/ccLuKydl.ltrans2.ltrans.o:In function ‘idl_parseFile’:
:(.text+0x523c):undefined reference to ‘preprocess’
/tmp/ccLuKydl.ltrans6.ltrans.o:In function ‘main’:
:(.text.startup+0x2c):undefined reference to ‘init_preprocess’
:(.text.startup+0x582):undefined reference to ‘Ifile’
:(.text.startup+0xe92):undefined reference to ‘Ifile’
:(.text.startup+0x15d0):undefined reference to ‘init_preprocess’
:(.text.startup+0x1619):undefined reference to ‘Ifile’
/tmp/ccLuKydl.ltrans26.ltrans.o:In function ‘addDefine.lto_priv.705’:
:(.text+0xa05):undefined reference to ‘define’
collect2: error: ld returned 1 exit status
/home/worker/project/VortexOpenSplice/setup/makefiles/target-only.mak:110: recipe for target 'idlpp' failed
make[5]: *** [idlpp] Error 1
make[5]: Leaving directory '/home/worker/project/VortexOpenSplice/src/tools/idlpp/bld/x86_64.linux-release'
makefile:7: recipe for target 'all' failed

for g++ 4.9 (ubuntu 15.04) someone fixed a similar problem with:

sudo ln -s /usr/lib/gcc/x86_64-linux-gnu/4.9.2/liblto_plugin.so /usr/lib/bfd-plugins/

but it doesn't work here

Share this post


Link to post
Share on other sites
erik   

I suspect the use of -flto (which turns on link-time optimizations) is the cause in your case, too, but I can't easily test it on my machine. I would suggest modifying bin/checkconf, commenting out the "set_var CFLAGS_LTO=-flto" (line 262), and doing a full rebuild.

Share this post


Link to post
Share on other sites

You can also take a look here: http://forums.opensplice.org/index.php?/topic/2602-build-opensplicedds-v64-from-source-error-on-unbuntu-1504/

Which references the page: http://ros2.xyz/blog/2015/09/16/building-opensplicedds-v6-4-on-ubuntu15-04/

 

We will also update our website w.r.t. these instructions .. sorry for the inconvenience

 

Regards,

Hans

Share this post


Link to post
Share on other sites
mrwangxc   

Thanks for your suggestion !

 

I've previously read these pages and tried but ignored the advice "get a fresh code and compile again".

It seems that "make clean is not work for opensplice build script" is also TRUE with 6.7......

 

Here's the process to compile the 6.7 successfully on ubuntu 16.04:

Set up the specific link to the liblto_plugin.so according to the links.

Extract the OpenSpliceDDSV6.7.170523OSS-src.tar.gz (VERY IMPORTANT INDEED !).

FIX A FEW BUGS:

    1: change bin/checkconf  lines 564-565 to

        soapcpp2 -V> soapcpp2.ver

        GSOAP_VERSION=`sed -n '2p' < soapcpp2.ver | awk '{print $NF}'`
        my soapcpp2 is 2.8.47, -v does not work and -V just print the version number
    2: change src/services/cmsoap/makefile.mak(line 18)
        stdsoap2.c : $(ESCAPED_GSOAPHOME)/include/stdsoap2.c
        to
        stdsoap2.c : $(ESCAPED_GSOAPHOME)/include/stdsoap2.h
Compile as usual

 

You can also take a look here: http://forums.opensplice.org/index.php?/topic/2602-build-opensplicedds-v64-from-source-error-on-unbuntu-1504/

Which references the page: http://ros2.xyz/blog/2015/09/16/building-opensplicedds-v6-4-on-ubuntu15-04/

 

We will also update our website w.r.t. these instructions .. sorry for the inconvenience

 

Regards,

Hans

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×