At the Hadrian Hotel

At the Hadrian Hotel

Tuesday, October 06, 2009

Running Simplify Media's Software on CentOS 5

I love Simplify Media's music sharing system. It lets me have access to all of the music I have on one computer from my iPhone or any other computer I use. So, I no longer need multiple copies of every song, and I can listen to the entirety of my collection from the iPhone, regardless of the amount of memory available on the phone. Now, I don't have a ton of music, but I do have over 30 GB. Clearly, that would be a bit tough to shoe-horn on to a 16 GB iPhone.

Now, in addition to the iPhone app, Simplify has software for the Mac, MS-Windows, and Ubuntu Linux. My home fileserver, where all of my music lives, is a Linux system, but for a number fo reasons I am running CentOS, not Ubuntu. Unfortunately, the Linux code provided by Simplify will not "just run" on CentOS because of a system library problem.

Simplify's Linux software includes the SimplifyMedia client and the SimplifyPeer server. These programs are dynamically linked and written in C++, and therefore require the library. The latest library version available on CentOS is libstdc++.6.0.8, but the Simplify programs require I found all of this out when I tried to run SimplifyPeer and got this error message:
./SimplifyPeer: /usr/lib/ `GLIBCXX_3.4.9' not found (required by ./SimplifyPeer)
Being the geek that I am, I ran the 'strings' command against the library and looked for "GLIBCXX." The highest number I found was "3.4.8," which clearly was not going to cut it. I did a number fo different Google searches, and most of the results I found spoke of replacing the file, but very few of them actually told me how to go about getting a copy. I finally stumbled across a forum post on that included a link to download a RAR file containing the libstdc++.6.0.9 library file.

Great! Now I had the library file I needed to run the program. The problem I now had was that I was a bit nervous about replacing /usr/lib/ I wasn't sure if just replacing it with a later version would break anything. So I started looking at options for the dynamic linker, starting with LD_LIBRARY_PATH. Unfortunately, none of the various permutations of LD_LIBRARY_PATH values I could think of worked. It was time to check out the man page....

In the man page on my system, the first environment variable listed is LD_LIBABRY_PATH, and the second one is LD_PRELOAD. Herein lies the required magic. Files listed in this variable are "ELF shared libraries to be loaded before all others." This allows you to "selectively override functions in other shared libraries." It turns out this was just what I needed.

The SimplifyPeer program is normally invoked by a bash script that sets a number of arguments in addition to those required from the user. Since I had unpacked the .tgz file into /usr/local, all I needed to do was put the file in the same directory as the program, and add this line to the bash script before the SimplifyPeer program was run:
export LD_PRELOAD=/usr/local/simplifymedia/
That done, I fired up the script with the appropriate arguments for my account, machine name and MP3 directory, and it ran! My family and I could now use Simplify Media to access all of the music on my fileserver from my laptop, the various PCs around the house and, most importantly, the short-on-memory iPhone. This will allow for more varied musical choices on those long car rides to DC when transporting my oldest to and from college.


Anonymous said...

Thanks!! Been looking for how to do this -came across your post - job done!

Anonymous said...

Hi there - great work but it doesn;t quite seem to do the trick for me and woould love a little advise.

Simplify log tells me:

./SimplifyPeer: /lib/ version `GLIBC_2.9' not found (required by ./SimplifyPeer)
./SimplifyPeer: /lib/ version `GLIBC_2.7' not found (required by ./SimplifyPeer)

Any ideas?

Anonymous said...

Hi again - please ignore my last comment. It turns out that it will only run if you use the older version of Simplify (they mark it as legacy on the ubuntu downloads) . the latest version can't run.

Regardless thank you so much for the initial posting on this, its been a wonderful help and thankfully am now up and running with the older build and your tips!