Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install commonmarker on OS X #71

Closed
pschloss opened this issue Jun 18, 2018 · 5 comments
Closed

Unable to install commonmarker on OS X #71

pschloss opened this issue Jun 18, 2018 · 5 comments

Comments

@pschloss
Copy link

I'm running into a snag trying to update the github-pages gem where it fails on updating commonmarker. I'm using Ruby 2.3.3 on Mac OS X 10.13.5/High Sierra.

$ gem install commonmarker -v '0.17.9'
Building native extensions.  This could take a while...
ERROR:  Error installing commonmarker:
	ERROR: Failed to build gem native extension.

    current directory: /Users/pschloss/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/commonmarker-0.17.9/ext/commonmarker
/Users/pschloss/.rbenv/versions/2.3.3/bin/ruby -r ./siteconf20180618-45632-1hyrp7t.rb extconf.rb
creating Makefile

current directory: /Users/pschloss/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/commonmarker-0.17.9/ext/commonmarker
make "DESTDIR=" clean

current directory: /Users/pschloss/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/commonmarker-0.17.9/ext/commonmarker
make "DESTDIR="
compiling xml.c
compiling strikethrough.c
compiling cmark.c
compiling man.c
compiling buffer.c
compiling autolink.c
compiling blocks.c
compiling commonmarker.c
In file included from commonmarker.c:3:
In file included from ./houdini.h:9:
./config.h:8:9: warning: 'HAVE_STDBOOL_H' macro redefined [-Wmacro-redefined]
#define HAVE_STDBOOL_H
        ^
/Users/pschloss/.rbenv/versions/2.3.3/include/ruby-2.3.0/x86_64-darwin15/ruby/config.h:28:9: note: previous definition is here
#define HAVE_STDBOOL_H 1
        ^
1 warning generated.
compiling cmark_ctype.c
compiling table.c
compiling inlines.c
compiling latex.c
compiling houdini_href_e.c
compiling syntax_extension.c
compiling ext_scanners.c
compiling tagfilter.c
compiling houdini_html_e.c
compiling plaintext.c
compiling utf8.c
compiling references.c
compiling render.c
compiling iterator.c
compiling arena.c
compiling linked_list.c
compiling commonmark.c
compiling map.c
compiling html.c
compiling plugin.c
compiling scanners.c
compiling footnotes.c
compiling houdini_html_u.c
compiling registry.c
compiling node.c
compiling core-extensions.c
linking shared-object commonmarker/commonmarker.bundle

current directory: /Users/pschloss/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/commonmarker-0.17.9/ext/commonmarker
make "DESTDIR=" install
make: /opt/local/bin/gmkdir: No such file or directory
make: *** [.RUBYARCHDIR.-.commonmarker.time] Error 1

make install failed, exit code 2

Gem files will remain installed in /Users/pschloss/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/commonmarker-0.17.9 for inspection.
Results logged to /Users/pschloss/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/extensions/x86_64-darwin-15/2.3.0-static/commonmarker-0.17.9/gem_make.out

There is no /opt/local/bin/ directory on my computer and gmkdir is in /usr/local/bin/gmkdir, which is where it was installed when I used brew reinstall coreutils to install it. Suggestions?

@gjtorikian
Copy link
Owner

I am not sure at all what's going on here. I also don't have /opt/local/bin/; I assume your gmkdir is also just a symlink to ../Cellar/coreutils/8.29/bin/gmkdir?

Can I see the Makefile that was generated? I believe it should be under /Users/pschloss/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/commonmarker-0.17.9/x86_64-darwin16/commonmarker/2.3.3/Makefile.

Curiously it appears that mine uses /usr/bin/install but I wonder why yours is calling gmkdir. I could be totally wrong though, just trying to take guesses.

@gjtorikian
Copy link
Owner

Alternatively, you could try cloning this repo and running bundle install; bundle exec rake compile and see if that works.

@pschloss
Copy link
Author

The Makefile is in /Users/pschloss/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/commonmarker-0.17.9/ext/commonmarker

Here's what the Makefile looks like

SHELL = /bin/sh

