BabbleSim / native_simulator

Native simulator
22 stars 1 forks source link

Unclear build procedure #1

Closed gl-yziquel closed 5 months ago

gl-yziquel commented 8 months ago

Hi.

I just tried to build your code as it claimed to be an alternative to QEMU.

I'm afraid the build instructions are a bit unclear. For the record, I had to install the gcc-multilib ubuntu package to have make runner_lib succeed in building runner.a, but make all fails at the linking phase. As follows.

Some documentation would thus be helpful.

mini-me@virtucon ~/h/c/native_simulator (main)> make all
/usr/bin/ld: /home/mini-me/home/cellar/native_simulator/_build/runner.a(main.o): in function `nsi_init':
/home/mini-me/home/cellar/native_simulator/common/src/main.c:73: undefined reference to `nsi_handle_cmd_line'
/usr/bin/ld: /home/mini-me/home/cellar/native_simulator/_build/runner.a(nsi_trace_varg.o): in function `nsi_print_error_and_exit':
/home/mini-me/home/cellar/native_simulator/common/src/nsi_trace_varg.c:15: undefined reference to `nsi_vprint_error_and_exit'
/usr/bin/ld: /home/mini-me/home/cellar/native_simulator/_build/runner.a(nsi_trace_varg.o): in function `nsi_print_warning':
/home/mini-me/home/cellar/native_simulator/common/src/nsi_trace_varg.c:24: undefined reference to `nsi_vprint_warning'
/usr/bin/ld: /home/mini-me/home/cellar/native_simulator/_build/runner.a(nsi_trace_varg.o): in function `nsi_print_trace':
/home/mini-me/home/cellar/native_simulator/common/src/nsi_trace_varg.c:33: undefined reference to `nsi_vprint_trace'
collect2: error: ld returned 1 exit status
make: *** [Makefile:131: /home/mini-me/home/cellar/native_simulator/_build/native_simulator.exe] Error 1
aescolar commented 8 months ago

Hi @gl-yziquel in what context are you trying to build it? Are you a Zephyr users who wants to use its native_sim target? Or are you trying to get some other embedded OS or some baremetal embedded SW running on it?

What you see there is that the runner lacks some functionality. One plain-vanilla version of that functionality can be enabled by setting NSI_NATIVE=1, so for example calling make like NSI_NATIVE=1 make all. With that you will get a "working" executable but without any embedded SW to run.

gl-yziquel commented 7 months ago

I came to it through Zephyr, but I want to dabble in embedded systems kind of out of a personal kink. I've got a toy personal os doing almost nothing, and I'm kind of toying around with the various techs.

I hope to come back to native_simulator as soon as I find more time.

aescolar commented 5 months ago

Closing as answered.