gjtorikian / mathematical

Convert mathematical equations to SVGs, PNGs, or MathML. A general wrapper to Lasem and mtex2MML.
https://gjtorikian.github.io/mathematical/
MIT License
164 stars 31 forks source link

Failed to build gem native extension #50

Closed AndorChen closed 9 years ago

AndorChen commented 9 years ago

During my installation, I got a "Failed to build gem native extension" error, as following:

$ gem install mathematical
Fetching: ruby-enum-0.4.0.gem (100%)
Successfully installed ruby-enum-0.4.0
Fetching: mathematical-1.4.2.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing mathematical:
    ERROR: Failed to build gem native extension.

   ~/.rbenv/versions/2.2.2/bin/ruby -r ./siteconf20150807-12392-1vm016r.rb extconf.rb
checking for cmake... yes
checking for main() in -lxml2... yes
checking for main() in -lpangocairo-1.0... yes
checking for libxml/tree.h in /include/libxml2,/usr/include/libxml2,/usr/local/include/libxml2... yes
checking for libxml/parser.h in /include/libxml2,/usr/include/libxml2,/usr/local/include/libxml2... yes
checking for libxml/xpath.h in /include/libxml2,/usr/include/libxml2,/usr/local/include/libxml2... yes
checking for libxml/xpathInternals.h in /include/libxml2,/usr/include/libxml2,/usr/local/include/libxml2... yes
-- The C compiler identification is AppleClang 6.1.0.6020049
-- The CXX compiler identification is AppleClang 6.1.0.6020049
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found BISON: /usr/bin/bison (found version "2.3") 
-- Found FLEX: /usr/bin/flex (found version "2.5.35") 
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
-- Found PythonInterp: /usr/bin/python (found version "2.7.6") 
-- Configuring done
-- Generating done
-- Build files have been written to: ~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/mathematical-1.4.2/ext/mathematical/mtex2MML/build
[ 12%] [FLEX][MTEX2MMLSCANNER] Building scanner with flex 2.5.35
[ 25%] [BISON][MTEX2MMLPARSER] Building parser with bison 2.3
conflicts: 5209 shift/reduce, 412 reduce/reduce
Scanning dependencies of target libmtex2MML_static
[ 37%] Building C object CMakeFiles/libmtex2MML_static.dir/src/colors.c.o
[ 50%] Building C object CMakeFiles/libmtex2MML_static.dir/src/em.c.o
[ 62%] Building C object CMakeFiles/libmtex2MML_static.dir/src/environment.c.o
[ 75%] Building C object CMakeFiles/libmtex2MML_static.dir/src/string_extras.c.o
[ 87%] Building C object CMakeFiles/libmtex2MML_static.dir/parser.c.o
~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/mathematical-1.4.2/ext/mathematical/mtex2MML/src/parser.y:54:30: warning: unused parameter 'ret_str' [-Wunused-parameter]
 static void yyerror (char **ret_str, const char * s)
                             ^
~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/mathematical-1.4.2/ext/mathematical/mtex2MML/src/parser.y:66:14: warning: unused function 'mtex2MML_default_write' [-Wunused-function]
 static void mtex2MML_default_write (const char * buffer, unsigned long length)
             ^
~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/mathematical-1.4.2/ext/mathematical/mtex2MML/src/parser.y:77:14: warning: unused function 'mtex2MML_default_write_mathml' [-Wunused-function]
 static void mtex2MML_default_write_mathml (const char * mathml)
             ^
3 warnings generated.
[100%] Building C object CMakeFiles/libmtex2MML_static.dir/lexer.c.o
~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/mathematical-1.4.2/ext/mathematical/mtex2MML/build/lexer.c:8186:16: warning: function 'input' is not needed and will not be emitted [-Wunneeded-internal-declaration]
    static int input  (void)
               ^
1 warning generated.
Linking C static library libmtex2MML.a
[100%] Built target libmtex2MML_static
extconf.rb:59:in ``': No such file or directory - pkg-config (Errno::ENOENT)
    from extconf.rb:59:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in ~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/mathematical-1.4.2 for inspection.
Results logged to ~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-14/2.2.0-static/mathematical-1.4.2/gem_make.out

All dependencies are installed via homebrew (hope so), but still can't build, something or any steps I missed?

gjtorikian commented 9 years ago

Hm, am I correct in assuming you're on a Mac?

I think I might've missed a dependency. Can you try brew install pkg-config ?

AndorChen commented 9 years ago

@gjtorikian Yes, on a Mac. I already got pkg-config installed, but after a re-install, the build passed. Maybe the old one is a legacy of Mavericks.

Thanks.