# V=0 quiet, V=1 verbose.  other values don't work.
V = 0
Q1 = $(V:1=)
Q = $(Q1:0=@)
ECHO1 = $(V:1=@:)
ECHO = $(ECHO1:0=@echo)
NULLCMD = :

#### Start of system configuration section. ####

srcdir = .
topdir = /Users/pschloss/.rbenv/versions/2.3.3/include/ruby-2.3.0
hdrdir = $(topdir)
arch_hdrdir = /Users/pschloss/.rbenv/versions/2.3.3/include/ruby-2.3.0/x86_64-darwin15
PATH_SEPARATOR = :
VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby
prefix = $(DESTDIR)/Users/pschloss/.rbenv/versions/2.3.3
rubysitearchprefix = $(rubylibprefix)/$(sitearch)
rubyarchprefix = $(rubylibprefix)/$(arch)
rubylibprefix = $(libdir)/$(RUBY_BASE_NAME)
exec_prefix = $(prefix)
vendorarchhdrdir = $(vendorhdrdir)/$(sitearch)
sitearchhdrdir = $(sitehdrdir)/$(sitearch)
rubyarchhdrdir = $(rubyhdrdir)/$(arch)
vendorhdrdir = $(rubyhdrdir)/vendor_ruby
sitehdrdir = $(rubyhdrdir)/site_ruby
rubyhdrdir = $(includedir)/$(RUBY_VERSION_NAME)
vendorarchdir = $(vendorlibdir)/$(sitearch)
vendorlibdir = $(vendordir)/$(ruby_version)
vendordir = $(rubylibprefix)/vendor_ruby
sitearchdir = $(DESTDIR)./.gem.20180621-16217-1mi5sx
sitelibdir = $(DESTDIR)./.gem.20180621-16217-1mi5sx
sitedir = $(rubylibprefix)/site_ruby
rubyarchdir = $(rubylibdir)/$(arch)
rubylibdir = $(rubylibprefix)/$(ruby_version)
sitearchincludedir = $(includedir)/$(sitearch)
archincludedir = $(includedir)/$(arch)
sitearchlibdir = $(libdir)/$(sitearch)
archlibdir = $(libdir)/$(arch)
ridir = $(datarootdir)/$(RI_BASE_NAME)
mandir = $(datarootdir)/man
localedir = $(datarootdir)/locale
libdir = $(exec_prefix)/lib
psdir = $(docdir)
pdfdir = $(docdir)
dvidir = $(docdir)
htmldir = $(docdir)
infodir = $(datarootdir)/info
docdir = $(datarootdir)/doc/$(PACKAGE)
oldincludedir = $(DESTDIR)/usr/include
includedir = $(SDKROOT)$(prefix)/include
localstatedir = $(prefix)/var
sharedstatedir = $(prefix)/com
sysconfdir = $(prefix)/etc
datadir = $(datarootdir)
datarootdir = $(prefix)/share
libexecdir = $(exec_prefix)/libexec
sbindir = $(exec_prefix)/sbin
bindir = $(exec_prefix)/bin
archdir = $(rubyarchdir)


CC = clang
CXX = clang++
LIBRUBY = $(LIBRUBY_A)
LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
LIBRUBYARG_SHARED = 
LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static -framework CoreFoundation
empty =
OUTFLAG = -o $(empty)
COUTFLAG = -o $(empty)

RUBY_EXTCONF_H = 
cflags   =  $(optflags) $(debugflags) $(warnflags)
cxxflags =  $(optflags) $(debugflags) $(warnflags)
optflags = -O3 -fno-fast-math
debugflags = -ggdb3
warnflags = -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens
CCDLFLAGS = -fno-common
CFLAGS   = $(CCDLFLAGS)  -O3 -Wno-error=shorten-64-to-32  -pipe -std=c99 $(ARCH_FLAG)
INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir)
DEFS     = 
CPPFLAGS =  -I/Users/pschloss/.rbenv/versions/2.3.3/include  -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT $(DEFS) $(cppflags)
CXXFLAGS = $(CCDLFLAGS) $(cxxflags) $(ARCH_FLAG)
ldflags  = -L. -L/Users/pschloss/.rbenv/versions/2.3.3/lib  -fstack-protector -L/usr/local/lib
dldflags = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress 
ARCH_FLAG = 
DLDFLAGS = $(ldflags) $(dldflags) $(ARCH_FLAG)
LDSHARED = $(CC) -dynamic -bundle
LDSHAREDXX = $(CXX) -dynamic -bundle
AR = ar
EXEEXT = 

RUBY_INSTALL_NAME = $(RUBY_BASE_NAME)
RUBY_SO_NAME = ruby
RUBYW_INSTALL_NAME = 
RUBY_VERSION_NAME = $(RUBY_BASE_NAME)-$(ruby_version)
RUBYW_BASE_NAME = rubyw
RUBY_BASE_NAME = ruby

arch = x86_64-darwin15
sitearch = $(arch)
ruby_version = 2.3.0
ruby = $(bindir)/$(RUBY_BASE_NAME)
RUBY = $(ruby)
ruby_headers = $(hdrdir)/ruby.h $(hdrdir)/ruby/ruby.h $(hdrdir)/ruby/defines.h $(hdrdir)/ruby/missing.h $(hdrdir)/ruby/intern.h $(hdrdir)/ruby/st.h $(hdrdir)/ruby/subst.h $(arch_hdrdir)/ruby/config.h

RM = rm -f
RM_RF = $(RUBY) -run -e rm -- -rf
RMDIRS = rmdir -p
MAKEDIRS = /opt/local/bin/gmkdir -p
INSTALL = /opt/local/bin/ginstall -c
INSTALL_PROG = $(INSTALL) -m 0755
INSTALL_DATA = $(INSTALL) -m 644
COPY = cp
TOUCH = exit >

#### End of system configuration section. ####

preload = 

libpath = . $(libdir)
LIBPATH =  -L. -L$(libdir)
DEFFILE = 

CLEANFILES = mkmf.log
DISTCLEANFILES = 
DISTCLEANDIRS = 

extout = 
extout_prefix = 
target_prefix = /commonmarker
LOCAL_LIBS = 
LIBS =   -lpthread -lgmp -ldl -lobjc 
ORIG_SRCS = xml.c strikethrough.c cmark.c man.c buffer.c autolink.c blocks.c commonmarker.c cmark_ctype.c table.c inlines.c latex.c houdini_href_e.c syntax_extension.c ext_scanners.c tagfilter.c houdini_html_e.c plaintext.c utf8.c references.c render.c iterator.c arena.c linked_list.c commonmark.c map.c html.c plugin.c scanners.c footnotes.c houdini_html_u.c registry.c node.c core-extensions.c
SRCS = $(ORIG_SRCS) 
OBJS = xml.o strikethrough.o cmark.o man.o buffer.o autolink.o blocks.o commonmarker.o cmark_ctype.o table.o inlines.o latex.o houdini_href_e.o syntax_extension.o ext_scanners.o tagfilter.o houdini_html_e.o plaintext.o utf8.o references.o render.o iterator.o arena.o linked_list.o commonmark.o map.o html.o plugin.o scanners.o footnotes.o houdini_html_u.o registry.o node.o core-extensions.o
HDRS = $(srcdir)/cmarkextensions_export.h $(srcdir)/cmark_export.h $(srcdir)/html.h $(srcdir)/plugin.h $(srcdir)/map.h $(srcdir)/config.h $(srcdir)/chunk.h $(srcdir)/footnotes.h $(srcdir)/parser.h $(srcdir)/scanners.h $(srcdir)/node.h $(srcdir)/core-extensions.h $(srcdir)/registry.h $(srcdir)/cmark_version.h $(srcdir)/autolink.h $(srcdir)/cmark_ctype.h $(srcdir)/commonmarker.h $(srcdir)/buffer.h $(srcdir)/cmark.h $(srcdir)/strikethrough.h $(srcdir)/cmark_extension_api.h $(srcdir)/syntax_extension.h $(srcdir)/inlines.h $(srcdir)/table.h $(srcdir)/tagfilter.h $(srcdir)/ext_scanners.h $(srcdir)/houdini.h $(srcdir)/iterator.h $(srcdir)/utf8.h $(srcdir)/references.h $(srcdir)/render.h
TARGET = commonmarker
TARGET_NAME = commonmarker
TARGET_ENTRY = Init_$(TARGET_NAME)
DLLIB = $(TARGET).bundle
EXTSTATIC = 
STATIC_LIB = 

