2009-04-07 10:57:28 how to use libbfdsp functions
Ashish Gupta (INDIA)
Message: 72332
Hi
Please explain how i can use the functions provided by the "libbfdsp" library. This one does not appear in the library configuration during uclinux build, Is this integrated with the toolchain.?
I looked at the the following page : -
docs.blackfin.uclinux.org/doku.php?id=toolchain:libbfdsp
but could not find which header files to include.
regards
Ashish
QuoteReplyEditDelete
2009-04-07 15:31:10 Re: how to use libbfdsp functions
Mike Frysinger (UNITED STATES)
Message: 72351
the library is compiled with the toolchain
the manual on analog.com documents the headers
QuoteReplyEditDelete
2009-04-08 14:29:21 Re: how to use libbfdsp functions
David Kasper (UNITED STATES)
Message: 72430
Mike,
I am experiencing compiler errors when using the DSP library functions. At the top of my cpp file I added:
#include <complex.h>
I added the following to the body:
//DSP Library test
complex_fract16 a, b, prod;
a.re = 1;
a.im = 0;
b.re = 8;
b.im = 0;
prod = cmlt_fr16(a, b);
Using bfin-linux-uclibc-g++ I get a warning on the include file and the compiler doesn't find a definion for complex_fract16 type or cmlt_fr16 function as shown below. Any help would be appreciated.
Thanks,
David Kasper
[student@localhost apps]$
[student@localhost apps]$ make
bfin-linux-uclibc-g++ -c -I.. -I../../ -I./sup_sw/libmicrocpp -I./sup_sw/tools/protocols/g2/c++ -I./sup_sw/libmicrocpp/commio -I./sup_sw/libmicrocpp/containers -I./sup_sw/libmicrocpp/fastdelegate -I./sup_sw/libmicrocpp/system -I./sup_sw/tools/protocols/g2/c++/interfaces -I./sup_sw/tools/protocols/g2/c++/src -I./sup_sw/tools/protocols/g2/c++/test -I./sup_sw/uclinux/bf/libs/libdbugmon -I./sup_sw/uclinux/bf/libs/liblog -I./sup_sw/uclinux/bf/libs/libg2 -I./sup_sw/uclinux/bf/libs/libxml -Wall -mfdpic -DBF -O2 SysStatusMonitorApp.cpp -o SysStatusMonitorApp.o
In file included from /home/student/work/toolchain/bfin-linux-uclibc/lib/gcc/bfin-linux-uclibc/4.1.2/include/c++/backward/complex.h:31,
from SysStatusMonitorApp.cpp:22:
/home/student/work/toolchain/bfin-linux-uclibc/lib/gcc/bfin-linux-uclibc/4.1.2/include/c++/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated.
SysStatusMonitorApp.cpp: In member function ‘virtual void SysStatusMonitorApp::MainLoop()’:
SysStatusMonitorApp.cpp:93: error: ‘complex_fract16’ was not declared in this scope
SysStatusMonitorApp.cpp:93: error: expected `;' before ‘a’
SysStatusMonitorApp.cpp:95: error: ‘a’ was not declared in this scope
SysStatusMonitorApp.cpp:97: error: ‘b’ was not declared in this scope
SysStatusMonitorApp.cpp:100: error: ‘prod’ was not declared in this scope
SysStatusMonitorApp.cpp:100: error: ‘cmlt_fr16’ was not declared in this scope
make: *** [SysStatusMonitorApp.o] Error 1
[student@localhost apps]$
QuoteReplyEditDelete
2009-04-08 16:52:50 Re: how to use libbfdsp functions
Mike Frysinger (UNITED STATES)
Message: 72436
do not build it as C++, use C only
QuoteReplyEditDelete
2009-04-08 19:27:26 Re: how to use libbfdsp functions
David Kasper (UNITED STATES)
Message: 72439
Mike,
I am using the '08-R1.5 toolchain and still have the same problems when a c file was used. I created the simple file below and got compile errors indicating compled_fract16 wasn't found. Any help is appreciated.
Dave
Compiler error:
[student@localhost apps]$ bfin-linux-uclibc-gcc Test.c -o Test.o
Test.c: In function ‘Test’:
Test.c:11: error: ‘complex_fract16’ undeclared (first use in this function)
Test.c:11: error: (Each undeclared identifier is reported only once
Test.c:11: error: for each function it appears in.)
Test.c:11: error: expected ‘;’ before ‘a’
Test.c:13: error: ‘a’ undeclared (first use in this function)
Test.c:15: error: ‘b’ undeclared (first use in this function)
Test.c:18: error: ‘prod’ undeclared (first use in this function)
[student@localhost apps]$
C file:
#include <complex.h>
void Test(void);
void Test(void)
{
//DSP Library test
complex_fract16 a, b, prod;
a.re = 1;
a.im = 0;
b.re = 8;
b.im = 0;
prod = cmlt_fr16(a, b);
// printf("a = %d, b = %d", prod.re, prod.im);
}
QuoteReplyEditDelete
2009-04-08 20:10:16 Re: how to use libbfdsp functions
Mike Frysinger (UNITED STATES)
Message: 72440
if you want to use complex_fract's, you need to include fract_complex.h