installing two different versions of software on one machine - compilation

I'd like to install both thrift 0.8.0 and 0.9.0 on one machine. I have successfully downloaded both .tar.gz archives, unpacked, configured and ran make. When I ran make install fr 0.9.0, a binary executable thrift has been copied to /usr/local/bin/thrift. If I wanted to make install for 0.8.0, I guess there could be a huge mess, because the system would try to overwrite some files, unaware that the previous version is installed. How can I install compiled two versions of thrift on one machine e.g. to have it accesible via thrift-0.8.0 and thrift-0.9.0?

The configure program accepts a large number of arguments; one of which is --prefix=<dir>. The default is --prefix=/usr/local. In your case, compile each version with a different prefix. For example:
$ cd .../thrift.0.8.0/...
$ configure --prefix=/usr/local/thrift/0.8.0
$ make install
and then
$ cd .../thrift.0.9.0/...
$ configure --prefix=/usr/local/thrift/0.9.0
$ make install
Then, you modify your PATH (MANPATH, etc) to use either of /usr/local/thrift/0.{8,9}.0/bin

Related

How to install a newer version of Ruby than what is present in the package manager?

I'm using "yum" which has a very old version of Ruby. I'm on linux OS and quite new to it. How can I install a specific version of Ruby that isn't present in the package installer?
Note: I don't have the other package managers (rbenv / rmv etc).
Note2: I am connected to this Linux machine via putty. So I only have command-line access.
Without package managers and using yum, your last option is to build from source.
Building from Source
Of course, you can install Ruby from source.
Download and unpack a tarball (EG: Ruby 3.0.2), then just do this:
$ ./configure
$ make
$ sudo make install
By default, this will install
Ruby into /usr/local. To change, pass the --prefix=DIR option to the
./configure script.
REF: https://www.ruby-lang.org/en/documentation/installation/#building-from-source

Download different version of grep in cygwin?

I'd like to download a different version of grep in Cygwin. Currently, I have version 2.21, but I'd like to get version 2.5.1 (this is what runs on Mac OS by default, and I'm more familiar with that).
I obviously don't want to run the entire setup again. Is there a way to get the Mac OS version (i.e. 2.5.1) without running setup all over again? Thanks. <3
Compiling is always a possible choice: grep lives here: ftp://ftp.gnu.org/gnu/grep/, and given the tarball (ftp://ftp.gnu.org/gnu/grep/grep-2.5.1.tar.gz),
tar xf 2.5.1.tar.gz
cd 2.5.1
./configure
make && make install
(this will probably install into /usr/local/bin — you should read the instructions, e.g., the --prefix option to suit your own needs).
That assumes you are developing, and have installed gcc (the Cygwin setup program helps in that case).

How to install GEOS with native Ruby bindings?

GEOS is a C++ port of the Java Topology Suite. It enables geometry and geospatial processing, and is the library beneath PostgreSQL's PostGIS. I want to work with it directly in Ruby, not in PostGIS, and I know that there are native Ruby bindings, but the documentation online is sparse, and installation is buggy. How do I install GEOS with the Ruby bindings enabled?
1. Compile and Install Swig
Ubuntu
sudo apt-get install swig
Mac OS X
Download and unpack the swig source code. In the unpacked directory:
./configure --without-pcre
make && sudo make install
(Or use brew install.)
2. Download and Configure GEOS
Download and unpack the GEOS source code. In the unpacked directory:
./configure --enable-ruby
Look for status lines showing Swig: true and Ruby bindings: true.
3. Compile and install GEOS
Try to compile and install:
make && sudo make install
(If make ends with the error library not found for -llibruby.2.0.0.dylib, this is due to a bug in GEOS (currently version 3.4.2). Run the following command to fix your configure file:
sed -i -e 's/RUBY_SO_NAME=.*/RUBY_SO_NAME=ruby/' configure
Then go back to Step 2.)
4. Set Up Linking
You will need to make sure the library is correctly linked before using require 'geos' in your Ruby. The install directory appears in the output of sudo make install.
Ubuntu
The default install directory is usr/local/lib.
Before executing your Ruby process, add the install directory to LD_LIBRARY_PATH.
$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
This environment variable needs to be set whenever you run a Ruby executable, so you may want to add it to your bash profile.
Mac OS X
The default install directory of the .so file is something like /Library/Ruby/Site/2.0.0/universal-darwin13.
Ruby on Mac OS X requires a .bundle file, so we create a symbolic link to the .so file.
$ cd /Library/Ruby/Site/2.0.0/universal-darwin13
$ sudo ln -s geos.so geos.bundle
This only needs to be run at install time to enable the Ruby GEOS bindings forever.
5. Load GEOS in Ruby
If you've linked correctly to the library, you should be able to use require 'geos' and see no errors.
$ irb
>> require 'geos'
=> true

Stand alone package installing for ActivePerl

I have a standard installation of ActivePerl. I need to install the package that is not included to the installation.
Is there any way to install the package without using ppm / CPAN? (it is supposed to be installed as part of other program)
NOTE: It supposed to work under Windows
A Perl package is an ephemeral store of subroutines and package variables in memory. Perhaps you mean a Perl distribution?
First, install cpanm if you don't already have it.
cpan App::cpanminus
Yes, this works on Windows. No, you don't have to install a compiler. cpan will do that for you if necessary.
Then, install the distribution by passing its file name to cpanm. For example,
cpanm IPC-System-Simple-1.21.tar.gz
This will perform the required configuration, install the indicated prerequisites, prepare the distribution's content for installation (e.g. by building any files that need building), run the distribution's tests and install the distribution.

Problem with gcc 4.6 installation on ubuntu

I am trying to install gcc 4.6 (mainly for having C++0x better supported) in my ubuntu 9.10 (via virtualbox). I referred to previous questions, but I am getting a different error.
I am referring this link for the installation. Now, I have done till the ./gcc-xx/configure ... step. Though it was giving some flex package related error. Mostly due to that make is also failing with below errors:
build/gengtype.o: In function
adjust_field_rtx_def':
/home/milind/ubuntu_shared/GCC/build/gcc/../../gcc-4.6-20110610/gcc/gengtype.c:978:
undefined reference tolexer_line'
/home/milind/ubuntu_shared/GCC/build/gcc/../../gcc-4.6-20110610/gcc/gengtype.c:1032:
undefined reference to lexer_line'
/home/milind/ubuntu_shared/GCC/build/gcc/../../gcc-4.6-20110610/gcc/gengtype.c:1042:
undefined reference tolexer_line' ...............
Now this is giving me a hard time figuring it out because I have already flex/bison latest versions installed. I searched over internet for 2 days almost but no luck. Any help would be really appreciated. Also note that, I already have gcc 4.4 installed in /usr/bin/gcc and I have unzipped the gcc 4.6 tar in my home directory local folder.
[Note: I am also ok with installing ubuntu 11.10 too (which has gcc 4.6) as last resort. But I don't know if its .iso image is available.]
I got this fixed. I followed following procedure:
[Note: run all the commands with sudo, if you are not login as root. e.g. sudo ls -ltr; sudo make install;
As mentioned in the link in my
question, download the gcc4.6...tar
file in a temporary place
Now find the place where current
gcc is stored. e.g. My earlier
gcc4.4 was stored in
/usr/lib/gcc/i486-linux-gnu. Which
has a folder called 4.4, 4.4.1
Create a folder named 4.6 (or
4.6.1/2/3 etc.) and put that
.tar file inside it. Untar the
file as shown in link.
Follow all the procedure as per the
link. Use nohup <command> & to
track the logs. i.e. nohup make
clean all & followed by tail -f
nohup.out
If some error comes, it means some
package is missing. Mostly those
package will be present in your
current gcc version. You can
install them there itself. For
example, in my case zlib was
missing. I ran sudo apt-get install
zlib1g-dev libssl-dev and it worked
fine. Otherwise download from internet and install it.
Once your gcc is installed, you
can simply check it using type
gcc-4.6. In my case it showed that
it's stored as
/usr/local/bin/g++-4.6.
Either you can use the same path to
compile or you can put an alias in
your bash/tcsh/ksh. e.g.
/usr/local/bin/g++-4.6 -std=c++0x
-Wall test.cpp
FWIW Debian testing and unstable have gcc-4.6 as a standard package. So you can simply install that distro inside of virtualbox or, as I've done on my Ubuntu 11.04 server at home, via kvm. In the past, I also used to use dchroot build environments.
There may also be prepackaged gcc-4.6 binaries at launchpad.

Resources