Thanks Nate. I just added env.Append(LIBS=['bz2']) to my SConscript
and it works like charm now. Thank you for your quick reply.

Regards
James Wang


On Fri, Jun 19, 2009 at 10:37 AM, nathan binkert<[email protected]> wrote:
> You're right.  You need to tell SCons to link with the bzip2 library.
> Check out how we get libz in the SConstruct file and do the same sort
> of thing for libbz2.
>
> The interesting thing is that python generally is built with bzip2
> support, so I'd think that normally you wouldn't need to link against
> it because the python library would have it, but maybe not all
> installations provide bz2.  Anyway, it should be easy.
>
>  Nate
>
> On Fri, Jun 19, 2009 at 10:01 AM, Cong Wang <[email protected]> wrote:
>>
>> Hi All:
>>    I am trying to open and then read a bzip file in one of the simple
>> cpu models. I manage to get the code to get pass the compile stage but
>> it stops and complains that there is a linking error. I didn't add
>> anything in the SConscript for bzip, I suspect that I should have, but
>> I am not sure what I should add in the SConscript. Any suggestions?
>>
>>    The error I get is the following:
>> build/ALPHA_SE/cpu/timingtracecpu/timing_trace.do: In function
>> `BZ2_bzgets(void*, char*, int)':
>> /proj/radl_rtl/users/conwang/m5/build/ALPHA_SE/cpu/timingtracecpu/timing_trace.cc:856:
>> undefined reference to `BZ2_bzread'
>> build/ALPHA_SE/cpu/timingtracecpu/timing_trace.do: In function
>> `TimingTraceCPU::fetch()':
>> /proj/radl_rtl/users/conwang/m5/build/ALPHA_SE/cpu/timingtracecpu/timing_trace.cc:450:
>> undefined reference to `BZ2_bzopen'
>> collect2: ld returned 1 exit status
>> scons: *** [build/ALPHA_SE/m5.debug] Error 1
>> scons: building terminated because of errors.
>>
>>    Thanks in advance for any suggestion.
>>
>> --
>> Regards
>> James Wang
>> _______________________________________________
>> m5-dev mailing list
>> [email protected]
>> http://m5sim.org/mailman/listinfo/m5-dev
>>
> _______________________________________________
> m5-dev mailing list
> [email protected]
> http://m5sim.org/mailman/listinfo/m5-dev
>



-- 
Regards
James Wang
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to