in reply to Re^2: Error during compilation of 5.8.8 on solaris 10
in thread Error during compilation of 5.8.8 on solaris 10

Close. It should be a dev package for 'libdb' - which will include 'libdb.a'. If I recall correctly, that should be the Berkeley DB package - e.g., db-4.2.52.NC-sol10-sparc-local.gz for Solaris 10.


-- 
Human history becomes more and more a race between education and catastrophe. -- HG Wells
  • Comment on Re^3: Error during compilation of 5.8.8 on solaris 10

Replies are listed 'Best First'.
Re^4: Error during compilation of 5.8.8 on solaris 10
by Sinistral (Monsignor) on Apr 10, 2008 at 13:39 UTC
    Your advice is correct in some respects, but incorrect in others.
    1. libdb.so is a shared library, whereas libdb.a is a static library. If you have both libdb.so and libdb.a available in the search paths used by a C compiler (gcc in this case), then the shared library is preferred. Shared libraries are preferred because they prevent the code from begin compiled into your resulting Perl binary, which increases binary size and requires more resources every time it is invoked. The previous comments about needing libdb.a instead of libdb.so were incorrect.
    2. Having the library is not sufficient; you need the development headers as well. This was a correct stateement.

    If you or someone you know has root access to the system, you can start at this page for the version of Solaris you have (as opposed to using the SunFreeware one):

    http://www.sun.com/software/solaris/freeware/index.xml

    You can get the Berkeley DB companion software for Solaris 8, 9, 10 and on Sparc and Intel platforms. Sun requires a free login to access the downloads (both DVD ISO image and individual package downloads).

      > The previous comments about needing libdb.a instead of libdb.so were incorrect.
      

      The documentation says you're wrong; the '-l' option explicitly requires the '.a' version.

      
      -- 
      Human history becomes more and more a race between education and catastrophe. -- HG Wells
      

        Your documentation link went to the original parent node. A little searching shows this: http://gcc.gnu.org/onlinedocs/gcc-4.3.0/gcc/Link-Options.html#Link-Options being what you're citing.

        I see what you're saying, but notice this option:

        -static On systems that support dynamic linking, this prevents linking with the shared libraries. On other systems, this option has no effect.

        Personal experience with GCC (including and especially on Solaris) indicates that if you have libname.so and libname.a, then the .so is preferred when building.

        If you only linked against libname.a, then you wouldn't need the -static command line flag.

        From the linker's (GNU ld) man page (remember, link options are just being passed through to the linker):

        -larchive
        --library=archive
        
        Add archive file archive to the list of files to link.  This option
        may be used any number of times. ld will search its path-list for
        occurrences of "libarchive.a" for every archive specified.
        
        On systems which support shared libraries, ld may also search for
        libraries with extensions other than ".a".  Specifically, on ELF and
        SunOS systems, ld will search a directory for a library with an 
        extension of ".so" before searching for one with an extension of ".a". 
        By convention, a ".so" extension indicates a shared library.
        
Re^4: Error during compilation of 5.8.8 on solaris 10
by mmakarczyk (Initiate) on Apr 10, 2008 at 14:26 UTC
    Sinistral- Per your comment of "Having the library is not sufficient; you need the development headers as well. " Will the 4.2.52.NC-sol10-sparc-local package from sunfreeware install both? This is going on a server that is running an oracle 9i database (production) Do you think there is anything in this package that could adversely affect the functionality of that database. The reason I ask is that the details page of the package discusses how Berkeley DB integrates w/ "Oracle's Overall Embedded database strategy." Since I don't have a non production server to test this package on, i'm a bit nervous. Thanks again- Matt
      As you've already tried, it works fine. I am running systems with Oracle and Berkeley DB, and they keep out of each other's way. I even have Perl scripts that use both DBD::Oracle and DB_File in the same script, and there's no problems. The "Oracle's Overall Embedded database strategy" is nice marketing text, but when it comes down to files on the metal, they can happily coexist.