Re: attempt to build 64 bit on Solaris fails



Daniel,

The following is some notes I wrote to myself in case I had to do this
all over again. It includes the things I had to do to install Perl 5.8.5
with Tk, GD, DBI, DBD::MySQL, DBD::Oracle, and at least part
of BioPerl. The Tk source distribution includes zlib compression,
libpng, andf libjpeg, but these libraries are not built as 64-bit
libraries needed to link with a 64-bit Tk. These notes have more
information than you need, so just ignore the rest.

Jim White

---------

This is a summary of my process for installing a 64-bit gcc-compiled
version of Perl 5.8.5 running under Solaris 9 (or Solaris 8). I have
not yet tried Solaris 10. We were running a 32-bit version of Perl
5.6.1, but with the change to 64-bits, I did not try to reuse any
modules that were already installed for Perl 5.6.1. In addition Perl
5.6.1 was installed a few years ago, and I wanted current versions of
the modules.

Perl 5.8.5 seems to work well in 64-bit mode under Solaris 9 running
on Sun Ultra processors. The problem is primarily in getting 64-bit
versions of the external C libraries installed into the right location
and getting Perl 5.8.5 to look in the right place. You need to build
64-bit versions of many of the C libraries, because Sun did not build
them for you.

Solaris 8 and 9 can run in mixed 32-bit and 64-bit mode, but any
particular process runs in one mode or the other. Object files and
libraries must be compiled and linked in either 32-bit or 64-bit mode.
A linked binary is either all 32-bit or all 64-bit, and dynamically
loaded libraries must match the mode of the caller. You will know you
are trying to mix 32-bit and 64-bit objects when you get messages
about something being the wrong ELFCLASS. If the complaint is about
ELFCLASS32, then you are linking or dynamically loading into a 64-bit
object file or program, but the linker or dynamic loader is pointing
to the 32-bit libraries. If the complaint is about ELFCLASS64, then
you are linking or dynamically into a 32-bit object or program, but
the linker or dynamic loader is pointing to the 64-bit libraries.

In order to keep both 32-bit and 64-bit libraries separate, Sun keeps
the C header files (common to both 32-bit and 64-bit versions) in
/usr/include, /usr/local/include, etc. (I'll abbreviate this as
"*/include".) The 32-bit object files/libraries are kept in "*/lib".
In some directories "*/lib/32" may be a link to "*/lib" for the
32-bit libraries, but this is not always present. The 64-bit object
files/libraries are kept in "*/lib/sparcv9". Again in some
directories "*/lib/64" may be a link to "*/lib/sparcv9" for the
64-bit libraries, but you can't depend upon this either.

To keep things straight, the Sun linker will use LD_LIBRARY_PATH_32
in preference to LD_LIBRARY_PATH when linking 32-bit programs and
LD_LIBRARY_PATH_64 in preference to LD_LIBRARY_PATH when linking
64-bit programs. Judicious use of LD_LIBRARY_PATH_32 and
LD_LIBRARY_PATH_64, instead of LD_LIBRARY_PATH might avoid a lot
of problems, but some of the make files and "configure" scripts
have LD_LIBRARY_PATH and "*/lib" hardwired into them.

I have moved my usual LD_LIBRARY_PATH to LD_LIBRARY_PATH_32 and
created LD_LIBRARY_PATH_64 by adding "/sparcv9" to each directory
in LD_LIBRARY_PATH_32. I do not use LD_LIBRARY_PATH, except when
installing a library whose "configure" script explicitly looks for
LD_LIBRARY_PATH. Then LD_LIBRARY_PATH should be set the same as
LD_LIBRARY_PATH_32 or LD_LIBRARY_PATH_64, as appropriate.

For the libraries that use "configure" scripts, you need to tell the
configure script to use gcc, with the right compile time and link
time options for 64-bits. The --libdir option is usually needed to
specify /usr/local/lib/sparcv9 as the target directory for 64-bit
object libraries.


####################


The environment in which Perl was installed:

We are running a cluster of Sun Ultras of various models with shared
NFS mounted RAID5 arrays. Perl 5.8.5 and all of the external libraries
were installed into a shared /usr/local.

Everything was compiled with gcc version 3.3. Linking was done using
the Solaris Link Editors version 5.9-1.385 that come with Solaris 9.

Each section below is a summary of the commands used to install it.
There can be some reordering of sections, and some sections can be
omitted if particular Perl modules are not needed. I have tried to
indicate prerequisites.

These summaries were written after the fact to give a minimal set of
commands for installation. In some cases it took several attempts to
discover what tricks to use to successfully install a particular
package. I tried to leave out the mistakes and summarize the process
to get an optimal set of commands, but in doing so I may have missed a
step that was inadvertently left over from a previous try, so I cannot
guarantee that each of these sections is correct, but I hope that I
can save someone else a lot of frustration.

