Forums - Linker Error when making Symphony example on x86_64-linux-gnu

5 posts / 0 new
Last post
Linker Error when making Symphony example on x86_64-linux-gnu
qualcommdev1
Join Date: 19 Jan 11
Posts: 7
Posted: Wed, 2017-06-14 11:33

Hi,

I've been trying to build the examples provided with the SDK version 1.1.2  on x86_64 LInux target (Ubuntu 16.04LTS) using the quick start guide. However, I've been getting linker errors when running make. I've added the result I'm getting after running cmake and make. How can I fix this?

$> cmake . -DSYMPHONY_LIB_TYPE=release-cpu
-- The C compiler identification is GNU 5.4.0
-- The CXX 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
-- 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
Symphony version: 1.1.2
Symphony includes: /opt/Qualcomm/Symphony/1.1.2/x86_64-linux-gnu/lib/CMake/symphony/../../../include
Symphony cxx flags:  -std=c++11  -DSYMPHONY_HAVE_RTTI  -DSYMPHONY_HAVE_RTTI
Symphony libs: symphony;-lpthread
-- Configuring done
-- Generating done
-- Build files have been written to: /opt/Qualcomm/Symphony/1.1.2/x86_64-linux-gnu/examples
 
$> make
Scanning dependencies of target symphony_examples_wait_for_group1
[  0%] Building CXX object CMakeFiles/symphony_examples_wait_for_group1.dir/wait_for_group1.cc.o
[  1%] Linking CXX executable symphony_examples_wait_for_group1
CMakeFiles/symphony_examples_wait_for_group1.dir/wait_for_group1.cc.o: In function `symphony::internal::cputask<symphony::internal::task_type_info<main::{lambda()#1}, false> >::describe_body()':
wait_for_group1.cc:(.text+0x9a8): undefined reference to `symphony::internal::strprintf[abi:cxx11](char const*, ...)'
CMakeFiles/symphony_examples_wait_for_group1.dir/wait_for_group1.cc.o: In function `symphony::api_exception::api_exception(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char const*, int, char const*)':
wait_for_group1.cc:(.text._ZN8symphony13api_exceptionC2ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKciS8_[_ZN8symphony13api_exceptionC5ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKciS8_]+0x58): undefined reference to `symphony::error_exception::error_exception(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char const*, int, char const*)'
CMakeFiles/symphony_examples_wait_for_group1.dir/wait_for_group1.cc.o: In function `symphony::internal::task::add_control_dependency(symphony::internal::task*)':
wait_for_group1.cc:(.text._ZN8symphony8internal4task22add_control_dependencyEPS1_[_ZN8symphony8internal4task22add_control_dependencyEPS1_]+0x67): undefined reference to `symphony::internal::task::to_string[abi:cxx11]()'
wait_for_group1.cc:(.text._ZN8symphony8internal4task22add_control_dependencyEPS1_[_ZN8symphony8internal4task22add_control_dependencyEPS1_]+0x90): undefined reference to `symphony::internal::strprintf[abi:cxx11](char const*, ...)'
CMakeFiles/symphony_examples_wait_for_group1.dir/wait_for_group1.cc.o: In function `symphony::internal::demangler::demangle[abi:cxx11](std::type_info const&)':
wait_for_group1.cc:(.text._ZN8symphony8internal9demangler8demangleB5cxx11ERKSt9type_info[_ZN8symphony8internal9demangler8demangleB5cxx11ERKSt9type_info]+0x2e): undefined reference to `symphony::internal::demangler::do_work[abi:cxx11](std::type_info const&)'
CMakeFiles/symphony_examples_wait_for_group1.dir/wait_for_group1.cc.o: In function `symphony::internal::group::~group()':
wait_for_group1.cc:(.text._ZN8symphony8internal5groupD2Ev[_ZN8symphony8internal5groupD5Ev]+0x85): undefined reference to `symphony::internal::group::to_string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
CMakeFiles/symphony_examples_wait_for_group1.dir/wait_for_group1.cc.o:(.rodata._ZTVN8symphony8internal17cputask_arg_layerIFvvEJEEE[_ZTVN8symphony8internal17cputask_arg_layerIFvvEJEEE]+0x40): undefined reference to `symphony::internal::task::describe_body[abi:cxx11]()'
CMakeFiles/symphony_examples_wait_for_group1.dir/wait_for_group1.cc.o:(.rodata._ZTVN8symphony8internal20cputask_return_layerIvEE[_ZTVN8symphony8internal20cputask_return_layerIvEE]+0x40): undefined reference to `symphony::internal::task::describe_body[abi:cxx11]()'
CMakeFiles/symphony_examples_wait_for_group1.dir/wait_for_group1.cc.o: In function `symphony::internal::cputask<symphony::internal::task_type_info<symphony::internal::blocked_blocking_task::blocked_blocking_task()::{lambda()#1}&, true> >::describe_body()':
wait_for_group1.cc:(.text._ZN8symphony8internal7cputaskINS0_14task_type_infoIRZNS0_21blocked_blocking_taskC4EvEUlvE_Lb1EEEE13describe_bodyEv[_ZN8symphony8internal7cputaskINS0_14task_type_infoIRZNS0_21blocked_blocking_taskC4EvEUlvE_Lb1EEEE13describe_bodyEv]+0xb6): undefined reference to `symphony::internal::strprintf[abi:cxx11](char const*, ...)'
collect2: error: ld returned 1 exit status
CMakeFiles/symphony_examples_wait_for_group1.dir/build.make:95: recipe for target 'symphony_examples_wait_for_group1' failed
make[2]: *** [symphony_examples_wait_for_group1] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/symphony_examples_wait_for_group1.dir/all' failed
make[1]: *** [CMakeFiles/symphony_examples_wait_for_group1.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

 

  • Up0
  • Down0
eshaw Moderator
Join Date: 12 May 16
Location: San Diego
Posts: 120
Posted: Wed, 2017-06-28 16:02

This can be fixed by setting the _GLIBCXX_USE_CXX11_ABI preprocessor variable to 0. The simplest way to do this for the examples is to modify the CMakeLists.txt file in the examples directory. Find this line:

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SYMPHONY_CXX_FLAGS}")

Then add -D_GLIBCXX_USE_CXX11_ABI=0:

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SYMPHONY_CXX_FLAGS} -D_GLIBCXX_USE_CXX11_ABI=0")

Once you've modified the file, re-run CMake and you should be able to compile the examples.

Eric

  • Up0
  • Down0
kshitiz16051
Join Date: 15 May 18
Posts: 12
Posted: Sun, 2018-06-24 22:42

Sir
I too got a similar error while building x86_64-linux-gnu directory with -DSYMPHONY_LIB_TYPE=release-gpu. Setting the _GLIBCXX_USE_CXX11_ABI preprocessor variable to 0 worked for me but it later results into a segmentation fault with all the symphony examples built by the make command.

Error displayed on running an executable file of a symphony_example in $PATH_TO_SYMPHONY/x86_64-linux-gnu/examples directoy : Segmentation fault (core dumped)

Kindly help.

  • Up0
  • Down0
asraghav
Join Date: 29 Nov 17
Posts: 11
Posted: Mon, 2018-06-25 17:45

Can you post the stack trace of the segmentation fault?

  • Up0
  • Down0
kshitiz16051
Join Date: 15 May 18
Posts: 12
Posted: Tue, 2018-06-26 23:01

(gdb) run
Starting program: ~/opt/Qualcomm/Symphony/1.1.4/x86_64-linux-gnu/examples/symphony_examples_helloworld
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff4187700 (LWP 24473)]
[New Thread 0x7fffe9590700 (LWP 24491)]
[New Thread 0x7fffe3fff700 (LWP 24492)]
[New Thread 0x7fffe918f700 (LWP 24493)]
[New Thread 0x7fffe8d8e700 (LWP 24494)]
[New Thread 0x7fffe858c700 (LWP 24496)]
[New Thread 0x7fffe898d700 (LWP 24495)]
[New Thread 0x7fffe3bfe700 (LWP 24497)]
[New Thread 0x7fffe37fd700 (LWP 24498)]
[New Thread 0x7fffe2ffc700 (LWP 24499)]
[New Thread 0x7fffe27fb700 (LWP 24500)]
[New Thread 0x7fffe1ffa700 (LWP 24501)]
[New Thread 0x7fffe17f9700 (LWP 24502)]
[New Thread 0x7fffe0ff8700 (LWP 24503)]
[New Thread 0x7fffdbfff700 (LWP 24504)]
[New Thread 0x7fffdb7fe700 (LWP 24505)]
[New Thread 0x7fffdaffd700 (LWP 24506)]
A        0 t7ffff7fca740 ~/opt/Qualcomm/Symphony/1.1.4/x86_64-linux-gnu/examples/helloworld.cc:16 This is Qualcomm Symphony!

A        1 t7fffe1ffa700 ~/opt/Qualcomm/Symphony/1.1.4/x86_64-linux-gnu/examples/helloworld.cc:13 Hello World!

[Thread 0x7fffe17f9700 (LWP 24502) exited]
[Thread 0x7fffdb7fe700 (LWP 24505) exited]
[Thread 0x7fffdbfff700 (LWP 24504) exited]
[Thread 0x7fffe37fd700 (LWP 24498) exited]
[Thread 0x7fffe2ffc700 (LWP 24499) exited]
[Thread 0x7fffe27fb700 (LWP 24500) exited]
[Thread 0x7fffe0ff8700 (LWP 24503) exited]
[Thread 0x7fffe1ffa700 (LWP 24501) exited]
[Thread 0x7fffdaffd700 (LWP 24506) exited]

Thread 1 "symphony_exampl" received signal SIGSEGV, Segmentation fault.
0x00007ffff59a7470 in ?? () from /opt/intel/opencl/libintelocl.so

 

(gdb) backtrace
#0  0x00007ffff59a7470 in ?? () from /opt/intel/opencl/libintelocl.so
#1  0x00007ffff676536a in __cxa_finalize (d=0x7ffff59a73c0) at cxa_finalize.c:56
#2  0x00007ffff5681e13 in ?? () from /opt/intel/opencl/libintelocl.so
#3  0x00007fffffffdff0 in ?? ()
#4  0x00007ffff7de7de7 in _dl_fini () at dl-fini.c:235
Backtrace stopped: frame did not save the PC
(gdb)
 

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.