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

berkshelf commands are broken using the dep_selector-1.0.1 gem on centOS #23

Closed
etherealiska opened this issue Apr 17, 2014 · 25 comments · Fixed by #26
Closed

berkshelf commands are broken using the dep_selector-1.0.1 gem on centOS #23

etherealiska opened this issue Apr 17, 2014 · 25 comments · Fixed by #26

Comments

@etherealiska
Copy link

I already fixed my issue by installing dep_selector-1.0.0 first, and then installing berkshelf. This is on a CentOS 6.4 machine. I wish I had more info but I'm new to this kind of stuff. Berkshelf was installed on this chef server using the chef client, which I assume is how gem_package resource works.

$ /opt/chef/embedded/bin/gem install berkshelf

The error comes from any berks command, even just getting the version number.

$ /opt/chef/embedded/bin/berks -v

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/ffi-1.9.3/lib/ffi/library.rb:133:in `block in ffi_lib': Could not open library '/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/dep_selector-1.0.1/lib/dep_gecode.so': libgecodesearch.so.32: cannot open shared object file: No such file or directory (LoadError)
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/ffi-1.9.3/lib/ffi/library.rb:100:in `map'
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/ffi-1.9.3/lib/ffi/library.rb:100:in `ffi_lib'
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/dep_selector-1.0.1/lib/dep_selector/dep_gecode.rb:39:in `<module:Dep_gecode>'
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/dep_selector-1.0.1/lib/dep_selector/dep_gecode.rb:21:in `<top (required)>'
    from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/dep_selector-1.0.1/lib/dep_selector/gecode_wrapper.rb:21:in `<top (required)>'
    from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/dep_selector-1.0.1/lib/dep_selector/dependency_graph.rb:21:in `<top (required)>'
    from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/dep_selector-1.0.1/lib/dep_selector/selector.rb:21:in `<top (required)>'
    from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/dep_selector-1.0.1/lib/dep_selector.rb:22:in `<top (required)>'
    from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/solve-1.1.0/lib/solve/solver.rb:1:in `<top (required)>'
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/solve-1.1.0/lib/solve.rb:10:in `require_relative'
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/solve-1.1.0/lib/solve.rb:10:in `<module:Solve>'
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/solve-1.1.0/lib/solve.rb:3:in `<top (required)>'
    from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/berkshelf-3.0.1/lib/berkshelf.rb:8:in `<top (required)>'
    from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
    from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/berkshelf-3.0.1/lib/berkshelf/cli.rb:1:in `<top (required)>'
    from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
    from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
    from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/berkshelf-3.0.1/bin/berks:3:in `<top (required)>'
    from /opt/chef/embedded/bin/berks:23:in `load'
    from /opt/chef/embedded/bin/berks:23:in `<main>'
@danielsdeleo
Copy link
Contributor

Can you still reproduce this? Was the dep-selector-libgecode gem getting installed successfully?

@jontrainor
Copy link

I am having the same problem on Linux Mint. I get the following errors installing the dep-selector-libgecode gem.

Building native extensions.  This could take a while...
Successfully installed dep-selector-libgecode-1.0.0
1 gem installed
Installing ri documentation for dep-selector-libgecode-1.0.0...
unable to convert "\\xED" from ASCII-8BIT to UTF-8 for lib/dep-selector-libgecode/vendored-gecode/include/gecode/int.hh, skipping

unable to convert "\\xE4" from ASCII-8BIT to UTF-8 for lib/dep-selector-libgecode/vendored-gecode/include/gecode/int/sorted.hh, skipping
unable to convert "\\xE9" from ASCII-8BIT to UTF-8 for lib/dep-selector-libgecode/vendored-gecode/include/gecode/int/distinct.hh,skipping
unable to convert "\\xED" from ASCII-8BIT to UTF-8 for lib/dep-selector-libgecode/vendored-gecode/include/gecode/int/cumulative.hh, skipping
unable to convert "\\xED" from ASCII-8BIT to UTF-8 for lib/dep-selector-libgecode/vendored-gecode/include/gecode/int/unary.hh, skipping
unable to convert "\\xF3" from ASCII-8BIT to UTF-8 for lib/dep-selector-libgecode/vendored-gecode/include/gecode/int/gcc.hh, skipping
Installing RDoc documentation for dep-selector-libgecode-1.0.0...
unable to convert "\\xED" from ASCII-8BIT to UTF-8 for lib/dep-selector-libgecode/vendored-gecode/include/gecode/int.hh, skipping

unable to convert "\\xE4" from ASCII-8BIT to UTF-8 for lib/dep-selector-libgecode/vendored-gecode/include/gecode/int/sorted.hh, skipping
unable to convert "\\xE9" from ASCII-8BIT to UTF-8 for lib/dep-selector-libgecode/vendored-gecode/include/gecode/int/distinct.hh, skipping
unable to convert "\\xED" from ASCII-8BIT to UTF-8 for lib/dep-selector-libgecode/vendored-gecode/include/gecode/int/cumulative.hh, skipping
unable to convert "\\xED" from ASCII-8BIT to UTF-8 for lib/dep-selector-libgecode/vendored-gecode/include/gecode/int/unary.hh, skipping
unable to convert "\\xF3" from ASCII-8BIT to UTF-8 for lib/dep-selector-libgecode/vendored-gecode/include/gecode/int/gcc.hh, skipping

@sethvargo
Copy link
Contributor

@jontrainor those errors are different. They are just warnings while installing the documentation. The gem installed successfully. You need to set your system encoding I believe.

@danielsdeleo
Copy link
Contributor

Closing this because we need more information to reproduce. The only change in 1.0.1 was a code path that should only affect windows: 1.0.0...1.0.1 and we're not seeing this issue on our ChefDK build systems.

@rrehbein
Copy link

I've been getting a similar issue.

Added LD_LIBRARY_PATH gets around it, but probably is the wrong answer.

$ LD_LIBRARY_PATH=/var/lib/gems/2.0.0/gems/dep-selector-libgecode-1.0.0/ext/libgecode3/vendor/gecode-3.7.3/ berks version
3.0.1
$ berks version
/var/lib/gems/2.0.0/gems/ffi-1.9.3/lib/ffi/library.rb:133:in `block in ffi_lib': Could not open library '/var/lib/gems/2.0.0/gems/dep_selector-1.0.2/lib/dep_gecode.so': libgecodesearch.so.32: cannot open shared object file: No such file or directory (LoadError)
    from /var/lib/gems/2.0.0/gems/ffi-1.9.3/lib/ffi/library.rb:100:in `map'
    from /var/lib/gems/2.0.0/gems/ffi-1.9.3/lib/ffi/library.rb:100:in `ffi_lib'
    from /var/lib/gems/2.0.0/gems/dep_selector-1.0.2/lib/dep_selector/dep_gecode.rb:39:in `<module:Dep_gecode>'
    from /var/lib/gems/2.0.0/gems/dep_selector-1.0.2/lib/dep_selector/dep_gecode.rb:21:in `<top (required)>'
    from /usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /var/lib/gems/2.0.0/gems/dep_selector-1.0.2/lib/dep_selector/gecode_wrapper.rb:21:in `<top (required)>'
    from /usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /var/lib/gems/2.0.0/gems/dep_selector-1.0.2/lib/dep_selector/dependency_graph.rb:21:in `<top (required)>'
    from /usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /var/lib/gems/2.0.0/gems/dep_selector-1.0.2/lib/dep_selector/selector.rb:21:in `<top (required)>'
    from /usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /var/lib/gems/2.0.0/gems/dep_selector-1.0.2/lib/dep_selector.rb:22:in `<top (required)>'
    from /usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /var/lib/gems/2.0.0/gems/solve-1.1.0/lib/solve/solver.rb:1:in `<top (required)>'
    from /var/lib/gems/2.0.0/gems/solve-1.1.0/lib/solve.rb:10:in `require_relative'
    from /var/lib/gems/2.0.0/gems/solve-1.1.0/lib/solve.rb:10:in `<module:Solve>'
    from /var/lib/gems/2.0.0/gems/solve-1.1.0/lib/solve.rb:3:in `<top (required)>'
    from /usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /var/lib/gems/2.0.0/gems/berkshelf-3.0.1/lib/berkshelf.rb:8:in `<top (required)>'
    from /usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /var/lib/gems/2.0.0/gems/berkshelf-3.0.1/lib/berkshelf/cli.rb:1:in `<top (required)>'
    from /usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /var/lib/gems/2.0.0/gems/berkshelf-3.0.1/bin/berks:3:in `<top (required)>'
    from /usr/local/bin/berks:23:in `load'
    from /usr/local/bin/berks:23:in `<main>'

Below is some requested details

$ cat `gem which dep_selector`
#
# Author:: Christopher Walters (<cw@opscode.com>)
# Author:: Mark Anderson (<mark@opscode.com>)
# Copyright:: Copyright (c) 2010-2011 Opscode, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

require 'dep_selector/dep_selector_version'

require 'dep_selector/selector'
require 'dep_selector/dependency_graph'
require 'dep_selector/package'
require 'dep_selector/package_version'
require 'dep_selector/dependency'
require 'dep_selector/solution_constraint'
require 'dep_selector/version'
require 'dep_selector/version_constraint'
require 'dep_selector/exceptions'

# error reporting
require 'dep_selector/error_reporter'
require 'dep_selector/error_reporter/simple_tree_traverser'
$ cat /var/lib/gems/2.0.0/gems/dep_selector-1.0.2/ext/dep_gecode/Makefile 

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)

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