I normally use csh, and su to root normally uses the sh shell. The
Perl CPAN module gets each Perl module and stores it into a separate
directory in ~/.cpan/build. We store the source directories for the
external C libraries in another directory. The command summaries
below are written with these assumptions. You may have to change
some commands for your use. Have fun!


####################


"Getting" source for an external C library

In the sections below, when you see a line like

{get xxx source <.tar.gz_file> ...}

it may involve some or all of the following set of commands:

$ cd <your_directory_of_source_directories>
{use a web download, ftp, or other means to get a <.tar.gz_file> file}
### Use next command to determine where output goes, hopefully to new
### directory
$ gunzip -c <.tar.gz_file> | tar -tf -
### If tar does not show a new directory as the target, then you
### need to create one and cd into it before the next command
$ gunzip -c <.tar.gz_file> | tar -xovf - # extract to dir structure
### now is a good time to either save or remove the <.tar.gz_file>.
$ mv <.tar.gz_file> <your_source_archive_of_.tar.gz_files>/
$ cd <the_new_source_directory> # if you aren't already here

Then your current directory is the directory containing the source
files. For the external C libraries, that is where each of the
following sections usually continues.


####################


### "Getting" source for a Perl module or package

### In the sections below, when a new Perl modules is to be installed,
### the CPAN shell is used, which downloads the module/package and untars
### it into a new directory, "~/.cpan/build/<new_module_source_directory>".
### You can cd into it directly, or within the CPAN shell, the "look"
### command opens up a new shell inside the source directory for you.
### Then your current directory is the directory containing the source
### files. If you need to do anything special, that is usually where the
### non-CPAN shell commands need to be run.


####################


### Installing gdb (gdbm-1.8.3) - GNU database manager, used by Perl
### GDBM_File module

{get gdbm source <.tar.gz_file> from www.gnu.org}
### use gcc, 64bitall, ultrasparc
$ ./configure CC=gcc CFLAGS='-mcpu=v9 -m64' LDFLAGS='-m64' \
-libdir=/usr/local/lib/sparcv9
$ make
$ make check
$ su
# /usr/local/bin/make install
# ^D


####################


### Installing Berkeley db (db-4.2.52), used by Perl BerkeleyDB and
### DB_File modules

{get Berkeley db source <.tar.gz_file> from www.sleepycat.com}
### Build into /usr/local/BerkeleyDB or later change Perl BerkeleyDB
### config.in to point to /usr/local/BerkeleyDB.<version>
### If you want both 32-bit and 64-bit libraries, then you should add a
### -libdir flag to the configure command below to put the 64-bit library
### into /usr/local/BerkeleyDB.<version>/lib/sparcv9. I was lazy and
### didn't bother to build a 32-bit version for this library, so I left
### the 64-bit version in /usr/local/BerkeleyDB.<version>/lib
$ cd build_unix
### use gcc, 64bitall, ultrasparc
$ ../dist/configure CC=gcc CFLAGS='-mcpu=v9 -m64' LDFLAGS='-m64'
### -libdir /usr/local/BerkeleyDB.<version>/lib/sparcv9 # ???
$ make
$ make check
$ su
# make install
# ^D


####################


### Installing zlib (zlib-1.2.1) - Zlib Data Compression Library, used
### by libpng, Perl Compress::Zlib module, and Perl IO::Zlib module

{get zlib source <.tar.gz_file> from www.gzip.org/zlib}
$ make clean
$ sh # if necessary
### use gcc, 64bitall, ultrasparc
$ CC=gcc CFLAGS='-mcpu=v9 -m64 -O' LDFLAGS='-m64' \
LDSHARED='gcc -G -mcpu=v9 -m64' ./configure --shared \
--libdir=/usr/local/lib/sparcv9
$ make
$ LD_LIBRARY_PATH_64=.:$LD_LIBRARY_PATH_64 make test
$ su
# /usr/local/bin/make install
# ^D


####################


### Installing libpng (libpng-1.2.8-config) - PNG Graphics Library, used
### by libgd and Perl Tk module

{get libpng source <.tar.gz_file> from www.libpng.org}
$ make clean
### use gcc, 64bitall, ultrasparc
$ ./configure -libdir=/usr/local/lib/sparcv9 CC=gcc \
CFLAGS='-mcpu=v9 -m64 -O' LDFLAGS='-m64 -L/usr/local/lib/sparcv9'
$ make
$ make check
$ su
# /usr/local/bin/make install
### After the install, I had to modify /usr/local/bin/libpng-config and
### /usr/local/bin/libpng12-config. This was needed to help the 64-bit
### build for the libgd library work properly. To build a 32-bit app
### you would need to put the files back the way they were.
{edit /usr/local/bin/libpng-config and /usr/local/bin/libpng12-config
(They have the same contents.). diff output is below.}
27a28,32
> # following line needed for Solaris ld with gcc on Ultra 64-bit
> R_opts="-Wl,-R,/usr/local/lib/sparcv9"
> # following line needed for Solaris Ultra 64-bit
> libdir="/usr/local/lib/sparcv9"
>
# ^D


####################


### Installing FreeType 2 (freetype-2.1.9) - A Free Type Engine, used
### by libgd, which is used by Bioperl

{get freetype2 source <.tar.gz_file> from sourceforge.net}
### Note: ./builds/unix/configure needs an egrep that can read "long"
### lines, such as GNU grep. I dropped a copy of GNU grep into
### ./builds/unix/
### Note: LD_LIBRARY_PATH was set to point to the libraries in
### LD_LIBRARY_PATH_64 before ./configure was run
### ./configure --help # get help for configure
### Note: CFLAGS='"..."' is needed below because ./configure runs
### ./builds/unix/configure, causing the outside quotes to be lost
$ ./configure CC=gcc CFLAGS='"-mcpu=v9 -m64"' LDFLAGS='-m64' \
-libdir=/usr/local/lib/sparcv9
$ make
$ su
# /usr/local/bin/make install
# ^D


####################


### Installing XPM - XPixMap, used by libgd

### This comes with Solaris 9 in /usr/openwin/lib, so I used the one
### that was already available. XPixMap does not come preinstalled
### with Solaris 8.


####################


### Installing fontconfig, used by libgd

### This comes with Solaris 9 in /usr/lib, so I used the one that was
### already available. fontconfig does not come preinstalled with
### Solaris 8.


####################


### Installing expat (expat-1.95.8), which is used by XML-Parser, which
### is part of Bioperl

