bugCERTI - Bugs: bug #47662, Compilation/linking broken on...

 
 

bug #47662: Compilation/linking broken on recent version of Ubuntu/GCC

Submitter:  Sebastien Mamessier <smamessier>
Submitted:  Mon 11 Apr 2016 03:12:43 PM UTC
   
 
Category:  CERTI Severity:  * 3 - Normal
Item Group:  Compilation error Status:  Fixed
Privacy:  Public Assigned to:  cvannier
Open/Closed:  Open Release:  * GIT-master
Reproducibility:  Every Time Fixed Release:  * NextRelease
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 12 Apr 2018 09:17:57 AM UTC, comment #7: 

Hi,

You seem to have issues with TestFedTime and TestHlaTypes, which are targets from master that no longer exists in the branch dev-scalian/cvannier.

Are you sure you do not have artifacts from previous compilation or configurations ?

About building with clang, I personally set CC and CXX environment variables and let cmake use those.

Moreover, I see in my Jenkins conf that clang 3.4 requires a special case : maybe this can help you, from my jenkins build recipe:

export CC=clang
export CXX=clang++

    if [[ "${Compiler}" == clang-3.4 ]]; then
        export CXX=clang++-libc++
    fi

cmake .. -DCMAKE_BUILD_TYPE=${Mode} -DCERTI_USE_NULL_PRIME_MESSAGE_PROTOCOL=${NullPrime} -DCOMPILE_UNIT_TESTS=ON -DCMAKE_INSTALL_PREFIX=../install



Best regards,
Clément

Clément Vannier <cvannier>
Group Member
Thu 12 Apr 2018 09:06:08 AM UTC, comment #6: 

Hi,

It looks like you specified clang-3.8 as your C++ compiler:


-DCMAKE_CXX_COMPILER=clang-3.8



Can you try again by replacing this argument by

-DCMAKE_CXX_COMPILER=clang++-3.8


that invokes clang++ instead ?

Clément Michel <cmichel>
Group Member
Wed 11 Apr 2018 10:30:11 PM UTC, comment #5: 

Under Ubuntu 16.04 with branch dev-scalian/svannier, compilation with gcc 5.4.0 fails with

