leedm777 / homebrew-asterisk

Homebrew tap for building an Asterisk dev environment
50 stars 27 forks source link

Installation failing on clean El Capitan install #22

Closed adgray closed 8 years ago

adgray commented 8 years ago

Trying to install on a brand-new El-Capitan 10.11.4 + standard home-brew install. The last log output is as follows:

Last 15 lines from /Users/admin/Library/Logs/Homebrew/pjsip-asterisk/02.make:
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: ../lib/libpjmedia-codec-x86_64-apple-darwin15.4.0.a(openh264.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: ../lib/libpjmedia-codec-x86_64-apple-darwin15.4.0.a(h263_packetizer.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: ../lib/libpjmedia-codec-x86_64-apple-darwin15.4.0.a(h264_packetizer.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: ../lib/libpjmedia-codec-x86_64-apple-darwin15.4.0.a(ipp_codecs.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: ../lib/libpjmedia-codec-x86_64-apple-darwin15.4.0.a(silk.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: ../lib/libpjmedia-codec-x86_64-apple-darwin15.4.0.a(g7221.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/make -f /private/tmp/pjsip-asterisk20160408-40863-8cq9xf/pjproject-2.4.5/build/rules.mak APP=PJMEDIA_CODEC app=pjmedia-codec ../lib/libpjmedia-codec.dylib
if test ! -d ../lib; then mkdir -p ../lib; fi
clang -o ../lib/libpjmedia-codec.dylib.2 \
         output/pjmedia-codec-x86_64-apple-darwin15.4.0/audio_codecs.o  output/pjmedia-codec-x86_64-apple-darwin15.4.0/ffmpeg_vid_codecs.o  output/pjmedia-codec-x86_64-apple-darwin15.4.0/openh264.o  output/pjmedia-codec-x86_64-apple-darwin15.4.0/h263_packetizer.o  output/pjmedia-codec-x86_64-apple-darwin15.4.0/h264_packetizer.o  output/pjmedia-codec-x86_64-apple-darwin15.4.0/ipp_codecs.o  output/pjmedia-codec-x86_64-apple-darwin15.4.0/silk.o  output/pjmedia-codec-x86_64-apple-darwin15.4.0/l16.o  output/pjmedia-codec-x86_64-apple-darwin15.4.0/gsm.o  output/pjmedia-codec-x86_64-apple-darwin15.4.0/speex_codec.o  output/pjmedia-codec-x86_64-apple-darwin15.4.0/ilbc.o  output/pjmedia-codec-x86_64-apple-darwin15.4.0/g722.o  output/pjmedia-codec-x86_64-apple-darwin15.4.0/g722/g722_enc.o  output/pjmedia-codec-x86_64-apple-darwin15.4.0/g722/g722_dec.o  output/pjmedia-codec-x86_64-apple-darwin15.4.0/g7221.o  output/pjmedia-codec-x86_64-apple-darwin15.4.0/g7221_sdp_match.o  output/pjmedia-codec-x86_64-apple-darwin15.4.0/amr_sdp_match.o -lpjmedia -lpj  -lilbccodec -lg7221codec  -lsrtp -lgsm -lspeex -lspeexdsp  -L/usr/local/opt/openssl/lib -lssl -lcrypto -lm -lpthread  -framework Foundation -framework AppKit   -L/private/tmp/pjsip-asterisk20160408-40863-8cq9xf/pjproject-2.4.5/pjlib/lib -L/private/tmp/pjsip-asterisk20160408-40863-8cq9xf/pjproject-2.4.5/pjlib-util/lib -L/private/tmp/pjsip-asterisk20160408-40863-8cq9xf/pjproject-2.4.5/pjnath/lib -L/private/tmp/pjsip-asterisk20160408-40863-8cq9xf/pjproject-2.4.5/pjmedia/lib -L/private/tmp/pjsip-asterisk20160408-40863-8cq9xf/pjproject-2.4.5/pjsip/lib -L/private/tmp/pjsip-asterisk20160408-40863-8cq9xf/pjproject-2.4.5/third_party/lib           -L/usr/local/opt/openssl/lib       -dynamiclib -undefined dynamic_lookup -flat_namespace
ld: file not found: ../lib/libpjlib-util.dylib.2 for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [../lib/libpjmedia-codec.dylib.2] Error 1
make[1]: *** [libpjmedia-codec.dylib] Error 2
make: *** [all] Error 1

Any suggestions? Google doesn't reveal anything useful.

leedm777 commented 8 years ago

Weird; I get the same thing. I'll take a look at it.

Thanks!

leedm777 commented 8 years ago

So libpjmedia-codec.dylib.2 is linking with libpjmedia.dylib.2, which is linked with libpjlib-util.dylib.2.

For some reason, it's trying to find libpjlib-util in the path ../lib/libpjlib-util.dylib.2

$ otool -L pjmedia/lib/libpjmedia.dylib
pjmedia/lib/libpjmedia.dylib:
    ../lib/libpjmedia.dylib.2 (compatibility version 0.0.0, current version 0.0.0)
    ../lib/libpj.dylib.2 (compatibility version 0.0.0, current version 0.0.0)
    ../lib/libpjlib-util.dylib.2 (compatibility version 0.0.0, current version 0.0.0)
    ../lib/libpjnath.dylib.2 (compatibility version 0.0.0, current version 0.0.0)
    ../../lib/libilbccodec.dylib.2 (compatibility version 0.0.0, current version 0.0.0)
    ../../lib/libg7221codec.dylib.2 (compatibility version 0.0.0, current version 0.0.0)
    /usr/local/lib/libsrtp.1.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/local/lib/libgsm.1.0.13.dylib (compatibility version 1.0.0, current version 1.0.13)
    /usr/local/lib/libspeex.1.5.0.dylib (compatibility version 7.0.0, current version 7.0.0)
    /usr/local/lib/libspeexdsp.1.5.0.dylib (compatibility version 7.0.0, current version 7.0.0)
    /usr/local/opt/openssl/lib/libssl.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
    /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
    /usr/local/lib/libuuid.16.dylib (compatibility version 17.0.0, current version 17.22.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
    /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1258.0.0)
    /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 1404.46.0)

There are some odd things about linking on OS X that change occasionally with Xcode releases. I'm guessing something's changed recently.

Not totally sure how to fix it yet. If anyone has any ideas, I'd be glad to hear them.

leedm777 commented 8 years ago

I've been able to reproduce the problem, but I'm not exactly sure what to do about it yet.

I've posted a question about it on SO, so maybe someone else has some ideas.

SipSeb commented 8 years ago

Hi, did you find a solution for the problem? I just stumbled upon the same issue. I guess the solution from SO is not applicable, did you manage to find a workaround? Thanks a lot.

leedm777 commented 8 years ago

@SipSeb The solution from SO was close, but no quite right (since it moved all the libs into a single directory). I was able to get a patch that compiled, but it was unable to find the libraries at runtime.

Although, looking at it with fresh eyes, I have an idea for a quick fix. It may work, but I think there's likely something really wrong with how we're building shared objects on OS X.

leedm777 commented 8 years ago

@SipSeb @adgray

I've pushed a workaround (1c1c98a97d6ae9acf2f0025ab46b17755c3a72d9) which seems to get things compiling again, but I think there's still something hinky in the PJSIP build for OS X.

Let me know how it works out.

SipSeb commented 8 years ago

Thank you for the work you put in it. It compiled on my machine.