# Re: Discuss-gnuradio Digest, Vol 40, Issue 39

**URL:** <https://www.ruby-forum.com/t/re-discuss-gnuradio-digest-vol-40-issue-39/55658>\
**Category:** GNU Radio\
**Created:** [March 22, 2006, 8:36pm UTC](https://www.ruby-forum.com/t/re-discuss-gnuradio-digest-vol-40-issue-39/55658 "2006-03-22T20:36:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ges](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/3be4f8/32.png) [@Ges](https://www.ruby-forum.com/u/Ges)\
**Post date:** [March 22, 2006, 8:36pm UTC](https://www.ruby-forum.com/t/re-discuss-gnuradio-digest-vol-40-issue-39/55658/1 "2006-03-22T20:36:08Z")

</div>

Hi Eric,

As an added note to my last post, in case the gr-usrp code is not being  
compiled into a shared library, I could probably create one using the  
object files present. Am I right? If so, I am a bit weary of the compile  
options that I would have to use.

If you could guide me on that, that would be a great help.

Thanks,  
Gesly

---

<div class="post-metadata">

**Author:** ![Ges](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/3be4f8/32.png) [@Ges](https://www.ruby-forum.com/u/Ges)\
**Post date:** [March 22, 2006, 10:12pm UTC](https://www.ruby-forum.com/t/re-discuss-gnuradio-digest-vol-40-issue-39/55658/2 "2006-03-22T22:12:47Z")

</div>

On Wed, Mar 22, 2006 at 11:35:04AM -0800, Ges wrote:

> Gesly  
> Hi Gesly,

I don’t think I saw the post you’re referencing.

In any event, gr-usrp does get compiled into a shared library. That’s  
the mechanism we use to get our code loaded into python.

This fragment from gr-usrp/src/Makefile.am builds the shared lib.  
The automake and libtool manuals will be helpful for decoding 😉

```
ourlib_LTLIBRARIES = _usrp1.la

_usrp1_la_SOURCES = \
        usrp1.cc \
        usrp1_sink_base.cc \
        usrp1_sink_c.cc \
        usrp1_sink_s.cc \
        usrp1_source_base.cc \
        usrp1_source_c.cc \
        usrp1_source_s.cc

_usrp1_la_LIBADD = \
        $(PYTHON_LDFLAGS) \
        -lstdc++

_usrp1_la_LDFLAGS = $(NO_UNDEFINED) -module -avoid-version

```

Perhaps you can provide a bit more context?

Thanks,  
Eric

---

<div class="post-metadata">

**Author:** ![Ges](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/3be4f8/32.png) [@Ges](https://www.ruby-forum.com/u/Ges)\
**Post date:** [March 23, 2006, 5:41am UTC](https://www.ruby-forum.com/t/re-discuss-gnuradio-digest-vol-40-issue-39/55658/3 "2006-03-23T05:41:41Z")

</div>

Hi Eric,

The mail previous to the one below is there on the mailing list.

Anyway, what I was trying to do was try to get some code that I wrote  
using the usrp1\_source\_c functions to work. I was trying to link with  
the gnuradio-core libraries. Later I realised that these files are not  
complied in the gnuradio-core library. I saw the \_usrp1.so lib file in  
.libs directory. But this contains all the swig related symbols in it as  
well.

So, I then made a different shared library using the .o files and I was  
able to link my code with it.

I was basically trying to find out if there is some shared library for  
the gr-usrp code with which I could link my C++ code.

Thanks,  
Gesly

Eric B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote: On Wed, Mar 22, 2006 at 11:35:04AM  
-0800, Ges wrote:

> Gesly  
> Hi Gesly,

I don’t think I saw the post you’re referencing.

In any event, gr-usrp does get compiled into a shared library. That’s  
the mechanism we use to get our code loaded into python.

This fragment from gr-usrp/src/Makefile.am builds the shared lib.  
The automake and libtool manuals will be helpful for decoding 😉

```
ourlib_LTLIBRARIES = _usrp1.la

_usrp1_la_SOURCES = \
        usrp1.cc \
        usrp1_sink_base.cc \
        usrp1_sink_c.cc \
        usrp1_sink_s.cc \
        usrp1_source_base.cc \
        usrp1_source_c.cc \
        usrp1_source_s.cc

_usrp1_la_LIBADD = \
        $(PYTHON_LDFLAGS) \
        -lstdc++

_usrp1_la_LDFLAGS = $(NO_UNDEFINED) -module -avoid-version

```

Perhaps you can provide a bit more context?

Thanks,  
Eric

---

<div class="post-metadata">

**Author:** ![Ges](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/3be4f8/32.png) [@Ges](https://www.ruby-forum.com/u/Ges)\
**Post date:** [March 27, 2006, 8:29pm UTC](https://www.ruby-forum.com/t/re-discuss-gnuradio-digest-vol-40-issue-39/55658/4 "2006-03-27T20:29:45Z")

</div>

On Wed, Mar 22, 2006 at 08:40:13PM -0800, Ges wrote:

> Hi Eric,
> 
> The mail previous to the one below is there on the mailing list.
> 
> Anyway, what I was trying to do was try to get some code that I  
> wrote using the usrp1\_source\_c functions to work. I was trying to  
> link with the gnuradio-core libraries. Later I realised that these  
> files are not complied in the gnuradio-core library. I saw the  
> \_usrp1.so lib file in .libs directory. But this contains all the  
> swig related symbols in it as well.

Are you trying to use the functions in usrp1\_source\_c from C++?  
If so, that seems a bit odd. I’d suggest using the stable and  
documented interface in usrp\_standard.h. usrp1\_\*'s only purpose in  
life is to glue usrp\_standard\_{tx,rx} into GNU Radio. It’s a bit of a  
kludge right now. However, SWIG is now supporting multiple  
inheritance, so refactoring could remove all the manual proxying.

> So, I then made a different shared library using the .o files and I  
> was able to link my code with it.

OK.

> I was basically trying to find out if there is some shared library  
> for the gr-usrp code with which I could link my C++ code.

OK. Are you aware that there’s a separate libusrp.so that contains  
usrp\_standard and friends?

Eric
