Forums - qmath examples

3 posts / 0 new
Last post
qmath examples
tom.zheng
Join Date: 11 Jun 18
Posts: 3
Posted: Thu, 2018-06-14 01:23

Hi there,

I was working on porting my alrithmetic to qmath HVX based operations, however, I could not build nor run the qmath_example locating at \examples\compute\qmath_sample. I was importing the project by the following steps: File -> Import... -> Import Hexagon Project -> Executable -> Browse... -> \examples\compute\qmath_sample -> Finish. Am I doing it incorrectly?

Please help!!

BR, 

Tom

  • Up0
  • Down0
tom.zheng
Join Date: 11 Jun 18
Posts: 3
Posted: Thu, 2018-06-14 02:29

Well I was able to sucessfully build and test the qmath_sample after a few trials. Here is what I found how to build and test qmath_sample code.

- Make sure you have already install make and python

- Go to qmath_sample directory and have a look at README.txt

- Open your Terminal tool and cd  qmath_sample directory

- Run python qmath_sample_walkthrough.py, after running this command the following command can then be able to be executed

- Run make tree VERBOSE=1 V=hexagon_Release_toolv81_v65, then you can see your output from the terminal. You can modified the code to see how it behaves.

PS. I'm still having trouble to integrate qmath into the existing example project (i.e. capi_v2_gain example), can anyone help me with it?

BR, 

Tom

  • Up0
  • Down0
_jeremiel
Join Date: 21 May 21
Posts: 2
Posted: Mon, 2021-06-07 09:32

Hi there,

I'm facing the same problem. I'd like to insert some qhmath functions in the capi_v2_passthru example, but I get the following issue:

When executing the build & test command, there's some undefined symbols:

$ make tree V=hexagon_Release_toolv84_v66

==== Using Hexagon Tools at /local/mnt/workspace/Qualcomm/Hexagon_SDK/4.3.0.0/tools/HEXAGON_Tools/8.4.11 ====
==== Build output directory: /local/mnt/workspace/Qualcomm/Hexagon_SDK/4.3.0.0/addons/audio/elite/examples/capi_v2_passthru/hexagon_Release_toolv84_v66/ship ====
making /local/mnt/workspace/Qualcomm/Hexagon_SDK/4.3.0.0/addons/audio/elite/test/test_capi_v2_voice
making /local/mnt/workspace/Qualcomm/Hexagon_SDK/4.3.0.0/addons/audio/elite/test/test_capi_v2
making /local/mnt/workspace/Qualcomm/Hexagon_SDK/4.3.0.0/utils/sim_utils
making /local/mnt/workspace/Qualcomm/Hexagon_SDK/4.3.0.0/addons/audio/elite/libs/capi_v2_utils_props
making /local/mnt/workspace/Qualcomm/Hexagon_SDK/4.3.0.0/libs/atomic
making /local/mnt/workspace/Qualcomm/Hexagon_SDK/4.3.0.0/utils/sim_profiler
making .
hexagon-sim INFO: The rev_id used in the simulation is 0x00008466 (v66g_1024)

Done!

    T0: Insns=1114779 Packets=478523
    T1: Insns=0 Packets=0
    T2: Insns=0 Packets=0
    T3: Insns=0 Packets=0
    Total: Insns=1114779 Pcycles=957048
make[1]: *** [/local/mnt/workspace/Qualcomm/Hexagon_SDK/4.3.0.0/build/make.d/rules.min:656: hexagon_Release_toolv84_v66/capi_v2_passthru_q.ok] Error 1
ERROR making .
make[1]: Entering directory '/local/mnt/workspace/Qualcomm/Hexagon_SDK/4.3.0.0/addons/audio/elite/examples/capi_v2_passthru'
==== Using Hexagon Tools at /local/mnt/workspace/Qualcomm/Hexagon_SDK/4.3.0.0/tools/HEXAGON_Tools/8.4.11 ====
==== Build output directory: /local/mnt/workspace/Qualcomm/Hexagon_SDK/4.3.0.0/addons/audio/elite/examples/capi_v2_passthru/hexagon_Release_toolv84_v66/ship ====
echo ok hexagon_Release_toolv84_v66/capi_v2_passthru_q
ok hexagon_Release_toolv84_v66/capi_v2_passthru_q
/local/mnt/workspace/Qualcomm/Hexagon_SDK/4.3.0.0/tools/HEXAGON_Tools/8.4.11/Tools/bin/hexagon-sim -mv66g_1024 --simulated_returnval --usefs hexagon_Release_toolv84_v66 --pmu_statsfile hexagon_Release_toolv84_v66/pmu_stats.txt    hexagon_Release_toolv84_v66/capi_v2_passthru_q --   
added path ".":  HIGH:0x0:122:paths.c
--------------------------------------------------------------------:  HIGH:0x0:70:capi_v2_passthru_test.c
Calling test_main_start in target module's test file.               :  HIGH:0x0:71:capi_v2_passthru_test.c
--------------------------------------------------------------------:  HIGH:0x0:72:capi_v2_passthru_test.c
-- start dll test --                                                :  HIGH:0x0:111:capi_v2_passthru_test.c
attempt to load   capi_v2_passthru.so                               :  HIGH:0x0:114:capi_v2_passthru_test.c
try to load capi_v2_passthru.so from file:  HIGH:0x0:122:search.c
try ./capi_v2_passthru.so:  HIGH:0x0:81:search.c
read headers 0x0 -> 2d000 (0x1000 B):  HIGH:0x0:539:map_object.c
mapped  [2f000 - 66000] (225280 Bytes):  HIGH:0x0:729:map_object.c
load 0x0 -> 2f000 (0x2BEE4 B):  HIGH:0x0:845:map_object.c
Verify segment 0 [2f000 - 5aee3] (0x2BEE4 B):  HIGH:0x0:853:map_object.c
zero    [65d38 - 65d3b] (0x4 B):  HIGH:0x0:815:map_object.c
load 0x2C000 -> 5b000 (0xAD38 B):  HIGH:0x0:845:map_object.c
Verify segment 1 [5b000 - 65d37] (0xAD38 B):  HIGH:0x0:853:map_object.c
libc.so builtin:  HIGH:0x0:345:load.c
libgcc.so builtin:  HIGH:0x0:345:load.c
undefined symbol PLT  #169 _FDclass in ./capi_v2_passthru.so: ERROR:0x0:350:symbol.c
plt object relocation failure: ERROR:0x0:274:mdreloc.c
undefined symbol PLT  #136 __hexagon_divsf3 in ./capi_v2_passthru.so: ERROR:0x0:350:symbol.c
plt object relocation failure: ERROR:0x0:274:mdreloc.c
undefined symbol PLT  #373 qhmath_pow_f in ./capi_v2_passthru.so: ERROR:0x0:350:symbol.c
plt object relocation failure: ERROR:0x0:274:mdreloc.c
undefined symbol PLT  #7 qhmath_exp_f in ./capi_v2_passthru.so: ERROR:0x0:350:symbol.c
plt object relocation failure: ERROR:0x0:274:mdreloc.c
undefined symbol PLT  #163 qhmath_sqrt_f in ./capi_v2_passthru.so: ERROR:0x0:350:symbol.c
plt object relocation failure: ERROR:0x0:274:mdreloc.c
undefined symbol PLT  #383 qhmath_cos_f in ./capi_v2_passthru.so: ERROR:0x0:350:symbol.c
plt object relocation failure: ERROR:0x0:274:mdreloc.c
undefined symbol PLT  #149 qhmath_sin_f in ./capi_v2_passthru.so: ERROR:0x0:350:symbol.c
plt object relocation failure: ERROR:0x0:274:mdreloc.c
Error: dlopen_ex failed for capi_v2_passthru.so (flags 2): ERROR:0x0:773:rtld.c
unloading ./capi_v2_passthru.so:  HIGH:0x0:308:rtld.c
dlopen capi_v2_passthru.so return obj 0:  HIGH:0x0:792:rtld.c
dlopen capi_v2_passthru.so failed undefined symbol PLT  #169 _FDclass in ./capi_v2_passthru.so                           :  HIGH:0x0:117:capi_v2_passthru_test.c
-- end dll test --                                                  :  HIGH:0x0:160:capi_v2_passthru_test.c
--------------------------------------------------------------------:  HIGH:0x0:76:capi_v2_passthru_test.c
Failed                                                              :  HIGH:0x0:77:capi_v2_passthru_test.c
--------------------------------------------------------------------:  HIGH:0x0:78:capi_v2_passthru_test.c
make[1]: Leaving directory '/local/mnt/workspace/Qualcomm/Hexagon_SDK/4.3.0.0/addons/audio/elite/examples/capi_v2_passthru'
make: *** [/local/mnt/workspace/Qualcomm/Hexagon_SDK/4.3.0.0/build/defines.min:145: tree] Error 1

To reach this point, I updated the hexagon.min file to add sources & includes directory, as well as the the list of dependencies:

capi_v2_passthru_q_LIBS = rtld test_util test_capi_v2 capi_v2_utils_props capi_v2_passthru test_profile atomic libqhmath

I also updated the hexagon_deps.min file to point to qhmath sources, and list it as a dependency.

AUDIO_ROOT = $(HEXAGON_SDK_ROOT)/addons/audio/elite
# must list all variants supported by this project
SUPPORTED_VS = $(default_VS)
 
# must list all the dependencies of this project
DEPENDENCIES =        TEST_CAPI_V2_VOICE \
               TEST_CAPI_V2 \
               SIM_UTILS \
               CAPI_V2_UTILS_PROPS \
               ATOMIC \
               SIM_PROFILER \
               QHMATH_DIR \
 
# each dependency needs a directory definition
#  the form is <DEPENDENCY NAME>_DIR
#  for example:
#    DEPENDENCIES = FOO
#    FOO_DIR = $(HEXAGON_SDK_ROOT)/examples/common/foo
#
ATOMIC_DIR = $(HEXAGON_SDK_ROOT)/libs/atomic
CAPI_V2_UTILS_PROPS_DIR = $(AUDIO_ROOT)/libs/capi_v2_utils_props
SIM_UTILS_DIR = $(HEXAGON_SDK_ROOT)/utils/sim_utils
TEST_CAPI_V2_DIR = $(AUDIO_ROOT)/test/test_capi_v2
TEST_CAPI_V2_VOICE_DIR = $(AUDIO_ROOT)/test/test_capi_v2_voice
SIM_PROFILER_DIR = $(HEXAGON_SDK_ROOT)/utils/sim_profiler
QHMATH_DIR = $(HEXAGON_SDK_ROOT)/libs/qhl

Bu it seems that qhmath.a is not built, which results in undefined symbols while trying to do the dlopen() in test application.

 

Does anyone knows how to update available examples to add qhmath support ?

  • 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.