srcdir = .
topdir = /usr/include/ruby-2.0.0
hdrdir = $(topdir)
arch_hdrdir = /usr/include/x86_64-linux-gnu/ruby-2.0.0
PATH_SEPARATOR = :
VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby
prefix = /usr
rubysitearchprefix = $(sitearchlibdir)/$(RUBY_BASE_NAME)
rubyarchprefix = $(archlibdir)/$(RUBY_BASE_NAME)
rubylibprefix = $(libdir)/$(RUBY_BASE_NAME)
exec_prefix = $(prefix)
vendorarchhdrdir = $(sitearchincludedir)/$(RUBY_VERSION_NAME)/vendor_ruby
sitearchhdrdir = $(sitearchincludedir)/$(RUBY_VERSION_NAME)/site_ruby
rubyarchhdrdir = $(archincludedir)/$(RUBY_VERSION_NAME)
vendorhdrdir = $(rubyhdrdir)/vendor_ruby
sitehdrdir = $(rubyhdrdir)/site_ruby
rubyhdrdir = $(includedir)/$(RUBY_VERSION_NAME)
vendorarchdir = $(rubysitearchprefix)/vendor_ruby/$(ruby_version)
vendorlibdir = $(vendordir)/$(ruby_version)
vendordir = $(rubylibprefix)/vendor_ruby
sitearchdir = ./.gem.20140418-25934-yo06b2
sitelibdir = ./.gem.20140418-25934-yo06b2
sitedir = $(DESTDIR)/usr/local/lib/site_ruby
rubyarchdir = $(rubyarchprefix)/$(ruby_version)
rubylibdir = $(rubylibprefix)/$(ruby_version)
sitearchincludedir = $(includedir)/$(sitearch)
archincludedir = $(includedir)/$(arch)
sitearchlibdir = $(libdir)/$(sitearch)
archlibdir = $(libdir)/$(arch)
ridir = $(datarootdir)/$(RI_BASE_NAME)
mandir = $(prefix)/share/man
localedir = $(datarootdir)/locale
libdir = $(exec_prefix)/lib
psdir = $(docdir)
pdfdir = $(docdir)
dvidir = $(docdir)
htmldir = $(docdir)
infodir = $(prefix)/share/info
docdir = $(datarootdir)/doc/$(PACKAGE)
oldincludedir = /usr/include
includedir = $(prefix)/include
localstatedir = $(DESTDIR)/var
sharedstatedir = $(prefix)/com
sysconfdir = $(DESTDIR)/etc
datadir = $(datarootdir)
datarootdir = $(prefix)/share
libexecdir = $(prefix)/lib/ruby2.0
sbindir = $(exec_prefix)/sbin
bindir = $(exec_prefix)/bin
archdir = $(rubyarchdir)


CC = gcc
CXX = g++
LIBRUBY = $(LIBRUBY_SO)
LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
LIBRUBYARG_SHARED = -l$(RUBY_SO_NAME)
LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static
empty =
OUTFLAG = -o $(empty)
COUTFLAG = -o $(empty)

RUBY_EXTCONF_H = 
cflags   =  $(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 -Wimplicit-function-declaration
CCDLFLAGS = -fPIC
CFLAGS   = $(CCDLFLAGS) -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -fPIC $(ARCH_FLAG)
INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir) -I/var/lib/gems/2.0.0/gems/dep-selector-libgecode-1.0.0/lib/dep-selector-libgecode/vendored-gecode/include
DEFS     = 
CPPFLAGS =  -D_FORTIFY_SOURCE=2 $(DEFS) $(cppflags)
CXXFLAGS = $(CCDLFLAGS) -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security $(ARCH_FLAG)
ldflags  = -L. -Wl,-z,relro -L/build/ruby2.0-0uKpS5/ruby2.0-2.0.0.484+really457/debian/lib -fstack-protector -rdynamic -Wl,-export-dynamic
dldflags =  
ARCH_FLAG = 
DLDFLAGS = $(ldflags) $(dldflags) $(ARCH_FLAG)
LDSHARED = $(CC) -shared
LDSHAREDXX = $(CXX) -shared
AR = ar
EXEEXT = 

RUBY_INSTALL_NAME = ruby2.0
RUBY_SO_NAME = ruby-2.0
RUBYW_INSTALL_NAME = 
RUBY_VERSION_NAME = $(RUBY_BASE_NAME)-$(ruby_version)
RUBYW_BASE_NAME = rubyw
RUBY_BASE_NAME = ruby

arch = x86_64-linux-gnu
sitearch = $(arch)
ruby_version = 2.0.0
ruby = $(bindir)/ruby2.0
RUBY = $(ruby)
ruby_headers = $(hdrdir)/ruby.h $(hdrdir)/ruby/defines.h $(arch_hdrdir)/ruby/config.h

RM = rm -f
RM_RF = $(RUBY) -run -e rm -- -rf
RMDIRS = rmdir --ignore-fail-on-non-empty -p
MAKEDIRS = /bin/mkdir -p
INSTALL = /usr/bin/install -c
INSTALL_PROG = $(INSTALL) -m 0755
INSTALL_DATA = $(INSTALL) -m 644
COPY = cp
TOUCH = exit >

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

preload = 

libpath = . $(libdir) /var/lib/gems/2.0.0/gems/dep-selector-libgecode-1.0.0/lib/dep-selector-libgecode/vendored-gecode/lib
LIBPATH =  -L. -L$(libdir) -L/var/lib/gems/2.0.0/gems/dep-selector-libgecode-1.0.0/lib/dep-selector-libgecode/vendored-gecode/lib
DEFFILE = 

CLEANFILES = mkmf.log
DISTCLEANFILES = 
DISTCLEANDIRS = 

extout = 
extout_prefix = 
target_prefix = 
LOCAL_LIBS = 
LIBS = $(LIBRUBYARG_SHARED) -lgecodesearch -lgecodeminimodel -lgecodeint -lgecodekernel -lgecodesupport -lgecodesupport  -lpthread -lrt -ldl -lcrypt -lm   -lc
ORIG_SRCS = define_dummy_init.cxx dep_selector_to_gecode.cpp dep_selector_to_gecode_interface.cpp
SRCS = $(ORIG_SRCS) 
OBJS = define_dummy_init.o dep_selector_to_gecode.o dep_selector_to_gecode_interface.o
HDRS = $(srcdir)/dep_selector_to_gecode.h $(srcdir)/dep_selector_to_gecode_interface.h
TARGET = dep_gecode
TARGET_NAME = dep_gecode
TARGET_ENTRY = Init_$(TARGET_NAME)
DLLIB = $(TARGET).so
EXTSTATIC = 
STATIC_LIB = 

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

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

all:    $(DLLIB)
static: $(STATIC_LIB)
.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) ./.RUBYARCHDIR.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:
    $(ECHO) installing default dep_gecode libraries
./.RUBYARCHDIR.time:
    $(Q) $(MAKEDIRS) $(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 .C .o

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

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

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

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

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

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

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

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



$(OBJS): $(HDRS) $(ruby_headers)
$ readelf -d $(gem which dep_gecode)

Dynamic section at offset 0xfc20 contains 37 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libruby-2.0.so.2.0]
 0x0000000000000001 (NEEDED)             Shared library: [libgecodesearch.so.32]
 0x0000000000000001 (NEEDED)             Shared library: [libgecodeminimodel.so.32]
 0x0000000000000001 (NEEDED)             Shared library: [libgecodeint.so.32]
 0x0000000000000001 (NEEDED)             Shared library: [libgecodekernel.so.32]
 0x0000000000000001 (NEEDED)             Shared library: [libgecodesupport.so.32]
 0x0000000000000001 (NEEDED)             Shared library: [libpthread.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [librt.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libdl.so.2]
 0x0000000000000001 (NEEDED)             Shared library: [libcrypt.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libstdc++.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libm.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libgcc_s.so.1]
 0x000000000000000c (INIT)               0x5638
 0x000000000000000d (FINI)               0xc898
 0x0000000000000019 (INIT_ARRAY)         0x20f8d0
 0x000000000000001b (INIT_ARRAYSZ)       24 (bytes)
 0x000000000000001a (FINI_ARRAY)         0x20f8e8
 0x000000000000001c (FINI_ARRAYSZ)       8 (bytes)
 0x000000006ffffef5 (GNU_HASH)           0x1f0
 0x0000000000000005 (STRTAB)             0x1d48
 0x0000000000000006 (SYMTAB)             0x6b0
 0x000000000000000a (STRSZ)              8532 (bytes)
 0x000000000000000b (SYMENT)             24 (bytes)
 0x0000000000000003 (PLTGOT)             0x210000
 0x0000000000000002 (PLTRELSZ)           2688 (bytes)
 0x0000000000000014 (PLTREL)             RELA
 0x0000000000000017 (JMPREL)             0x4bb8
 0x0000000000000007 (RELA)               0x4150
 0x0000000000000008 (RELASZ)             2664 (bytes)
 0x0000000000000009 (RELAENT)            24 (bytes)
 0x000000006ffffffe (VERNEED)            0x4080
 0x000000006fffffff (VERNEEDNUM)         4
 0x000000006ffffff0 (VERSYM)             0x3e9c
 0x000000006ffffff9 (RELACOUNT)          5
 0x0000000000000000 (NULL)               0x0

@danielsdeleo
Copy link
Contributor

@rrehbeindoi Thanks so much for this. Can you also tell me what you get for this: ruby -rrbconfig -e 'p RbConfig::MAKEFILE_CONFIG["RPATHFLAG"]' Thanks in advance.

@danielsdeleo danielsdeleo reopened this Apr 19, 2014
@rrehbein
Copy link

$ ruby -rrbconfig -e 'p RbConfig::MAKEFILE_CONFIG["RPATHFLAG"]'
""

@danielsdeleo
Copy link
Contributor

Well, that's odd. On my Ubuntu VM, the RPATHFLAG is " -Wl,-R%1$-s" so the generated Makefile adds that to the linker flags and I get the right rpath in the compiled library:

readelf -d $(gem which dep_gecode) |grep RPATH
 0x000000000000000f (RPATH)              Library rpath: [/home/ddeleo/.rbenv/versions/1.9.3-p429/lib:/home/ddeleo/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/dep-selector-libgecode-1.0.0/lib/dep-selector-libgecode/vendored-gecode/lib]

I guess we can't trust ruby to set the rpath and will need to take matters into our own hands.

@danielsdeleo
Copy link
Contributor

If you have a chance to test #26 that would be helpful.

@danielsdeleo
Copy link
Contributor

I've released version 1.0.3.rc.0 to rubygems.org, you can test it with gem install dep_selector --pre. Please report here if you're still seeing the issue. If everything works out, I'll release that as 1.0.3 (final) tomorrow or so.

@rrehbein
Copy link

dep_selector-1.0.3.rc.0 does work for me.

@danielsdeleo
Copy link
Contributor

@rrehbeindoi Thanks for testing (and all your other help so far).

@hntd187
Copy link

hntd187 commented Apr 29, 2014

I rc.0 does not work for me...

/home/scarman/.rvm/gems/ruby-2.1.0/gems/ffi-1.9.3/lib/ffi/library.rb:133:in `block in ffi_lib': Could not open library '/home/scarman/.rvm/gems/ruby-2.1.0/gems/dep_selector-1.0.3.rc.0/lib/dep_gecode.so': libgecodesearch.so.32: cannot open shared object file: No such file or directory (LoadError)
    from /home/scarman/.rvm/gems/ruby-2.1.0/gems/ffi-1.9.3/lib/ffi/library.rb:100:in `map'
    from /home/scarman/.rvm/gems/ruby-2.1.0/gems/ffi-1.9.3/lib/ffi/library.rb:100:in `ffi_lib'
    from /home/scarman/.rvm/gems/ruby-2.1.0/gems/dep_selector-1.0.3.rc.0/lib/dep_selector/dep_gecode.rb:39:in `<module:Dep_gecode>'
    from /home/scarman/.rvm/gems/ruby-2.1.0/gems/dep_selector-1.0.3.rc.0/lib/dep_selector/dep_gecode.rb:21:in `<top (required)>'
    from /home/scarman/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /home/scarman/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /home/scarman/.rvm/gems/ruby-2.1.0/gems/dep_selector-1.0.3.rc.0/lib/dep_selector/gecode_wrapper.rb:21:in `<top (required)>'
    from /home/scarman/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /home/scarman/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /home/scarman/.rvm/gems/ruby-2.1.0/gems/dep_selector-1.0.3.rc.0/lib/dep_selector/dependency_graph.rb:21:in `<top (required)>'
    from /home/scarman/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /home/scarman/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /home/scarman/.rvm/gems/ruby-2.1.0/gems/dep_selector-1.0.3.rc.0/lib/dep_selector/selector.rb:21:in `<top (required)>'
    from /home/scarman/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /home/scarman/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /home/scarman/.rvm/gems/ruby-2.1.0/gems/dep_selector-1.0.3.rc.0/lib/dep_selector.rb:22:in `<top (required)>'
    from /home/scarman/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /home/scarman/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /home/scarman/.rvm/gems/ruby-2.1.0/gems/solve-1.2.0/lib/solve/solver.rb:1:in `<top (required)>'
    from /home/scarman/.rvm/gems/ruby-2.1.0/gems/solve-1.2.0/lib/solve.rb:10:in `require_relative'
    from /home/scarman/.rvm/gems/ruby-2.1.0/gems/solve-1.2.0/lib/solve.rb:10:in `<module:Solve>'
    from /home/scarman/.rvm/gems/ruby-2.1.0/gems/solve-1.2.0/lib/solve.rb:3:in `<top (required)>'
    from /home/scarman/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /home/scarman/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /home/scarman/.rvm/gems/ruby-2.1.0/gems/berkshelf-3.1.1/lib/berkshelf.rb:8:in `<top (required)>'
    from /home/scarman/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /home/scarman/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /home/scarman/.rvm/gems/ruby-2.1.0/gems/berkshelf-3.1.1/lib/berkshelf/cli.rb:1:in `<top (required)>'
    from /home/scarman/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /home/scarman/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /home/scarman/.rvm/gems/ruby-2.1.0/gems/berkshelf-3.1.1/bin/berks:3:in `<top (required)>'
    from /home/scarman/.rvm/gems/ruby-2.1.0/bin/berks:23:in `load'
    from /home/scarman/.rvm/gems/ruby-2.1.0/bin/berks:23:in `<main>'
    from /home/scarman/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `eval'
    from /home/scarman/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `<main>'
#
# Author:: Christopher Walters (<cw@opscode.com>)
# Author:: Mark Anderson (<mark@opscode.com>)
# Copyright:: Copyright (c) 2010-2011 Opscode, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

require 'dep_selector/dep_selector_version'

require 'dep_selector/selector'
require 'dep_selector/dependency_graph'
require 'dep_selector/package'
require 'dep_selector/package_version'
require 'dep_selector/dependency'
require 'dep_selector/solution_constraint'
require 'dep_selector/version'
require 'dep_selector/version_constraint'
require 'dep_selector/exceptions'

# error reporting
require 'dep_selector/error_reporter'
require 'dep_selector/error_reporter/simple_tree_traverser'
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)

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

