coolwanglu / pdf2htmlEX

Convert PDF to HTML without losing text or format.
http://coolwanglu.github.com/pdf2htmlEX/
Other
10.38k stars 1.84k forks source link

Possible Incompatibility with Latest Version of Poppler #340

Closed sathomas closed 10 years ago

sathomas commented 10 years ago

Looks like there might be a problem with the latest version (0.26) of poppler. Trying to build pdf2htmlEX (via Homebrew) fails with the following error.

1 error generated.
make[2]: *** [CMakeFiles/pdf2htmlEX.dir/src/util/unicode.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/pdf2htmlEX.dir/all] Error 2
make: *** [all] Error 2

Only change that I know about was an update from poppler 0.24.5_1 to 0.26, though there could be another update lurking somewhere in my system.

coolwanglu commented 10 years ago

Hmm.. any other error messages you might find helpful? I cannot tell from only Error 1 and Error 2 here.

sathomas commented 10 years ago

Me neither. Just guessing, but I think Homebrew cleans up everything on a failed installation. I'm hoping the problem can be reproduced with a standard Unix build when trying to use the latest poppler.

shalecraig commented 10 years ago

I've just run into the same thing in a clean install of OS X.

Running git clone/cd/cmake gives me this stack trace, but I'm unsure if it's related:

➜  pdf2htmlEX git:(master) cmake .
-- The C compiler identification is Clang 5.1.0
-- The CXX compiler identification is Clang 5.1.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.28") 
-- checking for module 'poppler>=0.25.0'
--   found poppler, version 0.26.0
-- checking for module 'libfontforge>=2.0.0'
--   package 'libfontforge>=2.0.0' not found
CMake Error at /usr/local/Cellar/cmake/2.8.12.2/share/cmake/Modules/FindPkgConfig.cmake:279 (message):
  A required package was not found
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/2.8.12.2/share/cmake/Modules/FindPkgConfig.cmake:333 (_pkg_check_modules_internal)
  CMakeLists.txt:75 (pkg_check_modules)

-- Performing Test CXX0X_SUPPORT
-- Performing Test CXX0X_SUPPORT - Success
-- Configuring incomplete, errors occurred!
See also "/Users/$USER/code/pdf2htmlEX/CMakeFiles/CMakeOutput.log".

CMakeOutput.log is as follows:

The system is: Darwin - 13.1.0 - i386
Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded.
Compiler: /usr/bin/cc 
Build flags: 
Id flags: 

The output was:
0

Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "a.out"

The C compiler identification is Clang, found in "/Users/$USER/code/pdf2htmlEX/CMakeFiles/2.8.12.2/CompilerIdC/a.out"

Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded.
Compiler: /usr/bin/c++ 
Build flags: 
Id flags: 

The output was:
0

Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "a.out"

The CXX compiler identification is Clang, found in "/Users/$USER/code/pdf2htmlEX/CMakeFiles/2.8.12.2/CompilerIdCXX/a.out"

Determining if the C compiler works passed with the following output:
Change Dir: /Users/$USER/code/pdf2htmlEX/CMakeFiles/CMakeTmp

Run Build Command:/usr/bin/make "cmTryCompileExec140708641/fast"
/Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/cmTryCompileExec140708641.dir/build.make CMakeFiles/cmTryCompileExec140708641.dir/build
/usr/local/Cellar/cmake/2.8.12.2/bin/cmake -E cmake_progress_report /Users/$USER/code/pdf2htmlEX/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec140708641.dir/testCCompiler.c.o
/usr/bin/cc    -o CMakeFiles/cmTryCompileExec140708641.dir/testCCompiler.c.o   -c /Users/$USER/code/pdf2htmlEX/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTryCompileExec140708641
/usr/local/Cellar/cmake/2.8.12.2/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec140708641.dir/link.txt --verbose=1
/usr/bin/cc    -Wl,-search_paths_first -Wl,-headerpad_max_install_names   CMakeFiles/cmTryCompileExec140708641.dir/testCCompiler.c.o  -o cmTryCompileExec140708641  

Detecting C compiler ABI info compiled with the following output:
Change Dir: /Users/$USER/code/pdf2htmlEX/CMakeFiles/CMakeTmp

Run Build Command:/usr/bin/make "cmTryCompileExec833321270/fast"
/Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/cmTryCompileExec833321270.dir/build.make CMakeFiles/cmTryCompileExec833321270.dir/build
/usr/local/Cellar/cmake/2.8.12.2/bin/cmake -E cmake_progress_report /Users/$USER/code/pdf2htmlEX/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec833321270.dir/CMakeCCompilerABI.c.o
/usr/bin/cc    -o CMakeFiles/cmTryCompileExec833321270.dir/CMakeCCompilerABI.c.o   -c /usr/local/Cellar/cmake/2.8.12.2/share/cmake/Modules/CMakeCCompilerABI.c
Linking C executable cmTryCompileExec833321270
/usr/local/Cellar/cmake/2.8.12.2/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec833321270.dir/link.txt --verbose=1
/usr/bin/cc    -Wl,-search_paths_first -Wl,-headerpad_max_install_names -v -Wl,-v CMakeFiles/cmTryCompileExec833321270.dir/CMakeCCompilerABI.c.o  -o cmTryCompileExec833321270   
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.1.0
Thread model: posix
 "/Library/Developer/CommandLineTools/usr/bin/ld" -demangle -dynamic -arch x86_64 -macosx_version_min 10.9.0 -o cmTryCompileExec833321270 -search_paths_first -headerpad_max_install_names -v CMakeFiles/cmTryCompileExec833321270.dir/CMakeCCompilerABI.c.o -lSystem /Library/Developer/CommandLineTools/usr/bin/../lib/clang/5.1/lib/darwin/libclang_rt.osx.a
@(#)PROGRAM:ld  PROJECT:ld64-236.4
configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 armv6m armv7m armv7em
Library search paths:
    /usr/lib
    /usr/local/lib
Framework search paths:
    /Library/Frameworks/
    /System/Library/Frameworks/

Parsed C implicit link information from above output:
  link line regex: [^( *|.*[/\])(ld|([^/\]+-)?ld|collect2)[^/\]*( |$)]
  ignore line: [Change Dir: /Users/$USER/code/pdf2htmlEX/CMakeFiles/CMakeTmp]
  ignore line: []
  ignore line: [Run Build Command:/usr/bin/make "cmTryCompileExec833321270/fast"]
  ignore line: [/Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/cmTryCompileExec833321270.dir/build.make CMakeFiles/cmTryCompileExec833321270.dir/build]
  ignore line: [/usr/local/Cellar/cmake/2.8.12.2/bin/cmake -E cmake_progress_report /Users/$USER/code/pdf2htmlEX/CMakeFiles/CMakeTmp/CMakeFiles 1]
  ignore line: [Building C object CMakeFiles/cmTryCompileExec833321270.dir/CMakeCCompilerABI.c.o]
  ignore line: [/usr/bin/cc    -o CMakeFiles/cmTryCompileExec833321270.dir/CMakeCCompilerABI.c.o   -c /usr/local/Cellar/cmake/2.8.12.2/share/cmake/Modules/CMakeCCompilerABI.c]
  ignore line: [Linking C executable cmTryCompileExec833321270]
  ignore line: [/usr/local/Cellar/cmake/2.8.12.2/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec833321270.dir/link.txt --verbose=1]
  ignore line: [/usr/bin/cc    -Wl,-search_paths_first -Wl,-headerpad_max_install_names -v -Wl,-v CMakeFiles/cmTryCompileExec833321270.dir/CMakeCCompilerABI.c.o  -o cmTryCompileExec833321270   ]
  ignore line: [Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)]
  ignore line: [Target: x86_64-apple-darwin13.1.0]
  ignore line: [Thread model: posix]
  link line: [ "/Library/Developer/CommandLineTools/usr/bin/ld" -demangle -dynamic -arch x86_64 -macosx_version_min 10.9.0 -o cmTryCompileExec833321270 -search_paths_first -headerpad_max_install_names -v CMakeFiles/cmTryCompileExec833321270.dir/CMakeCCompilerABI.c.o -lSystem /Library/Developer/CommandLineTools/usr/bin/../lib/clang/5.1/lib/darwin/libclang_rt.osx.a]
    arg [/Library/Developer/CommandLineTools/usr/bin/ld] ==> ignore
    arg [-demangle] ==> ignore
    arg [-dynamic] ==> ignore
    arg [-arch] ==> ignore
    arg [x86_64] ==> ignore
    arg [-macosx_version_min] ==> ignore
    arg [10.9.0] ==> ignore
    arg [-o] ==> ignore
    arg [cmTryCompileExec833321270] ==> ignore
    arg [-search_paths_first] ==> ignore
    arg [-headerpad_max_install_names] ==> ignore
    arg [-v] ==> ignore
    arg [CMakeFiles/cmTryCompileExec833321270.dir/CMakeCCompilerABI.c.o] ==> ignore
    arg [-lSystem] ==> lib [System]
    arg [/Library/Developer/CommandLineTools/usr/bin/../lib/clang/5.1/lib/darwin/libclang_rt.osx.a] ==> lib [/Library/Developer/CommandLineTools/usr/bin/../lib/clang/5.1/lib/darwin/libclang_rt.osx.a]
  Library search paths: [;/usr/lib;/usr/local/lib]
  Framework search paths: [;/Library/Frameworks/;/System/Library/Frameworks/]
  remove lib [System]
  collapse lib [/Library/Developer/CommandLineTools/usr/bin/../lib/clang/5.1/lib/darwin/libclang_rt.osx.a] ==> [/Library/Developer/CommandLineTools/usr/lib/clang/5.1/lib/darwin/libclang_rt.osx.a]
  collapse library dir [/usr/lib] ==> [/usr/lib]
  collapse library dir [/usr/local/lib] ==> [/usr/local/lib]
  collapse framework dir [/Library/Frameworks/] ==> [/Library/Frameworks]
  collapse framework dir [/System/Library/Frameworks/] ==> [/System/Library/Frameworks]
  implicit libs: [/Library/Developer/CommandLineTools/usr/lib/clang/5.1/lib/darwin/libclang_rt.osx.a]
  implicit dirs: [/usr/lib;/usr/local/lib]
  implicit fwks: [/Library/Frameworks;/System/Library/Frameworks]

