Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

building perl with 64-bit

by dsb (Chaplain)
on May 21, 2014 at 20:03 UTC ( #1087016=perlquestion: print w/replies, xml ) Need Help??

dsb has asked for the wisdom of the Perl Monks concerning the following question:

All,
despite having used Perl for years, I've never had the privilege (riiiiiight) of building out my own perl build.

I'm building perl on a server in order to productionize a small tool, but it's proving tricky. Getting perl installed is easy enough. I've got it installed to the non-standard location:
/export/home/scratch/perl

The hiccups started when I needed to install DBD::Sybase. After trying (and failing) several times, the errors i was getting lead me to believe I needed to be dealing with a 64-bit version of the library. Found an rpm for it, but it requires 64-bit DBI. Again, i found an RPM.

After checking the non-prod box, I see that there are many 64-bit versions of modules installed:

>:/export/home/scratch/perl/lib/site_perl/5.16.3/x86_64-linux$ ls -l total 468 drwxrwx--- 3 dbalaban dbalaban 4096 Apr 8 2013 Apache drwxrwx--- 3 dbalaban dbalaban 4096 Apr 8 2013 Apache2 drwxrwx--- 2 dbalaban dbalaban 4096 Apr 8 2013 APR -rwxrwx--- 1 dbalaban dbalaban 2239 Apr 8 2013 APR.pm drwxr-x--- 3 dbalaban dbalaban 4096 May 15 13:44 Attribute drwxrwx--- 63 dbalaban dbalaban 4096 May 15 13:44 auto drwxrwx--- 3 dbalaban dbalaban 4096 May 21 15:51 Bit drwxrwx--- 3 dbalaban dbalaban 4096 Apr 8 2013 Bundle drwxrwx--- 3 dbalaban dbalaban 4096 Apr 5 2013 Compress drwxr-x--- 3 dbalaban dbalaban 4096 Nov 11 2013 Crypt drwxrwx--- 6 dbalaban dbalaban 4096 Jun 20 2013 DBD drwxrwx--- 8 dbalaban dbalaban 4096 Apr 5 2013 DBI -rwxrwx--- 1 dbalaban dbalaban 311516 Mar 28 2013 DBI.pm -rwxrwx--- 1 dbalaban dbalaban 1533 Jul 16 2007 dbixs_rev.pl drwxrwx--- 2 dbalaban dbalaban 4096 Apr 5 2013 Digest drwxrwx--- 2 dbalaban dbalaban 4096 Apr 5 2013 HTML drwxrwx--- 3 dbalaban dbalaban 4096 Apr 5 2013 List drwxrwx--- 2 dbalaban dbalaban 4096 Apr 8 2013 ModPerl -rwxrwx--- 1 dbalaban dbalaban 1805 Apr 25 2012 mod_perl2.pm drwxr-x--- 3 dbalaban dbalaban 4096 Nov 11 2013 Net drwxr-x--- 3 dbalaban dbalaban 4096 May 15 13:44 Package drwxr-x--- 3 dbalaban dbalaban 4096 May 15 13:44 Params -rwxrwx--- 1 dbalaban dbalaban 4234 Jan 24 2012 RRDs.pm drwxrwx--- 2 dbalaban dbalaban 4096 Apr 5 2013 Scalar drwxr-x--- 8 dbalaban dbalaban 4096 Nov 12 2013 Template -r--r--r-- 1 dbalaban dbalaban 25038 Jul 24 2013 Template.pm drwxrwx--- 2 dbalaban dbalaban 4096 Apr 5 2013 Term -r--r--r-- 1 dbalaban dbalaban 15550 Nov 5 2007 Tibrv.pm drwxrwx--- 2 dbalaban dbalaban 4096 Apr 5 2013 Win32 drwxr-x--- 3 dbalaban dbalaban 4096 Nov 11 2013 XML
Is there a way to configure cpan to install 64-bit version to the architecture specific directories (..../x86_64-linux)? I can only find rpm's to do this, and it seems like manually building this out will be a bear.

dsb
This @ISA my( $cool ) %SIG

Replies are listed 'Best First'.
Re: building perl with 64-bit
by syphilis (Bishop) on May 22, 2014 at 00:18 UTC
    Hi dsb,

    I don't quite follow (which is not necessarily your fault :-)

    What is the output of perl -V for the perl you built yourself ?

    When you fire up cpan, are you running the one that's part of the perl you built ? Or are you running the one that's part of the system perl ?
    (You want the former.)

    Is there a way to configure cpan to install 64-bit version to the architecture specific directories

    Normally, make install will install into the correct location without there being any need to even think about it.
    In which location are modules being placed ? ... and where precisely do you want them to be placed ?

    Cheers,
    Rob
      Hi When You install perl modules via cpan, you need to make sure you start the proper perl aka:
      /opt/perl/bin/perl -MCPAN -e shell

      or inside a untarred module
      /opt/perl/bin/perl ./MAKEFILE.PL

      Or you can use perlbrew which sets up the PERL5LIB environment variable accordingly.

      Here's my perl -V output:
      >:~$ perl -V Summary of my perl5 (revision 5 version 16 subversion 3) configuration +: Platform: osname=linux, osvers=2.6.32-279.el6.x86_64, archname=x86_64-linux uname='linux nyctrdmonp02 2.6.32-279.el6.x86_64 #1 smp fri jun 22 +12:19:21 utc 2012 x86_64 x86_64 x86_64 gnulinux ' config_args='' hint=recommended, useposix=true, d_sigaction=define useithreads=undef, usemultiplicity=undef useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=und +ef use64bitint=define, use64bitall=define, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-fno-strict-aliasing -pipe -fstack-protector -I +/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O2', cppflags='-fno-strict-aliasing -pipe -fstack-protector -I/usr/loca +l/include' ccversion='', gccversion='4.4.7 20120313 (Red Hat 4.4.7-3)', gccos +andvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=1 +6 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', + lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='cc', ldflags =' -fstack-protector -L/usr/local/lib' libpth=/usr/local/lib /lib/../lib64 /usr/lib/../lib64 /lib /usr/li +b /lib64 /usr/lib64 libs=-lnsl -ldb -ldl -lm -lcrypt -lutil -lc perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc libc=/lib/libc-2.12.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.12' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib -fstac +k-protector' Characteristics of this binary (from libperl): Compile-time options: HAS_TIMES PERLIO_LAYERS PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP PERL_PRESERVE_IVUV USE_64_BIT +_ALL USE_64_BIT_INT USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_PERLIO USE_PERL_ATOF Built under linux Compiled at May 21 2014 13:54:14 @INC: /export/home/scratch/perl/lib/site_perl/5.16.3/x86_64-linux /export/home/scratch/perl/lib/site_perl/5.16.3 /export/home/scratch/perl/lib/5.16.3/x86_64-linux /export/home/scratch/perl/lib/5.16.3
      So the problem is ultimately that I need DBD::Sybase, which fails when using CPAN.

      When searched around for the errors I was getting, I picked up a lot of hints that CPAN was trying to install 32-bit versions which were clashing on my 64-bit box.

      When i went back to the non-prod box that was built out by a guy not with the company any more, I noticed that all the DB(I|D) modules were in the architecture specific directory:

      >:/export/home/scratch/perl/lib$ find . -name DBI* ./site_perl/5.16.3/CGI/Session/Driver/DBI.pm ./site_perl/5.16.3/Log/Log4perl/Appender/DBI.pm ./site_perl/5.16.3/DBI ./site_perl/5.16.3/x86_64-linux/Win32/DBIODBC.pm ./site_perl/5.16.3/x86_64-linux/DBI ./site_perl/5.16.3/x86_64-linux/auto/DBI ./site_perl/5.16.3/x86_64-linux/auto/DBI/DBI.bs ./site_perl/5.16.3/x86_64-linux/auto/DBI/DBI.so ./site_perl/5.16.3/x86_64-linux/auto/DBI/DBIXS.h ./site_perl/5.16.3/x86_64-linux/DBI.pm ./site_perl/5.16.3/x86_64-linux/Bundle/DBI.pm >:/export/home/scratch/perl/lib$ find . -name DBD* ./site_perl/5.16.3/DBD ./site_perl/5.16.3/x86_64-linux/DBD ./site_perl/5.16.3/x86_64-linux/DBI/DBD ./site_perl/5.16.3/x86_64-linux/DBI/DBD.pm ./site_perl/5.16.3/x86_64-linux/auto/DBD ./site_perl/5.16.3/x86_64-linux/Bundle/DBD
      Also notice that there is a DBI folder under the standard site_perl directory, but the DBI.pm package is only in the x86... directory. Never seen that, but again, not very experienced with building a good perl install.

      From there I started looking around for 64-bit specific DBI and DBD packages and found a source for rpms. But that seems fairly tedious, so...here I am. Truth be told, I'm not even sure that these RPM's will work.

      Short version: I want DBI with DBD::Sybase and DBD::Oracle but perl complains when I try to install via CPAN.

      dsb
      This @ISA my( $cool ) %SIG

Re: building perl with 64-bit
by karlgoethebier (Abbot) on May 22, 2014 at 18:58 UTC
    "I want DBI with DBD::Sybase and DBD::Oracle but perl complains..."

    It's just an idea - but are you aware that you need a Sybase environment as well as an Oracle environment to build this modules?

    In other words: you need to build DBD::Sybase as user sybase and DBD::Oracle as user oracle.

    Else it's like banging your head against a wall ;-)

    Regards, Karl

    «The Crux of the Biscuit is the Apostrophe»

Re: building perl with 64-bit
by andal (Hermit) on May 23, 2014 at 06:26 UTC

    Maybe, it would be better if you provide the command that you use when you install DBD::Sybase and the error that you get.

      output from the failures in make:
      >:~/packages/DBD-Sybase-1.15$ make 2>&1 | tee -a make.1.log cp dbd-sybase.pod blib/lib/DBD/dbd-sybase.pod cp Sybase.pm blib/lib/DBD/Sybase.pm /export/home/scratch/perl/bin/perl -p -e "s/~DRIVER~/Sybase/g" /export +/home/scratch/perl/lib/site_perl/5.16.3/x86_64-linux/auto/DBI/Driver. +xst > Sybase.xsi /export/home/scratch/perl/bin/perl /export/home/scratch/perl/lib/5.16. +3/ExtUtils/xsubpp -typemap /export/home/scratch/perl/lib/5.16.3/ExtU +tils/typemap Sybase.xs > Sybase.xsc && mv Sybase.xsc Sybase.c cc -c -I/apps/sybase/include -DSYB_LP64 -I/export/home/scratch/perl/l +ib/site_perl/5.16.3/x86_64-linux/auto/DBI -fno-strict-aliasing -pipe +-fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OF +FSET_BITS=64 -O2 -DVERSION=\"1.15\" -DXS_VERSION=\"1.15\" -fPIC "-I +/export/home/scratch/perl/lib/5.16.3/x86_64-linux/CORE" Sybase.c cc -c -I/apps/sybase/include -DSYB_LP64 -I/export/home/scratch/perl/l +ib/site_perl/5.16.3/x86_64-linux/auto/DBI -fno-strict-aliasing -pipe +-fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OF +FSET_BITS=64 -O2 -DVERSION=\"1.15\" -DXS_VERSION=\"1.15\" -fPIC "-I +/export/home/scratch/perl/lib/5.16.3/x86_64-linux/CORE" dbdimp.c dbdimp.c: In function ‘syb_st_execute’: dbdimp.c:3906: warning: passing argument 2 of ‘ct_results’ from incomp +atible pointer type /apps/sybase/include/ctpublic.h:363: note: expected ‘CS_INT *’ but arg +ument is of type ‘int *’ dbdimp.c:3930: warning: passing argument 5 of ‘ct_bind’ from incompati +ble pointer type /apps/sybase/include/ctpublic.h:110: note: expected ‘CS_INT *’ but arg +ument is of type ‘int *’ Running Mkbootstrap for DBD::Sybase () chmod 644 Sybase.bs rm -f blib/arch/auto/DBD/Sybase/Sybase.so LD_RUN_PATH="/apps/sybase/lib" cc -L/apps/sybase/lib -shared -O2 -L/u +sr/local/lib -fstack-protector Sybase.o dbdimp.o -o blib/arch/auto/D +BD/Sybase/Sybase.so \ -L/apps/sybase/lib -lct -lcs -lcomn -lintl -lblk -lskrb -ld +l -lm \ /usr/bin/ld: skipping incompatible /apps/sybase/lib/libct.so when sear +ching for -lct /usr/bin/ld: skipping incompatible /apps/sybase/lib/libct.a when searc +hing for -lct /usr/bin/ld: skipping incompatible /apps/sybase/lib/libct.so when sear +ching for -lct /usr/bin/ld: skipping incompatible /apps/sybase/lib/libct.a when searc +hing for -lct /usr/bin/ld: cannot find -lct collect2: ld returned 1 exit status make: *** [blib/arch/auto/DBD/Sybase/Sybase.so] Error 1
      Part of my own confusion is whether I need to point the CONFIG towards the freetds directories or the sybase directories. These are errors are with the sybase directories.

      dsb
      This @ISA my( $cool ) %SIG

        So, it might be that your Sybase installation is 32-bit. Normally, perl modules link against libraries provided by the application. In this case, linker searches for these libraries in /apps/sybase/lib, it needs library with name 'ct'. The ones that it finds are not compatible with the object currently created.

        So, I would recommend you to check Sybase installation and leave CPAN alone :) You can use 'file' utility to see type of the object.

        andal is bang on.
        You Sybase libs are 32bit. The 64bit libs are named libct64.so (etc). However, given the name of the libs this appears to be Sybase 12.x (or maybe even earlier), and may not exist as 64bit code at all (depending on the platform).

        Michael

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1087016]
Approved by boftx
Front-paged by GotToBTru
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2020-10-30 20:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (284 votes). Check out past polls.

    Notices?