Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

shell command

76 views
Skip to first unread message

Guillaume Dargaud

unread,
Apr 2, 2013, 5:00:00 PM4/2/13
to
Hello all,
I have a Makefile which starts with the following:

LIBS=$(shell pkg-config fftw3 gimp-2.0 --libs)

It fails with

Package fftw3 was not found in the pkg-config search path.
Perhaps you should add the directory containing `fftw3.pc'
to the PKG_CONFIG_PATH environment variable
No package 'fftw3' found

Now, I can tell that "pkg-config fftw3" is looking for a library, which I
have, but which it cannot find (that's one question). But I'm dumbfounded by
the 'shell' command. Never seen it, and searching for it doesn't return
anything, as expected for such a generic name.
--
Guillaume Dargaud
http://www.gdargaud.net/
Message has been deleted

Barry Margolin

unread,
Apr 2, 2013, 5:17:21 PM4/2/13
to
In article <515b46ca$0$2294$426a...@news.free.fr>,
In make, $(...) calls functions, and subsitutes the returned value into
the makefile.

http://www.gnu.org/software/make/manual/make.html#Functions

"shell" is the name of a make function that invokes a shell command and
returns its output:

http://www.gnu.org/software/make/manual/make.html#Shell-Function

--
Barry Margolin, bar...@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***

Eric

unread,
Apr 2, 2013, 5:29:27 PM4/2/13
to
Maybe it is supposed to be

LIBS=$($SHELL pkg-config fftw3 gimp-2.0 --libs)

though I don't really see the point.

Eric
--
ms fnd in a lbry

Steve Youngs

unread,
Apr 2, 2013, 7:39:43 PM4/2/13
to
* Guillaume Dargaud <guil...@gdargaud.net> writes:

> Hello all,
> I have a Makefile which starts with the following:

> LIBS=$(shell pkg-config fftw3 gimp-2.0 --libs)

> It fails with

> Package fftw3 was not found in the pkg-config search path.
> Perhaps you should add the directory containing `fftw3.pc'
> to the PKG_CONFIG_PATH environment variable
> No package 'fftw3' found

> Now, I can tell that "pkg-config fftw3" is looking for a library,

No, it is searching $PKG_CONFIG_PATH for a file called 'fftw3.pc', and
the '--libs' option says to print what is in `Libs:' section of that
file. In this case it is being used to build a compiler command line
used later in the Makefile.

Take a look at some of the files in /usr/lib/pkgconfig/ and also the
pkg-config man page.

> which I have, but which it cannot find (that's one question).

You may have a libfftw3, but it looks like that either it didn't install
a fftw3.pc at all, or it installed it somewhere that pkg-config doesn't
search.

> But I'm dumbfounded by the 'shell' command.

It is just a Makefile function that performs a command in the shell and
returns the output. It is the same as doing: `ls` or $(ls) on the
command line.

--
|---<Steve Youngs>---------------<GnuPG KeyID: A94B3003>---|
| Te audire no possum. |
| Musa sapientum fixa est in aure. |
|--------------------------------<st...@steveyoungs.com>---|

Dan Espen

unread,
Apr 2, 2013, 8:04:41 PM4/2/13
to
Nope, someone else correctly identified the GNU Make $(shell ...)
command.

It runs:

pkg-config fftw3 gimp-2.0 --libs

as a command.

The original poster might find it instructive to paste the command
into a terminal. It should fail there too.

Probably missing some -devel packages.

--
Dan Espen

Ivan Shmakov

unread,
Apr 4, 2013, 10:15:12 AM4/4/13
to
>>>>> Steve Youngs <st...@steveyoungs.com> writes:
>>>>> * Guillaume Dargaud <guil...@gdargaud.net> writes:

[...]

>> It fails with

>> Package fftw3 was not found in the pkg-config search path.
>> Perhaps you should add the directory containing `fftw3.pc' to the
>> PKG_CONFIG_PATH environment variable
>> No package 'fftw3' found

>> Now, I can tell that "pkg-config fftw3" is looking for a library,

> No, it is searching $PKG_CONFIG_PATH for a file called 'fftw3.pc',
> and the '--libs' option says to print what is in `Libs:' section of
> that file. In this case it is being used to build a compiler command
> line used later in the Makefile.

Specifically, to save filesystem space and bandwidth, shared
libraries typically come in /two/ packages:

* the one containing the files necessary to /run/ the
(pre-built) applications linked against the library;

* the one containing the files necessary to develop and build
new applications using the library.

The first package contains, first and foremost, the shared
library file (.so) itself. The second may contain header files,
the static library file (or archive, .a), as well as the ".pc"
file used by pkg-config(1).

Thus, the usual cause for the error message above is that the
system in question lacks the second ("developers'") package.

> Take a look at some of the files in /usr/lib/pkgconfig/ and also the
> pkg-config man page.

[...]

--
FSF associate member #7257 http://hfday.org/
0 new messages