Determining if the CXX compiler works passed with the following output:
Change Dir: /Users/$USER/code/pdf2htmlEX/CMakeFiles/CMakeTmp

Run Build Command:/usr/bin/make "cmTryCompileExec2722847745/fast"
/Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/cmTryCompileExec2722847745.dir/build.make CMakeFiles/cmTryCompileExec2722847745.dir/build
/usr/local/Cellar/cmake/2.8.12.2/bin/cmake -E cmake_progress_report /Users/$USER/code/pdf2htmlEX/CMakeFiles/CMakeTmp/CMakeFiles 1
Building CXX object CMakeFiles/cmTryCompileExec2722847745.dir/testCXXCompiler.cxx.o
/usr/bin/c++     -o CMakeFiles/cmTryCompileExec2722847745.dir/testCXXCompiler.cxx.o -c /Users/$USER/code/pdf2htmlEX/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
Linking CXX executable cmTryCompileExec2722847745
/usr/local/Cellar/cmake/2.8.12.2/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec2722847745.dir/link.txt --verbose=1
/usr/bin/c++     -Wl,-search_paths_first -Wl,-headerpad_max_install_names   CMakeFiles/cmTryCompileExec2722847745.dir/testCXXCompiler.cxx.o  -o cmTryCompileExec2722847745  

Detecting CXX compiler ABI info compiled with the following output:
Change Dir: /Users/$USER/code/pdf2htmlEX/CMakeFiles/CMakeTmp

