[Scons-users] Force scons to use local libraries over system libraries

Bill Deegan bill at baddogconsulting.com
Sat Aug 29 11:16:12 EDT 2020


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 暗黑聖飢魔 <kugwa2000 at gmail.com> 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
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20200829/80e22935/attachment.html>


More information about the Scons-users mailing list