# Solaris install

**URL:** <https://www.ruby-forum.com/t/solaris-install/60976>\
**Category:** Ruby\
**Created:** [May 18, 2006, 11:59pm UTC](https://www.ruby-forum.com/t/solaris-install/60976 "2006-05-18T23:59:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![xmg-eric](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/f04885/32.png) [@xmg-eric](https://www.ruby-forum.com/u/xmg-eric)\
**Post date:** [May 18, 2006, 11:59pm UTC](https://www.ruby-forum.com/t/solaris-install/60976/1 "2006-05-18T23:59:10Z")

</div>

Folks, I have a real opportunity to make a  
difference here. But I need some help, and  
the lack of documentation on this subject  
is a major hindrance.

To do an install, I have to do a build (unlike  
my PC). For that, I need a bit more assistance.

Dan B. was very helpful when he laid out  
this process:

> > make distclean  
> > ./configure --prefix=/wherever/you/want  
> > make  
> > make install

That’s a good process that will probably work  
decently. But then Ara Howard added this cryptic  
note:

> don’t forget to do both of these before compiling
> 
> LD\_LIBRARY\_PATH=/wherever/you/want/lib  
> LD\_RUN\_PATH=/wherever/you/want/lib # most important!
> 
> if you do this all the stuff you compile it will  
> inter-operate nicely–e.g. ruby extensions–and other  
> users will be able to use it without having their  
> LD\_LIBRARY\_PATH set. They’ll only require PATH.

I sure this makes sense, but I’m missing the mental  
model–the picture of what’s happening–that would  
explain /why/ it makes sense. These variables aren’t  
mentioned in the Makefile, so they must be important  
to gcc. But why, if I’m /creating/ the lib as part  
of the process??

Finally, it looks as though install-all is what I want,  
because install looks seems to a documentn-free install.  
I’m not conversant enough with the Ruby build to be  
sure I’m reading the Makefile right, but what I see is  
this:

> install: install-nodoc $(RDOCTARGET)  
> install-all: install-nodoc install-doc

Where RDOCTARGET is defined as nil, by default.

If it’s supposed to be specified, it’s not mentioned in  
the Makefile. So I’m guessing that the target I really  
want is install-all. But I’d like to confirm that.

So the process that /looks/ right to me, at the moment,  
is:

```
make distclean
setenv LD_LIBRARY_PATH /wherever/you/want/lib
setenv LD_RUN_PATH /wherever/you/want/lib
./configure --prefix=/wherever/you/want
make
make install-all

```

I’ll try it, but I feel like a blind man groping in  
the dark. I was hoping for confirmation and/or a bit  
more enlightenment before going forward…

---

<div class="post-metadata">

**Author:** ![xmg-eric](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/f04885/32.png) [@xmg-eric](https://www.ruby-forum.com/u/xmg-eric)\
**Post date:** [May 19, 2006, 12:11am UTC](https://www.ruby-forum.com/t/solaris-install/60976/2 "2006-05-19T00:11:25Z")

</div>

On Fri, 19 May 2006, Eric A. wrote:

> > inter-operate nicely–e.g. ruby extensions–and other  
> > users will be able to use it without having their  
> > LD\_LIBRARY\_PATH set. They’ll only require PATH.
> 
> I sure this makes sense, but I’m missing the mental  
> model–the picture of what’s happening–that would  
> explain /why/ it makes sense. These variables aren’t  
> mentioned in the Makefile, so they must be important  
> to gcc. But why, if I’m /creating/ the lib as part  
> of the process??

it has nothing to do with ruby, the Makefile, or gcc - it’s all about  
your  
linker:

man ld.so  
man ld  
[http://groups.google.com/group/comp.lang.ruby/browse\_frm/thread/615935bf1489d843/dae3f2dd2fae3e1e?q=LD\_RUN\_PATH&rnum=6#dae3f2dd2fae3e1e](http://groups.google.com/group/comp.lang.ruby/browse_frm/thread/615935bf1489d843/dae3f2dd2fae3e1e?q=LD_RUN_PATH&rnum=6#dae3f2dd2fae3e1e)  
[http://groups.google.com/group/comp.lang.ruby/browse\_frm/thread/b0ecc81f80082df8/f651b1d2000dd5e1?q=LD\_RUN\_PATH&rnum=7#f651b1d2000dd5e1](http://groups.google.com/group/comp.lang.ruby/browse_frm/thread/b0ecc81f80082df8/f651b1d2000dd5e1?q=LD_RUN_PATH&rnum=7#f651b1d2000dd5e1)  
[http://www.visi.com/~barr/ldpath.html](http://www.visi.com/~barr/ldpath.html)

let me know if this doesn’t shed some light.

regards.

-a

---

<div class="post-metadata">

**Author:** ![xmg-eric](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/f04885/32.png) [@xmg-eric](https://www.ruby-forum.com/u/xmg-eric)\
**Post date:** [May 19, 2006, 4:30am UTC](https://www.ruby-forum.com/t/solaris-install/60976/3 "2006-05-19T04:30:57Z")

</div>

Ah ha!! Thanks much for the additional info, Ara.

Your 5 May 2004 writeup was particularly good:

> You have two good choices
> 
> a) install ruby where your system looks for stuff
> 
> b) configure your system to look where ruby puts stuff
> 
> Having LD\_RUN\_PATH set at compile time encodes it  
> in the binaries. It sets up all the bins and libs so  
> they know where to look for things.

You also give a good diagnostic tool:

> In general, if you are having load errors do this
> 
> ruby -e ‘p $LOAD\_PATH’
> 
> this tells you where ruby looks for things.

In your 32 Mar 2006 msg, you gave a really nice recipe:

> If you follow these steps just about anything will work:
> 
> - chose a common nfs location. we’ll call it /nfs
> 
> - every single time you compile something do this
> 
> I set LD\_LIBRARY\_PATH and LD\_RUN\_PATH in my .bashrc  
> because i do this so much. the cool thing with  
> LD\_RUN\_PATH is that it encodes inter-library dependencies  
> (so ruby tk.so needs libtk.so needs …) , so users don’t  
> have to set LD\_LIBRARY\_PATH themselves…They just have to  
> add /nfs/bin to their path.

So it appears that:

LD\_RUN\_PATH  
tells the binaries where to look for things  
when they’re running

LD\_LIBRARY\_PATH  
tells the linker where to look for things  
when it is creating the binaries

The installation sequence for a non-standard location  
Solaris location therefore turns out to be:

# Clear out a previous build & create config.h

make distclean  
./configure --prefix=/wherever/you/want

# Set the values you need when compiling

sh: export LD\_RUN\_PATH=/wherever/you/want/lib/  
export LD\_LIBRARY\_PATH=/wherever/you/want/lib/

csh: setenv LD\_RUN\_PATH /wherever/you/want/lib/  
setenv LD\_LIBRARY\_PATH /wherever/you/want/lib/

# Compile without installing, then install binaries & docs

make  
make install-all

Thanks again. Considering that your original post on this  
subject was in 2004, I can see why your responses have  
become shorter!

I greatly appreciate your help, and am glad to say that  
I now have functional installation of Ruby.

P.S.  
I’ll be happy to put this information on a Wiki page  
somewhere. I went to RubyGarden, but only saw a small  
comment box. I could stuff it in there, post at my  
weblog, or put it anywhere else that will let the  
community find it easily. Suggestions?
