Re: Force scons to use local libraries over system libraries

Bill Deegan <[email protected]>
Newsgroups gmane.comp.programming.tools.scons.user
Message-ID <CAEyG4CEzVun-RfOdCz2eRpC_kZiTEMB88jTz7GQ=xRs6Ptb_bA@mail.gmail.com>
Hsuan,

If you're trying to build gem5, you should probably ask there first how to
make this change.
Every project implements their build system with SCons differently and so
to answer your question would take a bit of time to understand what they've
done.
Additionally it's possible they have added command line flags to specify
the location of libz..

Please ask there first and then if they are unable to help you, come back.

-Bill

On Sat, Aug 29, 2020 at 10:03 AM 暗黑聖飢魔 <[email protected]> wrote:

> Hi, is it possible to change the library path search order, so that scons
> searches a specific path before the system path?
>
> We try to build an open source project called gem5, which uses scons as
> its build system. We need to link gem5 with *libz 1.2.9*. The problem is
> that there is already a */usr/lib/libz.so*, whose version is the
> incompatible *1.2.8*. Unfortunately, we don't have permission to update
> the system libraries.
>
> We have already tried adding the following statement to SConstruct:
>
>     main.Prepend(LIBPATH=['*/path/to/our/libz*'])
>
> but in the build log, we find "*/path/to/our/libz*" is still searched
> after "*/usr/lib*":
>
>     scons build/ARM/gem5.opt --verbose
>     ...
>     g++ -o build/ARM/marshal \
>         -L/usr/lib/python2.7/config-x86_64-linux-gnu \
>         -L*/usr/lib* \
>         -Xlinker \
>         -export-dynamic \
>         -Wl,-O1 \
>         -Wl,-Bsymolic-functions \
>         -z origin build/ARM/python/marshar.o \
>         -Lbuild/nomail \
>         -Lbuild/libfdt \
>         -Lbuild/libelf \
>         -Lbuild/iostream3 \
>         -Lbuild/fputils \
>         -Lbuild/drampower \
>         -L*/path/to/our/libz* \
>         -Lbuild/googletest \
>         -lpthread -lm -lpython2.7 *-lz* -lrt -llz4 ...... -ldrampower
> -lfputils -liostream3 -lelf -lfdt -lnomali -lpng
>
> It seems the "*/usr/lib*" is specified by scons itself instead of gem5's
> scons scripts. Is it possible to bring our "*/path/to/our/libz*" before
> that?
>
> Thanks,
> Hsuan
> _______________________________________________
> Scons-users mailing list
> [email protected]
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>

_______________________________________________
Scons-users mailing list
[email protected]
https://pairlist4.pair.net/mailman/listinfo/scons-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.