Re: [Discuss-gnuradio] Need help with gr how to create a signal processing block template

2010-05-27 Thread Tom Rondeau
On Tue, May 25, 2010 at 10:26 PM, Hassaan R.  wrote:
>
> On Tue, May 25, 2010 at 7:08 AM, Eric Blossom  wrote:
>>
>> On Tue, May 25, 2010 at 08:24:21AM +0600, Hassaan R. wrote:
>> > Dear Eric,
>> >
>> > Still working on it, hopefully will get a solution soon. Thanks for your
>> > reply, I'll focus on the Makefiles now to find the answer, I've been
>> > just
>> > going through stuff all over the place and working on Octave side by
>> > side. I
>> > will try my best to follow the guidelines in the link you gave me for
>> > reporting errors and apologize for the incomplete post, but rest assured
>> > I
>> > am using all the suggestions and information as best as possible. I'll
>> > continue reading those manuals after documenting all that I have done so
>> > far.
>> >
>> > Regards,
>> > Hassaan
>>
>> Thanks.  No problem.
>>
>> I suspect that you'll need to add the matlab libs using
>>
>>  libfoo_la_LIBADD = -llibmatlab
>>
>> or something similar.  If it's not in /usr/lib or /usr/lib64, you'll
>> probably need to use something like
>>
>>  libfoo_la_LIBADD = -L/opt/path-to-lib-dir -llibmatlab
>>
>> Eric
>
> It was indeed a pathing issue. I used -rpath and -L to gather all the
> required libraries, had to spend alot of time finding all the ones I needed
> though using ldd and hit n trial testing, set them to LIBS inside the
> Makefile and now they are passed to the .la files as dependencies and are
> called whenever linking is done. Everything is in order now and I am getting
> my block compiled and installed. Thanks alot for your help and guidance.
> Next step is sorting out the data types, I/O and understanding how the
> functions will be called so I can use the various .m files that I've
> generated in Matlab and Octave, I'm reading up on different tutorials and
> examples but would be great if you can direct me to some guides or
> references which use external libraries. For I/O I believe the gnu examples
> will be enough but I didn't find any example yet which uses external
> libraries/wrapped functions like I am doing. I'll just keep on looking,
> thanks again for your reply and time.
> Regards,
> Hassaan


Glad you got it working!

There are tons of examples in GNU Radio, considering all of the
dependencies we require. You can start with FFTW by looking at the
gri_fft block. Also, the gr-qtgui has some complicated dependencies on
QT and QWT libraries.

Tom

___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Need help with gr how to create a signal processing block template

2010-05-26 Thread Hassaan R.
On Tue, May 25, 2010 at 7:08 AM, Eric Blossom  wrote:

> On Tue, May 25, 2010 at 08:24:21AM +0600, Hassaan R. wrote:
> > Dear Eric,
> >
> > Still working on it, hopefully will get a solution soon. Thanks for your
> > reply, I'll focus on the Makefiles now to find the answer, I've been just
> > going through stuff all over the place and working on Octave side by
> side. I
> > will try my best to follow the guidelines in the link you gave me for
> > reporting errors and apologize for the incomplete post, but rest assured
> I
> > am using all the suggestions and information as best as possible. I'll
> > continue reading those manuals after documenting all that I have done so
> > far.
> >
> > Regards,
> > Hassaan
>
> Thanks.  No problem.
>
> I suspect that you'll need to add the matlab libs using
>
>  libfoo_la_LIBADD = -llibmatlab
>
> or something similar.  If it's not in /usr/lib or /usr/lib64, you'll
> probably need to use something like
>
>  libfoo_la_LIBADD = -L/opt/path-to-lib-dir -llibmatlab
>
> Eric
>

It was indeed a pathing issue. I used -rpath and -L to gather all the
required libraries, had to spend alot of time finding all the ones I needed
though using ldd and hit n trial testing, set them to LIBS inside the
Makefile and now they are passed to the .la files as dependencies and are
called whenever linking is done. Everything is in order now and I am getting
my block compiled and installed. Thanks alot for your help and guidance.

