[Jack-Devel] Jack beginner question

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[Jack-Devel] Jack beginner question

Val Veirs (R)
Greetings,

I am just beginning to look at Jack.  I am running Ubuntu 13.04 and I installed the binaries and QJackCtrl seems to work just fine.  That makes me think that so far I have the deamon running as it should.

I want to compile just the simplest of your example clients programs to get started.
 I download the Jack sources and put them in my user space.  There I find metro.c.  In a terminal window I try to compile and I run into path problems.

Here is what is reported:

val@zar:~/JackFiles/jack-1.9.9.5/example-clients$  gcc -o metronome `pkg-config --cflags --libs jack` metro.c

Package jack was not found in the pkg-config search path.
Perhaps you should add the directory containing `jack.pc'
to the PKG_CONFIG_PATH environment variable
No package 'jack' found
metro.c:30:23: fatal error: jack/jack.h: No such file or directory
compilation terminated.


I guess my question is what should PKG_CONFIG_PATH point to?

I would appreciate any suggestions.

Val Veirs
Colorado College
Colorado Springs
_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Jack beginner question

Florian Paul Schmidt-2
On 21.08.2013 08:15, Val Veirs (R) wrote:

> Greetings,
>
> I am just beginning to look at Jack.  I am running Ubuntu 13.04 and I installed the binaries and QJackCtrl seems to work just fine.  That makes me think that so far I have the deamon running as it should.
>
> I want to compile just the simplest of your example clients programs to get started.
>   I download the Jack sources and put them in my user space.  There I find metro.c.  In a terminal window I try to compile and I run into path problems.
>
> Here is what is reported:
>
> val@zar:~/JackFiles/jack-1.9.9.5/example-clients$  gcc -o metronome `pkg-config --cflags --libs jack` metro.c
>
> Package jack was not found in the pkg-config search path.
> Perhaps you should add the directory containing `jack.pc'
> to the PKG_CONFIG_PATH environment variable
> No package 'jack' found
> metro.c:30:23: fatal error: jack/jack.h: No such file or directory
> compilation terminated.
>
>
> I guess my question is what should PKG_CONFIG_PATH point to?
>
> I would appreciate any suggestions.

Like some other people mentioned, you need the -dev packages for
libjack. But the metro client should be available in the (some) jack
package. It's called jack_metro. You could also try tools like jack_lsp
to check if the daemon is running fine..

But just to answer your question: pkg-config looks in some default paths
for .pc files. One of them should be /usr/lib/pkgconfig. If you want it
to search additional paths, then you can point it to e.g.
/usr/local/lib/pkgconfig, this is where the .pc files of packages are
often put when you build the packages yourself from source and leave the
default prefix /usr/local unchanged. Installing libjack-dev (or whatever
it's called) should give you /usr/lib/pkgconfig/jack.pc. So no need to
adjust the PKG_CONFIG_PATH..

Have fun,
Flo

> Val Veirs
> Colorado College
> Colorado Springs
> _______________________________________________
> Jack-Devel mailing list
> [hidden email]
> http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org

_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Jack beginner question

Val Veirs (R)
In reply to this post by Val Veirs (R)

First, “Thank you” to Pawel and Flo for helping me as I try to compile anything with jack.

I have now installed libjack-dev and one result seems to be that I now have a path and file:
/usr/include/jack/jack.h
which I take to be a good thing.
When I try to compile, now the compiler now finds jack.h but none of its references resolve.  I now need to be linked into some jack library(s) that either I don't yet have or I have them in one or more wrong locations.
Compiling metro.c yields:
[hidden email] gcc -o metronome `pkg-config --cflags --libs jack` metro.c
/tmp/ccnO5ZRZ.o: In function `signal_handler':
metro.c:(.text+0x16): undefined reference to `jack_client_close'
/tmp/ccnO5ZRZ.o: In function `process_silence':
metro.c:(.text+0x81): undefined reference to `jack_port_get_buffer'
/tmp/ccnO5ZRZ.o: In function `process_audio':
metro.c:(.text+0xc3): undefined reference to `jack_port_get_buffer'
/tmp/ccnO5ZRZ.o: In function `process':
metro.c:(.text+0x214): undefined reference to `jack_transport_query'
/tmp/ccnO5ZRZ.o: In function `main':
metro.c:(.text+0x6e2): undefined reference to `jack_client_open'
metro.c:(.text+0x736): undefined reference to `jack_set_process_callback'
metro.c:(.text+0x75c): undefined reference to `jack_port_register'
metro.c:(.text+0x772): undefined reference to `jack_get_sample_rate'
metro.c:(.text+0xb31): undefined reference to `sin'
metro.c:(.text+0xbaf): undefined reference to `jack_activate'
collect2: error: ld returned 1 exit status

I looked to see if Flo's suggested path to jack.pc existed and found that my jack.pc is one directory farther down at: /usr/lib/x86_64-linux-gnu/pkgconfig

I tried setting:
  PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig; export PKG_CONFIG_PATH
and confirmed that this setting worked:
  printenv PKG_CONFIG_PATH
/usr/lib/x86_64-linux-gnu/pkgconfig

But, compiling again did not change the failure to find the needed links to the jack.h entry points (jack_client_close etc.)

I have messed with jack so much now that I may have made it impossible to get a working combination of files and paths and libraries.

But, I so much need further advice!

Thanks in advance,
Val Veirs
Colorado College
________________________________________
From: [hidden email] [[hidden email]] on behalf of Florian Paul Schmidt [[hidden email]]
Sent: Wednesday, August 21, 2013 6:01 AM
To: [hidden email]
Subject: Re: [Jack-Devel] Jack beginner question

On 21.08.2013 08:15, Val Veirs (R) wrote:
Greetings,

I am just beginning to look at Jack.  I am running Ubuntu 13.04 and I installed the binaries and QJackCtrl seems to work just fine.  That makes me think that so far I have the deamon running as it should.

I want to compile just the simplest of your example clients programs to get started.
   I download the Jack sources and put them in my user space.  There I find metro.c.  In a terminal window I try to compile and I run into path problems.

Here is what is reported:

[hidden email]  gcc -o metronome `pkg-config --cflags --libs jack` metro.c

Package jack was not found in the pkg-config search path.
Perhaps you should add the directory containing `jack.pc'
to the PKG_CONFIG_PATH environment variable
No package 'jack' found
metro.c:30:23: fatal error: jack/jack.h: No such file or directory
compilation terminated.


I guess my question is what should PKG_CONFIG_PATH point to?

I would appreciate any suggestions.
Like some other people mentioned, you need the -dev packages for
libjack. But the metro client should be available in the (some) jack
package. It's called jack_metro. You could also try tools like jack_lsp
to check if the daemon is running fine..

But just to answer your question: pkg-config looks in some default paths
for .pc files. One of them should be /usr/lib/pkgconfig. If you want it
to search additional paths, then you can point it to e.g.
/usr/local/lib/pkgconfig, this is where the .pc files of packages are
often put when you build the packages yourself from source and leave the
default prefix /usr/local unchanged. Installing libjack-dev (or whatever
it's called) should give you /usr/lib/pkgconfig/jack.pc. So no need to
adjust the PKG_CONFIG_PATH..

Have fun,
Flo

Val Veirs
Colorado College
Colorado Springs
_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org



On 08/20/2013 11:15 PM, Val Veirs (R) wrote:
Greetings,

I am just beginning to look at Jack.  I am running Ubuntu 13.04 and I installed the binaries and QJackCtrl seems to work just fine.  That makes me think that so far I have the deamon running as it should.

I want to compile just the simplest of your example clients programs to get started. 
 I download the Jack sources and put them in my user space.  There I find metro.c.  In a terminal window I try to compile and I run into path problems.

Here is what is reported:

[hidden email]  gcc -o metronome `pkg-config --cflags --libs jack` metro.c

Package jack was not found in the pkg-config search path.
Perhaps you should add the directory containing `jack.pc'
to the PKG_CONFIG_PATH environment variable
No package 'jack' found
metro.c:30:23: fatal error: jack/jack.h: No such file or directory
compilation terminated.


I guess my question is what should PKG_CONFIG_PATH point to?

I would appreciate any suggestions.

Val Veirs
Colorado College
Colorado Springs
_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org


_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Jack beginner question

Harry van Haaren
On Wed, Aug 21, 2013 at 11:13 PM, val and leslie <[hidden email]> wrote:
> I tried setting:
>   PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig; export PKG_CONFIG_PATH
> and confirmed that this setting worked:
>   printenv PKG_CONFIG_PATH
> /usr/lib/x86_64-linux-gnu/pkgconfig
>
> But, compiling again did not change the failure to find the needed links to the jack.h entry points (jack_client_close etc.)

Just running the following command should print the line after it:
$ pkg-config --cflags --libs jack
-ljack -lpthread -lrt

If it doesn't print that your PATH is set wrong, and pkg-config can't find you .pc file.
A hacky workaround is to just use the following to compile:
gcc -o metronome -ljack -lpthread -lrt metro.c

> But, I so much need further advice!
Unrelated advice: please send "plain text" instead of HTML emails to the mailing list, they're easier to read :)

Hope that helps, -Harry

_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Jack beginner question

Harry van Haaren
Please "reply-all" to CC the list on all correspondence, the following email was sent to me directly:

On Thu, Aug 22, 2013 at 1:19 AM, val and leslie <[hidden email]> wrote:
When I run:
$ pkg-config --cflags --libs jack
It just reports the jack library and not the pthread and rt.
i.e.
-ljack
 
What happens when you compile with just -ljack, leaving out pthread & rt?
 
I don't know how to proceed or why this has become so tricky for me.
Figure out why -ljack isn't recognized by gcc. You can use LIBRARY_PATH to tell gcc to search custom paths.
To be honest, something is strange on your system... and I'm not using Ubuntu so its hard for me to know what your system *should* be doing.


_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Jack beginner question

Paul Davis



On Wed, Aug 21, 2013 at 8:50 PM, Harry van Haaren <[hidden email]> wrote:
Please "reply-all" to CC the list on all correspondence, the following email was sent to me directly:

On Thu, Aug 22, 2013 at 1:19 AM, val and leslie <[hidden email]> wrote:
When I run:
$ pkg-config --cflags --libs jack
It just reports the jack library and not the pthread and rt.
i.e.
-ljack
 
What happens when you compile with just -ljack, leaving out pthread & rt?
 
I don't know how to proceed or why this has become so tricky for me.
Figure out why -ljack isn't recognized by gcc. You can use LIBRARY_PATH to tell gcc to search custom paths.

LD_LIBRARY_PATH on *nix systems.
 


_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org