srcdir = .
topdir = /home/scarman/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0
hdrdir = $(topdir)
arch_hdrdir = /home/scarman/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/x86_64-linux
PATH_SEPARATOR = :
VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby
prefix = $(DESTDIR)/home/scarman/.rvm/rubies/ruby-2.1.0
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.20140429-406-sd6yup
sitelibdir = $(DESTDIR)./.gem.20140429-406-sd6yup
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 = $(prefix)/include
localstatedir = $(prefix)/var
sharedstatedir = $(prefix)/com
sysconfdir = $(DESTDIR)/etc
datadir = $(datarootdir)
datarootdir = $(prefix)/share
libexecdir = $(exec_prefix)/libexec
sbindir = $(exec_prefix)/sbin
bindir = $(exec_prefix)/bin
archdir = $(rubyarchdir)


CC = gcc
CXX = g++
LIBRUBY = $(LIBRUBY_SO)
LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
LIBRUBYARG_SHARED = -Wl,-rpath,'$${ORIGIN}/../lib' -Wl,-R -Wl,'$${ORIGIN}/../lib' -L'$${ORIGIN}/../lib' -l$(RUBY_SO_NAME)
LIBRUBYARG_STATIC = -Wl,-rpath,'$${ORIGIN}/../lib' -Wl,-R -Wl,'$${ORIGIN}/../lib' -L'$${ORIGIN}/../lib' -l$(RUBY_SO_NAME)-static
empty =
OUTFLAG = -o $(empty)
COUTFLAG = -o $(empty)

RUBY_EXTCONF_H = 
cflags   =  $(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 -Wimplicit-function-declaration
CCDLFLAGS = -fPIC
CFLAGS   = $(CCDLFLAGS) $(cflags)  -fPIC $(ARCH_FLAG)
INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir) -I/home/scarman/.rvm/gems/ruby-2.1.0/gems/dep-selector-libgecode-1.0.0/lib/dep-selector-libgecode/vendored-gecode/include
DEFS     = 
CPPFLAGS =   $(DEFS) $(cppflags)
CXXFLAGS = $(CCDLFLAGS) $(cxxflags) $(ARCH_FLAG)
ldflags  = -L. -fstack-protector -rdynamic -Wl,-export-dynamic
dldflags =  
ARCH_FLAG = 
DLDFLAGS = $(ldflags) $(dldflags) $(ARCH_FLAG)
LDSHARED = $(CC) -shared
LDSHAREDXX = $(CXX) -shared
AR = ar
EXEEXT = 

