Wednesday Apr 02, 2008

Groovy on Solaris 10

I tried installing groovy on solaris 10 today. As expected, groovy 1.5.4 installed smoothly but I encountered a problem post installation. When I tried running groovy, I got the following error!

"startGroovy: syntax error at line 219: `i=$' unexpected"

The startGroovy script has a #!/bin/sh at the top and solaris 10 has problems with the lines
i=$(i+1). There were also other lines in the script that were not compatible with the shell - like the case statement which had

case ($i) in
(0) set -- ;;

This has to be changed to

case ($i) in
0) set --;

This patch will fix these issues with solaris. However, the fix has been put back into the code base recently. I will soon be releasing a groovy package for solaris. Do watch out the blog for updates!

Wednesday Mar 26, 2008

Ruby Native Gem Support on Open Solaris

We integrated Ruby into Open Solaris build 78! From build 78 onwards, you can use ruby 1.8.6 and ruby gems 0.9.4 with Openssl, Curses, Readline, and Tcl/Tk extensions enabled :)

Ruby and Ruby Gems are available in /usr/ruby and have been linked form /usr/bin for easy use! So, in case you want to install a gem, all you need to do is issue the '(/usr/bin/)gem install ' command! If you are behind a proxy, do not forget to set your proxy - export http_proxy="http://:"

However, for native gems, you need to make some changes to your rbconfig.file (in /usr/ruby/1.8/lib/ruby/1.8/-solaris-)

If you are using Sun Studio, make sure you have /opt/SUNWspro/bin in your path and make the following changes to your rbconfig.rb file.

CONFIG["CC"] = "cc"
CONFIG["CFLAGS"] = "-xO3 -xbuiltin=%all -xinline=auto -xprefetch=auto -xdepend -KPIC"
CONFIG["LDFLAGS"] = "-L. -L/usr/sfw/lib -R/usr/sfw/lib"
CONFIG["CPPFLAGS"] = "-DTEXT_DOMAIN=\\"\\" -I/usr/sfw/include -I/usr/include"
CONFIG["CPP"] = "cc -E
CONFIG["CCDLFLAGS"] = "-KPIC"

If you are using GNU compiler tools, make sure you have gcc, g++, etc (usually /usr/sfw/bin) in your path and make the following changes to your rbconfig.rb file.

CONFIG["CC"] = "gcc"
CONFIG["CFLAGS"] = "-g -O3 -fPIC"
CONFIG["LDFLAGS"] = "-L. -L/usr/sfw/lib -R/usr/sfw/lib"
CONFIG["CPPFLAGS"] = "-DTEXT_DOMAIN=\\"\\" -I/usr/sfw/include -I/usr/include"
CONFIG["CPP"] = "gcc -E"
CONFIG["CCDLFLAGS"] = "-fPIC"

Voila! you are done and ready to use the gem command to install native gems on the fly!!
Well, this is just for the time being, these changes will also be integrated into Open Solaris soon so that native gem support too will be enabled by default! Shall blog about that once the integration is done!

About

gkrish

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today