Run Build Command:/usr/bin/make "cmTryCompileExec1879465706/fast"
/Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/cmTryCompileExec1879465706.dir/build.make CMakeFiles/cmTryCompileExec1879465706.dir/build
/usr/local/Cellar/cmake/2.8.12.2/bin/cmake -E cmake_progress_report /Users/$USER/code/pdf2htmlEX/CMakeFiles/CMakeTmp/CMakeFiles 1
Building CXX object CMakeFiles/cmTryCompileExec1879465706.dir/CMakeCXXCompilerABI.cpp.o
/usr/bin/c++     -o CMakeFiles/cmTryCompileExec1879465706.dir/CMakeCXXCompilerABI.cpp.o -c /usr/local/Cellar/cmake/2.8.12.2/share/cmake/Modules/CMakeCXXCompilerABI.cpp
Linking CXX executable cmTryCompileExec1879465706
/usr/local/Cellar/cmake/2.8.12.2/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec1879465706.dir/link.txt --verbose=1
/usr/bin/c++     -Wl,-search_paths_first -Wl,-headerpad_max_install_names -v -Wl,-v CMakeFiles/cmTryCompileExec1879465706.dir/CMakeCXXCompilerABI.cpp.o  -o cmTryCompileExec1879465706   
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.1.0
Thread model: posix
 "/Library/Developer/CommandLineTools/usr/bin/ld" -demangle -dynamic -arch x86_64 -macosx_version_min 10.9.0 -o cmTryCompileExec1879465706 -search_paths_first -headerpad_max_install_names -v CMakeFiles/cmTryCompileExec1879465706.dir/CMakeCXXCompilerABI.cpp.o -lc++ -lSystem /Library/Developer/CommandLineTools/usr/bin/../lib/clang/5.1/lib/darwin/libclang_rt.osx.a
@(#)PROGRAM:ld  PROJECT:ld64-236.4
configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 armv6m armv7m armv7em
Library search paths:
    /usr/lib
    /usr/local/lib
Framework search paths:
    /Library/Frameworks/
    /System/Library/Frameworks/

Parsed CXX implicit link information from above output:
  link line regex: [^( *|.*[/\])(ld|([^/\]+-)?ld|collect2)[^/\]*( |$)]
  ignore line: [Change Dir: /Users/$USER/code/pdf2htmlEX/CMakeFiles/CMakeTmp]
  ignore line: []
  ignore line: [Run Build Command:/usr/bin/make "cmTryCompileExec1879465706/fast"]
  ignore line: [/Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/cmTryCompileExec1879465706.dir/build.make CMakeFiles/cmTryCompileExec1879465706.dir/build]
  ignore line: [/usr/local/Cellar/cmake/2.8.12.2/bin/cmake -E cmake_progress_report /Users/$USER/code/pdf2htmlEX/CMakeFiles/CMakeTmp/CMakeFiles 1]
  ignore line: [Building CXX object CMakeFiles/cmTryCompileExec1879465706.dir/CMakeCXXCompilerABI.cpp.o]
  ignore line: [/usr/bin/c++     -o CMakeFiles/cmTryCompileExec1879465706.dir/CMakeCXXCompilerABI.cpp.o -c /usr/local/Cellar/cmake/2.8.12.2/share/cmake/Modules/CMakeCXXCompilerABI.cpp]
  ignore line: [Linking CXX executable cmTryCompileExec1879465706]
  ignore line: [/usr/local/Cellar/cmake/2.8.12.2/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec1879465706.dir/link.txt --verbose=1]
  ignore line: [/usr/bin/c++     -Wl,-search_paths_first -Wl,-headerpad_max_install_names -v -Wl,-v CMakeFiles/cmTryCompileExec1879465706.dir/CMakeCXXCompilerABI.cpp.o  -o cmTryCompileExec1879465706   ]
  ignore line: [Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)]
  ignore line: [Target: x86_64-apple-darwin13.1.0]
  ignore line: [Thread model: posix]
  link line: [ "/Library/Developer/CommandLineTools/usr/bin/ld" -demangle -dynamic -arch x86_64 -macosx_version_min 10.9.0 -o cmTryCompileExec1879465706 -search_paths_first -headerpad_max_install_names -v CMakeFiles/cmTryCompileExec1879465706.dir/CMakeCXXCompilerABI.cpp.o -lc++ -lSystem /Library/Developer/CommandLineTools/usr/bin/../lib/clang/5.1/lib/darwin/libclang_rt.osx.a]
    arg [/Library/Developer/CommandLineTools/usr/bin/ld] ==> ignore
    arg [-demangle] ==> ignore
    arg [-dynamic] ==> ignore
    arg [-arch] ==> ignore
    arg [x86_64] ==> ignore
    arg [-macosx_version_min] ==> ignore
    arg [10.9.0] ==> ignore
    arg [-o] ==> ignore
    arg [cmTryCompileExec1879465706] ==> ignore
    arg [-search_paths_first] ==> ignore
    arg [-headerpad_max_install_names] ==> ignore
    arg [-v] ==> ignore
    arg [CMakeFiles/cmTryCompileExec1879465706.dir/CMakeCXXCompilerABI.cpp.o] ==> ignore
    arg [-lc++] ==> lib [c++]
    arg [-lSystem] ==> lib [System]
    arg [/Library/Developer/CommandLineTools/usr/bin/../lib/clang/5.1/lib/darwin/libclang_rt.osx.a] ==> lib [/Library/Developer/CommandLineTools/usr/bin/../lib/clang/5.1/lib/darwin/libclang_rt.osx.a]
  Library search paths: [;/usr/lib;/usr/local/lib]
  Framework search paths: [;/Library/Frameworks/;/System/Library/Frameworks/]
  remove lib [System]
  collapse lib [/Library/Developer/CommandLineTools/usr/bin/../lib/clang/5.1/lib/darwin/libclang_rt.osx.a] ==> [/Library/Developer/CommandLineTools/usr/lib/clang/5.1/lib/darwin/libclang_rt.osx.a]
  collapse library dir [/usr/lib] ==> [/usr/lib]
  collapse library dir [/usr/local/lib] ==> [/usr/local/lib]
  collapse framework dir [/Library/Frameworks/] ==> [/Library/Frameworks]
  collapse framework dir [/System/Library/Frameworks/] ==> [/System/Library/Frameworks]
  implicit libs: [c++;/Library/Developer/CommandLineTools/usr/lib/clang/5.1/lib/darwin/libclang_rt.osx.a]
  implicit dirs: [/usr/lib;/usr/local/lib]
  implicit fwks: [/Library/Frameworks;/System/Library/Frameworks]

