Elektito
Elektito

Reputation: 4155

Installing glib in non-standard prefix fails

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?

Upvotes: 39

Views: 16403

Answers (3)

z0gSh1u
z0gSh1u

Reputation: 507

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.

Upvotes: -1

Sergio El Kala Rojas
Sergio El Kala Rojas

Reputation: 11

Using:

make clean 
make distclean 

Works for me.

Upvotes: 1

Juve
Juve

Reputation: 10824

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".

Upvotes: 73

Related Questions