FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14455 questions

17168 answers

28195 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
409 views 7 comments
by anonymous

Hi all,

I am following the guide to build the teltonika image, so I installed the dependencies, I run make menuconfig, I select "qualcomm atheros ipq40xx" as target system and "TELTONIKA RUTX" for target profile. The operation runs until it tries to build logread, when I get missing dependenciy on sqlite3 with message:

Scanning dependencies of target logread

make[7]: Leaving directory '/build_mnt/teltonika_02_06/openwrt-gpl-ipq40xx-generic.Linux-x86_64/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/ubox-2019-06-16-4df34a4d'

make -f CMakeFiles/logread.dir/build.make CMakeFiles/logread.dir/build

make[7]: Entering directory '/build_mnt/teltonika_02_06/openwrt-gpl-ipq40xx-generic.Linux-x86_64/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/ubox-2019-06-16-4df34a4d'

[  5%] Building C object CMakeFiles/logread.dir/log/logread.c.o

/build_mnt/teltonika_02_06/openwrt-gpl-ipq40xx-generic.Linux-x86_64/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/arm-openwrt-linux-muslgnueabi-gcc   -Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard -iremap/build_mnt/teltonika_02_06/openwrt-gpl-ipq40xx-generic.Linux-x86_64/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/ubox-2019-06-16-4df34a4d:ubox-2019-06-16-4df34a4d -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro  -DRUTX_PLATFORM=1 -DTLT_PLATFORM_NAME=RUTX -DNDEBUG   -Os -ggdb -Wall -Werror --std=gnu99 -Wmissing-declarations -o CMakeFiles/logread.dir/log/logread.c.o   -c /build_mnt/teltonika_02_06/openwrt-gpl-ipq40xx-generic.Linux-x86_64/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/ubox-2019-06-16-4df34a4d/log/logread.c

[ 11%] Building C object CMakeFiles/logread.dir/log/logdb.c.o

/build_mnt/teltonika_02_06/openwrt-gpl-ipq40xx-generic.Linux-x86_64/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.5.0_musl_eabi/bin/arm-openwrt-linux-muslgnueabi-gcc   -Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard -iremap/build_mnt/teltonika_02_06/openwrt-gpl-ipq40xx-generic.Linux-x86_64/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/ubox-2019-06-16-4df34a4d:ubox-2019-06-16-4df34a4d -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro  -DRUTX_PLATFORM=1 -DTLT_PLATFORM_NAME=RUTX -DNDEBUG   -Os -ggdb -Wall -Werror --std=gnu99 -Wmissing-declarations -o CMakeFiles/logread.dir/log/logdb.c.o   -c /build_mnt/teltonika_02_06/openwrt-gpl-ipq40xx-generic.Linux-x86_64/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/ubox-2019-06-16-4df34a4d/log/logdb.c

/build_mnt/teltonika_02_06/openwrt-gpl-ipq40xx-generic.Linux-x86_64/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/ubox-2019-06-16-4df34a4d/log/logdb.c:7:10: fatal error: sqlite3.h: No such file or directory

 #include <sqlite3.h>

          ^~~~~~~~~~~

How comes this dependency is missing from the build directory? Any workaround?
Thanks,
S

1 Answer

+1 vote
by anonymous

Hello,

No issue for me. Could you check your .config:

[openwrt-gpl-ipq40xx-generic.Linux-x86_64-02.06]$ grep -i sqlite3 .config
CONFIG_PACKAGE_lsqlite3=y
# CONFIG_PACKAGE_python-sqlite3 is not set
# CONFIG_PACKAGE_python-sqlite3-src is not set
# CONFIG_PACKAGE_python3-sqlite3 is not set
# CONFIG_PACKAGE_python3-sqlite3-src is not set
CONFIG_PACKAGE_libsqlite3=y
CONFIG_SQLITE3_DYNAMIC_EXTENSIONS=y
CONFIG_SQLITE3_FTS3=y
CONFIG_SQLITE3_FTS4=y
CONFIG_SQLITE3_FTS5=y
CONFIG_SQLITE3_JSON1=y
CONFIG_SQLITE3_RTREE=y
# CONFIG_SQLITE3_SESSION is not set
# CONFIG_PACKAGE_sqlite3-cli is not set
Regards,
Best answer
by anonymous

Hi,

Thanks for coming back to me, it seems fine, but I don't get all the optiond u get for JSON , FTS3 and RTREE, is that a problem? What should I select? This is my output:

/build_mnt/teltonika_02_06/openwrt-gpl-ipq40xx-generic.Linux-x86_64$ grep -i sqlite3 .config

CONFIG_PACKAGE_lsqlite3=y

# CONFIG_PACKAGE_luasql-sqlite3 is not set

# CONFIG_PACKAGE_python-sqlite3 is not set

# CONFIG_PACKAGE_python-sqlite3-src is not set

# CONFIG_PACKAGE_python3-sqlite3 is not set

# CONFIG_PACKAGE_python3-sqlite3-src is not set

CONFIG_PACKAGE_libsqlite3=y

# CONFIG_PACKAGE_sqlite3-cli is not set

I also see the package makefile, but differently from is written in the docs, I need to download and install the feeds otherwise I can't see that information. I can also see the Makefile in package (after I download the feeds).I try to build specifically "qualcomm atheros ipq40xx" as target system and "TELTONIKA RUTX" option. I am doing a parallel build with 3 cpus on a debian 10 machine. Problem still is valid. 

Thanks,

S

by anonymous
Hello,

The SDK ships with a default .config which already has the correct target+profile you don't need to select anything in make menuconfig, and the compilation goes straight without errors. You can change options/add other feeds later.

However I have found a minor issue, there is three .o files (conf.o mconf.o zconf.tab.o) and two executables (conf mconf) in scripts/config, they are compiled with a gcc incompatible with mine I delete them all immediately after unpacking the SDK.

I'll send a ticket for this point later.

Regards,
by anonymous

Hi,

Ok, thank you I appreciate, also I'd like to flag something else. I tried to build with 1 core only so my steps have been:

1 -  ./scripts/feeds update -a

2 -  ./scripts/feeds install -a

3 - make menuconfig and select the "qualcomm atheros ipq40xx" and "TELTONIKA RUTX"

4 - Run make

I get a totally different error: 

gresource-tool.c:32:10: fatal error: libelf.h: No such file or directory

 #include <libelf.h>

          ^~~~~~~~~~

compilation terminated.

make[9]: *** [Makefile:4219: gresource-gresource-tool.o] Error 1

It seems another dependency is missing and if we build with different number of cores the error changes. I will try to rebuild without steps 1,2,3 and see what happens following your advice.

Thanks,

S

by anonymous

Hello,

[openwrt-gpl-ipq40xx-generic.Linux-x86_64-02.06]$ find . -name 'libelf.h' -print
./staging_dir/host/include/libelf/libelf.h
./staging_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/usr/include/libelf.h
./build_dir/host/libelf-0.8.13/lib/libelf.h
./build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/elfutils-0.177/libelf/libelf.h
./build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/elfutils-0.177/ipkg-install/usr/include/libelf.h
Maybe you should restart with a clean install:
 untar the SDK
 remove the five files mentioned above from scripts/config
 make menuconfig -- don't change anything
 make 
Regards,
by anonymous
Hi, I tried various experiment and combination below all the test cases:

COMPILER => gcc 8.3

OS= DEBIAN10 VM

SDK version = 00.02.06.1 for RUTX09

I didn't download any feed neither I changed menuconfig as you suggested, these are the outcomes:

- Building using single core (make) from scratch (from zip file) -> ok

- Rebuild 1 core no distclean command (dirty environment) -> ok

- Rebuild 3 cores no distclean command from previous build with 1 core-> ok

- Building 3 cores from scratch -> ok

- Rebuild 3 cores no distclean command from previous build with 3 core-> ok

The problem arises when you build the first time, no matter if you use a single or multiple cores, than you issue "make distclean" command. In this case the environement is not completely clean and you get the sqlite3 error.

I tried to remove those files as you suggested, this didn't solve the issue, mconf.o or mconf don't exist in the package. I guess distclean doesn't clean everything which should be clean.

Thanks,

S
by anonymous

Hello,

The mconf.o mconf etc issue is compiler/glibc-specific I use centos7/devtoolset-9 so my libc.so doesn't have GLIBC_2.27. Your mileage may vary. From the tar archive:

[openwrt-gpl-ipq40xx-generic.Linux-x86_64-02.06]$ tar tvfz ../Downloads/RUTX_R_GPL_00.02.06.tar.gz | grep mconf.o

-rw-r--r-- eimis/users   35160 2020-11-05 14:45 openwrt-gpl-ipq40xx-generic.Linux-x86_64/scripts/config/mconf.o

The SDK is not a raw OpenWRT distribution, "make distclean" appears to be overzealous here it removes a lot of important files including the .config etc you'll have to be very careful when rebuilding the image. AFAIK "make clean" appears to be good enough if you make a serious mistake and want to do an almost-full rebuild without having to regenerate the gcc cross-compiler and all the other tools.

Hope that helps.

Regards,

by anonymous

Thanks, I won't use distclean than. I still don't get why I ca't get that files, they are not in the zip file in the Teltonika page, the version I am running is r11208-ce6496d796.