This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to port iqmath to c6678

Other Parts Discussed in Thread: MATHLIB

Hi,

I am using TMDSEVM6678le  and I want to use iqmath library,

I follow next instructions that comes from SPRUGG9:

1) Include the IQmath.h include file.
2) Link your code with the IQmath object code library. If executing the code on a C64x+ big-endian
device, include IQmath_c64x+e.lib. If executing the code on a C64x+ little-endian device, include the
library IQmath_c64x+.lib. If the little-endian device of choice is DM643x, include the library
IQmath_ROM_c643x.lib to refer the IQmath tables from the device ROM. If the little-endian device is
not DM643x, if executing the code on a device simulator, or if it is required to link the tables from RAM,
include the library IQmath_RAM_c64x+.lib. Thus, for big-endian devices, only a single library needs to
be included, whereas, for little-endian devices, two libraries need to be included.
3) Use the linker command file to place the IQmath section in program memory. This step is optional and
only required if a finer control is desired on the memory location where the IQmath code and tables are
linked.

I skipped step 3 because it is optional.

So I get this in Problems window:

Errors:

unresolved symbol _IQNtoF, first referenced in ./geodistance.obj
unresolved symbol _FtoIQN, first referenced in ./geodistance.obj

Warnings:

Description    Resource    Path    Location    Type
library "C:/ti/c64xplus-iqmath_2_01_04_00/lib/IQmath_RAM_c64x+.lib"

Someone has tried to used with c6678?  How to solve it.

Any help will be appreciated.