Performing C++ SOURCE FILE Test CXX0X_SUPPORT succeded with the following output:
Change Dir: /Users/$USER/code/pdf2htmlEX/CMakeFiles/CMakeTmp

Run Build Command:/usr/bin/make "cmTryCompileExec1278979163/fast"
/Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/cmTryCompileExec1278979163.dir/build.make CMakeFiles/cmTryCompileExec1278979163.dir/build
/usr/local/Cellar/cmake/2.8.12.2/bin/cmake -E cmake_progress_report /Users/$USER/code/pdf2htmlEX/CMakeFiles/CMakeTmp/CMakeFiles 1
Building CXX object CMakeFiles/cmTryCompileExec1278979163.dir/src.cxx.o
/usr/bin/c++    -Wall -stdlib=libc++ -std=c++0x -DCXX0X_SUPPORT   -Wall -stdlib=libc++ -std=c++0x -o CMakeFiles/cmTryCompileExec1278979163.dir/src.cxx.o -c /Users/$USER/code/pdf2htmlEX/CMakeFiles/CMakeTmp/src.cxx
Linking CXX executable cmTryCompileExec1278979163
/usr/local/Cellar/cmake/2.8.12.2/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec1278979163.dir/link.txt --verbose=1
/usr/bin/c++    -Wall -stdlib=libc++ -std=c++0x -DCXX0X_SUPPORT -Wl,-search_paths_first -Wl,-headerpad_max_install_names   CMakeFiles/cmTryCompileExec1278979163.dir/src.cxx.o  -o cmTryCompileExec1278979163  

Source file was:
int main() { return 0;}
coolwanglu commented 10 years ago

@shalecraig check your message, you don't have fontforge installed that is new enough

shalecraig commented 10 years ago

It was installed because it's a macports dependency. fontforge --version gives me fontforge 20120731 and libfontforge 20120731.

This is way too old, according to this other issue.

I'm trying to figure out if there's a better way to specify the version required through homebrew, since it isn't specified.

Thanks @coolwanglu for this awesome utility, btw.

shalecraig commented 10 years ago

It looks like I was on the wrong track.

Running brew install --verbose pdf2htmlEX gives this output.

coolwanglu commented 10 years ago

That's an older version, which is not compatible with latest poppler.

coolwanglu commented 10 years ago

I've just tried compiling pdf2htmlEX with the git version of poppler (on Linux), and there was no problem. Please make sure to update pdf2htmlEX to latest version and try again. And feel free to reopen the issue when you have more information.