lf-lang / lingua-franca

Intuitive concurrent programming in any language
https://www.lf-lang.org
Other
234 stars 62 forks source link

Unable to build or flash examples in lf-zephyr #2329

Closed the-systematic-chaos closed 3 months ago

the-systematic-chaos commented 3 months ago

System: Ubuntu 22.04.4 LFC version: lfc 0.5.2-SNAPSHOT Board: nrf52dk_nrf52832

I tried to build the lf-zephyr apps as shown in https://www.lf-lang.org/docs/embedded/zephyr/ , I am facing an error with the following message:

[154/159] Linking C executable zephyr/zephyr_pre0.elf                           
FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map /home/aditya/lf-zephyr-workspace/apps/NrfBlinky/build/zephyr/zephyr_pre0.map
: && ccache /home/aditya/zephyr-sdk-0.16.8/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc -O3 -DNDEBUG -gdwarf-4 zephyr/CMakeFiles/zephyr_pre0.dir/misc/empty_file.c.obj -o zephyr/zephyr_pre0.elf  zephyr/CMakeFiles/offsets.dir/./arch/arm/core/offsets/offsets.c.obj  -fuse-ld=bfd  -T  zephyr/linker_zephyr_pre0.cmd  -Wl,-Map=/home/aditya/lf-zephyr-workspace/apps/NrfBlinky/build/zephyr/zephyr_pre0.map  -Wl,--whole-archive  app/libapp.a  zephyr/libzephyr.a  zephyr/arch/common/libarch__common.a  zephyr/arch/arch/arm/core/libarch__arm__core.a  zephyr/arch/arch/arm/core/cortex_m/libarch__arm__core__cortex_m.a  zephyr/arch/arch/arm/core/mpu/libarch__arm__core__mpu.a  zephyr/lib/libc/newlib/liblib__libc__newlib.a  zephyr/lib/libc/common/liblib__libc__common.a  zephyr/soc/soc/arm/common/cortex_m/libsoc__arm__common__cortex_m.a  zephyr/soc/soc/arm/nordic_nrf/nrf52/libsoc__arm__nordic_nrf__nrf52.a  zephyr/drivers/clock_control/libdrivers__clock_control.a  zephyr/drivers/console/libdrivers__console.a  zephyr/drivers/counter/libdrivers__counter.a  zephyr/drivers/gpio/libdrivers__gpio.a  zephyr/drivers/pinctrl/libdrivers__pinctrl.a  zephyr/drivers/serial/libdrivers__serial.a  zephyr/drivers/timer/libdrivers__timer.a  modules/hal_nordic/nrfx/libmodules__hal_nordic__nrfx.a  modules/segger/libmodules__segger.a  -Wl,--no-whole-archive  zephyr/kernel/libkernel.a  -L"/home/aditya/zephyr-sdk-0.16.8/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/thumb/v7e-m/nofp"  -L/home/aditya/lf-zephyr-workspace/apps/NrfBlinky/build/zephyr  -lgcc  core/libcore.a  zephyr/kernel/libkernel.a  zephyr/arch/common/libisr_tables.a  -mcpu=cortex-m4  -mthumb  -mabi=aapcs  -mfp16-format=ieee  -Wl,--gc-sections  -Wl,--build-id=none  -Wl,--sort-common=descending  -Wl,--sort-section=alignment  -Wl,-u,_OffsetAbsSyms  -Wl,-u,_ConfigAbsSyms  -nostdlib  -static  -Wl,-X  -Wl,-N  -Wl,--orphan-handling=warn  -Wl,-no-pie  -lm  -Wl,-lc  -L"/home/aditya/zephyr-sdk-0.16.8/arm-zephyr-eabi/arm-zephyr-eabi"/lib/thumb/v7e-m/nofp  -u_printf_float  -Wl,-lgcc  -lc && cd /home/aditya/lf-zephyr-workspace/apps/NrfBlinky/build/zephyr && /usr/bin/cmake -E true
/home/aditya/zephyr-sdk-0.16.8/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: app/libapp.a(NrfBlinky.c.obj): in function `main':
/home/aditya/lf-zephyr-workspace/apps/NrfBlinky/src-gen/NrfBlinky/NrfBlinky.c:17: undefined reference to `lf_reactor_c_main'
collect2: error: ld returned 1 exit status                                      
ninja: build stopped: subcommand failed.                                        
FATAL ERROR: command exited with status 1: /usr/bin/cmake --build /home/aditya/lf-zephyr-workspace/apps/NrfBlinky/build

I am attaching the complete log below, since a few warnings pertaining to the single-threaded target property, return type of main and an unused variable are also present. I am using the nRF52-DK board.

lf-zephyr-log.txt

hokeun commented 3 months ago

@the-systematic-chaos Could you try to release 0.7.0 which is the version supported by the documentation he links to? This is the suggestion by @erlingrj

the-systematic-chaos commented 3 months ago

Sure, I will try with that release version.

the-systematic-chaos commented 3 months ago

Closing the issue, the error was the wrong lfc version. 0.7.2 was the intended version for the documentation.