Board index FlightGear Support Compiling

SimGear compilation issues with Clang

Building FlightGear from source, and in the need for help?

SimGear compilation issues with Clang

Postby fatty » Wed Apr 07, 2021 3:57 pm

I've been trying to build FG with Clang instead of gcc to see if the binary ends up being a bit faster. However, I keep runnning into this:

Code: Select all
Scanning dependencies of target test_sg_dir
[ 54%] Building CXX object simgear/misc/CMakeFiles/test_sg_dir.dir/sg_dir_test.cxx.o
[ 55%] Linking CXX executable test-simgear_misc-SVGpreserveAspectRatio
[ 56%] Linking CXX executable test_argparse
/usr/bin/ld: /usr/bin/ld: DWARF error: could not find variable specification at offset 37a6
CMakeFiles/test-simgear_misc-SVGpreserveAspectRatio.dir/SVGpreserveAspectRatio_test.cxx.o: in function `boost::unit_test::make_test_case(boost::function<void ()> const&, boost::unit_test::basic_cstring<char const>, boost::unit_test::basic_cstring<char const>, unsigned long)':
/usr/include/boost/test/tree/test_unit.hpp:265: undefined reference to `boost::unit_test::ut_detail::normalize_test_case_name(boost::unit_test::basic_cstring<char const>)'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[5]: *** [simgear/misc/CMakeFiles/test-simgear_misc-SVGpreserveAspectRatio.dir/build.make:110: simgear/misc/test-simgear_misc-SVGpreserveAspectRatio] Error 1
make[4]: *** [CMakeFiles/Makefile2:2669: simgear/misc/CMakeFiles/test-simgear_misc-SVGpreserveAspectRatio.dir/all] Error 2
make[4]: *** Waiting for unfinished jobs....


This is with Clang 11 and latest FG git. Any ideas?
fatty
 
Posts: 202
Joined: Sat Jan 13, 2007 4:41 am
Location: Pennsylvania, U.S.

Re: SimGear compilation issues with Clang

Postby zakalawe » Thu Apr 08, 2021 11:34 am

That looks stranger: I build all the time on macOS using Clang/LLVM without problems. And I think some other Linux users also use Clang, and maybe Jules on OpenBSD as well. So 'it should work', although this does not help you much, sorry.

One thing: did you use a new CMake build-tree when switching compilers? If not, you might get object files mixed between the two compilers.
zakalawe
 
Posts: 1259
Joined: Sat Jul 19, 2008 5:48 pm
Location: Edinburgh, Scotland
Callsign: G-ZKLW
Version: next
OS: Mac

Re: SimGear compilation issues with Clang

Postby xcvb » Thu Apr 08, 2021 12:02 pm

Are you sure you are using clang? As far as I know ld is the gcc linker.
xcvb
 
Posts: 132
Joined: Sat Mar 14, 2015 3:08 pm
Version: Next
OS: Fedora Kinoite

Re: SimGear compilation issues with Clang

Postby fatty » Thu Apr 08, 2021 6:58 pm

Thank you both! I thought I had cleaned up all the old CMake stuff but it turns out I didn't get everything.
fatty
 
Posts: 202
Joined: Sat Jan 13, 2007 4:41 am
Location: Pennsylvania, U.S.


Return to Compiling

Who is online

Users browsing this forum: No registered users and 3 guests