Next step is sorting out the data types, I/O and understanding how the
functions will be called so I can use the various .m files that I've
generated in Matlab and Octave, I'm reading up on different tutorials and
examples but would be great if you can direct me to some guides or
references which use external libraries. For I/O I believe the gnu examples
will be enough but I didn't find any example yet which uses external
libraries/wrapped functions like I am doing. I'll just keep on looking,
thanks again for your reply and time.

Regards,
Hassaan
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Need help with gr how to create a signal processing block template

2010-05-24 Thread Eric Blossom
On Mon, May 24, 2010 at 03:36:35PM -0700, H.Raza wrote:
> 
> Thanks Eric for your reply. The suggestion was immensely helpful. I was
> looking for the wrong documentation initially and could not understand how
> Automake works, think I had the Make one open.
> 
> As the documentation is very comprehensive, I was only able to grasp a few
> things but I was able to fix 2 of the errors, the ones related to my own
> library file implementations not being defined. However, for the
> implementation of the other API functions which are a part of Matlab
> internal libraries I don't have the .cc or .cpp file and just the .so files
> which contain all the implementations inside the Matlab root folder.
> 
> Although shared libraries are covered in the Automake document and the
> followup Libtool document, but there are many instances and I'm not sure
> where exactly should I be looking for my specific case. I figured out that I
> need to add the full path to the API function library file in the
> lib/makefile.am, under lib_LTLIBRARIES however as expected it is saying that
> a .la (libtool library) is needed. I'm not sure if this is what I should be
> doing, so any guidance would be great. Thank you for your time.

Please spent some more time with the docs.

lib_LTLIBRARIES is a list of shared libraries that you are building
and installing.  You are unlikely to be building and installing what
I'm assuming are matlab libraries; you want to _use_ them.

There are _many_ Makefile.am's in the source tree.  Please consider
looking at them for inspiration.

Also, please spend some time reading this:

  http://gnuradio.org/redmine/wiki/gnuradio/ReportingErrors

It's got many tips on ways to effectively get help on this list.

Eric

___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Need help with gr how to create a signal processing block template

2010-05-24 Thread H.Raza

Thanks Eric for your reply. The suggestion was immensely helpful. I was
looking for the wrong documentation initially and could not understand how
Automake works, think I had the Make one open.

As the documentation is very comprehensive, I was only able to grasp a few
things but I was able to fix 2 of the errors, the ones related to my own
library file implementations not being defined. However, for the
implementation of the other API functions which are a part of Matlab
internal libraries I don't have the .cc or .cpp file and just the .so files
which contain all the implementations inside the Matlab root folder.

Although shared libraries are covered in the Automake document and the
followup Libtool document, but there are many instances and I'm not sure
where exactly should I be looking for my specific case. I figured out that I
need to add the full path to the API function library file in the
lib/makefile.am, under lib_LTLIBRARIES however as expected it is saying that
a .la (libtool library) is needed. I'm not sure if this is what I should be
doing, so any guidance would be great. Thank you for your time.

These and some other Matlab API function errors are appearing.

/home/user/Downloads/gr-howto-write-a-block-template/lib/.libs/libgnuradio-howto.so:
 undefined reference to `mclTerminateApplication_proxy'

/home/user/Downloads/gr-howto-write-a-block-template/lib/.libs/libgnuradio-howto.so:
 undefined reference to `mclInitializeApplication_proxy'

Regards,
H.Raza