RUBY_INSTALL_NAME = ruby
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-linux
sitearch = $(arch)
ruby_version = 2.1.0
ruby = $(bindir)/ruby
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 --ignore-fail-on-non-empty -p
MAKEDIRS = /bin/mkdir -p
INSTALL = /bin/install -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) -Wl,-R$(libdir)
DEFFILE = 

CLEANFILES = mkmf.log
DISTCLEANFILES = 
DISTCLEANDIRS = 

extout = 
extout_prefix = 
target_prefix = 
LOCAL_LIBS = 
LIBS = $(LIBRUBYARG_SHARED) -lgecodesearch -lgecodeminimodel -lgecodeint -lgecodekernel -lgecodesupport -lgecodesupport  -lpthread -ldl -lcrypt -lm   -lc
ORIG_SRCS = define_dummy_init.cxx dep_selector_to_gecode.cpp dep_selector_to_gecode_interface.cpp
SRCS = $(ORIG_SRCS) 
OBJS = define_dummy_init.o dep_selector_to_gecode.o dep_selector_to_gecode_interface.o
HDRS = $(srcdir)/dep_selector_to_gecode_interface.h $(srcdir)/dep_selector_to_gecode.h
TARGET = dep_gecode
TARGET_NAME = dep_gecode
TARGET_ENTRY = Init_$(TARGET_NAME)
DLLIB = $(TARGET).so
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).so 
CLEANOBJS     = *.o  *.bak

all:    $(DLLIB)
static: $(STATIC_LIB)
.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.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:
    $(ECHO) installing default dep_gecode libraries
$(TIMESTAMP_DIR)/.RUBYARCHDIR.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 .C .o

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

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

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

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

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

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

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

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



$(OBJS): $(HDRS) $(ruby_headers)
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libruby.so.2.1]
 0x0000000000000001 (NEEDED)             Shared library: [libgecodesearch.so.32]
 0x0000000000000001 (NEEDED)             Shared library: [libgecodeminimodel.so.32]
 0x0000000000000001 (NEEDED)             Shared library: [libgecodeint.so.32]
 0x0000000000000001 (NEEDED)             Shared library: [libgecodekernel.so.32]
 0x0000000000000001 (NEEDED)             Shared library: [libgecodesupport.so.32]
 0x0000000000000001 (NEEDED)             Shared library: [libpthread.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libdl.so.2]
 0x0000000000000001 (NEEDED)             Shared library: [libcrypt.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libstdc++.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libm.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libgcc_s.so.1]
 0x000000000000000f (RPATH)              Library rpath: [/home/scarman/.rvm/rubies/ruby-2.1.0/lib:${ORIGIN}/../lib]
 0x000000000000000c (INIT)               0x90b8
 0x000000000000000d (FINI)               0x153f8
 0x0000000000000019 (INIT_ARRAY)         0x2198e8
 0x000000000000001b (INIT_ARRAYSZ)       24 (bytes)
 0x000000000000001a (FINI_ARRAY)         0x219900
 0x000000000000001c (FINI_ARRAYSZ)       8 (bytes)
 0x000000006ffffef5 (GNU_HASH)           0x1f0
 0x0000000000000005 (STRTAB)             0x2d88
 0x0000000000000006 (SYMTAB)             0xb50
 0x000000000000000a (STRSZ)              16903 (bytes)
 0x000000000000000b (SYMENT)             24 (bytes)
 0x0000000000000003 (PLTGOT)             0x21a000
 0x0000000000000002 (PLTRELSZ)           4992 (bytes)
 0x0000000000000014 (PLTREL)             RELA
 0x0000000000000017 (JMPREL)             0x7d38
 0x0000000000000007 (RELA)               0x7300
 0x0000000000000008 (RELASZ)             2616 (bytes)
 0x0000000000000009 (RELAENT)            24 (bytes)
 0x000000006ffffffe (VERNEED)            0x7270
 0x000000006fffffff (VERNEEDNUM)         4
 0x000000006ffffff0 (VERSYM)             0x6f90
 0x000000006ffffff9 (RELACOUNT)          5
 0x0000000000000000 (NULL)               0x0
[scarman@coldlight neuron]$ readelf -d $(gem which dep_gecode) |grep RPATH
 0x000000000000000f (RPATH)              Library rpath: [/home/scarman/.rvm/rubies/ruby-2.1.0/lib:${ORIGIN}/../lib]
[scarman@coldlight neuron]$ ruby -rrbconfig -e 'p RbConfig::MAKEFILE_CONFIG["RPATHFLAG"]'
" -Wl,-R%1$-s"

@danielsdeleo
Copy link
Contributor

@hntd187 do you have the dep-selector-libgecode gem installed? Does it successfully compile gecode when it installs? Did you install it with the USE_SYSTEM_GECODE environment variable set?

@hntd187
Copy link

hntd187 commented Apr 29, 2014

@danielsdeleo I tried both using system and vendoredberk gecode and neither methods worked. When I set the LD_LIBRARY_PATH it does work though, but as mentioned above I assume that is not intended.

@danielsdeleo
Copy link
Contributor

@hntd187 how did you install the system gecode? And also, for the vendored library, what do you get for this:
ruby -rpp -rdep-selector-libgecode -e 'pp Dir[DepSelectorLibgecode.opt_path + "/*"]'

