gjtorikian / mathematical

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

Building from source... #91

Closed mahmoudparsian closed 5 years ago

mahmoudparsian commented 5 years ago

Hello,

can you please help with this error (building from source):

$ bundle exec rake compile cd tmp/universal.x86_64-darwin18/mathematical/2.3.7 /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -I. ../../../../ext/mathematical/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 -- Configuring done -- Generating done -- Build files have been written to: /Users/max/zmp/github/mathematical/ext/mathematical/mtex2MML/build [100%] Built target libmtex2MML_static -- Configuring done CMake Warning (dev): Policy CMP0042 is not set: MACOSX_RPATH is enabled by default. Run "cmake --help-policy CMP0042" for policy details. Use the cmake_policy command to set the policy and suppress this warning.

MACOSX_RPATH is not specified for the following targets:

lasem

This warning is for project developers. Use -Wno-dev to suppress it.

-- Generating done -- Build files have been written to: /Users/max/zmp/github/mathematical/ext/mathematical/lasem/build [ 1%] Linking C shared library liblasem.dylib ld: library not found for -lglib-2.0 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: [liblasem.dylib] Error 1 make[1]: [CMakeFiles/lasem.dir/all] Error 2 make: [all] Error 2 ../../../../ext/mathematical/extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.

Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=../../../../ext/mathematical --curdir --ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/$(RUBY_BASE_NAME) --with-xml2lib --without-xml2lib --with-pangocairo-1.0lib --without-pangocairo-1.0lib --use-system-mtex2MML --use-system-lasem /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:1388:in copy': unknown file type: /Users/max/zmp/github/mathematical/ext/mathematical/lasem/build/liblasem.dylib (RuntimeError) from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:473:inblock in copy_entry' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:1499:in wrap_traverse' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:470:incopy_entry' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:445:in block in cp_r' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:1572:inblock in fu_each_src_dest' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:1586:in fu_each_src_dest0' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:1570:infu_each_src_dest' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:444:in cp_r' from ../../../../ext/mathematical/extconf.rb:98:in

' rake aborted! Command failed with status (1): [/System/Library/Frameworks/Ruby.framework/...] /Users/max/zmp/github/mathematical/vendor/gems/ruby/2.3.0/gems/rake-compiler-1.0.7/lib/rake/extensiontask.rb:205:in block (2 levels) in define_compile_tasks' /Users/max/zmp/github/mathematical/vendor/gems/ruby/2.3.0/gems/rake-compiler-1.0.7/lib/rake/extensiontask.rb:202:inblock in define_compile_tasks' /Library/Ruby/Gems/2.3.0/gems/bundler-2.0.1/lib/bundler/cli/exec.rb:74:in load' /Library/Ruby/Gems/2.3.0/gems/bundler-2.0.1/lib/bundler/cli/exec.rb:74:inkernel_load' /Library/Ruby/Gems/2.3.0/gems/bundler-2.0.1/lib/bundler/cli/exec.rb:28:in run' /Library/Ruby/Gems/2.3.0/gems/bundler-2.0.1/lib/bundler/cli.rb:463:inexec' /Library/Ruby/Gems/2.3.0/gems/bundler-2.0.1/lib/bundler/vendor/thor/lib/thor/command.rb:27:in run' /Library/Ruby/Gems/2.3.0/gems/bundler-2.0.1/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:ininvoke_command' /Library/Ruby/Gems/2.3.0/gems/bundler-2.0.1/lib/bundler/vendor/thor/lib/thor.rb:387:in dispatch' /Library/Ruby/Gems/2.3.0/gems/bundler-2.0.1/lib/bundler/cli.rb:27:indispatch' /Library/Ruby/Gems/2.3.0/gems/bundler-2.0.1/lib/bundler/vendor/thor/lib/thor/base.rb:466:in start' /Library/Ruby/Gems/2.3.0/gems/bundler-2.0.1/lib/bundler/cli.rb:18:instart' /Library/Ruby/Gems/2.3.0/gems/bundler-2.0.1/exe/bundle:30:in block in <top (required)>' /Library/Ruby/Gems/2.3.0/gems/bundler-2.0.1/lib/bundler/friendly_errors.rb:124:inwith_friendly_errors' /Library/Ruby/Gems/2.3.0/gems/bundler-2.0.1/exe/bundle:22:in <top (required)>' /usr/local/bin/bundle:22:inload' /usr/local/bin/bundle:22:in `
' Tasks: TOP => compile => compile:universal.x86_64-darwin18 => compile:mathematical:universal.x86_64-darwin18 => copy:mathematical:universal.x86_64-darwin18:2.3.7 => tmp/universal.x86_64-darwin18/mathematical/2.3.7/mathematical.bundle => tmp/universal.x86_64-darwin18/mathematical/2.3.7/Makefile (See full trace by running task with --trace)

mahmoudparsian commented 5 years ago

the error is:

[ 1%] Linking C shared library liblasem.dylib ld: library not found for -lglib-2.0 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: [liblasem.dylib] Error 1 make[1]: [CMakeFiles/lasem.dir/all] Error 2 make: [all] Error 2 ../../../../ext/mathematical/extconf.rb failed ***

gjtorikian commented 5 years ago

Yes. Please install glib.

Since you are building from source, the instructions to fetch this library are here: https://github.com/gjtorikian/mathematical#building