chef / dep-selector-libgecode

Bundled Gecode Libraries for dep-selector
Apache License 2.0
11 stars 26 forks source link

build fails on SmartOS #34

Open bixu opened 10 years ago

bixu commented 10 years ago
[admin@c9308a86-1b42-4a68-f463-d67bfdb483d8 ~/omnibus-chef]$ cat /etc/product 
Name: Joyent Instance
Image: base64 14.2.0
Documentation: http://wiki.joyent.com/jpc2/SmartMachine+Base

[admin@c9308a86-1b42-4a68-f463-d67bfdb483d8 ~/omnibus-chef]$ cat /etc/release 
                                SmartOS x86_64
              Copyright 2010 Sun Microsystems, Inc.  All Rights Reserved.
              Copyright 2010-2013 Joyent, Inc.  All Rights Reserved.
                        Use is subject to license terms.
                   See joyent_20140613T024634Z for assembly date and time.

[admin@c9308a86-1b42-4a68-f463-d67bfdb483d8 ~/omnibus-chef]$ sudo gem install dep-selector-libgecode -v '1.0.2'
Building native extensions.  This could take a while...
ERROR:  Error installing dep-selector-libgecode:
        ERROR: Failed to build gem native extension.

    /opt/local/bin/ruby212 extconf.rb
-> sh /opt/local/lib/ruby/gems/2.1.2/gems/dep-selector-libgecode-1.0.2/ext/libgecode3/vendor/gecode-3.7.3/configure --prefix=/opt/local/lib/ruby/gems/2.1.2/gems/dep-selector-libgecode-1.0.2/lib/dep-selector-libgecode/vendored-gecode --disable-doc-dot --disable-doc-search --disable-doc-tagfile --disable-doc-chm --disable-doc-docset --disable-qt --disable-examples --disable-flatzinc
checking for the host operating system... configure: error: Host OS not supported.
extconf.rb:98:in `block in run': Failed to build gecode library. (GecodeBuild::BuildError)
        from extconf.rb:97:in `chdir'
        from extconf.rb:97:in `run'
        from extconf.rb:104:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in /opt/local/lib/ruby/gems/2.1.2/gems/dep-selector-libgecode-1.0.2 for inspection.
Results logged to /opt/local/lib/ruby/gems/2.1.2/extensions/x86_64-solaris2.11/2.1.2/dep-selector-libgecode-1.0.2/gem_make.out
bahamas10 commented 9 years ago

@bixu I was able to get this to compile by lying to the configure script and telling it SmartOS was actually Linux (like is done for the BSDs)

dave - sjc1-dave-01 sunos ~/dev/dep-selector-libgecode (git:master) $ git diff
diff --git a/ext/libgecode3/vendor/gecode-3.7.3/configure b/ext/libgecode3/vendor/gecode-3.7.3/configure
index 05f0595..6eed352 100755
--- a/ext/libgecode3/vendor/gecode-3.7.3/configure
+++ b/ext/libgecode3/vendor/gecode-3.7.3/configure
@@ -2692,7 +2692,7 @@ $as_echo_n "checking for the host operating system... " >&6; }
        guess_host_os=${with_host_os}
         fi
           case ${guess_host_os} in
-       GNU/kFreeBSD|*inux*|FreeBSD|NetBSD)
+       GNU/kFreeBSD|*inux*|FreeBSD|NetBSD|SunOS)
        host_os=linux
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: Linux" >&5
 $as_echo "Linux" >&6; }
bahamas10 commented 9 years ago

fyi this may be the more approved method of passing this information

diff --git a/ext/libgecode3/extconf.rb b/ext/libgecode3/extconf.rb
index 37bcd45..9107c4b 100644
--- a/ext/libgecode3/extconf.rb
+++ b/ext/libgecode3/extconf.rb
@@ -13,6 +13,10 @@ module GecodeBuild
    !!(RUBY_PLATFORM =~ /mswin|mingw|windows/)
   end

+  def self.sunos?
+    `uname`.strip == 'SunOS'
+  end
+
   def self.gecode_vendor_dir
     GECODE_VENDOR_DIR
   end
@@ -40,6 +44,7 @@ module GecodeBuild
       --disable-flatzinc
     ]
     args << "--with-host-os=windows" if windows?
+    args << "--with-host-os=Linux" if sunos?
     args
   end