@hntd187
Copy link

hntd187 commented Apr 29, 2014

[scarman@coldlight neuron]$ ruby -rpp -rdep-selector-libgecode -e 'pp Dir[DepSelectorLibgecode.opt_path + "/*"]'
[]

@danielsdeleo
Copy link
Contributor

Your dep-selector-libgecode is installed incorrectly. Can you uninstall it and install it again?

@hntd187
Copy link

hntd187 commented Apr 29, 2014

[scarman@coldlight neuron]$ rvm gemset create dep
ruby-2.1.0 - #gemset created /home/scarman/.rvm/gems/ruby-2.1.0@dep
ruby-2.1.0 - #generating dep wrappers.........
[scarman@coldlight neuron]$ rvm gemset use dep
Using ruby-2.1.0 with gemset dep
[scarman@coldlight neuron]$ gem install berkshelf
Fetching: addressable-2.3.6.gem (100%)
Successfully installed addressable-2.3.6
Fetching: multipart-post-2.0.0.gem (100%)
Successfully installed multipart-post-2.0.0
Fetching: faraday-0.9.0.gem (100%)
Successfully installed faraday-0.9.0
Fetching: berkshelf-api-client-1.2.0.gem (100%)
Successfully installed berkshelf-api-client-1.2.0
Fetching: buff-extensions-0.5.0.gem (100%)
Successfully installed buff-extensions-0.5.0
Fetching: hashie-2.1.1.gem (100%)
Successfully installed hashie-2.1.1
Fetching: varia_model-0.3.2.gem (100%)
Successfully installed varia_model-0.3.2
Fetching: buff-config-0.4.0.gem (100%)
Successfully installed buff-config-0.4.0
Fetching: buff-ruby_engine-0.1.0.gem (100%)
Successfully installed buff-ruby_engine-0.1.0
Fetching: buff-shell_out-0.1.1.gem (100%)
Successfully installed buff-shell_out-0.1.1
Fetching: minitar-0.5.4.gem (100%)
Successfully installed minitar-0.5.4
Fetching: retryable-1.3.5.gem (100%)
Successfully installed retryable-1.3.5
Fetching: semverse-1.1.0.gem (100%)
Successfully installed semverse-1.1.0
Fetching: net-http-persistent-2.9.4.gem (100%)
Successfully installed net-http-persistent-2.9.4
Fetching: mixlib-log-1.6.0.gem (100%)
Successfully installed mixlib-log-1.6.0
Fetching: mixlib-authentication-1.3.0.gem (100%)
Successfully installed mixlib-authentication-1.3.0
Fetching: erubis-2.7.0.gem (100%)
Successfully installed erubis-2.7.0
Fetching: nio4r-1.0.0.gem (100%)
Building native extensions.  This could take a while...
Successfully installed nio4r-1.0.0
Fetching: hitimes-1.2.1.gem (100%)
Building native extensions.  This could take a while...
Successfully installed hitimes-1.2.1
Fetching: timers-2.0.0.gem (100%)
Successfully installed timers-2.0.0
Fetching: celluloid-0.16.0.pre.gem (100%)
Successfully installed celluloid-0.16.0.pre
Fetching: celluloid-io-0.16.0.pre.gem (100%)
Successfully installed celluloid-io-0.16.0.pre
Fetching: buff-ignore-1.1.1.gem (100%)
Successfully installed buff-ignore-1.1.1
Fetching: ridley-3.1.0.gem (100%)
Successfully installed ridley-3.1.0
Fetching: dep-selector-libgecode-1.0.0.gem (100%)
Building native extensions.  This could take a while...
Successfully installed dep-selector-libgecode-1.0.0
Fetching: ffi-1.9.3.gem (100%)
Building native extensions.  This could take a while...
Successfully installed ffi-1.9.3
Fetching: dep_selector-1.0.3.gem (100%)
Building native extensions.  This could take a while...
Successfully installed dep_selector-1.0.3
Fetching: solve-1.2.0.gem (100%)
Successfully installed solve-1.2.0
Fetching: thor-0.19.1.gem (100%)
Successfully installed thor-0.19.1
Fetching: sawyer-0.5.4.gem (100%)
Successfully installed sawyer-0.5.4
Fetching: octokit-3.1.0.gem (100%)
Successfully installed octokit-3.1.0
Fetching: berkshelf-3.1.1.gem (100%)
Successfully installed berkshelf-3.1.1
Parsing documentation for addressable-2.3.6
Installing ri documentation for addressable-2.3.6
Parsing documentation for berkshelf-3.1.1
Installing ri documentation for berkshelf-3.1.1
Parsing documentation for berkshelf-api-client-1.2.0
Installing ri documentation for berkshelf-api-client-1.2.0
Parsing documentation for buff-config-0.4.0
Installing ri documentation for buff-config-0.4.0
Parsing documentation for buff-extensions-0.5.0
Installing ri documentation for buff-extensions-0.5.0
Parsing documentation for buff-ignore-1.1.1
Installing ri documentation for buff-ignore-1.1.1
Parsing documentation for buff-ruby_engine-0.1.0
Installing ri documentation for buff-ruby_engine-0.1.0
Parsing documentation for buff-shell_out-0.1.1
Installing ri documentation for buff-shell_out-0.1.1
Parsing documentation for celluloid-0.16.0.pre
Installing ri documentation for celluloid-0.16.0.pre
Parsing documentation for celluloid-io-0.16.0.pre
Installing ri documentation for celluloid-io-0.16.0.pre
Parsing documentation for dep-selector-libgecode-1.0.0
Installing ri documentation for dep-selector-libgecode-1.0.0
Parsing documentation for dep_selector-1.0.3
Installing ri documentation for dep_selector-1.0.3
Parsing documentation for erubis-2.7.0
Installing ri documentation for erubis-2.7.0
Parsing documentation for faraday-0.9.0
Installing ri documentation for faraday-0.9.0
Parsing documentation for ffi-1.9.3
Installing ri documentation for ffi-1.9.3
Parsing documentation for hashie-2.1.1
Installing ri documentation for hashie-2.1.1
Parsing documentation for hitimes-1.2.1
Installing ri documentation for hitimes-1.2.1
Parsing documentation for minitar-0.5.4
Installing ri documentation for minitar-0.5.4
Parsing documentation for mixlib-authentication-1.3.0
Installing ri documentation for mixlib-authentication-1.3.0
Parsing documentation for mixlib-log-1.6.0
Installing ri documentation for mixlib-log-1.6.0
invalid options: -SHN
(invalid options are ignored)
Parsing documentation for multipart-post-2.0.0
Installing ri documentation for multipart-post-2.0.0
Parsing documentation for net-http-persistent-2.9.4
Installing ri documentation for net-http-persistent-2.9.4
Parsing documentation for nio4r-1.0.0
Installing ri documentation for nio4r-1.0.0
Parsing documentation for octokit-3.1.0
Installing ri documentation for octokit-3.1.0
Parsing documentation for retryable-1.3.5
Installing ri documentation for retryable-1.3.5
Parsing documentation for ridley-3.1.0
Installing ri documentation for ridley-3.1.0
Parsing documentation for sawyer-0.5.4
Installing ri documentation for sawyer-0.5.4
Parsing documentation for semverse-1.1.0
Installing ri documentation for semverse-1.1.0
Parsing documentation for solve-1.2.0
Installing ri documentation for solve-1.2.0
Parsing documentation for thor-0.19.1
Installing ri documentation for thor-0.19.1
Parsing documentation for timers-2.0.0
Installing ri documentation for timers-2.0.0
Parsing documentation for varia_model-0.3.2
Installing ri documentation for varia_model-0.3.2
Done installing documentation for addressable, berkshelf, berkshelf-api-client, buff-config, buff-extensions, buff-ignore, buff-ruby_engine, buff-shell_out, celluloid, celluloid-io, dep-selector-libgecode, dep_selector, erubis, faraday, ffi, hashie, hitimes, minitar, mixlib-authentication, mixlib-log, multipart-post, net-http-persistent, nio4r, octokit, retryable, ridley, sawyer, semverse, solve, thor, timers, varia_model after 17 seconds
32 gems installed
[scarman@coldlight neuron]$ gem uninstall dep_selector

You have requested to uninstall the gem:
    dep_selector-1.0.3

solve-1.2.0 depends on dep_selector (~> 1.0)
If you remove this gem, these dependencies will not be met.
Continue with Uninstall? [yN]  y
Successfully uninstalled dep_selector-1.0.3
[scarman@coldlight neuron]$ gem install dep_selector --pre -v 1.0.3.rc.0
Fetching: dep_selector-1.0.3.rc.0.gem (100%)
Building native extensions.  This could take a while...
Successfully installed dep_selector-1.0.3.rc.0
Parsing documentation for dep_selector-1.0.3.rc.0
Installing ri documentation for dep_selector-1.0.3.rc.0
Done installing documentation for dep_selector after 0 seconds
1 gem installed
[scarman@coldlight neuron]$ ruby -rpp -rdep-selector-libgecode -e 'pp Dir[DepSelectorLibgecode.opt_path + "/*"]'
[]
[scarman@coldlight neuron]$ gem install dep-selector-libgecode
Building native extensions.  This could take a while...
Successfully installed dep-selector-libgecode-1.0.0
Parsing documentation for dep-selector-libgecode-1.0.0
Done installing documentation for dep-selector-libgecode after 0 seconds
1 gem installed
[scarman@coldlight neuron]$ ruby -rpp -rdep-selector-libgecode -e 'pp Dir[DepSelectorLibgecode.opt_path + "/*"]'
[]

@danielsdeleo
Copy link
Contributor

@hntd187 at this point, I'm guessing there might be an issue with dep-selector-libgecode when using rvm gemsets. I've created chef/dep-selector-libgecode#20 to track the issue.

pniederlag added a commit to TYPO3-cookbooks/gerrit that referenced this issue Jun 11, 2014
there have been troubles with dep_selector 1.0.2,  see chef/dep-selector#23

Gemfile.lock probably should be removed from git development tree
altogether
@CloCkWeRX
Copy link

There's a pretty similar issue with rbenv, bundler etc happening to me - centos 6.4, etc.

@bhouse
Copy link

bhouse commented Jul 16, 2014

+1 on rbenv with bundler on OSX

@schovi
Copy link

schovi commented Oct 6, 2015

+1 Debian 8.1 jessie

@cloneluke
Copy link

I've had some issues in this area, did the following
gem uninstall dep_selector
gem uninstall dep-selector-libgecode

and then re-installed

@the-nose-knows
Copy link

@cloneluke Omg... why didn't I try that an hour ago >_< lol...

Uninstalling both and then installed dep_selector unblocked me ^_^

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

Successfully merging a pull request may close this issue.