Re: trouble with MakeMaker finding library

2004-03-31 Thread Arthur Corliss
On Wed, 31 Mar 2004, Tim Harsch wrote:

 Hi all,
 My module requires a shared library.  I'd like for the user to have that
 library available at LD_LIBRARY_PATH and call it good enough.  However, look
 at the following.  I get 'No library found' and note: both LD_LIBRARY_PATH
 is set and -L specifies the location

 ***
 use ExtUtils::MakeMaker;

 die SGE_ROOT environment variable not defined  unless my $SGE_ROOT =
 $ENV{SGE_ROOT};

 # See lib/ExtUtils/MakeMaker.pm for details of how to influence
 # the contents of the Makefile that is written.
 WriteMakefile(
 'NAME'  = 'Schedule::DRMAAc',
 'VERSION_FROM' = 'DRMAAc.pm', # finds $VERSION
 'PREREQ_PM'  = {}, # e.g., Module::Name = 1.1
 ($] = 5.005 ?## Add these new keywords supported since 5.005
   (ABSTRACT_FROM = 'DRMAAc.pm', # retrieve abstract from module
AUTHOR = 'Tim Harsch [EMAIL PROTECTED]') : ()),
 'LIBS'  = ['-ldrmaa', '-lsocket', '-lnsl', '-lm', '-lpthread'],
 'DEFINE'  = '', # e.g., '-DHAVE_SOMETHING'
  # Insert -I. if you add *.h files later:
  'INC'  = -L$SGE_ROOT/lib/sol-sparc -I$SGE_ROOT/include,

  # Un-comment this if you add C files to link with later:
  'OBJECT' = '$(O_FILES)', # link all the C files too
 );
 ***
 [868] dna:/home/harsch/CVS/managers/drmaa echo $LD_LIBRARY_PATH
 /home/harsch/CVS/managers/drmaa/Schedule:/home/harsch/tmp/SGE_040310/lib/sol
 -sparc:/usr/local/lib:/usr/local/opt/SUNWspro/lib:/opt/SUNWspro/lib:/usr/ope
 nwin/lib:/usr/dt/lib:/usr/4lib
 [869] dna:/home/harsch/CVS/managers/drmaa echo $SGE_ROOT/
 /home/harsch/tmp/SGE_040310/
 [870] dna:/home/harsch/CVS/managers/drmaa perl Makefile.PL
 Note (probably harmless): No library found for -ldrmaa
 Writing Makefile for Schedule::DRMAAc

BTW, keep in mind that your usage of LIBS will use each array member as a
complete set of arguments to ld, which means that if you had the '-ldrmaa' as
the last array member you would have never even have gotten that warning.  If
all those libraries are mandatory you need to pass them as a single array
member.  Quoting the pod:

   LIBS
 An anonymous array of alternative library specifications to be
 searched for (in order) until at least one library is found.

In any event, setting LD_LIBRARY_PATH won't override the search path when
testing for libraries, you'll need to add it to LIBS as well:

  LIBS = [-L$SGE_ROOT/lib/sol-sparc -ldrmaa, ...]

--Arthur Corliss
  Bolverk's Lair -- http://arthur.corlissfamily.org/
  Digital Mages -- http://www.digitalmages.com/
  Live Free or Die, the Only Way to Live -- NH State Motto


Re: trouble with MakeMaker finding library

2004-03-31 Thread Tim Harsch
Thank you.  That was exactly it.

- Original Message - 
From: Arthur Corliss [EMAIL PROTECTED]
To: Tim Harsch [EMAIL PROTECTED]
Cc: Perl Mod Authors [EMAIL PROTECTED]
Sent: Wednesday, March 31, 2004 6:16 PM
Subject: Re: trouble with MakeMaker finding library


 On Wed, 31 Mar 2004, Tim Harsch wrote:

  Hi all,
  My module requires a shared library.  I'd like for the user to have that
  library available at LD_LIBRARY_PATH and call it good enough.  However,
look
  at the following.  I get 'No library found' and note: both
LD_LIBRARY_PATH
  is set and -L specifies the location
 
  ***
  use ExtUtils::MakeMaker;
 
  die SGE_ROOT environment variable not defined  unless my $SGE_ROOT =
  $ENV{SGE_ROOT};
 
  # See lib/ExtUtils/MakeMaker.pm for details of how to influence
  # the contents of the Makefile that is written.
  WriteMakefile(
  'NAME'  = 'Schedule::DRMAAc',
  'VERSION_FROM' = 'DRMAAc.pm', # finds $VERSION
  'PREREQ_PM'  = {}, # e.g., Module::Name = 1.1
  ($] = 5.005 ?## Add these new keywords supported since 5.005
(ABSTRACT_FROM = 'DRMAAc.pm', # retrieve abstract from module
 AUTHOR = 'Tim Harsch [EMAIL PROTECTED]') : ()),
  'LIBS'  = ['-ldrmaa', '-lsocket', '-lnsl', '-lm', '-lpthread'],
  'DEFINE'  = '', # e.g., '-DHAVE_SOMETHING'
   # Insert -I. if you add *.h files later:
   'INC'  = -L$SGE_ROOT/lib/sol-sparc -I$SGE_ROOT/include,
 
   # Un-comment this if you add C files to link with later:
   'OBJECT' = '$(O_FILES)', # link all the C files too
  );
  ***
  [868] dna:/home/harsch/CVS/managers/drmaa echo $LD_LIBRARY_PATH
 
/home/harsch/CVS/managers/drmaa/Schedule:/home/harsch/tmp/SGE_040310/lib/sol

 -sparc:/usr/local/lib:/usr/local/opt/SUNWspro/lib:/opt/SUNWspro/lib:/usr/o
pe
  nwin/lib:/usr/dt/lib:/usr/4lib
  [869] dna:/home/harsch/CVS/managers/drmaa echo $SGE_ROOT/
  /home/harsch/tmp/SGE_040310/
  [870] dna:/home/harsch/CVS/managers/drmaa perl Makefile.PL
  Note (probably harmless): No library found for -ldrmaa
  Writing Makefile for Schedule::DRMAAc

 BTW, keep in mind that your usage of LIBS will use each array member as a
 complete set of arguments to ld, which means that if you had the '-ldrmaa'
as
 the last array member you would have never even have gotten that warning.
If
 all those libraries are mandatory you need to pass them as a single array
 member.  Quoting the pod:

LIBS
  An anonymous array of alternative library specifications to be
  searched for (in order) until at least one library is found.

 In any event, setting LD_LIBRARY_PATH won't override the search path when
 testing for libraries, you'll need to add it to LIBS as well:

   LIBS = [-L$SGE_ROOT/lib/sol-sparc -ldrmaa, ...]

 --Arthur Corliss
   Bolverk's Lair -- http://arthur.corlissfamily.org/
   Digital Mages -- http://www.digitalmages.com/
   Live Free or Die, the Only Way to Live -- NH State Motto