{get expat source <.tar.gz_file> from http://sourceforge.net/projects/expat/}
$ ./configure --help # get help for configure
$ ./configure --libdir=/usr/local/lib/sparcv9 \
CC=gcc CFLAGS='-mcpu=v9 -m64 -O' \
LDFLAGS='-m64 -L/usr/local/lib/sparcv9'
$ make
$ make check # this fails because the sharable library is not
# installed yet, so it cannot be loaded at runtime
$ su
### /usr/local/bin and /usr/ccs/bin needed to find make, ar, and ranlib
# PATH=/usr/local/bin:/usr/sbin:/usr/bin:/usr/ccs/bin
# export PATH
# make install
### The following fix is needed because "On solaris at least, it appears
### that install-sh does not handle installing multiple files. As a
### consequence the expat_external.h is not installed. A manual workaround
### to this problem is to install the expat_external.h file by hand."
# cp lib/expat_external.h /usr/local/include/
# ^D
$ make check # make check works now


####################


### Install Oracle client library, which is used by Perl DBD::Oracle.

### I installed an Oracle client library separately into /usr/local,
### because the copy of Perl we use is in a shared /usr/local, and the
### Oracle server does not share its volumes with the rest of the cluster.
$ su - oracle
### Used "Oracle 9i Enterprise Edition" CD and used the Oracle Universal
### Installer
# cd /cdrom/oracle9i
# ./runInstaller
### Installed the "Oracle Client" in /usr/local/Oracle/OracleHome9i.
### Used the "Custom" install to include the programmer tools/libs.

### The following is needed to use the just installed client.
setenv ORACLE_HOME /usr/local/Oracle/OraHome9i


####################


### Install Mysql client library, which is used by Perl DBD::Mysql module

### I downloaded mysql-standard-4.0.24-sun-solaris2.9-sparc-64bit.tar.gz
### from www.mysqp.com, gunzipped and untarred into /usr/local with
### "gunzip -c <.tar.gz_file> | tar -xovf -". I did not set up the
### database. I am only using the client portion to connect to another
### host. The mysql_config provided options for a 64-bit Sun ForteC
### compiler. I had to provide my own CFLAGS when building DBD::Oracle.


####################


### Installing openssl (openssl-0.9.7g), which is used by Net::SSLeay
### and Crypt::SSLeay, which is used by Bioperl for HTTPS support

{get openssl source <.tar.gz_file> from http://www.openssl.org}
$ ./Configure -h # get help for configure
### We had a 32-bit SSL library in /usr/local/ssl. I am putting the
### 64-bit openssl library in /usr/local/openssl.
$ ./Configure --openssldir=/usr/local/openssl solaris64-sparcv9-gcc
{ To work around gcc optimization bugs, modify CFLAG in Makefile to
contain -O1 instead of -O3. (That's change to dash-oh-one from
dash-oh-three.) }
$ make
$ make check
$ su
# /usr/local/bin/make install
# ^D


####################


### Installing Perl 5.8.5:

{get Perl source <.tar.gz_file>}
$ sh # if necessary
### To build a 64-bit Solaris Ultra version of Perl, LD_LIBRARY_PATH should
### point to the 64-bit libraries in "*/lib/sparcv9", instead of the usual
### "*/lib" before configuring Perl. If any non-"sparcv9" libraries are
### configured into Perl, then you can edit
### /usr/local/lib/perl5/5.8.5/sun4-solaris-thread-multi-64/Config.pm
### to fix libpth, lddlflags, ldflags, libsdirs, libsfound, libspath, and
### loclibpth. I did this after after Perl is built, but it would be better
### to catch it early.
$ LD_LIBRARY_PATH=/usr/local/lib/sparcv9:/usr/lib/sparcv9:/usr/openwin/lib/sparcv9:/usr/dt/lib/sparcv9
$ export LD_LIBRARY_PATH
$ sh Configure -Dcc=gcc -Dusethreads -Duse64bitall
### To configure, just answer the questions. I used the defaults,
### except to not use modules from previous versions by answering
### 'none' to the following question:
### List of earlier versions to include in @INC? [5.6.1 5.005] none
### I think that's all I changed.
### (Configure includes 'make depend', unless you tell it not to)
$ make
$ make test
$ su
### The following, except for make install, is needed to preserve perl
### 5.6.1 as the default perl, until everything is installed
# cp perldoc perldoc5.6.1 # save older version of perldoc
# /usr/local/bin/make install
# cd /usr/local/bin
# mv perl perlnew # to keep /usr/local/bin/perl pointing
# cp perl5.6.1 perl # to older version of Perl until all
# modules are updated
# mv perldoc perldocnew # to keep /usr/local/bin/perldoc pointing
# cp perldoc perldoc5.8.5 # to older version of Perl until all
# cp perldoc5.6.1 perldoc # modules are updated
# ^D


####################


### next update the Perl CPAN module

$ su
# PATH=/usr/local/bin:/usr/sbin:/usr/bin:/usr/ccs/bin
# export PATH
# perlnew -MCPAN -e shell # use temporary perlnew while
# # installing modules
cpan> install Bundle::CPAN # reply yes to dependencies
cpan> reload cpan
cpan> exit
# ^D


####################


### next install HTTP::Date, which also installs HTML::Parser and libwww

### I seem to remember the CPAN shell checking for a new HTTP:Date each
### time it started, until I installed this.
$ su
# PATH=/usr/local/bin:/usr/sbin:/usr/bin:/usr/ccs/bin
# export PATH
# perlnew -MCPAN -e shell
cpan> install HTTP::Date
### I took all of the defaults
cpan> exit
# ^D


####################


### install BerkeleyDB

$ perlnew -MCPAN -e shell # run CPAN module with extra features
cpan> get BerkeleyDB # get BerkeleyDB (needs config)
cpan> look BerkeleyDB # bring up new shell inside build directory
### You may need to edit config.in to point to the BerkeleyDB libs at:
### /usr/local/BerkeleyDB.../include and /usr/local/BerkeleyDB.../lib
### (or usr/local/BerkeleyDB.../lib/sparcv9)
$ perlnew Makefile.PL
$ make
### The Berkeley DB library does not work on NFS mounted drives.
### If you try it, you get error messages about mmap resources being
### temporarily unavailable
$ ssh <your_file_server>
your_file_server% cd ~/.cpan/build/BerkeleyDB-...
your_file_server% make test
your_file_server% ^D
$ su # must be root to install
# make install
# ^D # exit to non-root shell
$ ^D # exit to CPAN shell
cpan> q # exit to original shell


####################


### install DB_File

$ perlnew -MCPAN -e shell # run CPAN module with extra features
cpan> get DB_File # get DB_File (needs config)
cpan> look DB_File
### You may need to edit config.in to point to the BerkeleyDB libs at:
### /usr/local/BerkeleyDB.../include and /usr/local/BerkeleyDB.../lib
$ perlnew Makefile.PL
$ make
### The Berkeley DB library does not work on NFS mounted drives.
### If you try it, you may get error messages about mmap resources being
### temporarily unavailable
$ ssh <your_file_server>
your_file_server% cd ~/.cpan/build/DB_File-...
your_file_server% make test
your_file_server% ^D
$ su # must be root to install
# make install
# ^D # exit to non-root shell
$ ^D # exit to CPAN shell
cpan> q # exit to original shell


####################


### Prepare to install Perl/Tk and GD.

### Perl/Tk needs zlib, jpeg and png. All but jpeg already installed.
### GD needs libgd, which needs zlib, jpeg, png, freetype-2, and XPM.
### All but jpeg and libgd already installed. libjpeg seems pretty
### stable -- the version of libjpeg that comes with Perl-Tk can be
### made to work.
$ perlnew -MCPAN -e shell # use temporary perlnew
cpan> get Tk
cpan> exit
$

####################


### Installing libjpeg (version 6b), which was includes with Tk

### { after CPAN get Tk }
$ cd ~/.cpan/build/Tk-804.027/JPEG/jpeg
$ cp Makefile.maybe Makefile.PL2 # create our own modified version
$ chmod 644 Makefile.PL2 # of Makefile.PL (renamed)
$ edit Makefile.PL2 # diff output follows
36c36,37
< system(sh => "./configure");
---
> system(sh => "./configure",
> qw(--enable-shared --enable-static --libdir=/usr/local/lib/sparcv9);
$ perlnew Makefile.PL2
### For some reason the --libdir parameter seems to have been ignored.
### The following edit fixes it.
$ edit Makefile # diff output follows
15c15
< libdir = $(exec_prefix)/lib
---
> libdir = $(exec_prefix)/lib/sparcv9
$ make
$ make test # fails, because libjpeg needed to be installed first,
# because libtool links the test programs to dynamically
# load libjpeg from the installed location, not the build
# location
$ su
# /usr/local/bin/make install
# ^D # drop back to user shell
$ make test # works now


####################


### install Perl/Tk

### Perl/Tk was difficult to install, because the included zlib, libjpeg,
### and libpng libraries were not configured to run in 64-bit mode. I
### downloaded a new zlib, because some bugs were fixed in the new
### version. A new libpng was used, because some bugs were fixed in the
### new version. I used the Perl/Tk version of libjpeg, because it seems
### to be stable. All three of these libraries were separately installed
### before installing Perl/Tk. The other problem to overcome was telling
### Perl/Tk where to find the X11 library.
###
### Remember that we already got the Perl/Tk module from CPAN
$ cd ~/.cpan/build/Tk-804.027...
{edit myConfig to point to Solaris 64-bit X11 library. This change lets
configure find the right X11 library for the build. diff output follows}
154a155,163
> # Because of the mixed 32-bit and 64-bit nature of UltraSparc
> # Solaris, 64-bit Solaris libs usually reside in ".../lib/sparcv9",
> # instead of ".../lib". The ".../lib/sparcv9" directory sometimes
> # is aliased by a soft link, ".../lib/64".
> if ($Config{'osname'} eq 'solaris' &&
> $Config{'archname'} =~ /^sun4-solaris.*-64/)
> {
> $_ .= '/sparcv9' if (-d "$_/sparcv9");
> }
{edit Tk.pm to point to Solaris 64-bit X11 library. This change tells Tk
where to preload the right X11 library at runtime. A better patch would
check for 64-bit Solaris at runtime. diff output follows.}
89,90c89,90
< Preload(DynaLoader::dl_findfile('-L/usr/openwin/lib','-lX11'))
< if (NeedPreload() && -d '/usr/openwin/lib');
---
> Preload(DynaLoader::dl_findfile('-L/usr/openwin/lib/sparcv9','-lX11'))
> if (NeedPreload() && -d '/usr/openwin/lib/sparcv9');
$ perlnew Makefile.PL
$ make
$ make test
$ su # must be root to install
# make install
# ^D


####################


### Installing libgd (gd-2.0.33) - GD Graphics Library, used by Perl GD
### module

### libgd wants to use /usr/openwin/lib/libXpm.so and
### /usr/lib/libfonconfig.so, both of which are present with Solaris 9,
### but not Solaris 8. If you have a mixed 8/9 environment, then building
### on Solaris 8 causes these features to be unavailable for both 8 and 9.
### Building on 9 and copying these files (and appropriate symlinks) from
### a 9 system to an 8 system seems to work.

{get libgd source <.tar.gz_file> from www.boutell.com}
$ make clean
$ sh # if necessary
# use gcc, 64bitall, ultrasparc
$ ./configure --libdir=/usr/local/lib/sparcv9 \
CC=gcc CFLAGS='-mcpu=v9 -m64 -O' \
LDFLAGS='-m64 -L/usr/local/lib/sparcv9'
### The version of libtool used by this install quits if ranlib if not
### found, even though on Solaris it is not needed. During the make install
### the PATH for root doesn't have /usr/ccs/bin, so ranlib is not found.
###
{ Edit libtool to make ranlib definition path explicit. Change line 175
to be:
RANLIB="/usr/ccs/bin/ranlib"
Another solution is to add /usr/ccs/bin to the PATH before running
"make install".
}
$ make
$ make check
$ su
# /usr/local/bin/make install
# ^D


####################


### Install Perl GD module

$ su
# perlnew -MCPAN -e shell # run CPAN module interactively
cpan> install GD # GD graphics module
cpan> q
# ^D


####################


### Install Perl DBI module

$ su
# perlnew -MCPAN -e shell # run CPAN module interactively
cpan> install Bundle::DBI # generic DBI module for SQL access
### cpan> install Bundle::DBI # install this if you need DBD::Proxy
### # and/or DBI::ProxyServer
cpan> q
# ^D


####################


### Install Perl DBD::Oracle-1.16 module (DBD::Oracle needs Oracle
### client library installed first)

$ setenv ORACLE_HOME /usr/local/Oracle/OraHome9i
$ setenv ORACLE_SID host={hostname};sid={database}
$ setenv ORACLE_USER scott/tiger@{database} # for testing DBD::Oracle
$ perlnew -MCPAN -e shell # run CPAN module interactively
### We can't just install DBD::Oracle directly from CPAN, because
### DBD::Oracle's Makefile.PL defaults to using the Oracle 9+ make
### build32 rule, which tries to link with 32-bit options and the
### 32-bit Oracle libraries. It can be fixed by editing Makefile.PL
### as shown below, or by using "perlnew Makefile.PL -r=build" to force
### usage of the "build" rule to find the 64-bit libraries. (This
### patch was emailed to Tim Bunce, so it may already be there in
### future versions of DBD::Oracle.)
cpan> get DBD::Oracle
cpan> look DBD::Oracle
{ edit Makefile.PL to fix 32/64-bit library problem }
331c331
< $build_target = "build32" if $mk_target_rules{build32};
---
> $build_target = "build32" if $mk_target_rules{build32} && ! perl_is_64bit();
$ perlnew Makefile.PL
$ make
$ make test
$ su
# make install
# ^D # exit to non-root shell
$ ^D # exit to CPAN shell
cpan> q # exit to original shell


####################


### Install Perl DBD::mysql module (DBD::mysql needs mysql client
### library installed first)

# /usr/local/bin/perlnew -MCPAN -e shell # run CPAN module interactively
cpan> get DBD::mysql
cpan> look DBD::mysql
### The two setenv commands and the two edits below let you provide
### the test username and test password as environment variables,
### instead of passing them on the "perl Makefile.PL ..." command,
### which writes the username and password to the file t/mysql.mtest.
### The two edit were sent as a suggested patch to Rudy Lippan
### (rlippan@xxxxxxxxxxxxxxx). If these edits are already present
### in a newer version, then only two setenv commands are needed here.
### Without the edits, the file t/mysql.mtest contains the values you
### passed (or the defaults) and overwrites the values obtained from
### DBI_USER and DBI_PASS.
$ setenv DBI_USER your_test_username
$ setenv DBI_PASS your_test_password
$ edit t/lib.pl # diff output follows
47c47
< $::test_password = $::test_passowrd || $ENV{'DBI_PASS'} || '';
---
> $::test_password = $::test_password || $ENV{'DBI_PASS'} || '';
$ edit Makefile.PL # diff output follows
129c129
< "\$::test_user = \$opt->{'testuser'};\n" .
---
> "\$::test_user = \$opt->{'testuser'} if \$opt->{'testuser'};\n" .
131c131
< "\$::test_password = \$opt->{'testpassword'};\n" .
---
> "\$::test_password = \$opt->{'testpassword'} if \$opt->{'testpassword'};\n" .
133,135c133,135
< "\$::test_dsn = \"DBI:mysql:\$::test_db\";\n" .
< "\$::test_dsn .= \":\$::test_host\" if \$::test_host;\n" .
< "\$::test_dsn .= \":\$::test_port\" if \$::test_port;\n" .
---
> "\$::test_dsn = \"DBI:mysql:\$::test_db\" if \$::test_db;\n" .
> "\$::test_dsn .= \":\$::test_host\" if \$::test_host && \$::test_db;\n" .
> "\$::test_dsn .= \":\$::test_port\" if \$::test_port && \$::test_db;\n" .
### If the edits were not done above, then the alternative is to add
### the following two options to the "perl Makefile.PL ..." command.
### --testuser=your_test_username --testpassword=your_test_password
### If you provide them on the Makefile.PL command line, then they
### are placed in "t/mysql.mtest" for use during "make test". You
### should delete the file or edit the file to remove your username
### and password after testing; otherwise, your username and password
### are lying around where they might be discovered. I prefer the
### patch, so they are never in the file.
$ tcsh # sh and csh cannot handle the long command line below
> perlnew Makefile.PL --help # display options for Makefile.PL
### "--mysql_config=..." is required for me, because this is not the
### production version of mysql pointed to by /usr/local/mysql. This
### copy of mysql is used for the client libraries only.
### "--testhost=..." is needed because I was using a mysql server on a
### different system, not localhost.
### "--cflags=..." is needed because mysql_config provides the compile
### options for the Sun Forte C compiler, not the gcc compiler. I got
### most of the values here from "perl -V".
> perlnew Makefile.PL \
--mysql_config=/usr/local/mysql-standard-4.0.24-sun-solaris2.9-sparc-64bit/bin/mysql_config \
--testhost=your_test_hostname \
--cflags="-D_REENTRANT -mcpu=v9 -m64 -Wa,-xarch=v9 -I/usr/local/include \
-I/usr/local/mysql-standard-4.0.24-sun-solaris2.9-sparc-64bit/include"
> make
> make test
> ^D # exit to CPAN shell
$ su
# make install
# ^D # exit to non-root shell
$ ^D # exit to CPAN shell
cpan> q # exit to original shell


####################


### Install BioPerl packages and modules

# perlnew -MCPAN -e shell # run CPAN module interactively
cpan> get Bundle::Bioperl
cpan> install Bundle::BioPerl
### install Bundle::BioPerl, which is a bundle of just the prerequisite
### modules for BioPerl itself. Replied yes to dependencies.
### XML::DOM got errors testing utf8 support. The problem is in mixing
### euc-jp and utf8 encodings. To get the tests to work, edit the
### following test programs: t/dom_jp_attr.t, t/dom_jp_ cdata.t,
### t/dom_jp_minus.t, t/dom_jp_modify.t, and t/dom_jp_print by
### changing the line with "use utf8;" to "use encoding utf8;".
### ("use encoding utf8;" already does "use utf8;".)
cpan> look XML::DOM
$ edit t/dom_jp_attr.t
....
$ edit t/dom_jp_print.t
$ make test
$ su
# make install
# ^D
$ ^D


installed Perl Crypt::SSLeay, Mail::Address, MIME::Types, MIME::Parser,
MIME::Lite


####################


### Install Perl Net::SSLeay module (Net::SSLeay needs openssl
### client library installed first)

$ perlnew -MCPAN -e shell # run CPAN module interactively
### We can't just install Net::SSLeay directly from CPAN, because
### test.pl runs perl, not perlnew and TCP case was wrong?)
cpan> get Net::SSLeay
cpan> look Net::SSLeay
$ perlnew Makefile.PL
$ make
$ edit test.pl # diff output follows
47a48
> $perl = "/usr/local/bin/perlnew $inc"; # force selection of perlnew
95c96
< print &test('5tcp', ($res =~ /SSLEAY-TCP-TEST/));
---
> print &test('5tcp', ($res =~ /SSLEAY-TCP-TEST/i)); # make case insensitive
$ make test
$ su
# /usr/local/bin/make install
# ^D # exit to non-root shell
$ ^D # exit to CPAN shell
cpan> q # exit to original shell


####################


cpan> install IO::Socket::SSL # needs Net::SSLeay first


cpan> install Bundle::BioPerl # install BioPerl again to finish
# the rest
cpan> i /BioPerl/ # get the full name and version of BioPerl
cpan> install B/BI/BIRNEY/bioperl-0.7.1.tar.gz # now really install BioPerl
cpan> install B/BI/BIRNEY/bioperl-ext-0.6.tar.gz # and extras
cpan> install B/BI/BIRNEY/bioperl-gui-0.7.tar.gz # *
cpan> q


####################


### Make Perl 5.8.5 the new default version of perl. Don't do this step
### until you have tested everything and are ready to make the new Perl
### the production one.

$ su
# cd /usr/local/bin
# mv perldoc perldocold # save older version of perldoc
# mv perldocnew perldoc # use new perldoc
# cp perl perlold # save older version of perl
# cp perl5.8.5 perl # use new perl
# ^D

### Now it is done.


daniel lance herrick wrote:

> The perl we are using was compiled 64 bit. I'm
> trying to get TK running with it:
>
> make[2]: Entering directory `/work/appl4/gm/gme/TK/Tk-804.027/PNG/libpng'
> gcc -fPIC -I../zlib -Wall -O2 -c -o pngtest.o pngtest.c
> gcc -fPIC -o pngtest pngtest.o -L. -L../zlib -lpng -lz -lm -s
> ld: warning: file ../zlib/libz.a(crc32.o): wrong ELF class: ELFCLASS64
>
> Then there is a list of 9 undefined symbols that
> libpng.a presumably expected to access from libz.a
>
> There were many gcc commands with an "-m64" on the
> command line before this point, but not in
> directory PNG/libpng.
>
> The command line used to bring us to this point:
>
> /epo/app/martin/gme/epc3/thirdPartyLinks/perl Makefile.PL ; make
>
> Scrolling back a bit, PNG/zlib is compiled with
> the "-m64" switch as it needs to be, as, for
> example:
>
> gcc -fPIC -mcpu=v9 -m64 -Wa,-xarch=v9 -mcpu=v9 \
> -m64 -fno-strict-aliasing -I/usr/local/include \
> -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fPIC \
> -DHAVE_UNISTD_H -DUSE_MMAP -c -o inffast.o \
> inffast.c
>
> But in PNG/libpng, the compile commands are much
> shorter:
>
> make[2]: Entering directory `/work/appl4/gm/gme/TK/Tk-804.027/PNG/libpng'
> gcc -fPIC -I../zlib -Wall -O2 -c -o png.o png.c
> gcc -fPIC -I../zlib -Wall -O2 -c -o pngerror.o pngerror.c
>
> I suspect the problem is that Makefile.PL is
> choosing scripts/makefile.gcc when it needs to
> choose scripts/makefile.64sunu, except I don't see
> the string "-m64" in the 64sunu makefile.
>
> So, I hand-edited the CFLAGS variable in
> PNG/libpng/Makefile, did a make clean in
> PNG/libpng and repeated the make in the build
> directory. This time it compiled all the library
> components 64 bit, but still compiled
> PNG/libpng/pngtest without the -m64.
>
> Where is the proper place to make such a
> configuration change so it affects the whole
> build?
>
> dan
> (perl -V below)
>
> [herrick@rfautopub:Tk-804.027]$/epo/app/martin/gme/epc3/thirdPartyLinks/perl -V
> Summary of my perl5 (revision 5.0 version 8 subversion 1) configuration:
> Platform:
> osname=solaris, osvers=2.9, archname=sun4-solaris-64
> uname='sunos build9 5.9 generic_112233-08 sun4u sparc sunw,ultra-4 '
> config_args='-Dprefix=/opt/perl/5.8.1 -Dcc=gcc -Accflags=-mcpu=v9 -m64 -Aldflags=-mcpu=v9 -m64 -Alddlflags=-mcpu=v9 -m64 -Duse64bitall'
> hint=recommended, useposix=true, d_sigaction=define
> usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
> useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
> use64bitint=define use64bitall=define uselongdouble=undef
> usemymalloc=n, bincompat5005=undef
> Compiler:
> cc='gcc', ccflags ='-mcpu=v9 -m64 -Wa,-xarch=v9 -mcpu=v9 -m64 -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
> optimize='-O',
> cppflags='-mcpu=v9 -m64 -Wa,-xarch=v9 -mcpu=v9 -m64 -fno-strict-aliasing -I/usr/local/include'
> ccversion='', gccversion='3.3.2', gccosandvers='solaris2.9'
> intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=87654321
> d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
> ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
> alignbytes=8, prototype=define
> Linker and Libraries:
> ld='gcc', ldflags =' -mcpu=v9 -m64 -L/usr/lib/sparcv9 -L/usr/local/lib '
> libpth=/usr/lib/sparcv9 /usr/local/lib /usr/lib /usr/ccs/lib
> libs=-lsocket -lnsl -ldl -lm -lc
> perllibs=-lsocket -lnsl -ldl -lm -lc
> libc=/usr/lib/sparcv9/libc.so, so=so, useshrplib=false, libperl=libperl.a
> gnulibc_version=''
> Dynamic Linking:
> dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' -z ignore -z lazyload -z combreloc'
> cccdlflags='-fPIC', lddlflags=' -mcpu=v9 -m64 -G -z ignore -z lazyload -z combreloc -L/usr/lib/sparcv9 -L/usr/local/lib'
>
> Characteristics of this binary (from libperl):
> Compile-time options: USE_64_BIT_INT USE_64_BIT_ALL USE_LARGE_FILES
> Built under solaris
> Compiled at Oct 27 2003 16:50:15
> @INC:
> /opt/perl/5.8.1/lib/5.8.1/sun4-solaris-64
> /opt/perl/5.8.1/lib/5.8.1
> /opt/perl/5.8.1/lib/site_perl/5.8.1/sun4-solaris-64
> /opt/perl/5.8.1/lib/site_perl/5.8.1
> /opt/perl/5.8.1/lib/site_perl
> .
>
> -++**==--++**==--++**==--++**==--++**==--++**==--++**==
> This message was posted through the Stanford campus mailing list
> server. If you wish to unsubscribe from this mailing list, send the
> message body of "unsubscribe ptk" to majordomo@xxxxxxxxxxxxxxxxxx

--
James D. White (jdw@xxxxxx)
Director of Bioinformatics
Department of Chemistry and Biochemistry/ACGT
University of Oklahoma
101 David L. Boren Blvd., SRTC 2100
Norman, OK 73019
Phone: (405) 325-4912, FAX: (405) 325-7762



-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server. If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to majordomo@xxxxxxxxxxxxxxxxxx

.



Relevant Pages

  • Re: attempt to build 64 bit on Solaris fails
    ... > libraries needed to link with a 64-bit Tk. ... We were running a 32-bit version of Perl ... > Each section below is a summary of the commands used to install it. ...
    (comp.lang.perl.tk)
  • DBD::Oracle install - make test errors
    ... I'm trying to install the Perl DBD::Oracle module on ... I have read all the relevant DBD-Oracle README files. ... This is the info on Perl: ... Linker and Libraries: ...
    (perl.dbi.users)
  • Re: Question for this Group ... dont flame me :)
    ... > default libraries and modules. ... So I wound up documenting the core basic perl modules that had ... LOL) who doesn't have access to install as root or ... said that it was our set of CPAN module extensions... ...
    (perl.beginners)
  • Perl on Linux and SQL Server 2000 on Windows
    ... There was a time when I did a lot of searching on ways to use Perl ... sitting on Linux to connect SQL Server 2000 sitting on Windows. ... cpan> install DBI ... Install FreeTDS ...
    (comp.os.linux.misc)
  • RE: Please Help !!! Unable to install DBD-Oracle ( I am using perl 5.6 on solaris 8)
    ... Ron, I could be way off here, but the OP mayalready have Perl ... think the original issue was that he tried to use *PPM* to install ... I don't have any Solaris ... you are not the intended recipient, please notify the sender at Wipro ...
    (perl.dbi.users)