Monday, March 24, 2008

Building Git Version Control System on AIX, HP-UX and Solaris

Git is a fast version control system originally designed for the Linux kernel and written by Linus Torvalds.
Need git on AIX or HP-UX? Here's how:

HP-UX PA-RISC 2.0:

First, you're going to need a compiler (GCC), GNU make (gmake) and GNU coreutils (install). swinstall the dependency repositories first:
coreutils 6.9 coreutils
gcc 4.2.3 gcc
libgcc 4.2.3 libgcc
libiconv 1.12 libiconv
make 3.81 make
perl 5.8.8 perl
zlib 1.2.3 zlib

Untar the package and start building:

$ ./configure --with-iconv=/usr/local/bin

Edit the Makfile:

CC = gcc
AR = ar
RM = rm -f
TAR = tar
FIND = find
INSTALL = /usr/local/coreutils/bin/install

# sudo gmake NEEDS_LIBICONV=1 NO_TCLTK=1 install prefix=/usr/local

$ which git
/usr/local/bin/git
$ uname -sr
HP-UX B.11.11
$ git --version
git version 1.5.4.4


Building GIT on AIX 5.3 POWERPC:

Install dependencies and GCC, gmake, GNU coreutils (install), etc:

gcc-4.0.0-1 libgcc-4.0.0-1 libstdc++-4.0.0-1 libstdc++-devel-4.0.0-1 gcc-c++-4.0.0-1 readline-4.3-2 readline-devel-4.3-2 zlib-1.2.3-3 zlib-devel-1.2.3-3 make-3.80-1 unzip-5.51-1 flex-2.5.4a-6 bison-1.875-3 popt-1.7-2 gettext-0.10.40-6 expect-5.42.1-3 tcl-8.4.7-3 tk-8.4.7-3 coreutils-5.2.1-2

$ ./configure

vi Makefile:

CC = /opt/freeware/bin/gcc
AR = ar
RM = rm -f
TAR = /opt/freeware/bin/tar
FIND = find
INSTALL = /usr/linux/bin/install
RPMBUILD = rpmbuild
TCL_PATH = /opt/freeware/bin/tclsh
TCLTK_PATH = /opt/freeware/bin/wish

# gmake NO_MSGFMT=1 install prefix=/opt/freeware

$ uname -a
AIX aix 3 5 004518FC4C00
$ which git
/opt/freeware/bin/git
$ git --version
git version 1.5.4.4

Solaris 10:

Solaris 10 comes with gcc, gmake and GNU tools in /usr/sfw/bin, but you'll need ginstall from GNU coreutils (you can get it from Solaris Freeware).

$ ./configure

Edit the Makefile - set the path to "ar", "gcc" and GNU "install".

CC = /usr/sfw/bin/gcc
AR = /usr/ccs/bin/ar

RM = rm -f
TAR = tar
FIND = find
INSTALL = /opt/sfw/bin/install

Look for ifeq ($(uname_S),SunOS) and set INSTALL to /opt/sfw/bin/install also.

# gmake NO_TCLTK=1 NO_CURL=1 install prefix=/opt/sfw

% uname -a
SunOS ibmsolaris 5.10 Generic_127112-11 i86pc i386 i86pc

% git --version
git version 1.5.4.4

12 comments:

Unknown said...

Hello

compiling GIT on AIX with your dependencies list and configure/make options still doesn't produces a running GIT distribution, and crashes with:

/usr/bin/getopt: Not a recognized flag: d
Usage: install [-c DirectoryA] [-f DirectoryB] [-i] [-m] [-M Mode] [-O Owner]
[-G Group] [-S] [-n DirectoryC] [-o] [-s] File [DirectoryX ...]
gmake[1]: *** [boilerplates.made] Error 2
gmake: *** [all] Error 2

cmihai said...

Right, and you need GNU install, as I've said. AIX install doesn't support -d. It's part of GNU coreutils (you get get it from IBM Toolbar for Linux). Don't forget to define the full path to "install" in the Makefile. For example:

INSTALL = /usr/linux/bin/install

Unknown said...

Yes I vas focussing on getopt and not on install. Modifying my $PATH to have /opt/freeware/bin before /usr/bin or /opt/pware/bin solved the gmake problem.

Geez, even with "L" AIX is not easy to port native GNU code on even compared with 4.3. And my first tests on AIX6 doesn't show many improvements on this side...
Still have to rely on Bullfreeware (old versions in 32bit) IBM Toolbox (even older) or the new pware repository (unfortunately many complied in 32bit only but still a good effort).

cmihai said...

Most GNU products are geared specifically at GNU/Linux platforms, and don't expect actual POSIX compliant or SUS compliant systems.

They also rely on GNU extensions to most programs (as the -d flag for install for example, not present on UNIX systems).

It's usually easier to just install a complete GNU environment rather than try to make the software behave.

As for porting, I've had decent results with most software, and acceptable results using pkgsrc (NetBSD's ports). Though don't expect things to just work out of the box, there's usually tweaking to be done.

Unknown said...

Yes and even with "stict" C/C++ code it's hard to have it compiled on AIX, HP-UX or Irix using their own compilers and optimization flags (even worse when trying to include specific implementations of MPI to fully support SP switches or Altix NUMA). I think it's a waste for these platforms to rely only on proprietary software for their compilers or internal tools compatibility. Who's gonna pay $$$ for a Power6 and only put Linux on it (even with binary x86 compatibility)? So more and more clients are switching to barebone AMD/Intel pizzaboxes with xen or vmware+linux and a lower TCO...

cmihai said...

For specific role machines like database servers (Oracle, DB2) you still can't beat a good RISC platform, especially when it comes to performance, scalability and reliability.

Most IBM mainframes (zSeries), minicomputers (iSeries) or UNIX Servers (pSeries) serve as Oracle, DB2, WebSphere AS / portals or some other specific role (even if you count partitioning and such). They're usually core machines. TCO doesn't even come into play here, you just can't scale x86 like that. It's either RISC or EPIC (though EPIC is usually more expensive).

Besides, development tools are top notch on IBM's systems if you can afford XLC and such. Porting isn't usually a problem, it's just this workstation class GNU software.

Besides, this was hardly more than a ghettohack.

M said...

Git on AIX will crawl unless you define INTERNAL_QSORT in the Makefile

Anonymous said...

thanks a million mate! I blindly followed the steps on Open Solaris and it was a piece of cake.

newsfromhungary said...

Git 1.7.2.2 compiles with xlC on AIX after changing CC = c99_r and removing the -Wall option from the Makefile. It requires GNU make, expat and expat-devel, and python if you want to use the remote helpers.

My command line (RPMs are from perzl.org):

$ PYTHON_PATH=/opt/xpyv/bin/python PATH=/opt/freeware/bin:$PATH make prefix=/usr/local all

I used Python 2.6.2 which is bundled in 'xpyv.rte' from the XIV (storage) Host Attachment Kit.

qHp said...

I should have specified, git 1.7.9.rc2

przemek said...

Hi, very valuable post.

Building git version 1.7.6 on Solaris 5.10 Generic_144489-05 i86pc i386 i86pc

Instructions worked like a charm!

CHEERS!

PJ

Anonymous said...

Thanks, this was very helpful. I found I also had to remove CDPATH from my environment, otherwise the tar rule in make install bombed.