Lora-net / sx1302_hal

SX1302/SX1303 Hardware Abstraction Layer and Tools (packet forwarder...)
Other
219 stars 272 forks source link

Building issue #62

Closed joelguittet closed 2 years ago

joelguittet commented 2 years ago

Hello

Just following the README to build the project, just after cloning:

ubuntu@ubuntu-VirtualBox:~/sx1302_hal$ make all
make all -e -C libtools
make[1]: Entering directory '/home/ubuntu/sx1302_hal/libtools'
arm-poky-linux-gnueabi-gcc  -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 -fstack-protector-strong  -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/opt/poky/3.1.10/sysroots/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi -c  -O2 -pipe -g -feliminate-unused-debug-types  src/tinymt32.c -o obj/tinymt32.o
src/tinymt32.c:16:10: fatal error: tinymt32.h: No such file or directory
   16 | #include "tinymt32.h"
      |          ^~~~~~~~~~~~
compilation terminated.
make[1]: *** [Makefile:33: obj/tinymt32.o] Error 1
make[1]: Leaving directory '/home/ubuntu/sx1302_hal/libtools'
make: *** [Makefile:14: libtools] Error 2

Seems the libtoools\inc directory is not included ?

Joel

EDIT: make command below to pass over the issue:

make CFLAGS+="-Iinc -I../libtools/inc"

Clearly a problem with Makefiles...

mcoracin commented 2 years ago

Hello, libtools/inc is alredy included in the makefile: https://github.com/Lora-net/sx1302_hal/blob/4b42025d1751e04632c0b04160e0d29dbbb222a5/libloragw/Makefile#L14

I'm not able to reproduce your building issue, testing with Raspberry Pi toolchain, native ubuntu gcc, or even Poky...

joelguittet commented 2 years ago

Hello,

Thanks for the answer. Yes I notice that but not working anyway on my side.

My environnement is a Yocto toolchain, dunfell release. Target is a raspberry pi compute module. GCC version in the toolchain is 9.3.0.

What is your environment ?

I have used the above command to build the packet forwarder and I have CFLAGS += "-Iinc -I../libtools/inc" in my bitbake recipe. Else this fails with the above error.

Anyone else having the issue ?

Joel

mcoracin commented 2 years ago

I usually test on a RPi (v3 or v4) using the cross compilation toolchain from here: https://github.com/raspberrypi/tools

I also tried to compile with the gcc installed on my ubuntu machine, and with another cross-compilation toolchain (Yocto I think) that I have installed for a specific gateway vendor.

I could not see the issue in all 3 cases.

But that doesn't mean that there is no issue in our Makefile. ;)

joelguittet commented 2 years ago

@mcoracin yes sure! I have checked the Makefile myself and don't see what to change... So it's difficult to try solving something.

If the problem is not general, then no worries, I arrange myself with my config. You can do whatever you want with this issue.

Joel

mcoracin commented 2 years ago

@joelguittet As I never had such feedback and I'm unable to reproduce it, I'll close this issue for now. And re-open if the issue is confirmed later. Best regards