TIMESTAMP_DIR = .
BINDIR        = $(bindir)
RUBYCOMMONDIR = $(sitedir)$(target_prefix)
RUBYLIBDIR    = $(sitelibdir)$(target_prefix)
RUBYARCHDIR   = $(sitearchdir)$(target_prefix)
HDRDIR        = $(rubyhdrdir)/ruby$(target_prefix)
ARCHHDRDIR    = $(rubyhdrdir)/$(arch)/ruby$(target_prefix)

TARGET_SO     = $(DLLIB)
CLEANLIBS     = $(TARGET).bundle 
CLEANOBJS     = *.o  *.bak

all:    $(DLLIB)
static: $(STATIC_LIB) install-rb
.PHONY: all install static install-so install-rb
.PHONY: clean clean-so clean-static clean-rb

clean-static::
clean-rb-default::
clean-rb::
clean-so::
clean: clean-so clean-static clean-rb-default clean-rb
		-$(Q)$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES) .*.time

distclean-rb-default::
distclean-rb::
distclean-so::
distclean-static::
distclean: clean distclean-so distclean-static distclean-rb-default distclean-rb
		-$(Q)$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
		-$(Q)$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
		-$(Q)$(RMDIRS) $(DISTCLEANDIRS) 2> /dev/null || true

realclean: distclean
install: install-so install-rb

install-so: $(DLLIB) $(TIMESTAMP_DIR)/.RUBYARCHDIR.-.commonmarker.time
	$(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
clean-static::
	-$(Q)$(RM) $(STATIC_LIB)
install-rb: pre-install-rb install-rb-default
install-rb-default: pre-install-rb-default
pre-install-rb: Makefile
pre-install-rb-default: Makefile
pre-install-rb-default:
	@$(NULLCMD)
$(TIMESTAMP_DIR)/.RUBYARCHDIR.-.commonmarker.time:
	$(Q) $(MAKEDIRS) $(@D) $(RUBYARCHDIR)
	$(Q) $(TOUCH) $@

site-install: site-install-so site-install-rb
site-install-so: install-so
site-install-rb: install-rb

.SUFFIXES: .c .m .cc .mm .cxx .cpp .o .S

.cc.o:
	$(ECHO) compiling $(<)
	$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<

.cc.S:
	$(ECHO) translating $(<)
	$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $<

.mm.o:
	$(ECHO) compiling $(<)
	$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<

.mm.S:
	$(ECHO) translating $(<)
	$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $<

.cxx.o:
	$(ECHO) compiling $(<)
	$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<

.cxx.S:
	$(ECHO) translating $(<)
	$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $<

.cpp.o:
	$(ECHO) compiling $(<)
	$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<

.cpp.S:
	$(ECHO) translating $(<)
	$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $<

.c.o:
	$(ECHO) compiling $(<)
	$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $<

.c.S:
	$(ECHO) translating $(<)
	$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $<

.m.o:
	$(ECHO) compiling $(<)
	$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $<

.m.S:
	$(ECHO) translating $(<)
	$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $<

$(DLLIB): $(OBJS) Makefile
	$(ECHO) linking shared-object commonmarker/$(DLLIB)
	-$(Q)$(RM) $(@)
	$(Q) $(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
	$(Q) $(POSTLINK)



$(OBJS): $(HDRS) $(ruby_headers)

@pschloss
Copy link
Author

Sorry, I figured it out - there was a vestigial macports installation causing problems. Once I reinstalled rbenv everything worked.

@nbro
Copy link

nbro commented Oct 21, 2021

I'm still getting this error when trying to install commonmarker with my systems's ruby (mac os big sur): rbenv/rbenv#1354.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants