GNU Stow and make install (DESTDIR)

Hello!

I tried to install GNU Radio with GNU Stow. I’d like to have several
versions of GNU Radio that I can switch betwenn without rebuild. Stow
seems to help much in that scenario. And it does a clean uninstall even
if the build tree has changed since build.

How install does not work:

The Stow manual recommends[1]:

6.1.2 Other FSF software

The Free Software Foundation, the organization behind the GNU project,
has been unifying the build procedure for its tools for some time.
Thanks to its tools autoconf' and automake’, most packages now respond
well to these simple steps, with no other intervention necessary:

./configure options
make
make install prefix=/usr/local/stow/package

Hopefully, these tools can evolve to be aware of Stow-managed packages,
such that providing an option to configure' can allow make’ and `make
install’ steps to work correctly without needing to “fool” the build
process.

Unfortnately libtool does not like this way of installing:
$ make install prefix=/usr/local/stow/package
[…]
test -z “/usr/local/stow/packag/lib” || /bin/mkdir -p
“/usr/local/stow/packag/lib”
/bin/bash …/…/…/libtool --mode=install /usr/bin/install -c
libgnuradio-core.la ‘/usr/local/stow/packag/lib’
libtool: install: error: cannot install `libgnuradio-core.la’ to a
directory not ending in /usr/local/lib
[…]

How install does work:

You rather need to install with DESTDIR[2]:

full version

STOWDIR=/usr/local/stow
PACKAGE=gnuradio
VERSION=3.3git
PREFIX=/usr/local
./configure --prefix=${PREFIX}
make
sudo make install DESTDIR=${STOWDIR}/${PACKAGE}-${VERSION}
stow -d ${STOWDIR} -t / ${PACKAGE}-${VERSION}

Note: make install with DESTDIR installs everything with DESTDIR
prepended. If PREFIX=/usr/local/, and DESTDIR=/usr/local/stow/package,
files will end up under /usr/local/stow/package/usr/local/. Stow just
moves files out of DESTDIR to the target directory. This is why the
target has to be /-

If you install to the standard paths, this can be simplified to

simple version

PACKAGE=gnuradio
VERSION=3.3
./configure
make
sudo make install DESTDIR=/usr/local/stow/${PACKAGE}-${VERSION}
sudo stow -d /usr/local -t / ${PACKAGE}-${VERSION}

If you get conflicts you probably have an old package version installed.
You need to uninstall first.

Uninstall:

List your stow packages:

STOWDIR=/usr/local/stow
ls $STOWDIR

The name of the directory is the name of the package.

Unstow the currently installed version:

sudo stow -d $STOWDIR -t/ -D package

[1] http://www.gnu.org/software/stow/manual.html#SEC8
[2] GNU Coding Standards

I hope this information can help others manage their GNU Radio
installations.

Regards

Patrick

On Thu, Jan 6, 2011 at 1:51 PM, Patrick S.
[email protected] wrote:

The Stow manual recommends[1]:
make install prefix=/usr/local/stow/package
test -z “/usr/local/stow/packag/lib” || /bin/mkdir -p
You rather need to install with DESTDIR[2]:

VERSION=3.3

[1] http://www.gnu.org/software/stow/manual.html#SEC8
[2] GNU Coding Standards

I hope this information can help others manage their GNU Radio
installations.

Regards

Patrick

Patrick,
Thanks for the info!

Tom

Hi Patrick,

I manage multiple versions of GNU Radio manually by simply installing
each under its own prefix and having a symbolic link “current” point
to whichever version I want to use. It is really easy:

  1. Update local repository using “git pull”
  2. Get unique version for the snapshot “git describe --abbrev=8”
    This gives something like v3.3.1git-817-g66768f6e
  3. Build and install GNU Radio using
    –prefix=/opt/gnuradio/v3.3.1git-817-g66768f6e
  4. In /opt/gnuradio create a symlink pointing to the new version “ln
    -s v3.3.1git-817-g66768f6e current”

I have my environment set up to include the stuff in
/opt/gnuradio/current:

export PATH=$PATH:/opt/gnuradio/current/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/gnuradio/current/lib
export
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/opt/gnuradio/current/lib/pkgconfig
export
PYTHONPATH=$PYTHONPATH:/opt/gnuradio/current/lib/python2.6/site-packages

This way I can switch between versions by moving the symlink.
Removing an old version is done by deleting the whole folder
/opt/gnuradio/XYZ and does not rely on “make uninstall”

One could do the same with UHD. Until now I have simply installed it
in the same folder as GNU Radio.

This method also works with other software, even those that come as
binary only as long as they can be installed under custom prefix.

Alex

On Thu, Jan 6, 2011 at 7:51 PM, Patrick S.

On Thu, Jan 6, 2011 at 9:44 PM, Patrick S.
[email protected] wrote:

  1. Update local repository using “git pull”
  2. Get unique version for the snapshot “git describe --abbrev=8”
    This gives something like v3.3.1git-817-g66768f6e

That was the part I missed until now. Thanks!

I learned that trick from the GNU Radio build scripts. The version
string is also displayed in the beginning of the configure step but it
scrolls away very quickly.

Alex

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

schrieb Alexandru C. on 2011-01-06 21:09:

Hi Patrick,

I manage multiple versions of GNU Radio manually by simply installing
each under its own prefix and having a symbolic link “current” point
to whichever version I want to use. It is really easy:

  1. Update local repository using “git pull”
  2. Get unique version for the snapshot “git describe --abbrev=8”
    This gives something like v3.3.1git-817-g66768f6e

That was the part I missed until now. Thanks!

export PYTHONPATH=$PYTHONPATH:/opt/gnuradio/current/lib/python2.6/site-packages
I could not get all the paths right, and I like things in /opt less than
in /usr/local as you have to care yourself to get it known to the rest
of the system.

But in the end its a matter of taste.

Regards

Patrick

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk0mKYsACgkQ/G6gHctkMa8VOgCcC7KCkmqLWWsatJzeVH3x0ODc
mTEAoKLRcTEiTmBIpLNnLQdSe7C/B5JN
=WepS
-----END PGP SIGNATURE-----

schrieb Alexandru C. on 2011-01-06 21:09:

Hi Patrick,

I manage multiple versions of GNU Radio manually by simply installing
each under its own prefix and having a symbolic link “current” point
to whichever version I want to use.

We should document both ways in the wiki.

Patrick