Eric Blossom wrote:
> 
> On Mon, May 24, 2010 at 12:01:17PM -0700, H.Raza wrote:
>> 
>> Thanks a lot for the reply Tom, I figured out that part after looking at
>> a
>> number of sample Makefile.am files in different projects. I used the
>> -I
>> flag to include the directories and the compilation began, but after a
>> few
>> steps I received the following error. 
>> 
>> == from Terminal===
>> libtool: link: g++ -g -O2 -g -O2 -o .libs/test_all test_all.o 
>> ./.libs/libgnuradio-howto-qa.a
>> /home/user/Downloads/gr-howto-write-a-block-template/lib/.libs/libgnuradio-howto.so
>> -L/usr/local/lib -L/usr/lib /usr/lib/libcppunit.so -ldl -lboost_thread-mt
>> -lrt -lboost_date_time-mt /usr/local/lib/libgnuradio-core.so
>> /usr/local/lib/libgruel.so /usr/lib/libfftw3f.so -lgsl -lgslcblas -lm
>> /usr/local/lib/libgromnithread.so -pthread
>> /home/user/Downloads/gr-howto-write-a-block-template/lib/.libs/libgnuradio-howto.so:
>> undefined reference to `libmatinvTerminate'
>> /home/user/Downloads/gr-howto-write-a-block-template/lib/.libs/libgnuradio-howto.so:
>> undefined reference to `mclTerminateApplication_proxy'
>> /home/user/Downloads/gr-howto-write-a-block-template/lib/.libs/libgnuradio-howto.so:
>> undefined reference to `mclInitializeApplication_proxy'
>> /home/user/Downloads/gr-howto-write-a-block-template/lib/.libs/libgnuradio-howto.so:
>> undefined reference to `libmatinvInitialize'
>> collect2: ld returned 1 exit status
>> ===
>> 
>> In the above errors libmatinv is the name of my generated library from
>> matlab mcc. The library is already in the lib folder. The C driver
>> implementation is also in the lib folder inside generalwork function
>> implementation.
>> 
>> I have been searching around for this error and I heard from someone that
>> I
>> might have to use -L and "small L"-l flags to give the compiler
>> the implementation of the functions in my library header, along with the
>> -I but I am not exactly sure which files does it need. Any
>> suggestions
>> in this regard are highly appreciated.
>> 
>> Also Tom you mentioned M4 config files, I am planning to release these
>> later
>> on once my target is achieved. Would you kindly guide me a little, so I
>> have
>> a decent idea where to start learning about these files and then take it
>> 1
>> step at a time. Thanks again.
>> 
> 
> You have apparently failed to add the additional link-time dependency
> when you are bulding libgnuradio-howto.so.  The library that's missing
> is the one that contains libmatinvTerminate, et al.
> 
> I suggest that you spend a few minutes with the automake documentation:
> 
>   http://www.gnu.org/software/automake/#TOCdocumentation
> 
> Eric
> 
> ___
> Discuss-gnuradio mailing list
> Discuss-gnuradio@gnu.org
> http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Need-help-with-gr-how-to-create-a-signal-processing-block-template-tp28646216p28662571.html
Sent from the GnuRadio mailing list archive at Nabble.com.


___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Need help with gr how to create a signal processing block template

2010-05-24 Thread Eric Blossom
On Mon, May 24, 2010 at 12:01:17PM -0700, H.Raza wrote:
> 
> Thanks a lot for the reply Tom, I figured out that part after looking at a
> number of sample Makefile.am files in different projects. I used the -I
> flag to include the directories and the compilation began, but after a few
> steps I received the following error. 
> 
> == from Terminal===
> libtool: link: g++ -g -O2 -g -O2 -o .libs/test_all test_all.o 
> ./.libs/libgnuradio-howto-qa.a
> /home/user/Downloads/gr-howto-write-a-block-template/lib/.libs/libgnuradio-howto.so
> -L/usr/local/lib -L/usr/lib /usr/lib/libcppunit.so -ldl -lboost_thread-mt
> -lrt -lboost_date_time-mt /usr/local/lib/libgnuradio-core.so
> /usr/local/lib/libgruel.so /usr/lib/libfftw3f.so -lgsl -lgslcblas -lm
> /usr/local/lib/libgromnithread.so -pthread
> /home/user/Downloads/gr-howto-write-a-block-template/lib/.libs/libgnuradio-howto.so:
> undefined reference to `libmatinvTerminate'
> /home/user/Downloads/gr-howto-write-a-block-template/lib/.libs/libgnuradio-howto.so:
> undefined reference to `mclTerminateApplication_proxy'
> /home/user/Downloads/gr-howto-write-a-block-template/lib/.libs/libgnuradio-howto.so:
> undefined reference to `mclInitializeApplication_proxy'
> /home/user/Downloads/gr-howto-write-a-block-template/lib/.libs/libgnuradio-howto.so:
> undefined reference to `libmatinvInitialize'
> collect2: ld returned 1 exit status
> ===
> 
> In the above errors libmatinv is the name of my generated library from
> matlab mcc. The library is already in the lib folder. The C driver
> implementation is also in the lib folder inside generalwork function
> implementation.
> 
> I have been searching around for this error and I heard from someone that I
> might have to use -L and "small L"-l flags to give the compiler
> the implementation of the functions in my library header, along with the
> -I but I am not exactly sure which files does it need. Any suggestions
> in this regard are highly appreciated.
> 
> Also Tom you mentioned M4 config files, I am planning to release these later
> on once my target is achieved. Would you kindly guide me a little, so I have
> a decent idea where to start learning about these files and then take it 1
> step at a time. Thanks again.
> 