[ 67%] Linking CXX executable TestFedTime
libFedTimed.so.1.0.0: undefined reference to `typeinfo for RTI::Exception'

Below are details:

cxh@swarmnuc2008:~/src/certi$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.4 LTS
Release:        16.04
Codename:       xenial
cxh@swarmnuc2008:~/src/certi$ git status
On branch dev-scalian/cvannier
Untracked files:
  (use "git add <file>..." to include in what will be committed)

        build/

nothing added to commit but untracked files present (use "git add" to track)
cxh@swarmnuc2008:~/src/certi$ rm -rf build
cxh@swarmnuc2008:~/src/certi$ mkdir build
cxh@swarmnuc2008:~/src/certi$ cd build
cxh@swarmnuc2008:~/src/certi/build$ cmake -DCMAKE_INSTALL_PREFIX=/usr/local/certi ..
-- The CXX compiler identification is GNU 5.4.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The C compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Native build.
-- Target is 64 bits

....


Then running make:

[ 67%] Building CXX object libRTI/hla-1_3/CMakeFiles/TestFedTime.dir/TestFedTime.cc.o
[ 67%] Linking CXX executable TestFedTime
libFedTimed.so.1.0.0: undefined reference to `typeinfo for RTI::Exception'
collect2: error: ld returned 1 exit status
libRTI/hla-1_3/CMakeFiles/TestFedTime.dir/build.make:99: recipe for target 'libRTI/hla-1_3/TestFedTime' failed
make[2]: * [libRTI/hla-1_3/TestFedTime] Error 1
CMakeFiles/Makefile2:1596: recipe for target 'libRTI/hla-1_3/CMakeFiles/TestFedTime.dir/all' failed
make[1]: * [libRTI/hla-1_3/CMakeFiles/TestFedTime.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: * [all] Error 2


I also tried clang-3.6 and 3.8:

cmake -DCMAKE_INSTALL_PREFIX=/usr/local/certi -DCMAKE_C_COMPILER=clang-3.8 -DCMAKE_CXX_COMPILER=clang-3.8 ..

With clang-3.8, make failed with:

[ 11%] Linking CXX executable TestHLAtypes
CMakeFiles/TestHLAtypes.dir/TestHLAtypes.cc.o: In function `test0()':
/home/cxh/src/certi/libHLA/TestHLAtypes.cc:27: undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream(std::_Ios_Openmode)'
/home/cxh/src/certi/libHLA/TestHLAtypes.cc:28: undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream(std::_Ios_Openmode)'
/home/cxh/src/certi/libHLA/TestHLAtypes.cc:29: undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream(std::_Ios_Openmode)'

Anonymous
Tue 19 Dec 2017 10:17:57 AM UTC, comment #4: 

Hi,

Thank you for your test, and I'm glad it is now compiling on your platform.

Don't hesitate to report any regression you may encounter if you use the new branch.

Best regards,
Clément

Clément Vannier <cvannier>
Group Member
Mon 18 Dec 2017 05:17:28 PM UTC, comment #3: 

Hi Clément,

The fix seems to work for me.

I first tried to compile the master branch with

cmake -DCMAKE_INSTALL_PREFIX=$HOME/certi_builds ../

thus letting the system use my most recent compiler available, followed by

make -j8


This didn't work and showed the same error as previously stated -- an expected outcome.

Switching to the dev-scalian/cvannier branch and executing the same commands rewarded me with a successful compilation.

However I haven't tested the output of an HLA execution and thus cannot certify that the simulation runs the same way it does on  the current origin/master.

Nevertheless, compilation does work now.

Best regards,
Clément

Clément Michel <cmichel>
Group Member
Mon 18 Dec 2017 04:37:39 PM UTC, comment #2: 

Hi,

Those issues should be solved on the branch dev-scalian/cvannier

Can you try compiling on your system and keep us posted ?

Best regards,
Clément Vannier

Clément Vannier <cvannier>
Group Member
Tue 25 Oct 2016 09:13:12 AM UTC, comment #1: 

I've installed CERTI on two different machines and experienced the same problem.

On a CentOS-7 distribution, no error was noticed since the packages are not as recent as other distributions.

However, on a Ubuntu 16.04 I experienced the same

undefined reference to `typeinfo for RTI::Exception'

as Sebastien.
I was using gcc 5.4.0 build 5.4.0-6ubuntu1~16.04.2

I circumvented the issue by specifying an older version of clang and clang++ using

-DCMAKE_C_COMPILER=clang-3.6 -DCMAKE_CXX_COMPILER=clang++-3.6


It worked and the build succeeded. Up to the moment of this post I did not have encountered any issue arising from this method of compilation.

Clément Michel <cmichel>
Group Member
Mon 11 Apr 2016 03:12:43 PM UTC, original submission:  

As first reported here (https://lists.gnu.org/archive/html/certi-devel/2015-10/msg00005.html), compilation seems to fail on Ubuntu > 15.10 with GCC > 5.2. The error message looks like:

libFedTimed.so.1.0.0: undefined reference to `typeinfo for RTI::Exception'

it actually occurs when trying to link TestFedtime to libfedtime.so.

Sebastien Mamessier <smamessier>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by cvannier (Posted a comment)
  • -email is unavailable- added by cmichel (Posted a comment)
  • -email is unavailable- added by smamessier (Submitted the item)
  •  

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-12-19 cvannier StatusReady For Test Fixed
    2017-12-18 cvannier StatusNone Ready For Test
        Assigned toNone cvannier
        ReproducibilityNone Every Time

    Back to the top

    Powered by Savane 3.13-cf05.
    Corresponding source code