[pypy-dev] Specifying lib locations?

Davide Del Vento ddvento at ucar.edu
Mon Sep 9 19:14:08 CEST 2013


Sorry for the late reply.
Yes that is the bare-bone I was suggesting you to do. It looks like you 
figured your problem out yourself anyway, so I'd leave that part alone.

I have a few suggestions, not sure they are relevant for you, but they 
might for others reading this thread now or in the future:

- make these locations changeable, i.e. put them in an environmental 
variables (in my case the env vars are managed by lmod) instead of 
hard-coding them in the wrapper

- add something like a --show option, which would exactly print what 
would be executed (particularly important if you do the environmental 
variable thing mentioned above)

- add also the -Wl,-rpath,/opt/TWWfsw/ncurses57/lib so your final 
executable won't have to scramble to find its libraries (and the user 
won't have to scramble with the messy LD_LIBRARY_PATH)

- let the wrapper tell the user it is a wrapper, or tell people about it

- install other versions of whatever library you like, use the env vars 
to cherry pick what you want for any particular application (or other 
library) and enjoy them all working nicely together :-)

Regards,
Davide Del Vento,
NCAR Computational & Information Services Laboratory
Consulting Services Software Engineer
http://www2.cisl.ucar.edu/uss/csg/
SEA Chair http://sea.ucar.edu/

On 09/06/2013 08:11 AM, Skip Montanaro wrote:
>> The way we solved this problem on our system is creating a compiler wrapper.
>> This is a non-pypy-specific solution, which we believe is very effective and
>> convenient.
>>
>> The "normal" gcc is installed in non-standard out-of-path location. A gcc
>> shell script is installed instead. Such a script will call the actual gcc
>> with all the proper -I -L -l of the other libraries (managed by lmod). In
>> fact, in this way, it's a piece of cake to maintain several versions of the
>> same library (and compiler and everything) on the system.
>>
>> I can elaborate more if this is not clear.
>
>
> I thought it was clear, but my initial attempts at a wrapper have yielded no
> improvement.  Here's what my wrapper looks like at the moment:
>
> #!/bin/bash
>
> # Wrapper around GCC used to add a number of non-standard library and
> # include file locations to command lines when building pypy.
>
> gcc \
>      -L/opt/TWWfsw/ncurses57/lib -I/opt/TWWfsw/ncurses57/include \
>      -I/opt/TWWfsw/ncurses57/include/ncurses \
>      "$@"
>
> This seems to me what you were describing, and in fact, I've verified that
> at curses.h and term.h exist in the second -I directory. Lots of other compile
> commands before the failure succeed, and do use my minimal gcc-wrap
> script, so I'm sure it's being invoked, and doesn't have some stupid bug like
> a syntax error or typo.
>
> Hints appreciated...
>
> Thx,
>
> Skip
>


More information about the pypy-dev mailing list