Installing glib in non-standard prefix fails
Asked Answered
S

3

39

I'm trying to install glib in a non-standard prefix but I get the following when running make install:

/bin/sh ../libtool --mode=install /usr/bin/install -c libgthread-2.0.la '/root/build/lib'
libtool: install: error: cannot install `libgthread-2.0.la' to a directory not ending in /usr/local/lib

Any reason why I have to install gthread only in a prefix ending with /usr/local/lib?

Shockey answered 23/4, 2012 at 11:40 Comment(4)
Did you configure it right? I mean ./configure --prefix=<prefix_of_your_choice> ? Try make clean ; make distclean; ./configure --prefix=<prefix_of_your_choice> && make && make installDiatomaceous
I did all of that, to no avail. I finally did something like ../gcc-4.7.0/configure --prefix=/root/build/usr/local/ to make it work.Shockey
You definitely don't have to install glib only in /usr/local/lib; this is due to some libtool or automake weirdness, perhaps stale intermediate files lying around in the tree. I would try untarring a fresh source package and starting from scratch.Voncile
That was a fresh source tree, right out of the tar archive. It doesn't say it has to be /usr/local/lib, it says it has to end with that, which is still weird.Shockey
D
73

I also just stumbled over that problem when compiling MonetDB on my Linux machine. Here is the solution/workaround that worked for me: Always make clean after ./configure.

In your example you should be able to do:

./configure --prefix=/root/build && make clean && make && make install

I found the solution in a discussion on an apache httpd bug where Joe Orton shares his knowledge:

A "make clean" is usually necessary after re-running "configure".

Decommission answered 22/1, 2013 at 10:10 Comment(1)
I had this problem while compiling Gimp 2.9.2. libtool: error: error: cannot install 'libgimpcolor-2.0.la' to a directory not ending in /usr/local/lib. The answer works, but isn't there another method instead of running make clean. A full build takes ~15 minutes, just because one library seems to somehow hardcode the prefix ...Desmonddesmoulins
W
1

Using:

make clean 
make distclean 

Works for me.

Wayland answered 27/5, 2020 at 0:32 Comment(0)
C
-1

The install path of a library can usually be customized rather than the default one under somewhere /usr/local/.

For some libraries, you should specify it with ./configure like this:

./configure --prefix=/the/new/install/path
make
make install

Others allow you to specify it when make install:

./configure
make
make install prefix=/the/new/install/path

You can try both. At least one should resolve your issue.

Cholera answered 2/3, 2022 at 13:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.