Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined reference to `gem5::GshareBPParams::create() const #1

Open
akhil-deshneni opened this issue Oct 21, 2023 · 6 comments
Open

Comments

@akhil-deshneni
Copy link

I have followed the instructions laid out in readme and while reconstructing the source using scons getting the below error:

/usr/bin/ld: build/X86/python/_m5/param_GshareBP.o: in function void pybind11::cpp_function::initialize<pybind11::cpp_function::initialize<gem5::branch_prediction::GshareBP*, gem5::GshareBPParams, , pybind11::name, pybind11::is_method, pybind11::sibling>(gem5::branch_prediction::GshareBP* (gem5::GshareBPParams::*)() const, pybind11::name const&, pybind11::is_method const&, pybind11::sibling const&)::{lambda(gem5::GshareBPParams const*)#1}, gem5::branch_prediction::GshareBP*, gem5::GshareBPParams const*, pybind11::name, pybind11::is_method, pybind11::sibling>(pybind11::cpp_function::initialize<gem5::branch_prediction::GshareBP*, gem5::GshareBPParams, , pybind11::name, pybind11::is_method, pybind11::sibling>(gem5::branch_prediction::GshareBP* (gem5::GshareBPParams::*)() const, pybind11::name const&, pybind11::is_method const&, pybind11::sibling const&)::{lambda(gem5::GshareBPParams const*)#1}&&, gem5::branch_prediction::GshareBP* (*)(gem5::GshareBPParams const*), pybind11::name const&, pybind11::is_method const&, pybind11::sibling const&)': /home/akhil/gem_5/gem5/ext/pybind11/include/pybind11/pybind11.h:223: undefined reference to gem5::GshareBPParams::create() const'
collect2: error: ld returned 1 exit status
scons: *** [build/X86/gem5.opt] Error 1
scons: building terminated because of errors.

@akhil-deshneni
Copy link
Author

akhil-deshneni commented Oct 21, 2023

How to resolve this issue any insights are highly appreciated

@chnjstyj
Copy link

I modified the gshare.cc & gshare.hh by changing

void update(ThreadID tid, Addr branch_addr, bool taken, void *bp_history, bool squashed);

to

void update(ThreadID tid, Addr branch_addr, bool taken, void *bp_history, bool squashed, const StaticInstPtr &inst, Addr corrTarget);
in .hh .
At the same time modify the function signatures in .cc
After that ran scons command to rebuild the gem5 and got successful result.

@baul-iisc
Copy link

I modified the gshare.cc & gshare.hh by changing

void update(ThreadID tid, Addr branch_addr, bool taken, void *bp_history, bool squashed);

to

void update(ThreadID tid, Addr branch_addr, bool taken, void *bp_history, bool squashed, const StaticInstPtr &inst, Addr corrTarget); in .hh . At the same time modify the function signatures in .cc After that ran scons command to rebuild the gem5 and got successful result.

With the above corrections also, the same error is repeating, please suggest how to address the following errors, [ LINK] -> RISCV/gem5.opt
/usr/bin/ld: build/RISCV/python/_m5/param_GshareBP.o: in function void pybind11::cpp_function::initialize<pybind11::cpp_function::initialize<gem5::branch_prediction::GshareBP*, gem5::GshareBPParams, , pybind11::name, pybind11::is_method, pybind11::sibling>(gem5::branch_prediction::GshareBP* (gem5::GshareBPParams::*)() const, pybind11::name const&, pybind11::is_method const&, pybind11::sibling const&)::{lambda(gem5::GshareBPParams const*)#1}, gem5::branch_prediction::GshareBP*, gem5::GshareBPParams const*, pybind11::name, pybind11::is_method, pybind11::sibling>(pybind11::cpp_function::initialize<gem5::branch_prediction::GshareBP*, gem5::GshareBPParams, , pybind11::name, pybind11::is_method, pybind11::sibling>(gem5::branch_prediction::GshareBP* (gem5::GshareBPParams::*)() const, pybind11::name const&, pybind11::is_method const&, pybind11::sibling const&)::{lambda(gem5::GshareBPParams const*)#1}&&, gem5::branch_prediction::GshareBP* (*)(gem5::GshareBPParams const*), pybind11::name const&, pybind11::is_method const&, pybind11::sibling const&)': /development/gem5-riscv/gem5/ext/pybind11/include/pybind11/pybind11.h:223: undefined reference to gem5::GshareBPParams::create() const'
collect2: error: ld returned 1 exit status
scons: *** [build/RISCV/gem5.opt] Error 1
scons: building terminated because of errors.

@baul-iisc
Copy link

I have followed the instructions laid out in readme and while reconstructing the source using scons getting the below error:

/usr/bin/ld: build/X86/python/_m5/param_GshareBP.o: in function void pybind11::cpp_function::initialize<pybind11::cpp_function::initialize<gem5::branch_prediction::GshareBP*, gem5::GshareBPParams, , pybind11::name, pybind11::is_method, pybind11::sibling>(gem5::branch_prediction::GshareBP* (gem5::GshareBPParams::*)() const, pybind11::name const&, pybind11::is_method const&, pybind11::sibling const&)::{lambda(gem5::GshareBPParams const*)#1}, gem5::branch_prediction::GshareBP*, gem5::GshareBPParams const*, pybind11::name, pybind11::is_method, pybind11::sibling>(pybind11::cpp_function::initialize<gem5::branch_prediction::GshareBP*, gem5::GshareBPParams, , pybind11::name, pybind11::is_method, pybind11::sibling>(gem5::branch_prediction::GshareBP* (gem5::GshareBPParams::*)() const, pybind11::name const&, pybind11::is_method const&, pybind11::sibling const&)::{lambda(gem5::GshareBPParams const*)#1}&&, gem5::branch_prediction::GshareBP* (*)(gem5::GshareBPParams const*), pybind11::name const&, pybind11::is_method const&, pybind11::sibling const&)': /home/akhil/gem_5/gem5/ext/pybind11/include/pybind11/pybind11.h:223: undefined reference to gem5::GshareBPParams::create() const' collect2: error: ld returned 1 exit status scons: *** [build/X86/gem5.opt] Error 1 scons: building terminated because of errors.

Hay! are you able to resolve this issue? if so please suggest the correction required!

@chnjstyj
Copy link

I modified the gshare.cc & gshare.hh by changing
void update(ThreadID tid, Addr branch_addr, bool taken, void *bp_history, bool squashed);
to
void update(ThreadID tid, Addr branch_addr, bool taken, void *bp_history, bool squashed, const StaticInstPtr &inst, Addr corrTarget); in .hh . At the same time modify the function signatures in .cc After that ran scons command to rebuild the gem5 and got successful result.

With the above corrections also, the same error is repeating, please suggest how to address the following errors, [ LINK] -> RISCV/gem5.opt /usr/bin/ld: build/RISCV/python/_m5/param_GshareBP.o: in function void pybind11::cpp_function::initialize<pybind11::cpp_function::initialize<gem5::branch_prediction::GshareBP*, gem5::GshareBPParams, , pybind11::name, pybind11::is_method, pybind11::sibling>(gem5::branch_prediction::GshareBP* (gem5::GshareBPParams::*)() const, pybind11::name const&, pybind11::is_method const&, pybind11::sibling const&)::{lambda(gem5::GshareBPParams const*)#1}, gem5::branch_prediction::GshareBP*, gem5::GshareBPParams const*, pybind11::name, pybind11::is_method, pybind11::sibling>(pybind11::cpp_function::initialize<gem5::branch_prediction::GshareBP*, gem5::GshareBPParams, , pybind11::name, pybind11::is_method, pybind11::sibling>(gem5::branch_prediction::GshareBP* (gem5::GshareBPParams::*)() const, pybind11::name const&, pybind11::is_method const&, pybind11::sibling const&)::{lambda(gem5::GshareBPParams const*)#1}&&, gem5::branch_prediction::GshareBP* (*)(gem5::GshareBPParams const*), pybind11::name const&, pybind11::is_method const&, pybind11::sibling const&)': /development/gem5-riscv/gem5/ext/pybind11/include/pybind11/pybind11.h:223: undefined reference to gem5::GshareBPParams::create() const' collect2: error: ld returned 1 exit status scons: *** [build/RISCV/gem5.opt] Error 1 scons: building terminated because of errors.

I guess the problem is some functions' signature in source code is different from the newest gem5 predictor. You can check it with your own gem5 example predictor function signature and fix the differences.

@amunlau
Copy link

amunlau commented Dec 12, 2024

I modified the gshare.cc & gshare.hh by changing

void update(ThreadID tid, Addr branch_addr, bool taken, void *bp_history, bool squashed);

to

void update(ThreadID tid, Addr branch_addr, bool taken, void *bp_history, bool squashed, const StaticInstPtr &inst, Addr corrTarget); in .hh . At the same time modify the function signatures in .cc After that ran scons command to rebuild the gem5 and got successful result.

The issue of "undefined reference to gem5::GshareBPParams::create() const" still hasn't been resolved. Has anyone found a solution? I would appreciate it if you could share the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants