Comments (20)
This is because libjuice requires libnettle as dependency. It should often be present as GnuTLS crypto backend, but apparently not in your case (I guess for you GnuTLS is linked against gcrypt instead). You have a choice here: you need either to install libnettle, or to switch the TLS backend to OpenSSL by changing the cmake command to cmake -B build -DUSE_JUICE=1 -DUSE_GNUTLS=0
.
from libdatachannel.
Thanks for your feedback, so I looked into it and I actually do have gnu tls installed including nettle, see this snippet of output from cmake:
-- Performing Test has_wno_address_of_packet_member
-- Performing Test has_wno_address_of_packet_member - Success
-- Found GnuTLS: /usr/local/Cellar/gnutls/3.6.11.1/lib/libgnutls.dylib (found version "3.6.11")
-- Found NETTLE: /usr/local/lib/libnettle.dylib
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/will.munn/code/experiments/libdatachannel/build
I checked and both libnettle.dylib and libgnutls.dylib are at those locations. Is it expecting a different version?
I also tried with open ssl but then ran into this issue:
Scanning dependencies of target juice-static
[ 3%] Building C object deps/libjuice/CMakeFiles/juice-static.dir/src/addr.c.o
[ 3%] Building C object deps/libjuice/CMakeFiles/juice-static.dir/src/agent.c.o
[ 6%] Building C object deps/libjuice/CMakeFiles/juice-static.dir/src/crc32.c.o
[ 9%] Building C object deps/libjuice/CMakeFiles/juice-static.dir/src/hmac.c.o
[ 9%] Building C object deps/libjuice/CMakeFiles/juice-static.dir/src/ice.c.o
[ 12%] Building C object deps/libjuice/CMakeFiles/juice-static.dir/src/juice.c.o
[ 12%] Building C object deps/libjuice/CMakeFiles/juice-static.dir/src/log.c.o
[ 15%] Building C object deps/libjuice/CMakeFiles/juice-static.dir/src/random.c.o
[ 18%] Building C object deps/libjuice/CMakeFiles/juice-static.dir/src/stun.c.o
/Users/will.munn/code/experiments/libdatachannel/deps/libjuice/src/stun.c:34:9: warning: 'htonll' macro redefined [-Wmacro-redefined]
#define htonll(x) \
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sys/_endian.h:141:9: note: previous definition is here
#define htonll(x) __DARWIN_OSSwapInt64(x)
^
/Users/will.munn/code/experiments/libdatachannel/deps/libjuice/src/stun.c:36:9: warning: 'ntohll' macro redefined [-Wmacro-redefined]
#define ntohll(x) htonll(x)
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sys/_endian.h:140:9: note: previous definition is here
#define ntohll(x) __DARWIN_OSSwapInt64(x)
^
2 warnings generated.
[ 18%] Building C object deps/libjuice/CMakeFiles/juice-static.dir/src/udp.c.o
/Users/will.munn/code/experiments/libdatachannel/deps/libjuice/src/udp.c:70:12: error: use of undeclared identifier 'IP_PMTUDISC_DO'
int val = IP_PMTUDISC_DO;
^
/Users/will.munn/code/experiments/libdatachannel/deps/libjuice/src/udp.c:71:31: error: use of undeclared identifier 'IP_MTU_DISCOVER'
setsockopt(sock, IPPROTO_IP, IP_MTU_DISCOVER, &val, sizeof(val));
^
2 errors generated.
make[2]: *** [deps/libjuice/CMakeFiles/juice-static.dir/src/udp.c.o] Error 1
make[1]: *** [deps/libjuice/CMakeFiles/juice-static.dir/all] Error 2
make: *** [all] Error 2
from libdatachannel.
Oh OK, path MTU discovery is only available on Linux, it needs to be disabled otherwise.
This should be fixed by 6f39994
The missing header for libnettle is weird then, it should work fine since you seem to have everything installed. Do you have the header file /usr/local/include/nettle/hmac.h
?
from libdatachannel.
Yes I have that header file.
with open ssl I'm still seeing this issue after pulling your latest changes.
/Users/will.munn/code/experiments/libdatachannel/deps/libjuice/src/udp.c:70:12: error: use of undeclared identifier 'IP_PMTUDISC_DO'
int val = IP_PMTUDISC_DO;
^
/Users/will.munn/code/experiments/libdatachannel/deps/libjuice/src/udp.c:71:31: error: use of undeclared identifier 'IP_MTU_DISCOVER'
setsockopt(sock, IPPROTO_IP, IP_MTU_DISCOVER, &val, sizeof(val));
^
2 errors generated.
from libdatachannel.
OK, then it means you need to add /usr/local/include
to the system C/C++ header search paths before compiling. I'm not very familiar with MacOS, but just running xcode-select --install
might do the trick.
Hum, did you do git submodule update
after pulling the changes?
from libdatachannel.
Ah no I didn't update submodules, now I get
/Users/will.munn/code/experiments/libdatachannel/deps/libjuice/src/udp.c:74:31: error: use of undeclared identifier 'IP_DONTFRAG'
setsockopt(sock, IPPROTO_IP, IP_DONTFRAG, (char *)&enabled, sizeof(enabled));
^
1 error generated.
make[2]: *** [deps/libjuice/CMakeFiles/juice-static.dir/src/udp.c.o] Error 1
make[1]: *** [deps/libjuice/CMakeFiles/juice-static.dir/all] Error 2
make: *** [all] Error 2
with open ssl
from libdatachannel.
regarding /usr/local/include, I do see it listed when I run gcc -x c++ -v -E /dev/null
which I believe lists the include paths. should /usr/local/include/nettle
be listed there separately?
from libdatachannel.
OK, the IP_DONTFRAG
option does not exist on Mac OS, and there seems to be no other way to disable fragmentation. So at least for now I bypassed the MTU discovery on Mac OS to get around that issue: 7af3da7
Note you'll need a submodule update on this one also.
If /usr/src/include
is in the compiler include paths it should work fine, the nettle
subdirectory should not be listed. Maybe it's set for gcc but you use clang to compile? You can list clang include paths similarly with clang -v -E - < /dev/null
.
from libdatachannel.
Sorry I've been afk for a few days. I ran the clang command, /usr/local/include
is listed there so it's not that.
from libdatachannel.
That's puzzling. And what if you specify it manually when you run cmake
, like this?
CPPFLAGS=-I/usr/local/include cmake ..
from libdatachannel.
I get the same thing complaining about fatal error: 'nettle/hmac.h' file not found
from libdatachannel.
I've just noticed, the nettle directory is a symlink
ls -al /usr/local/include/nettle
lrwxr-xr-x 1 will.munn admin 37 27 Jan 21:09 /usr/local/include/nettle -> ../Cellar/nettle/3.4.1/include/nettle
however, then I tried
cmake CPPFLAGS=-I/usr/local/Cellar/nettle/3.4.1/include -DUSE_JUICE=1 -DUSE_GNUTLS=1 ..
but got the same error when I ran make
from libdatachannel.
That's a good point about the symlink, it could cause the problem somehow, however CPPFLAGS
should be passed as a shell variable to cmake otherwise I'm pretty sure it'll be ignored:
CPPFLAGS=-I/usr/local/Cellar/nettle/3.4.1/include cmake -DUSE_JUICE=1 -DUSE_GNUTLS=1 ..
from libdatachannel.
Ah thanks sorry about that, I tried putting the cppflags at the beginning, still no luck
from libdatachannel.
Hum, I'm a bit stuck here... Did you have more luck with OpenSSL?
from libdatachannel.
I've set up a travis build running on macos. I've got to the same point, maybe it will help? can you see this? https://travis-ci.org/willm/libdatachannel/builds/657518778
from libdatachannel.
interestingly, if I make a file test.cpp
#include <nettle/hmac.h>
int main() {}
then run clang++ ./test.cpp
it seems to compile fine.
from libdatachannel.
Yes I have acces to the travis build. Thanks, I'll try to investigate a bit.
from libdatachannel.
I didn't find the actual reason why /usr/local/include
is not searched, but it works when specified explicitly in CMakeLists.txt
so that's good enough. The compilation should now work properly on MacOS with the changes in #40. Could you confirm please?
from libdatachannel.
I'm merging the PR, please re-open the issue if you encounter another compilation issue on your side.
from libdatachannel.
Related Issues (20)
- Websocket::Open crash HOT 3
- Error in build node-datachannel for webtorrent-cli HOT 2
- ABI issue when linking HOT 2
- RtpPacketizationConfig not properly initialized HOT 2
- setLocalDescription's Init parameter may not work. HOT 3
- The push function of the sendQueue in DataChannel will trigger wait and can not be awaked. HOT 3
- Client xxx not found HOT 2
- WebSocket::path() returns nullopt when state is Connecting HOT 2
- Mixed up dynamic and static libjuice dependencies HOT 1
- Source directory requires read/write filesystem during build HOT 3
- C API lacking proper closure support HOT 4
- Lost connectivity after successful connection HOT 7
- WebSocketServer not stopping properly HOT 2
- How to troubleshoot when the onGatheringStateChange function returns very slowly? HOT 1
- Websocket disconnect HOT 2
- Trouble connecting via TURN server HOT 1
- Does libdatachannel support to compile in pure C Linux system(for some embedded device no support C++17)? HOT 3
- rtc::PeerConnection::close() causes the application to crash when called multiple times HOT 1
- Unable to retrieve negotiated media details HOT 2
- crash HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libdatachannel.