p2pvc icon indicating copy to clipboard operation
p2pvc copied to clipboard

Installation fails on OS X

Open Sajonara opened this issue 11 years ago • 34 comments

Hello,

I would like to thank you for p2pvc but I cannot install it on OS X (10.10.3 Beta 1). I have Homebrew installed and did install the depending packages like so, because at least with one package I got an error notice when I first tried to "make" p2pvc:

brew install homebrew/science/opencv
brew install pulseaudio
brew install ncurses

When all those installs are finished I'm still confronted with error messages, when I try to "make" p2pvc:

src/p2plib.c:275:7: warning: implicit declaration of function 'clock_gettime' is invalid in C99 [-Wimplicit-function-declaration]
      clock_gettime(CLOCK_MONOTONIC, &prevPacket);
      ^
src/p2plib.c:275:21: error: use of undeclared identifier 'CLOCK_MONOTONIC'
      clock_gettime(CLOCK_MONOTONIC, &prevPacket);
                    ^
src/p2plib.c:278:21: error: use of undeclared identifier 'CLOCK_MONOTONIC'
      clock_gettime(CLOCK_MONOTONIC, &currPacket);
                    ^
src/p2plib.c:280:21: error: use of undeclared identifier 'CLOCK_MONOTONIC'
      clock_gettime(CLOCK_MONOTONIC, &prevPacket);
                    ^

Any help would be appreciated.

Kind regards.

Sajonara avatar Feb 10 '15 06:02 Sajonara

hey, try pulling from the portaudio branch. I've successfully been able to get it working on my OS X machine using that branch. You'll also need to install portaudio: brew install portaudio

git fetch; git checkout portaudio; git pull; make clean; make

emgram769 avatar Feb 10 '15 06:02 emgram769

I'm sorry @emgram769 I tried as you said but it still outputs these errors.

Sajonara avatar Feb 10 '15 06:02 Sajonara

what is the output of git branch?

emgram769 avatar Feb 10 '15 06:02 emgram769

It is

fatal: Not a git repository (or any of the parent directories): .git
fatal: Not a git repository (or any of the parent directories): .git
fatal: Not a git repository (or any of the parent directories): .git
rm -rf objs audio video p2pvc
mkdir -p objs
gcc -Isrc/inc -O2 -Wall `pkg-config --cflags opencv` src/audio.c -c -o objs/audio.o
Package opencv was not found in the pkg-config search path.
Perhaps you should add the directory containing `opencv.pc'
to the PKG_CONFIG_PATH environment variable
No package 'opencv' found
gcc -Isrc/inc -O2 -Wall `pkg-config --cflags opencv` src/display.c -c -o objs/display.o
Package opencv was not found in the pkg-config search path.
Perhaps you should add the directory containing `opencv.pc'
to the PKG_CONFIG_PATH environment variable
No package 'opencv' found
gcc -Isrc/inc -O2 -Wall `pkg-config --cflags opencv` src/p2plib.c -c -o objs/p2plib.o
Package opencv was not found in the pkg-config search path.
Perhaps you should add the directory containing `opencv.pc'
to the PKG_CONFIG_PATH environment variable
No package 'opencv' found
src/p2plib.c:275:7: warning: implicit declaration of function 'clock_gettime' is invalid in C99 [-Wimplicit-function-declaration]
      clock_gettime(CLOCK_MONOTONIC, &prevPacket);
      ^
src/p2plib.c:275:21: error: use of undeclared identifier 'CLOCK_MONOTONIC'
      clock_gettime(CLOCK_MONOTONIC, &prevPacket);
                    ^
src/p2plib.c:278:21: error: use of undeclared identifier 'CLOCK_MONOTONIC'
      clock_gettime(CLOCK_MONOTONIC, &currPacket);
                    ^
src/p2plib.c:280:21: error: use of undeclared identifier 'CLOCK_MONOTONIC'
      clock_gettime(CLOCK_MONOTONIC, &prevPacket);
                    ^
1 warning and 3 errors generated.
make: *** [objs/p2plib.o] Error 1

Sajonara avatar Feb 10 '15 06:02 Sajonara

try this. it will directly clone the specified branch git clone -b portaudio https://github.com/mofarrell/p2pvc.git then make Also make sure you have opencv properly installed.

mofarrell avatar Feb 10 '15 06:02 mofarrell

clock_gettime() is not supprted by mac os , can i use gettimeofday() instead? if (delta == -1) { gettimeofday(&prevPacket, 0); // clock_gettime(CLOCK_MONOTONIC, &prevPacket); delta = 0; } else { gettimeofday(&currPacket, 0); // clock_gettime(CLOCK_MONOTONIC, &currPacket); delta = currPacket.tv_nsec - prevPacket.tv_nsec; // clock_gettime(CLOCK_MONOTONIC, &prevPacket); gettimeofday(&prevPacket, 0); }

hzwzw avatar Feb 10 '15 07:02 hzwzw

Probably better using http://stackoverflow.com/questions/5167269/clock-gettime-alternative-in-mac-os-x We will get to this once one of us can get our hands on a mac to test this with.

Alternatively you could try checking out a revision without the bandwidth information.

mofarrell avatar Feb 10 '15 07:02 mofarrell

This has now been disabled for OSX on the portaudio branch until we get someone to look at it. If you pull the latest it should compile.

mofarrell avatar Feb 10 '15 08:02 mofarrell

i change the code by using http://stackoverflow.com/questions/5167269/clock-gettime-alternative-in-mac-os-x and compile is ok and when i input the command "./p2pvc 127.0.0.1 -v" , nothing happened . how can i help you test @mofarrell

hzwzw avatar Feb 10 '15 08:02 hzwzw

what version of OS X are you running?

emgram769 avatar Feb 10 '15 08:02 emgram769

os 10.10.1 @emgram769

hzwzw avatar Feb 10 '15 08:02 hzwzw

I downloaded the newest release and tried to "make" it. But the errors remain. I will be following this project and see what future releases will offer me. I'm on 10.10.3 Beta 1.

Sajonara avatar Feb 10 '15 08:02 Sajonara

hopefully I'll be able to roll out some binaries for OS X soon, but there seem to be issues with 10.10's networking.

emgram769 avatar Feb 10 '15 08:02 emgram769

The same problem on OS X 10.9.5:

$ p2pvc git:(portaudio) make
uname: illegal option -- o
usage: uname [-amnprsv]
mkdir -p objs
gcc -Isrc/inc -O2 -Wall -DPA_USE_COREAUDIO `pkg-config --cflags opencv` src/audio.c -c -o objs/audio.o
gcc -Isrc/inc -O2 -Wall -DPA_USE_COREAUDIO `pkg-config --cflags opencv` src/display.c -c -o objs/display.o
gcc -Isrc/inc -O2 -Wall -DPA_USE_COREAUDIO `pkg-config --cflags opencv` src/p2plib.c -c -o objs/p2plib.o
src/p2plib.c:276:7: warning: implicit declaration of function 'clock_gettime' is invalid in C99 [-Wimplicit-function-declaration]
      clock_gettime(CLOCK_MONOTONIC, &prevPacket);
      ^
src/p2plib.c:276:21: error: use of undeclared identifier 'CLOCK_MONOTONIC'
      clock_gettime(CLOCK_MONOTONIC, &prevPacket);
                    ^
src/p2plib.c:279:21: error: use of undeclared identifier 'CLOCK_MONOTONIC'
      clock_gettime(CLOCK_MONOTONIC, &currPacket);
                    ^
src/p2plib.c:281:21: error: use of undeclared identifier 'CLOCK_MONOTONIC'
      clock_gettime(CLOCK_MONOTONIC, &prevPacket);
                    ^
1 warning and 3 errors generated.
make: *** [objs/p2plib.o] Error 1

ncurses 5.9, opencv 2.4.10.1, portaudio 19.20140130

jirutka avatar Feb 10 '15 10:02 jirutka

looks like a bad #ifdef was the cause. it may compile now, but I will update this when I test on a mac.

emgram769 avatar Feb 10 '15 15:02 emgram769

using git clone -b portaudio https://github.com/mofarrell/p2pvc.git I am able to make the project without the clock errors. Execution as ./p2pvc 127.0.0.1 -v causes the application to hang with no error messages, however.

Pinwheeler avatar Feb 10 '15 15:02 Pinwheeler

Same as @Pinwheeler.

jirutka avatar Feb 10 '15 17:02 jirutka

Same as @Pinwheeler

itsprdp avatar Feb 10 '15 17:02 itsprdp

Same as @Pinwheeler unfortunately. :(

damianesteban avatar Feb 10 '15 19:02 damianesteban

the thought is that yosemite is killing sockets with large UDP packets. I've just changed the way that the packets are sent to reduce the size of any individual one. can I confirm that most (if not all) of you are on yosemite? I'm not sure if the newest commit to portaudio will solve any of this, but it may help

emgram769 avatar Feb 10 '15 19:02 emgram769