You have apparently failed to add the additional link-time dependency
when you are bulding libgnuradio-howto.so.  The library that's missing
is the one that contains libmatinvTerminate, et al.

I suggest that you spend a few minutes with the automake documentation:

  http://www.gnu.org/software/automake/#TOCdocumentation

Eric

___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Need help with gr how to create a signal processing block template

2010-05-24 Thread H.Raza

Thanks a lot for the reply Tom, I figured out that part after looking at a
number of sample Makefile.am files in different projects. I used the -I
flag to include the directories and the compilation began, but after a few
steps I received the following error. 

== from Terminal===
libtool: link: g++ -g -O2 -g -O2 -o .libs/test_all test_all.o 
./.libs/libgnuradio-howto-qa.a
/home/user/Downloads/gr-howto-write-a-block-template/lib/.libs/libgnuradio-howto.so
-L/usr/local/lib -L/usr/lib /usr/lib/libcppunit.so -ldl -lboost_thread-mt
-lrt -lboost_date_time-mt /usr/local/lib/libgnuradio-core.so
/usr/local/lib/libgruel.so /usr/lib/libfftw3f.so -lgsl -lgslcblas -lm
/usr/local/lib/libgromnithread.so -pthread
/home/user/Downloads/gr-howto-write-a-block-template/lib/.libs/libgnuradio-howto.so:
undefined reference to `libmatinvTerminate'
/home/user/Downloads/gr-howto-write-a-block-template/lib/.libs/libgnuradio-howto.so:
undefined reference to `mclTerminateApplication_proxy'
/home/user/Downloads/gr-howto-write-a-block-template/lib/.libs/libgnuradio-howto.so:
undefined reference to `mclInitializeApplication_proxy'
/home/user/Downloads/gr-howto-write-a-block-template/lib/.libs/libgnuradio-howto.so:
undefined reference to `libmatinvInitialize'
collect2: ld returned 1 exit status
===

In the above errors libmatinv is the name of my generated library from
matlab mcc. The library is already in the lib folder. The C driver
implementation is also in the lib folder inside generalwork function
implementation.

I have been searching around for this error and I heard from someone that I
might have to use -L and "small L"-l flags to give the compiler
the implementation of the functions in my library header, along with the
-I but I am not exactly sure which files does it need. Any suggestions
in this regard are highly appreciated.

Also Tom you mentioned M4 config files, I am planning to release these later
on once my target is achieved. Would you kindly guide me a little, so I have
a decent idea where to start learning about these files and then take it 1
step at a time. Thanks again.


