Compiling against manually installed packages

I’m trying to compile the openEphys GUI on Ubuntu 14.04. The program requires libhdf5 of version greater than 1.8.12.

Unfortunately Ubuntu 14.04 only has libhdf5-1.8.11 in the repository. The openEphys wiki suggest compiling from source, but I’m afraid doing that might break gtkclient, my wireless neural recording PC client.

Steps I took:

1. sudo apt-get remove libhdf5-dev
This removed “libhdf5-dev”, “libmatio-dev”, “hdf5-helpers”, “libhdf5-serial-dev”, and “hdf5-tools”

2. Next I searched for libhdf5-dev on Ubuntu package directory, and downloaded it and all its dependencies.

I choose the version 1.8.13 whenever possible. These packages include “hdf5-helpers”, “libhdf5-8”, “libhdf5-cpp-8”, “libhdf5-dev”, “libmatio-dev”, “libhdf5-serial-dev”, and “hdf5-tools”. Then install all these packages with

sudo dpkg -i packageName.deb

3. We can check that they are indeed installed via
dpkg -l "*hdf5*".

4. These steps are already enough to compile openEphys GUI. However, it indeed breaks my gtkclient build, with the linker unable to find “-lhdf5”. This is most likely because proper environment variable settings aren’t set, so the linker can’t find the “libhdf5.a” file. Setting “LD_LIBRARY_PATH”  by creating and editing a ld_config file in this way did not work.

5. Instead, I edited my gtkclient Makefile flags to include:

HDF5INCLUDE := -I/usr/include/hdf5/serial

in the CPPFLAGS, and
HDF5LD := -L/usr/lib/x86_64-linux-gnu/hdf5/serial -lhdf5 -lhdf5_cpp

in the linker flags.The first directory name is because all the hdf5 header files are included there. The second directory name is there because the .a and .so library files are in there.

This information is found by executing dpkg -L "libhdf5-dev"

Now everything compiles successfully!


About collapsedwavefn

I have a lot of thoughts. Some of them I'd like to share.
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s