fishjam-dev / membrane_rtc_engine

Customizable Real-time Communication Engine/SFU library focused on WebRTC.
Apache License 2.0
140 stars 11 forks source link

Fail to compile fast_tls in webrtc_videoroom example (and probably others) #367

Closed noozo closed 6 months ago

noozo commented 6 months ago

OSX Sonoma 14.0

openssl --version
OpenSSL 3.2.1 30 Jan 2024 (Library: OpenSSL 3.2.1 30 Jan 2024)
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CFLAGS="-I/usr/local/opt/openssl/include/"
export CPPFLAGS="-I/usr/local/opt/openssl/include/"
iex -S mix phx.server
Erlang/OTP 26 [erts-14.0.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit] [dtrace]

===> Compiling /Users/xxx/Development/membrane_rtc_engine/examples/webrtc_videoroom/deps/fast_tls/c_src/fast_tls.c
===> /Users/xxx/Development/membrane_rtc_engine/examples/webrtc_videoroom/deps/fast_tls/c_src/fast_tls.c:21:10: fatal error: 'openssl/err.h' file not found
#include <openssl/err.h>
         ^~~~~~~~~~~~~~~
1 error generated.

** (Mix) Could not compile dependency :fast_tls, "/Users/xxx/.asdf/installs/elixir/1.14.1-otp-25/.mix/elixir/1-14/rebar3 bare compile --paths /Users/xxx/Development/membrane_rtc_engine/examples/webrtc_videoroom/_build/dev/lib/*/ebin" command failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile fast_tls", update it with "mix deps.update fast_tls" or clean it with "mix deps.clean fast_tls"
noozo commented 6 months ago

Same with elixir 1.16:

===> Analyzing applications...
===> Compiling pc
===> Compiling /Users/xxx/Development/membrane_rtc_engine/examples/webrtc_videoroom/deps/fast_tls/c_src/fast_tls.c
===> /Users/xxx/Development/membrane_rtc_engine/examples/webrtc_videoroom/deps/fast_tls/c_src/fast_tls.c:21:10: fatal error: 'openssl/err.h' file not found
#include <openssl/err.h>
         ^~~~~~~~~~~~~~~
1 error generated.

==> membrane_videoroom_demo
** (Mix) Could not compile dependency :fast_tls, "/Users/xxx/.asdf/installs/elixir/1.16.0/.mix/elixir/1-16/rebar3 bare compile --paths /Users/xxx/Development/membrane_rtc_engine/examples/webrtc_videoroom/_build/dev/lib/*/ebin" command failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile fast_tls --force", update it with "mix deps.update fast_tls" or clean it with "mix deps.clean fast_tls"
noozo commented 6 months ago

for reference in newer OSX versions, the correct exports required for compilation are (if you install openssh via homebrew):

export LDFLAGS="-L/opt/homebrew/etc/openssl/lib"
export CFLAGS="-I/opt/homebrew/etc/openssl/include/"
export CPPFLAGS="-I/opt/homebrew/etc/openssl/include/"