Konstantin Gredeskoul
2012-May-09 06:18 UTC
unicorn 4 does not compile on Joyent (SmartOS/Solaris) due to raindrops dependency
Dear unicorn developer list, I did a quick search online and couldn''t find many reports, but I thought I''d find out anyway. Joyent cloud is a pretty awesomely fast cloud running on Solaris derivative (SmartOS). Pretty much the entire ruby stack, including imagemagick (the perennial nightmare) build without problems with ruby 1.9.3, as does unicorn up until version 3.7.0. However, the raindrops dependency introduced in 4.0 breaks raindrops (and therefore unicorn 4) on SmartOS. The fact that the compilation breaks in the file named "linux_inet_diag.c" makes me believe that perhaps the authors may not have anticipated usage beyond Linux, or there may be some other reason. In any case, it would be great to be able to run latest unicorn on SmartOS, so if anyone has any suggestion please let me know how. In the meantime we are running on 3.7.0. Best regards, Konstantin> uname -aSunOS demo001.dev 5.11 joyent_XXXX i86pc i386 i86pc Solaris> file .rvm/rubies/ruby-1.9.3-p194/bin/ruby.rvm/rubies/ruby-1.9.3-p194/bin/ruby: ELF 64-bit LSB executable AMD64 Version 1, dynamically linked, not stripped> gem install raindropsFetching: raindrops-0.8.0.gem (100%) Building native extensions. ?This could take a while... ERROR: ?Error installing raindrops: ? ? ? ? ERROR: Failed to build gem native extension. ? ? ? ? /home/wanelo/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb checking for mmap() in sys/mman.h... yes checking for munmap() in sys/mman.h... yes checking for mremap() in sys/mman.h... no checking for getpagesize() in unistd.h... yes checking for rb_thread_blocking_region()... yes checking for rb_thread_io_blocking_region()... yes checking for GCC 4+ atomic builtins... yes creating Makefile make compiling linux_inet_diag.c linux_inet_diag.c:1:0: error: CPU you selected does not support x86-64 instruction set linux_inet_diag.c:1:0: error: CPU you selected does not support x86-64 instruction set make: *** [linux_inet_diag.o] Error 1 Gem files will remain installed in /home/kig/.rvm/gems/ruby-1.9.3-p194/gems/raindrops-0.8.0 for inspection. Results logged to /home/kig/.rvm/gems/ruby-1.9.3-p194/gems/raindrops-0.8.0/ext/raindrops/gem_make.out
Eric Wong
2012-May-09 07:02 UTC
unicorn 4 does not compile on Joyent (SmartOS/Solaris) due to raindrops dependency
Konstantin Gredeskoul <kig at wanelo.com> wrote:> However, the raindrops dependency introduced in 4.0 breaks raindrops > (and therefore unicorn 4) on SmartOS. > > The fact that the compilation breaks in the file named > "linux_inet_diag.c" makes me believe that perhaps the authors may not > have anticipated usage beyond Linux, or there may be some otherThat file is Linux-specific, but the rest of raindrops (and unicorn) works on FreeBSD, OpenBSD and probably others. I have every expectation it''d work on SmartOS[1]> > uname -a > SunOS demo001.dev 5.11 joyent_XXXX i86pc i386 i86pc Solaris^^^^> > file .rvm/rubies/ruby-1.9.3-p194/bin/ruby > .rvm/rubies/ruby-1.9.3-p194/bin/ruby: ELF 64-bit LSB executable > AMD64 Version 1, dynamically linked, not stripped^^^^^ Are you running a mixed 32-bit/64-bit installation? Can you check the build system isn''t picking the wrong compiler or compiler flags?> make > compiling linux_inet_diag.c > linux_inet_diag.c:1:0: error: CPU you selected does not support x86-64 > instruction setThat''s odd, the first line is just #include <ruby.h> You can try emptying/removing that file completely? (maybe linux_tcp_diag.c, too). Your env shouldn''t define the __linux__ macro. The linux_* files is wrapped with an #ifdef __linux__, so those files shouldn''t even be compiled on other OSes. The portable part of raindrops does use CPU-specific atomics (which GCC or libatomic_ops provides). Ruby 1.9.3 itself uses these instructions, too. [1] - SmartOS seems to be Free Software, so I can actually support it :)
Konstantin Gredeskoul
2012-May-09 07:11 UTC
unicorn 4 does not compile on Joyent (SmartOS/Solaris) due to raindrops dependency
Eric, awesome and thanks for replying! I''ll email you privately to chase this down. K On Wed, May 9, 2012 at 12:02 AM, Eric Wong <normalperson at yhbt.net> wrote:> Konstantin Gredeskoul <kig at wanelo.com> wrote: >> However, the raindrops dependency introduced in 4.0 breaks raindrops >> (and therefore unicorn 4) on SmartOS. >> >> The fact that the compilation breaks in the file named >> "linux_inet_diag.c" makes me believe that perhaps the authors may not >> have anticipated usage beyond Linux, or there may be some other > > That file is Linux-specific, but the rest of raindrops (and unicorn) > works on FreeBSD, OpenBSD and probably others. ?I have every expectation > it''d work on SmartOS[1] > >> > uname -a >> SunOS demo001.dev 5.11 joyent_XXXX i86pc i386 i86pc Solaris > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ^^^^ > >> > file .rvm/rubies/ruby-1.9.3-p194/bin/ruby >> .rvm/rubies/ruby-1.9.3-p194/bin/ruby: ? ELF 64-bit LSB executable >> AMD64 Version 1, dynamically linked, not stripped > ?^^^^^ > > Are you running a mixed 32-bit/64-bit installation? > Can you check the build system isn''t picking the wrong compiler > or compiler flags? > >> make >> compiling linux_inet_diag.c >> linux_inet_diag.c:1:0: error: CPU you selected does not support x86-64 >> instruction set > > That''s odd, the first line is just #include <ruby.h> > > You can try emptying/removing that file completely? ?(maybe > linux_tcp_diag.c, too). > > Your env shouldn''t define the __linux__ macro. ?The linux_* files is > wrapped with an #ifdef __linux__, so those files shouldn''t even > be compiled on other OSes. > > The portable part of raindrops does use CPU-specific atomics > (which GCC or libatomic_ops provides). ?Ruby 1.9.3 itself uses > these instructions, too. > > > [1] - SmartOS seems to be Free Software, so I can actually support it :) > _______________________________________________ > Unicorn mailing list - mongrel-unicorn at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-unicorn > Do not quote signatures (like this one) or top post when replying-- Konstantin Gredeskoul CTO?:: Wanelo Inc cell:?(415) 265 1054