Julian

  • Julian,

    The Warning looks like there is a problem for the linker to find the library at the path shown. Is your library at that location? What other information is included around that warning? There seem to be 5 headings and only 2 fields shown in your snippet.

    Other users have asked about implementing IQMATH on the C674x and C66x devices. IQMATH was developed as an efficient and intuitive way to implement approximations of floating point math on a fixed point device, like the C2000, C5000, and C62/64/64+ DSP. But the C674x and C66x have built-in floating point instructions, so these approximations are not necessary, from the way I look at it.

    So, I am curious: why do you want to use IQMATH instead of just writing the floating point operations and using the native floating point instructions?

    Regards,
    RandyP

  • Hi RandyP,

    I want to use fixed point operations contained in iqmath with c66x because I am developing an application

    of distance calculation and that requiere sine, cosine, pow, sqrt operations. This is a HPC application. I have already tried math.h

    and mathlib.h libraries, the performance is good but I feel it´s not completely necessary to use floating point

    for that operations. I know using fixed point is faster than floating point and that is going to let me reduce amount of memory

    used for stored arrays.

    I was looking for information about HPC with DSP´s and I found  this paper http://www.cs.utexas.edu/users/flame/pubs/FLAWN61.pdf

    and there c66x cores are used for matrix multiplication but in case of operations like sine and cosine what is the most efficient use of c66x? Maybe you can

    recommend a way to do that kind of operations efficiently.

    I was thinking a good try  was using  fixed point, but I don´t really know was is the best approach to this kind of operations using the c66x.

    About errors,  the next lines are the output console


    **** Build of configuration Debug for project helloworld_evmc6678l ****

    "C:\\ti\\ccsv5\\utils\\bin\\gmake" -k all
    'Building file: ../helloWorld.cfg'
    'Invoking: XDCtools'
    "C:/ti/xdctools_3_23_04_60/xs" --xdcpath="C:/ti/pdk_C6678_1_1_2_5/packages;C:/ti/ndk_2_21_01_38/packages;C:/ti/bios_6_33_06_50/packages;C:/ti/mcsdk_2_01_02_05/demos;C:/ti/ccsv5/ccs_base;" xdc.tools.configuro -o configPkg -t ti.targets.elf.C66 -p ti.platforms.evm6678 -r debug -c "C:/ti/ccsv5/tools/compiler/C6000 Code Generation Tools 7.4.0" "../helloWorld.cfg"
    making package.mak (because of package.bld) ...
    generating interfaces for package configPkg (because package/package.xdc.inc is older than package.xdc) ...
    configuring helloWorld.xe66 from package/cfg/helloWorld_pe66.cfg ...
    cle66 package/cfg/helloWorld_pe66.c ...
    'Finished building: ../helloWorld.cfg'
    ' '
    'Building file: C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld/src/geo_dist_1p2centroids.c'
    'Invoking: C6000 Compiler'
    "C:/ti/ccsv5/tools/compiler/C6000 Code Generation Tools 7.4.0/bin/cl6x" -mv6600 --abi=eabi -O3 -g --include_path="C:/ti/ccsv5/tools/compiler/C6000 Code Generation Tools 7.4.0/include" --include_path="C:/ti/c64xplus-iqmath_2_01_04_00/include" --include_path="C:/ti/mathlib_c66x_3_0_2_0/packages" --include_path="C:/ti/mathlib_c66x_3_0_2_0/inc" --include_path="C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld/src" --include_path="C:/ti/pdk_C6678_1_1_2_5/packages/ti/drv/qmss" --include_path="C:/ti/pdk_C6678_1_1_2_5/packages/ti/drv/cppi" --include_path="C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld" --diag_warning=225 --preproc_with_compile --preproc_dependency="geo_dist_1p2centroids.pp" --cmd_file="./configPkg/compiler.opt"  "C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld/src/geo_dist_1p2centroids.c"
    "C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld/src/geo_dist_1p2centroids.c", line 38: warning: variable "tag" was declared but never referenced
    "C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld/src/geo_dist_1p2centroids.c", line 39: warning: variable "j" was declared but never referenced
    'Finished building: C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld/src/geo_dist_1p2centroids.c'
    ' '
    'Building file: C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld/src/geodistance.c'
    'Invoking: C6000 Compiler'
    "C:/ti/ccsv5/tools/compiler/C6000 Code Generation Tools 7.4.0/bin/cl6x" -mv6600 --abi=eabi -O3 -g --include_path="C:/ti/ccsv5/tools/compiler/C6000 Code Generation Tools 7.4.0/include" --include_path="C:/ti/c64xplus-iqmath_2_01_04_00/include" --include_path="C:/ti/mathlib_c66x_3_0_2_0/packages" --include_path="C:/ti/mathlib_c66x_3_0_2_0/inc" --include_path="C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld/src" --include_path="C:/ti/pdk_C6678_1_1_2_5/packages/ti/drv/qmss" --include_path="C:/ti/pdk_C6678_1_1_2_5/packages/ti/drv/cppi" --include_path="C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld" --diag_warning=225 --preproc_with_compile --preproc_dependency="geodistance.pp" --cmd_file="./configPkg/compiler.opt"  "C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld/src/geodistance.c"
    "C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld/src/geodistance.c", line 55: warning: variable "d" is used before its value is set
    "C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld/src/geodistance.c", line 22: warning: variable "dlon" was set but never used
    "C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld/src/geodistance.c", line 23: warning: variable "a" was declared but never referenced
    "C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld/src/geodistance.c", line 24: warning: variable "c" was declared but never referenced
    "C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld/src/geodistance.c", line 26: warning: variable "r" was set but never used
    "C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld/src/geodistance.c", line 27: warning: variable "temp" was declared but never referenced
    "C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld/src/geodistance.c", line 30: warning: variable "temp_iq_to_F" was set but never used
    'Finished building: C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld/src/geodistance.c'
    ' '
    'Building file: C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld/helloWorld.c'
    'Invoking: C6000 Compiler'
    "C:/ti/ccsv5/tools/compiler/C6000 Code Generation Tools 7.4.0/bin/cl6x" -mv6600 --abi=eabi -O3 -g --include_path="C:/ti/ccsv5/tools/compiler/C6000 Code Generation Tools 7.4.0/include" --include_path="C:/ti/c64xplus-iqmath_2_01_04_00/include" --include_path="C:/ti/mathlib_c66x_3_0_2_0/packages" --include_path="C:/ti/mathlib_c66x_3_0_2_0/inc" --include_path="C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld/src" --include_path="C:/ti/pdk_C6678_1_1_2_5/packages/ti/drv/qmss" --include_path="C:/ti/pdk_C6678_1_1_2_5/packages/ti/drv/cppi" --include_path="C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld" --diag_warning=225 --preproc_with_compile --preproc_dependency="helloWorld.pp" --cmd_file="./configPkg/compiler.opt"  "C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld/helloWorld.c"
    'Finished building: C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld/helloWorld.c'
    ' '
    'Building file: C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld/platform_osal.c'
    'Invoking: C6000 Compiler'
    "C:/ti/ccsv5/tools/compiler/C6000 Code Generation Tools 7.4.0/bin/cl6x" -mv6600 --abi=eabi -O3 -g --include_path="C:/ti/ccsv5/tools/compiler/C6000 Code Generation Tools 7.4.0/include" --include_path="C:/ti/c64xplus-iqmath_2_01_04_00/include" --include_path="C:/ti/mathlib_c66x_3_0_2_0/packages" --include_path="C:/ti/mathlib_c66x_3_0_2_0/inc" --include_path="C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld/src" --include_path="C:/ti/pdk_C6678_1_1_2_5/packages/ti/drv/qmss" --include_path="C:/ti/pdk_C6678_1_1_2_5/packages/ti/drv/cppi" --include_path="C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld" --diag_warning=225 --preproc_with_compile --preproc_dependency="platform_osal.pp" --cmd_file="./configPkg/compiler.opt"  "C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld/platform_osal.c"
    'Finished building: C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld/platform_osal.c'
    ' '
    'Building file: C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld/src/radius_of_curvature.c'
    'Invoking: C6000 Compiler'
    "C:/ti/ccsv5/tools/compiler/C6000 Code Generation Tools 7.4.0/bin/cl6x" -mv6600 --abi=eabi -O3 -g --include_path="C:/ti/ccsv5/tools/compiler/C6000 Code Generation Tools 7.4.0/include" --include_path="C:/ti/c64xplus-iqmath_2_01_04_00/include" --include_path="C:/ti/mathlib_c66x_3_0_2_0/packages" --include_path="C:/ti/mathlib_c66x_3_0_2_0/inc" --include_path="C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld/src" --include_path="C:/ti/pdk_C6678_1_1_2_5/packages/ti/drv/qmss" --include_path="C:/ti/pdk_C6678_1_1_2_5/packages/ti/drv/cppi" --include_path="C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld" --diag_warning=225 --preproc_with_compile --preproc_dependency="radius_of_curvature.pp" --cmd_file="./configPkg/compiler.opt"  "C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld/src/radius_of_curvature.c"
    'Finished building: C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld/src/radius_of_curvature.c'
    ' '
    'Building file: C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld/resourcemgr.c'
    'Invoking: C6000 Compiler'
    "C:/ti/ccsv5/tools/compiler/C6000 Code Generation Tools 7.4.0/bin/cl6x" -mv6600 --abi=eabi -O3 -g --include_path="C:/ti/ccsv5/tools/compiler/C6000 Code Generation Tools 7.4.0/include" --include_path="C:/ti/c64xplus-iqmath_2_01_04_00/include" --include_path="C:/ti/mathlib_c66x_3_0_2_0/packages" --include_path="C:/ti/mathlib_c66x_3_0_2_0/inc" --include_path="C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld/src" --include_path="C:/ti/pdk_C6678_1_1_2_5/packages/ti/drv/qmss" --include_path="C:/ti/pdk_C6678_1_1_2_5/packages/ti/drv/cppi" --include_path="C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld" --diag_warning=225 --preproc_with_compile --preproc_dependency="resourcemgr.pp" --cmd_file="./configPkg/compiler.opt"  "C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld/resourcemgr.c"
    'Finished building: C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld/resourcemgr.c'
    ' '
    'Building file: C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld/udpHello.c'
    'Invoking: C6000 Compiler'
    "C:/ti/ccsv5/tools/compiler/C6000 Code Generation Tools 7.4.0/bin/cl6x" -mv6600 --abi=eabi -O3 -g --include_path="C:/ti/ccsv5/tools/compiler/C6000 Code Generation Tools 7.4.0/include" --include_path="C:/ti/c64xplus-iqmath_2_01_04_00/include" --include_path="C:/ti/mathlib_c66x_3_0_2_0/packages" --include_path="C:/ti/mathlib_c66x_3_0_2_0/inc" --include_path="C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld/src" --include_path="C:/ti/pdk_C6678_1_1_2_5/packages/ti/drv/qmss" --include_path="C:/ti/pdk_C6678_1_1_2_5/packages/ti/drv/cppi" --include_path="C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld" --diag_warning=225 --preproc_with_compile --preproc_dependency="udpHello.pp" --cmd_file="./configPkg/compiler.opt"  "C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld/udpHello.c"
    "C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld/udpHello.c", line 87: warning: variable "MES" was declared but never referenced
    "C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld/udpHello.c", line 89: warning: variable "cdna_ret" was declared but never referenced
    "C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld/udpHello.c", line 91: warning: variable "population" was set but never used
    "C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld/udpHello.c", line 93: warning: variable "token" was declared but never referenced
    "C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld/udpHello.c", line 94: warning: variable "pBuf_cpy" was declared but never referenced
    "C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld/udpHello.c", line 95: warning: variable "n_string" was declared but never referenced
    "C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld/udpHello.c", line 96: warning: variable "cdna" was declared but never referenced
    "C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld/udpHello.c", line 164: warning: variable "count2" was declared but never referenced
    "C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld/udpHello.c", line 168: warning: variable "ack" was declared but never referenced
    "C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld/udpHello.c", line 169: warning: variable "isub" was declared but never referenced
    'Finished building: C:/ti/mcsdk_2_01_02_05/examples/ndk/helloWorld/udpHello.c'
    ' '
    'Building target: helloworld_evmc6678l.out'
    'Invoking: C6000 Linker'
    "C:/ti/ccsv5/tools/compiler/C6000 Code Generation Tools 7.4.0/bin/cl6x" -mv6600 --abi=eabi -O3 -g --diag_warning=225 -z -m"helloworld_evmc6678l.map" -i"C:/ti/ccsv5/tools/compiler/C6000 Code Generation Tools 7.4.0/lib" -i"C:/ti/c64xplus-iqmath_2_01_04_00/lib" -i"C:/ti/mathlib_c66x_3_0_2_0/lib" -i"C:/ti/ccsv5/tools/compiler/C6000 Code Generation Tools 7.4.0/include" --reread_libs --warn_sections --rom_model -o "helloworld_evmc6678l.out" -l"./configPkg/linker.cmd"  "./udpHello.obj" "./resourcemgr.obj" "./radius_of_curvature.obj" "./platform_osal.obj" "./helloWorld.obj" "./geodistance.obj" "./geo_dist_1p2centroids.obj" -l"libc.a" -l"IQmath_RAM_c64x+.lib" -l"mathlib.ae66"
    <Linking>
    warning: library "C:/ti/c64xplus-iqmath_2_01_04_00/lib/IQmath_RAM_c64x+.lib"
       contains TI-COFF object files which are incompatible with the ELF output
       file.  Ensure you are using the proper library.
    warning: library "C:/ti/c64xplus-iqmath_2_01_04_00/lib/IQmath_RAM_c64x+.lib"

    >> Compilation failure
       contains TI-COFF object files which are incompatible with the ELF output
       file.  Ensure you are using the proper library.
    warning: library "C:/ti/c64xplus-iqmath_2_01_04_00/lib/IQmath_RAM_c64x+.lib"
       contains TI-COFF object files which are incompatible with the ELF output
       file.  Ensure you are using the proper library.

     undefined first referenced
      symbol       in file      
     --------- ----------------
     _FtoIQN   ./geodistance.obj
     _IQNtoF   ./geodistance.obj

    error: unresolved symbols remain
    error: errors encountered during linking; "helloworld_evmc6678l.out" not built
    gmake: *** [helloworld_evmc6678l.out] Error 1
    gmake: Target `all' not remade because of errors.

    **** Build Finished ****

    Problems window is this:

    and the linker search path is configured as is shown  in next image:


    Thanks in advance.

    Julian

  • Julian,

    Most of the C66x software is by default built with little endian ELF format so please replace IQMATH_c64xplus_elf.lib file. The linker build error suggest mismatch of object files built in COFF and ELF format.

    Let us know if this doesn`t resolve your issue.

    Regards,

    Rahul

    PS: FYI, there is a bug reported in the big endian version of this library recently so if you do plan to move to big endian implementation refer to the post here:

    http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/439/t/225956.aspx

  • Hi Julian,

    Are you still facing this issue or including the ELF version of the library has resolved the build issue.

    Regards,

    Rahul

  • Hi Rahul,

    changing to the elf version,  to IQmath_c64x+e_elf.lib, solved the issue.

    Thank you very much for the help.

    Julian