# Cmake build not placing lib\*.so properly

**URL:** <https://www.ruby-forum.com/t/cmake-build-not-placing-lib-so-properly/215725>\
**Category:** GNU Radio\
**Created:** [January 13, 2012, 8:02pm UTC](https://www.ruby-forum.com/t/cmake-build-not-placing-lib-so-properly/215725 "2012-01-13T20:02:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [January 13, 2012, 8:02pm UTC](https://www.ruby-forum.com/t/cmake-build-not-placing-lib-so-properly/215725/1 "2012-01-13T20:02:04Z")

</div>

Observe the following directory listing:

[mleech@localhost ~]$ ls -l /usr/local/lib/libgnuradio-core\*  
lrwxrwxrwx 1 root root 34 2012-01-13 13:56  
/usr/local/lib/libgnuradio-core-3.5.2git.so.0 →   
libgnuradio-core-3.5.2git.so.0.0.0  
lrwxrwxrwx 1 root root 34 2012-01-13 13:56  
/usr/local/lib/libgnuradio-core.so → libgnuradio-core-3.5.2git.so.0.0.0  
-rwxr-xr-x 1 root root 2108365 2012-01-13 13:45  
/usr/local/lib/libgnuradio-core.so.0.0.0

Notice how libgnuradio-core.so points off to nothingness

Now, gnuradio-based _applications_ seem to be just fine with this, after  
running ldconfig.

But, for example, if you pull something, like gr-stream-tags off of  
CGRAN, and try to build the result, it  
will barf on a linker error, due to not being able to resolve  
“-lgnuradio-core” (and others).

So the question is, where is cmake getting its notion of how to name  
these things, and set up the  
symlink hierarchy? If it comes from the “.pc” files, I’ll note that  
they haven’t been updated since  
I last ran an autotools build, 5 days ago. Does cmake update the  
“.pc” files? How is this  
dangling symlink problem happening?

–  
Principal Investigator  
Shirleys Bay Radio Astronomy Consortium

> **[Live Draw HK Tercepat | Result HK | HK Pools | Live HK | HK Prize Hari Ini](https://www.sbrac.org/)**
>
> Temukan live draw hk tercepat melalui halaman hk pools yang resmi dan dapatkan result hk prize melalui live hk secara langsung di situs kami.

---

<div class="post-metadata">

**Author:** ![Marcus\_DSLeech](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/74df32/32.png) [@Marcus\_DSLeech](https://www.ruby-forum.com/u/Marcus_DSLeech)\
**Post date:** [January 13, 2012, 8:22pm UTC](https://www.ruby-forum.com/t/cmake-build-not-placing-lib-so-properly/215725/2 "2012-01-13T20:22:31Z")

</div>

On 01/13/2012 11:01 AM, Marcus D. Leech wrote:

> So the question is, where is cmake getting its notion of how to name  
> these things, and set up the  
> symlink hierarchy? If it comes from the “.pc” files, I’ll note that  
> they haven’t been updated since  
> I last ran an autotools build, 5 days ago. Does cmake update the  
> “.pc” files? How is this  
> dangling symlink problem happening?

The weirdness comes from this code:  
[http://gnuradio.org/cgit/gnuradio.git/tree/cmake/Modules/GrMiscUtils.cmake?h=maint#n151](http://gnuradio.org/cgit/gnuradio.git/tree/cmake/Modules/GrMiscUtils.cmake?h=maint#n151)

The symlinks looks like this on my system:

> <https://pastebin.com/Q4Vuz8Kb>

What is your os? I think this line for you isnt changing the library  
target name to ${target}-${LIBVER}. Does that sound like the issue?

set\_target\_properties(${target} PROPERTIES LIBRARY\_OUTPUT\_NAME  
${target}-${LIBVER} SOVERSION “0.0.0”)

-Josh

---

<div class="post-metadata">

**Author:** ![Marcus\_DSLeech](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/74df32/32.png) [@Marcus\_DSLeech](https://www.ruby-forum.com/u/Marcus_DSLeech)\
**Post date:** [January 13, 2012, 8:34pm UTC](https://www.ruby-forum.com/t/cmake-build-not-placing-lib-so-properly/215725/3 "2012-01-13T20:34:54Z")

</div>

On 13/01/12 02:21 PM, Josh B. wrote:

> > /usr/local/lib/libgnuradio-core.so → libgnuradio-core-3.5.2git.so.0.0.0  
> > will barf on a linker error, due to not being able to resolve
> 
> set\_target\_properties(${target} PROPERTIES LIBRARY\_OUTPUT\_NAME  
> ${target}-${LIBVER} SOVERSION “0.0.0”)
> 
> -Josh

It’s a Fedora-12 32-bit machine. With cmake-2.6.4-5.fc12.i686

That could be the issue, yes. But I’m not a Cmake guy at all.

–  
Principal Investigator  
Shirleys Bay Radio Astronomy Consortium

> **[Live Draw HK Tercepat | Result HK | HK Pools | Live HK | HK Prize Hari Ini](https://www.sbrac.org)**
>
> Temukan live draw hk tercepat melalui halaman hk pools yang resmi dan dapatkan result hk prize melalui live hk secara langsung di situs kami.

---

<div class="post-metadata">

**Author:** ![Marcus\_DSLeech](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/74df32/32.png) [@Marcus\_DSLeech](https://www.ruby-forum.com/u/Marcus_DSLeech)\
**Post date:** [January 13, 2012, 8:50pm UTC](https://www.ruby-forum.com/t/cmake-build-not-placing-lib-so-properly/215725/4 "2012-01-13T20:50:59Z")

</div>

On 01/13/2012 11:34 AM, Marcus D. Leech wrote:

> > > lrwxrwxrwx 1 root root 34 2012-01-13 13:56  
> > > CGRAN, and try to build the result, it
> > 
> > set\_target\_properties(${target} PROPERTIES LIBRARY\_OUTPUT\_NAME  
> > ${target}-${LIBVER} SOVERSION “0.0.0”)
> > 
> > -Josh
> 
> It’s a Fedora-12 32-bit machine. With cmake-2.6.4-5.fc12.i686

Thats an old fedora 🙂

> That could be the issue, yes. But I’m not a Cmake guy at all.

This is part of our special LIBRARY\_EXTRAS mode. You can disable it with  
-DLIBRARY\_EXTRAS=OFF just so you know, but I think the following patch  
will solve the issue…

So, it like cmake 2.6 doesnt have LIBRARY\_OUTPUT\_NAME, but it does have  
OUTPUT\_NAME. They are both ways to rename the target, one being specific  
to a library and only possible with 2.8 and up. Try this patch:

> <https://pastebin.com/kXKgJPF7>

-josh