Tom Rondeau wrote:
> 
> On Sat, May 22, 2010 at 5:52 PM, Nick.R  wrote:
>>
>> I am quite new to unix as well as GNU radio, but after practising with
>> the
>> different modules and reading alot about it in papers and tutorials I've
>> been able to understand how to use some of its functions. Presently I am
>> trying to make a block in GNU Radio Companion from a C shared library
>> file
>> generated from Matlab.
>>
>> I've been following the tutorial on how to create a signal processing
>> block
>> and I believe my files are ready, also I have edited most of the scripts
>> as
>> per requirements. However, when I try to do "make"/"sudo make" after
>> ./bootstrap and ./configure, the compiler is unable to build because it
>> cannot find one of the matlab libraries that are a dependency for my .h
>> and
>> .cc file. I've tried looking everywhere on forums for a solution but
>> there
>> is no information regarding this. The library files in question are the
>> mclmcrrt.h and mclcppclass.h. Matlab used them to compile the shared
>> library
>> so the path I set for them in bashrc seems correct. When I do "locate" I
>> can
>> find the libraries as well.
>>
>> Following error is generated and then it says that all subsequent
>> functions
>> being used in the .cc file being not initialized and stops.
>> In file included from ./howto_square_ff.h:26,
>>                 from howto_square_ff.cc:32:
>> ./libmyfunc.h:14:22: error: mclmcrrt.h: No such file or directory
>> ./libmyfunc.h:15:25: error: mclcppclass.h: No such file or directory
>>
>> I'm on Ubuntu 9.10 - the Karmic Koala release
>>
>> Is there something specific that needs to be done for the "make"
>> procedure
>> to read these libraries ? Any help in this regard will be highly
>> appreciated. This is my first time posting here, so I hope I was able to
>> convey as much information as possibly regarding the problem.
> 
> 
> You will have to edit the Makefile.am to add the source code directory
> to include the two missing header files into the local make
> environment. The simplest thing to do is to add this to "AM_CPPFLAGS"
> in Makefile.am: "-I" where  is the directory of the files.
> 
> This isn't the most elegant way to handle this, and if you are
> planning on releasing this or using this code in a more
> production-oriented fashion, we'll have to talk about M4 config files
> and the such. But start here and see if it works.
> 
> Tom
> 
> ___
> Discuss-gnuradio mailing list
> Discuss-gnuradio@gnu.org
> http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Need-help-with-gr-how-to-create-a-signal-processing-block-template-tp28646216p28660534.html
Sent from the GnuRadio mailing list archive at Nabble.com.


Re: [Discuss-gnuradio] Need help with gr how to create a signal processing block template

2010-05-23 Thread Tom Rondeau
On Sat, May 22, 2010 at 5:52 PM, Nick.R  wrote:
>
> I am quite new to unix as well as GNU radio, but after practising with the
> different modules and reading alot about it in papers and tutorials I've
> been able to understand how to use some of its functions. Presently I am
> trying to make a block in GNU Radio Companion from a C shared library file
> generated from Matlab.
>
> I've been following the tutorial on how to create a signal processing block
> and I believe my files are ready, also I have edited most of the scripts as
> per requirements. However, when I try to do "make"/"sudo make" after
> ./bootstrap and ./configure, the compiler is unable to build because it
> cannot find one of the matlab libraries that are a dependency for my .h and
> .cc file. I've tried looking everywhere on forums for a solution but there
> is no information regarding this. The library files in question are the
> mclmcrrt.h and mclcppclass.h. Matlab used them to compile the shared library
> so the path I set for them in bashrc seems correct. When I do "locate" I can
> find the libraries as well.
>
> Following error is generated and then it says that all subsequent functions
> being used in the .cc file being not initialized and stops.
> In file included from ./howto_square_ff.h:26,
>                 from howto_square_ff.cc:32:
> ./libmyfunc.h:14:22: error: mclmcrrt.h: No such file or directory
> ./libmyfunc.h:15:25: error: mclcppclass.h: No such file or directory
>
> I'm on Ubuntu 9.10 - the Karmic Koala release
>
> Is there something specific that needs to be done for the "make" procedure
> to read these libraries ? Any help in this regard will be highly
> appreciated. This is my first time posting here, so I hope I was able to
> convey as much information as possibly regarding the problem.


You will have to edit the Makefile.am to add the source code directory
to include the two missing header files into the local make
environment. The simplest thing to do is to add this to "AM_CPPFLAGS"
in Makefile.am: "-I" where  is the directory of the files.

This isn't the most elegant way to handle this, and if you are
planning on releasing this or using this code in a more
production-oriented fashion, we'll have to talk about M4 config files
and the such. But start here and see if it works.

Tom

___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio