I've recently been given the opportunity to work on a logicial partition (LPAR) of a zSerie computer, under the Linux operating system.
It seems interesting to me to see if Erlang could work correctly on this platform.
The installed system is a RedHat 7.2, with 64 MB of RAM and 100 MB of swap.
So, I grabbed a source tarball, untar it, and give a try at the configure script :
[root@ztest010 root]# cd /usr/local/tgz
[root@ztest010 tgz]# wget http://www.erlang.org/download/otp_src_R9B-0.tar.gz
(...)
[root@ztest010 tgz]# cd ..
[root@ztest010 local]# cd src
[root@ztest010 src]# tar xvfz ../tgz/otp_src_R9B-0.tar.gz
(...)
[root@ztest010 src]# cd otp_src_R9B-0
[root@ztest010 otp_src_R9B-0]# ./configure
checking host system type... s390-ibm-linux-gnu
checking for GNU make... yes (make)
checking for a BSD compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking for ranlib... ranlib
creating ./config.status
creating Makefile
configuring in lib
(...)
creating s390-ibm-linux-gnu/config.h
*******************************************************************
****************** APPLICATIONS DISABLED ******************
*****************************************************************
jinterface : No Java compiler found
orber : No C++ compiler found
*******************************************************************
This is normal, as I didn't installed c++ or java, as configure detected.
Then, the fun :
[root@ztest010 otp_src_R9B-0]# make
cd erts/emulator && ERL_TOP=/usr/local/src/otp_src_R9B-0 make generate depend
make[1]: Entering directory `/data/local/src/otp_src_R9B-0/erts/emulator'
make -f s390-ibm-linux/Makefile generate
make[2]: Entering directory `/data/local/src/otp_src_R9B-0/erts/emulator'
make[2]: s390-ibm-linux/Makefile: No such file or directory
make[2]: *** No rule to make target `s390-ibm-linux/Makefile'. Stop.
make[2]: Leaving directory `/data/local/src/otp_src_R9B-0/erts/emulator'
make[1]: *** [generate] Error 2
make[1]: Leaving directory `/data/local/src/otp_src_R9B-0/erts/emulator'
make: *** [depend] Error 2
Ok. So we have a problem.
I've looked a little in the configure script, and I though that setting the host variable to s390-ibm-linux would do the trick, but it didn't.
So i've written a somewhat gross script that change all "s390-ibm-linux-gnu" to "s390-ibm-linux", either in name file or in Makefiles :
#!/bin/sh
export SAVEPWD=`pwd`
echo "---"
# 1/ Find out any "s390-ibm-linux-gnu" directory, and rename them
for dirname in `find -name "s390-ibm-linux-gnu" -type d` ; do
echo "Fixing $dirname ... "
cd $dirname
cd ..
mv s390-ibm-linux-gnu s390-ibm-linux
cd $SAVEPWD
done
echo "---"
# 2/ Change "s390-ibm-linux-gnu" to "s390-ibm-linux" in Makefiles
for makefile in `grep -rl "s390-ibm-linux-gnu" * | grep Makefile` ; do
echo "Fixing $makefile ... "
sed -e s:s390-ibm-linux-gnu:s390-ibm-linux:g < $makefile > $makefile.new
rm -f $makefile
mv $makefile.new $makefile
done
Running it gives the following results :
[root@ztest010 otp_src_R9B-0]# sh /root/fix_s390.sh
---
Fixing ./lib/asn1/c_src/s390-ibm-linux-gnu ...
Fixing ./lib/erl_interface/src/s390-ibm-linux-gnu ...
Fixing ./lib/runtime_tools/c_src/s390-ibm-linux-gnu ...
Fixing ./lib/ic/c_src/s390-ibm-linux-gnu ...
Fixing ./lib/orber/c_src/s390-ibm-linux-gnu ...
Fixing ./lib/os_mon/c_src/s390-ibm-linux-gnu ...
Fixing ./lib/megaco/src/flex/s390-ibm-linux-gnu ...
Fixing ./lib/crypto/c_src/s390-ibm-linux-gnu ...
Fixing ./lib/gs/tcl/s390-ibm-linux-gnu ...
Fixing ./lib/odbc/c_src/s390-ibm-linux-gnu ...
Fixing ./lib/ssl/c_src/s390-ibm-linux-gnu ...
Fixing ./erts/emulator/zlib/s390-ibm-linux-gnu ...
Fixing ./erts/emulator/s390-ibm-linux-gnu ...
Fixing ./erts/epmd/src/s390-ibm-linux-gnu ...
Fixing ./erts/etc/common/s390-ibm-linux-gnu ...
Fixing ./erts/obj/s390-ibm-linux-gnu ...
Fixing ./erts/obj.beam/s390-ibm-linux-gnu ...
Fixing ./erts/obj.debug/s390-ibm-linux-gnu ...
Fixing ./erts/obj.debug.beam/s390-ibm-linux-gnu ...
Fixing ./erts/obj.instr.beam/s390-ibm-linux-gnu ...
Fixing ./erts/obj.shared.beam/s390-ibm-linux-gnu ...
Fixing ./erts/obj.purify.beam/s390-ibm-linux-gnu ...
Fixing ./erts/obj.quantify.beam/s390-ibm-linux-gnu ...
Fixing ./erts/obj.purecov.beam/s390-ibm-linux-gnu ...
Fixing ./erts/s390-ibm-linux-gnu ...
Fixing ./make/s390-ibm-linux-gnu ...
Fixing ./bin/s390-ibm-linux-gnu ...
---
Fixing erts/emulator/zlib/s390-ibm-linux/Makefile ...
Fixing erts/emulator/s390-ibm-linux/Makefile ...
Fixing erts/epmd/src/s390-ibm-linux/Makefile ...
Fixing erts/etc/common/s390-ibm-linux/Makefile ...
Fixing lib/asn1/c_src/s390-ibm-linux/Makefile ...
Fixing lib/erl_interface/src/s390-ibm-linux/Makefile ...
Fixing lib/runtime_tools/c_src/s390-ibm-linux/Makefile ...
Fixing lib/ic/c_src/s390-ibm-linux/Makefile ...
Fixing lib/orber/c_src/s390-ibm-linux/Makefile ...
Fixing lib/os_mon/c_src/s390-ibm-linux/Makefile ...
Fixing lib/megaco/src/flex/s390-ibm-linux/Makefile ...
Fixing lib/crypto/c_src/s390-ibm-linux/Makefile ...
Fixing lib/odbc/c_src/s390-ibm-linux/Makefile ...
Fixing lib/ssl/c_src/s390-ibm-linux/Makefile ...
Fixing Makefile ...
Then "make && make install" goes fine.
Somehow, I suspect there must be a better way of handling this using configure parameters, so if someone has a hint, feel free to share it ! :-)
As Erlang was installed, I gave a try to the current Rei Server (see http://goonix.sf.net), and it works perfectly so far.
Thierry Mallard |