Build from source lab

22 Jan

In my lab, i try to install two software, one is bash, another is ocrad
lab steps for install ocrad    
1. install development tools
    yum groupinstall “Development Tools” “Development Libraries”
2. Choose new packages – ocrad, download from http://www.gnu.org/software/ocrad/
    ocrad-0.20.tar.gz
3. unpack the tarball:
    tar ocrad-0.20.tar.gz
4.    run ./configure at ocrad-0.20 directory
    
    [root@fedora ocrad-0.20]# ./configure

creating config.status
creating Makefile
VPATH = .
prefix = /usr/local
exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin
datadir = $(prefix)/share
includedir = ${prefix}/include
infodir = $(datadir)/info
libdir = ${exec_prefix}/lib
mandir = $(datadir)/man
sysconfdir = $(prefix)/etc
CXX = g++
CPPFLAGS =
CXXFLAGS = -Wall -W -O2
LDFLAGS =
OK. Now you can run mak

5. Run a script to build the software (typically make)
[root@fedora ocrad-0.20]# time make
g++  -Wall -W -O2 -c -o common.o common.cc
g++  -Wall -W -O2 -c -o mask.o mask.cc
g++  -Wall -W -O2 -c -o rational.o rational.cc
g++  -Wall -W -O2 -c -o rectangle.o rectangle.cc
g++  -Wall -W -O2 -c -o track.o track.cc
g++  -Wall -W -O2 -c -o ucs.o ucs.cc
g++  -Wall -W -O2 -c -o page_image.o page_image.cc
g++  -Wall -W -O2 -c -o page_image_io.o page_image_io.cc
g++  -Wall -W -O2 -c -o bitmap.o bitmap.cc
g++  -Wall -W -O2 -c -o blob.o blob.cc
g++  -Wall -W -O2 -c -o profile.o profile.cc
g++  -Wall -W -O2 -c -o feats.o feats.cc
g++  -Wall -W -O2 -c -o feats_test0.o feats_test0.cc
g++  -Wall -W -O2 -c -o feats_test1.o feats_test1.cc
g++  -Wall -W -O2 -c -o character.o character.cc
g++  -Wall -W -O2 -c -o character_r11.o character_r11.cc
g++  -Wall -W -O2 -c -o character_r12.o character_r12.cc
g++  -Wall -W -O2 -c -o character_r13.o character_r13.cc
g++  -Wall -W -O2 -c -o textline.o textline.cc
g++  -Wall -W -O2 -c -o textline_r2.o textline_r2.cc
g++  -Wall -W -O2 -c -o textblock.o textblock.cc
g++  -Wall -W -O2 -c -o textpage.o textpage.cc
g++  -Wall -W -O2 -c -o arg_parser.o arg_parser.cc
g++  -Wall -W -O2 -DPROGVERSION=\”0.20\” -c -o main.o main.cc
g++  -o ocrad common.o mask.o rational.o rectangle.o track.o ucs.o page_image.o page_image_io.o bitmap.o blob.o profile.o feats.o feats_test0.o feats_test1.o character.o character_r11.o character_r12.o character_r13.o textline.o textline_r2.o textblock.o textpage.o arg_parser.o main.o
g++  -Wall -W -O2 -c -o ocradlib.o ocradlib.cc
ar -rcs libocrad.a common.o mask.o rational.o rectangle.o track.o ucs.o page_image.o page_image_io.o bitmap.o blob.o profile.o feats.o feats_test0.o feats_test1.o character.o character_r11.o character_r12.o character_r13.o textline.o textline_r2.o textblock.o textpage.o ocradlib.o

real    0m2.299s
user    0m0.324s
sys    0m0.203s

6. make install
[root@fedora ocrad-0.20]# make install
if [ ! -d “/usr/local/share/info” ] ; then install -d -m 755 “/usr/local/share/info” ; fi
install -p -m 644 ./doc/ocrad.info “/usr/local/share/info/ocrad.info”
install-info –info-dir=”/usr/local/share/info” “/usr/local/share/info/ocrad.info”
if [ ! -d “/usr/local/share/man/man1” ] ; then install -d -m 755 “/usr/local/share/man/man1” ; fi
install -p -m 644 ./doc/ocrad.1 “/usr/local/share/man/man1/ocrad.1”
if [ ! -d “/usr/local/bin” ] ; then install -d -m 755 “/usr/local/bin” ; fi
if [ ! -d “/usr/local/include” ] ; then install -d -m 755 “/usr/local/include” ; fi
if [ ! -d “/usr/local/lib” ] ; then install -d -m 755 “/usr/local/lib” ; fi
install -p -m 755 ./ocrad “/usr/local/bin/ocrad”
install -p -m 644 ./ocradlib.h “/usr/local/include/ocradlib.h”
install -p -m 644 ./libocrad.a “/usr/local/lib/libocrad.a”

Lab steps for install Bash

package 2 Bash
1. Download bash package from it’s website
http://www.gnu.org/software/bash/
bash-4.2.tar.gz

2. unzip it and run ./configure
3. time make
    ***********************************************************
      *                                                         *
      * GNU bash, version 4.2.0(1)-release (x86_64-unknown-linux-gnu)
      *                                                         *
      ***********************************************************

real    0m0.052s
user    0m0.031s
sys    0m0.012s

4. make install
[root@fedora bash-4.2]# make install

      ***********************************************************
      *                                                         *
      * GNU bash, version 4.2.0(2)-release (x86_64-unknown-linux-gnu)
      *                                                         *
      ***********************************************************

make[1]: Entering directory `/home/gli37/Downloads/bash-4.2/builtins’
make[1]: `libbuiltins.a’ is up to date.
make[1]: Leaving directory `/home/gli37/Downloads/bash-4.2/builtins’
( cd ./po/ ; make  DESTDIR= installdirs )
make[1]: Entering directory `/home/gli37/Downloads/bash-4.2/po’
/bin/sh /home/gli37/Downloads/bash-4.2/./support/mkinstalldirs /usr/local/share
if test “bash” = “gettext-tools”; then \
  /bin/sh /home/gli37/Downloads/bash-4.2/./support/mkinstalldirs /usr/local/share/gettext/po; \
else \
  : ; \
fi
make[1]: Leaving directory `/home/gli37/Downloads/bash-4.2/po’
/usr/bin/install -c -m 0755 bash /usr/local/bin/bash
/usr/bin/install -c -m 0555 bashbug /usr/local/bin/bashbug
( cd ./doc ; make  \
    man1dir=/usr/local/share/man/man1 man1ext=.1 \
    man3dir=/usr/local/share/man/man3 man3ext=.3 \
    infodir=/usr/local/share/info htmldir= DESTDIR= install )
make[1]: Entering directory `/home/gli37/Downloads/bash-4.2/doc’
/bin/sh ../support/mkinstalldirs /usr/local/share/man/man1
/bin/sh ../support/mkinstalldirs /usr/local/share/info
if test -n “” ; then \
    /bin/sh ../support/mkinstalldirs  ; \
fi
/usr/bin/install -c -m 644 ./bash.1 /usr/local/share/man/man1/bash.1
/usr/bin/install -c -m 644 ./bashbug.1 /usr/local/share/man/man1/bashbug.1
if test -f bash.info; then d=.; else d=.; fi; \
  /usr/bin/install -c -m 644 $d/bash.info /usr/local/share/info/bash.info
if /bin/sh -c ‘install-info –version’ >/dev/null 2>&1; then \
    install-info –dir-file=/usr/local/share/info/dir /usr/local/share/info/bash.info; \
else true; fi
if test -n “” ; then \
    /usr/bin/install -c -m 644 ./bash.html  ; \
    /usr/bin/install -c -m 644 ./bashref.html  ; \
fi
make[1]: Leaving directory `/home/gli37/Downloads/bash-4.2/doc’
( cd ./builtins ; make  DESTDIR= install )
make[1]: Entering directory `/home/gli37/Downloads/bash-4.2/builtins’
make[1]: Nothing to be done for `install’.
make[1]: Leaving directory `/home/gli37/Downloads/bash-4.2/builtins’
( cd ./po/ ; make  DESTDIR= install )
make[1]: Entering directory `/home/gli37/Downloads/bash-4.2/po’
/bin/sh /home/gli37/Downloads/bash-4.2/./support/mkinstalldirs /usr/local/share
installing en@quot.gmo as /usr/local/share/locale/en@quot/LC_MESSAGES/bash.mo
installing en@boldquot.gmo as /usr/local/share/locale/en@boldquot/LC_MESSAGES/bash.mo
installing af.gmo as /usr/local/share/locale/af/LC_MESSAGES/bash.mo
….
installing vi.gmo as /usr/local/share/locale/vi/LC_MESSAGES/bash.mo
installing zh_CN.gmo as /usr/local/share/locale/zh_CN/LC_MESSAGES/bash.mo
installing zh_TW.gmo as /usr/local/share/locale/zh_TW/LC_MESSAGES/bash.mo
if test “bash” = “gettext-tools”; then \
  /bin/sh /home/gli37/Downloads/bash-4.2/./support/mkinstalldirs /usr/local/share/gettext/po; \
  for file in Makefile.in.in remove-potcdate.sin quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot   Makevars.template; do \
    /usr/bin/install -c -m 644 ./$file \
            /usr/local/share/gettext/po/$file; \
  done; \
  for file in Makevars; do \
    rm -f /usr/local/share/gettext/po/$file; \
  done; \
else \
  : ; \
fi
make[1]: Leaving directory `/home/gli37/Downloads/bash-4.2/po’

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: