Closed dochang closed 8 years ago
I have the same problem, but was able to fix it by specifying brew install lnav --cc=clang
. Does that work for you?
If so, I think this might need some investigation around a possible fails_with
for GCC.
Note that you can install clang from linuxbrew with brew install llvm --with-clang
if you don't have it.
brew install lnav --cc=clang
reports the same error.
After having switched to clang, I'm unable to reproduce this. I'm also able to install it (after installing a missing sqlite3
dependency, for which I'll make a separate pull request) when building on the Linuxbrew Docker image.
I apologize, but I do not have any further suggestions at the moment.
@sjackman, any ideas about this one?
@dochang Hi, Desmond. Please report the output of
brew install llvm --with-clang
brew install lnav --cc=clang
brew gist-logs lnav
If so, I think this might need some investigation around a possible fails_with for GCC.
Yes. fails_with :gcc => "5"
. For historical reasons, fails_with :gcc
means GCC 4.2 (which makes me grumpy).
brew install llvm --with-clang
causes high CPU usage and makes my laptop too hot to install clang by brew. I install clang by apt-get (Debian sid) instead.
Here is the gist-log of brew install lnav --cc=clang
.
CXXLD lnav
CXXLD lnav-test
/home/doc/.linuxbrew/Cellar/curl/7.48.0/lib/libcurl.a(libcurl_la-openssl.o): In function `ossl_connect_common':
openssl.c:(.text+0xde0): undefined reference to `SSLv3_client_method'
/home/doc/.linuxbrew/Cellar/curl/7.48.0/lib/libcurl.a(libcurl_la-openssl.o): In function `ossl_connect_common':
openssl.c:(.text+0xde0): undefined reference to `SSLv3_client_method'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Makefile:745: recipe for target 'lnav' failed
make[1]: *** [lnav] Error 1
make[1]: *** Waiting for unfinished jobs....
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Makefile:749: recipe for target 'lnav-test' failed
make[1]: *** [lnav-test] Error 1
make[1]: Leaving directory '/tmp/lnav20160411-17474-j927xf/lnav-0.8.0/src'
Makefile:463: recipe for target 'install-recursive' failed
make: *** [install-recursive] Error 1
https://gist.github.com/dochang/cfe6b5e49e620615a939ca0b76f6164d#file-02-make-L100
This error is typical when mixing openssl headers from one installation and openssl libraries from another. Try
sudo apt-get remove libopenssl-dev
brew remove openssl curl lnav
brew install lnav
I can build with clang after removing libssl-dev
. But building with gcc still fails.
gist-logs for brew install lnav
.
That's good news! When posting a gist, please quote the relevant lines and link to them.
https://gist.github.com/dochang/d2e4694264cbddffa076aed01f4ff077#file-02-make-L101
CXXLD lnav-test
lnav.o: In function `execute_search(lnav_view_t, std::__cxx11::lnav.obasic_string:< charIn, functionstd :`:execute_searchchar_traits(<lnav_view_tchar,> ,std :std::__cxx11::allocator:<basic_stringchar<>char ,> stdconst:&:)char_traits'<:char
>lnav.cc,: (std::allocator<char> > const&)':
lnav.cc:(.text+0x240e): undefined reference to `pcrecpp::RE::QuoteMeta[abi:cxx11](pcrecpp::StringPiece const&)'
.text+0x240e): undefined reference to `pcrecpp::RE::QuoteMeta[abi:cxx11](pcrecpp::StringPiece const&)'
collect2: error: ld returned 1 exit status
Try
sudo apt-get remove libpcre-dev
brew install pcre lnav
I didn't install libpcre3-dev
. There're only runtime libraries:
$ dpkg -l '*pcre*'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-========================-=================-=================-======================================================
un libpcre-ocaml <none> <none> (no description available)
ii libpcre16-3:amd64 2:8.38-3.1 amd64 Perl 5 Compatible Regular Expression Library - 16 bit
ii libpcre3:amd64 2:8.38-3.1 amd64 Perl 5 Compatible Regular Expression Library - runtime
un libpcre3-dev <none> <none> (no description available)
gist-logs of brew install pcre lnav
:
CXXLD lnav-test
lnav.o: In function `execute_search(lnav_view_t, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
lnav.cc:(.text+0x240e): undefined reference to `pcrecpp::RE::QuoteMeta[abi:cxx11](pcrecpp::StringPiece const&)'
collect2: error: ld returned 1 exit status
Makefile:745: recipe for target 'lnav' failed
make[1]: *** [lnav] Error 1
make[1]: *** Waiting for unfinished jobs....
lnav.o: In function `execute_search(lnav_view_t, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
lnav.cc:(.text+0x240e): undefined reference to `pcrecpp::RE::QuoteMeta[abi:cxx11](pcrecpp::StringPiece const&)'
collect2: error: ld returned 1 exit status
Makefile:749: recipe for target 'lnav-test' failed
make[1]: *** [lnav-test] Error 1
make[1]: Leaving directory '/tmp/lnav20160412-7877-1la5erd/lnav-0.8.0/src'
Makefile:463: recipe for target 'install-recursive' failed
make: *** [install-recursive] Error 1
It looks as though lnav
is using C++11. If that's the case, then I believe pcre
must also be built using C++11. Try this patch:
diff --git a/Library/Formula/pcre.rb b/Library/Formula/pcre.rb
index 08fd3b4..54d373b 100644
--- a/Library/Formula/pcre.rb
+++ b/Library/Formula/pcre.rb
@@ -22,6 +22,7 @@ class Pcre < Formula
end
option "without-check", "Skip build-time tests (not recommended)"
+ option :cxx11 unless OS.mac?
option :universal
fails_with :llvm do
@@ -33,6 +34,7 @@ class Pcre < Formula
depends_on "zlib" unless OS.mac?
def install
+ ENV.cxx11 if build.cxx11?
ENV.universal_binary if build.universal?
system "./autogen.sh" if build.head?
brew remove pcre
brew install pcre --cxx11
brew install lnav
Also try brew install gcc
Great! Your patch works!
brew remove pcre
brew edit pcre # apply the patch
brew install --build-from-source pcre --cxx11
brew install lnav
brew install gcc
is unnecessary.
Now lnav has been installed! Thanks for your help!
It's possible that lnav
should
depends_on "pcre" => "cxx11"
Great! Glad to here that you got it working, Desmond.
Please follow the general troubleshooting steps first:
brew update
and retried your prior step?brew doctor
, fixed as many issues as possible and retried your prior step?sudo chown -R $(whoami) $(brew --prefix)
?You can erase any parts of this template not applicable to your Issue.
Bug reports:
Gist log: https://gist.github.com/fe6e35aa8a2d4b693b13adb3e19b261b
When I run
brew install lnav
, Linuxbrew fails and reports the following message: