Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

pdfgrep failed to build on 10.8 #50170

Closed
plicplic opened this issue Mar 16, 2016 · 9 comments
Closed

pdfgrep failed to build on 10.8 #50170

plicplic opened this issue Mar 16, 2016 · 9 comments

Comments

@plicplic
Copy link

Please follow the general troubleshooting steps first:

  • [YES] Ran brew update and retried your prior step?
  • [YES] Ran brew doctor, fixed as many issues as possible and retried your prior step?

Bug reports:

I know that my old Mountain Lion is not supported anymore but maybe someone may help to get rid of this compile error in make?
Getting this message:
make[1]: *** [pdfgrep.o] Error 1
make: *** [install-recursive] Error 1

https://gist.github.com/anonymous/0bb2ebb558d6fefa58e9

regards,

  • alain -
@apjanke
Copy link
Contributor

apjanke commented Mar 17, 2016

That std::unique_ptr is a new C++11 feature. Maybe your older version of clang doesn't support it?

As a workaround, try installing Homebrew's gcc (brew install gcc) and using that, with brew install -cc=gcc pdfgrep.

@DomT4
Copy link
Member

DomT4 commented Mar 17, 2016

This is a 🐇 hole, it turns out.

The clang on 10.8 is "new" enough to have C++11 support, so formulae that need cxx11 are happy to use it. This includes poppler it seems, although poppler doesn't declare the need for cxx11 in-formula. If you build pdfgrep with GCC-5 you run into this:

Making install in src
g++-5 -DHAVE_CONFIG_H -I. -I..  -I/usr/local/Cellar/poppler/0.41.0/include/poppler/cpp -I/usr/local/Cellar/poppler/0.41.0/include/poppler      -g -O2 -c -o pdfgrep.o pdfgrep.cc
g++-5 -DHAVE_CONFIG_H -I. -I..  -I/usr/local/Cellar/poppler/0.41.0/include/poppler/cpp -I/usr/local/Cellar/poppler/0.41.0/include/poppler      -g -O2 -c -o output.o output.cc
g++-5 -DHAVE_CONFIG_H -I. -I..  -I/usr/local/Cellar/poppler/0.41.0/include/poppler/cpp -I/usr/local/Cellar/poppler/0.41.0/include/poppler      -g -O2 -c -o exclude.o exclude.cc
g++-5 -DHAVE_CONFIG_H -I. -I..  -I/usr/local/Cellar/poppler/0.41.0/include/poppler/cpp -I/usr/local/Cellar/poppler/0.41.0/include/poppler      -g -O2 -c -o regengine.o regengine.cc
g++-5  -g -O2   -o pdfgrep pdfgrep.o output.o exclude.o regengine.o -L/usr/local/Cellar/poppler/0.41.0/lib -lpoppler-cpp    
Undefined symbols for architecture x86_64:
  "poppler::version_string[abi:cxx11]()", referenced from:
      print_version()     in pdfgrep.o
  "poppler::set_debug_error_function(void (*)(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, void*), void*)", referenced from:
      _main in pdfgrep.o
  "poppler::document::load_from_file(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from:
      do_search_in_document(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Regengine&, bool) in pdfgrep.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make[1]: *** [pdfgrep] Error 1
make: *** [install-recursive] Error 1

The only way I can find out of that failure is to remove poppler and then re-install poppler using GCC-5 as well. I increasingly lean harder and harder in the direction of saying we should mandate GCC on 10.8 and below, but that wouldn't help from an existing installation in this case.

The most obvious solution here for an immediate fix is probably just to tag poppler and pdfgrep as fails_with :llvm and fails_with :clang for the respective builds on 10.8 and lower.

@plicplic
Copy link
Author

Hi, thanks to both of you for your help!

I did the following:

brew install gcc
brew uninstall poppler
brew install -cc=gcc poppler
brew install -cc=gcc pdfgrep

Unfortunately i ran into the same compile error than before.

Here is the new gist link:
https://gist.github.com/anonymous/5728bc928d78a6096c31
(just to be sure, as it is new for me, was I right to call it like this: brew
gist-logs -cc=gcc pdfgrep
?

any other clue that could get me out of that trap?

best regards,

  • alain -

2016-03-17 5:19 GMT+01:00 Dominyk Tiller notifications@github.com:

This is a [image: 🐇] hole, it turns out.

The clang on 10.8 is "new" enough to have C++11 support, so formulae that
need cxx11 are happy to use it. This includes poppler it seems, although
poppler doesn't declare the need for cxx11 in-formula. If you build
pdfgrep with GCC-5 you run into this
https://gist.github.com/anonymous/aa3b055dae2fc23dcef1:

Making install in src
g++-5 -DHAVE_CONFIG_H -I. -I.. -I/usr/local/Cellar/poppler/0.41.0/include/poppler/cpp -I/usr/local/Cellar/poppler/0.41.0/include/poppler -g -O2 -c -o pdfgrep.o pdfgrep.cc
g++-5 -DHAVE_CONFIG_H -I. -I.. -I/usr/local/Cellar/poppler/0.41.0/include/poppler/cpp -I/usr/local/Cellar/poppler/0.41.0/include/poppler -g -O2 -c -o output.o output.cc
g++-5 -DHAVE_CONFIG_H -I. -I.. -I/usr/local/Cellar/poppler/0.41.0/include/poppler/cpp -I/usr/local/Cellar/poppler/0.41.0/include/poppler -g -O2 -c -o exclude.o exclude.cc
g++-5 -DHAVE_CONFIG_H -I. -I.. -I/usr/local/Cellar/poppler/0.41.0/include/poppler/cpp -I/usr/local/Cellar/poppler/0.41.0/include/poppler -g -O2 -c -o regengine.o regengine.cc
g++-5 -g -O2 -o pdfgrep pdfgrep.o output.o exclude.o regengine.o -L/usr/local/Cellar/poppler/0.41.0/lib -lpoppler-cpp
Undefined symbols for architecture x86_64:
"poppler::version_stringabi:cxx11", referenced from:
print_version() in pdfgrep.o
"poppler::set_debug_error_function(void (_)(std::cxx11::basic_string<char, std::char_traits, std::allocator > const&, void), void)", referenced from:
main in pdfgrep.o
"poppler::document::load_from_file(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)", referenced from:
do_search_in_document(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, Regengine&, bool) in pdfgrep.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make[1]: *
* [pdfgrep] Error 1
make: *** [install-recursive] Error 1

The only way I can find out of that failure is to remove poppler and then
re-install poppler using GCC-5 as well. I increasingly lean harder and
harder in the direction of saying we should mandate GCC on 10.8 and below,
but that wouldn't help from an existing installation in this case.

The most obvious solution here for an immediate fix is probably just to
tag poppler and pdfgrep as fails_with :llvm and fails_with :clang for the
respective builds on 10.8 and lower.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#50170 (comment)

@DomT4
Copy link
Member

DomT4 commented Mar 17, 2016

Oh, you want:

brew install <formula> --cc=gcc-5

Rather than a plain gcc.

@apjanke
Copy link
Contributor

apjanke commented Mar 17, 2016

Sorry! My bad. I have a hard time remembering which of the options and :foo flags need version qualifiers. Also, I got the number of dashes wrong: a -cc=whatever with a single dash will just get you the bottle.

$ brew install -cc=your-mom poppler
==> Downloading https://homebrew.bintray.com/bottles/poppler-0.41.0.mavericks.bottle.tar.gz
Already downloaded: /Library/Caches/Homebrew/poppler-0.41.0.mavericks.bottle.tar.gz
==> Pouring poppler-0.41.0.mavericks.bottle.tar.gz
🍺  /usr/local/Cellar/poppler/0.41.0: 473 files, 23M

(If I had got the double-dashes right, it would have given you an error message.) Sorry.

@plicplic
Copy link
Author

No worry, Andrew!

I uninstalled poppler again and reinstalled it with:
brew install --cc=gcc-5 poppler

then tried again
brew install --cc=gcc-5 pdfgrep

But the same error occured, unfortunately.
https://gist.github.com/7137989f0c6bc965b04f

  • alain -

2016-03-17 12:09 GMT+01:00 Andrew Janke notifications@github.com:

Sorry! My bad. I have a hard time remembering which of the options and
:foo flags need version qualifiers. Also, I got the number of dashes
wrong: a -cc=whatever with a single dash will just get you the bottle.

$ brew install -cc=your-mom poppler
==> Downloading https://homebrew.bintray.com/bottles/poppler-0.41.0.mavericks.bottle.tar.gz
Already downloaded: /Library/Caches/Homebrew/poppler-0.41.0.mavericks.bottle.tar.gz
==> Pouring poppler-0.41.0.mavericks.bottle.tar.gz🍺 /usr/local/Cellar/poppler/0.41.0: 473 files, 23M

(If I had got the double-dashes right, it would have given you an error
message.) Sorry.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#50170 (comment)

@DomT4 DomT4 mentioned this issue Mar 18, 2016
2 tasks
@DomT4
Copy link
Member

DomT4 commented Mar 18, 2016

You'll need to brew update && brew reinstall poppler but afterwards from fairly extensive local testing you should be able to brew install pdfgrep without failure.

@DomT4 DomT4 closed this as completed in a1bdd40 Mar 18, 2016
@plicplic
Copy link
Author

Puzzled! I just ran these two commands you suggested, after all those
errors I explained before:
brew update && brew reinstall poppler
than:
brew install pdfgrep

And it worked in a couple of seconds!

So grateful for your help.

  • alain -

2016-03-18 5:47 GMT+01:00 Dominyk Tiller notifications@github.com:

Closed #50170 #50170 via
a1bdd40
a1bdd40
.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#50170 (comment)

@DomT4
Copy link
Member

DomT4 commented Mar 18, 2016

I made some changes our end, so it wasn't anything you did wrong before :). Glad it's working as-expected now. Thanks for the report!

xu-cheng pushed a commit to Homebrew/homebrew-core that referenced this issue Mar 19, 2016
Apparently Poppler needs a bit of a nudge on the older
compilers that do support cxx11, otherwise you get weird linking failures when
other formulae that need cxx11 try to link to `-lpoppler`.

Closes Homebrew/legacy-homebrew#50170.
benjaminfrank pushed a commit to benjaminfrank/homebrew that referenced this issue Apr 9, 2016
Apparently Poppler needs a bit of a nudge on the older
compilers that do support cxx11, otherwise you get weird linking failures when
other formulae that need cxx11 try to link to `-lpoppler`.

Closes Homebrew#50170.
@Homebrew Homebrew locked and limited conversation to collaborators Jul 10, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants