how to use sqlite in omap l138.
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi,
You have to cross compile the "sqlite" libraries using arm arago toolchain,
some what like this,
1) cd sqlite
2) ./configure --prefix=/target/rootfs --host=arm-arago-linux-gnueabi
3) make
4) make install
Hi Thangameena,
In general, if you would like to run some third party software package on processor target boards, first check what are all the list of processor architectures that the package supports. If ARM architecture is supported, in the package itself they would have given usage steps including cross compiling/porting/building and executing e.t.c.,
Not sure whether it was attempted earlier by TI people. But you can give it a try.
Please share your results if you attempt to do!.
Regards,
Shankari.
-------------------------------------------------------------------------------------------------------
Please click the Verify Answer button on this post if it answers your question.
--------------------------------------------------------------------------------------------------------
i done all these.. but when i execute .. error occur binary file cannot execure
Hi,
i done all these.. but when i execute .. error occur binary file cannot execure
It seems that you compiled for wrong platform and it is not ARM builded,
To check your builded binary,
ubuntu-host/sqlite$
ubuntu-host$ file sqlite
Ex:
1)
titus@titus-desktop:~/Desktop/C$ file a.out
a.out: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped
2)
titus@titus-desktop:~/Desktop/C$ file a.out
a.out: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=0xecb3f851a2b2f387b6d7f6a6c3f7a76bb9e9769f, not stripped
So, Please ensure that you have cross compiled properly,
Can you please share your procedures for cross compilation that you have followed,
i guess that i done mistake in the configure because if i give make . i get error.. so explain me how to use ./configure
i checked my executable file using file a.out command .. it results same as first one
32-bit LSB executable, ARM, version 1.......
i am using sqlite-autoconf-3070500.tar.gz..
to link with omap l138 sdk
./configure --target=arm CC=/home/l138/ti-sdk/linux-devkit/bin/arm-arago-linux-gnueabi-gcc --disable-tcl --host=arm-arago-linux-gnueabi --prefix=/sqlite-autoconf-3070500/build
after this if i give sudo make i get error as
./libtool: line 5969: arm-arago-linux-gnueabi-ar: command not found
make: *** [libsqlite3.la] Error 127
Hi,
I'm able to build "sqlite3" for my OMAPL138 LCDk board,
Config:
sudo su
1)
./configure --exec-prefix=/usr/local/filesystem_omapl138/ --host=arm --target=arm CC=arm-arago-linux-gnueabi-gcc AR=arm-arago-linux-gnueabi-ar STRIP=arm-arago-linux-gnueabi-strip RANLIB=arm-arago-linux-gnueabi-ranlib CFLAGS="-Os"
OR
2)
./configure --exec-prefix=/usr/local/filesystem_omapl138/ --host=arm --target=arm CC=arm_v5t_le-gcc AR=arm_v5t_le-ar STRIP=arm_v5t_le-strip RANLIB=arm_v5t_le-ranlib CFLAGS="-Os"
i executed ur configuration after that i done sudo make..
no error occured..
thank u....
next i done sudo make install.. from this i need to get bin,lib, include directory in my prefix path.
but i didnt get..
test -z "/sqlite-autoconf-3070500/build/bin" || mkdir -p -- "/sqlite-autoconf-3070500/build/bin"
/bin/bash ./libtool --mode=install /usr/bin/install -c 'sqlite3' '/sqlite-autoconf-3070500/build/bin/sqlite3'
/usr/bin/install -c sqlite3 /sqlite-autoconf-3070500/build/bin/sqlite3
test -z "/usr/local/include" || mkdir -p -- "/usr/local/include"
/usr/bin/install -c -m 644 'sqlite3.h' '/usr/local/include/sqlite3.h'
/usr/bin/install -c -m 644 'sqlite3ext.h' '/usr/local/include/sqlite3ext.h'
test -z "/usr/local/share/man/man1" || mkdir -p -- "/usr/local/share/man/man1"
/usr/bin/install -c -m 644 './sqlite3.1' '/usr/local/share/man/man1/sqlite3.1'
test -z "/sqlite-autoconf-3070500/build/lib/pkgconfig" || mkdir -p -- "/sqlite-autoconf-3070500/build/lib/pkgconfig"
/usr/bin/install -c -m 644 'sqlite3.pc' '/sqlite-autoconf-3070500/build/lib/pkgconfig/sqlite3.pc'
make[1]: Leaving directory `/home/marudham/omap2/sqlite-autoconf-3070500'
this is my output after make install.
Hi,
PFA of logs,
Use "sudo su" command for full root and not simple "sudo <commands>"
root@titus:~/Titus_Linux_Backup/ti-e2e/sqlite-autoconf-3080403# ./configure --exec-prefix=/usr/local/filesystem_omapl138/ --host=arm --target=arm CC=arm_v5t_le-gcc AR=arm_v5t_le-ar STRIP=arm_v5t_le-strip RANLIB=arm_v5t_le-ranlib CFLAGS="-Os" checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for arm-strip... arm_v5t_le-strip checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for style of include used by make... GNU checking for arm-gcc... arm_v5t_le-gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... yes checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether arm_v5t_le-gcc accepts -g... yes checking for arm_v5t_le-gcc option to accept ISO C89... none needed checking dependency style of arm_v5t_le-gcc... gcc3 checking for special C compiler options needed for large files... no checking for _FILE_OFFSET_BITS value needed for large files... 64 checking for arm-gcc... (cached) arm_v5t_le-gcc checking whether we are using the GNU C compiler... (cached) yes checking whether arm_v5t_le-gcc accepts -g... (cached) yes checking for arm_v5t_le-gcc option to accept ISO C89... (cached) none needed checking dependency style of arm_v5t_le-gcc... (cached) gcc3 checking for arm-ranlib... arm_v5t_le-ranlib checking build system type... i686-pc-linux-gnu checking host system type... arm-unknown-none checking how to print strings... printf checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for fgrep... /bin/grep -F checking for ld used by arm_v5t_le-gcc... /usr/local/montavista/pro/devkit/arm/v5t_le/armv5tl-montavista-linux-gnueabi/bin/ld checking if the linker (/usr/local/montavista/pro/devkit/arm/v5t_le/armv5tl-montavista-linux-gnueabi/bin/ld) is GNU ld... yes checking for BSD- or MS-compatible name lister (nm)... no checking for arm-dumpbin... no checking for arm-link... no checking for dumpbin... no checking for link... link -dump configure: WARNING: using cross tools not prefixed with host triplet checking the name lister (nm) interface... BSD nm checking whether ln -s works... yes checking the maximum length of command line arguments... 1572864 checking whether the shell understands some XSI constructs... yes checking whether the shell understands "+="... yes checking how to convert i686-pc-linux-gnu file names to arm-unknown-none format... func_convert_file_noop checking how to convert i686-pc-linux-gnu file names to toolchain format... func_convert_file_noop checking for /usr/local/montavista/pro/devkit/arm/v5t_le/armv5tl-montavista-linux-gnueabi/bin/ld option to reload object files... -r checking for arm-objdump... no checking for objdump... objdump checking how to recognize dependent libraries... unknown checking for arm-dlltool... no checking for dlltool... no checking how to associate runtime and link libraries... printf %s\n checking for arm-ar... arm_v5t_le-ar checking for archiver @FILE support... @ checking for arm-strip... (cached) arm_v5t_le-strip checking for arm-ranlib... (cached) arm_v5t_le-ranlib checking command to parse nm output from arm_v5t_le-gcc object... ok checking for sysroot... no checking for arm-mt... no checking for mt... mt checking if mt is a manifest tool... no checking how to run the C preprocessor... arm_v5t_le-gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for dlfcn.h... yes checking for objdir... .libs checking if arm_v5t_le-gcc supports -fno-rtti -fno-exceptions... no checking for arm_v5t_le-gcc option to produce PIC... -fPIC -DPIC checking if arm_v5t_le-gcc PIC flag -fPIC -DPIC works... yes checking if arm_v5t_le-gcc static flag -static works... yes checking if arm_v5t_le-gcc supports -c -o file.o... yes checking if arm_v5t_le-gcc supports -c -o file.o... (cached) yes checking whether the arm_v5t_le-gcc linker (/usr/local/montavista/pro/devkit/arm/v5t_le/armv5tl-montavista-linux-gnueabi/bin/ld) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... no checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... no checking whether to build shared libraries... no checking whether to build static libraries... yes checking for fdatasync... yes checking for usleep... yes checking for fullfsync... no checking for localtime_r... yes checking for gmtime_r... yes checking whether strerror_r is declared... yes checking for strerror_r... yes checking whether strerror_r returns char *... no checking for library containing tgetent... -lcurses checking for library containing readline... -lreadline checking for readline... yes checking for library containing pthread_create... -lpthread checking for library containing dlopen... -ldl checking for whether to support dynamic extensions... yes checking for posix_fallocate... yes configure: creating ./config.status config.status: creating Makefile config.status: creating sqlite3.pc config.status: executing depfiles commands config.status: executing libtool commands root@titus:~/Titus_Linux_Backup/ti-e2e/sqlite-autoconf-3080403# make /bin/sh ./libtool --tag=CC --mode=compile arm_v5t_le-gcc -DPACKAGE_NAME=\"sqlite\" -DPACKAGE_TARNAME=\"sqlite\" -DPACKAGE_VERSION=\"3.8.4.3\" -DPACKAGE_STRING=\"sqlite\ 3.8.4.3\" -DPACKAGE_BUGREPORT=\"http://www.sqlite.org\" -DPACKAGE_URL=\"\" -DPACKAGE=\"sqlite\" -DVERSION=\"3.8.4.3\" -D_FILE_OFFSET_BITS=64 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_FDATASYNC=1 -DHAVE_USLEEP=1 -DHAVE_LOCALTIME_R=1 -DHAVE_GMTIME_R=1 -DHAVE_DECL_STRERROR_R=1 -DHAVE_STRERROR_R=1 -DHAVE_READLINE=1 -DHAVE_POSIX_FALLOCATE=1 -I. -D_REENTRANT=1 -DSQLITE_THREADSAFE=1 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE -Os -MT sqlite3.lo -MD -MP -MF .deps/sqlite3.Tpo -c -o sqlite3.lo sqlite3.c libtool: compile: arm_v5t_le-gcc -DPACKAGE_NAME=\"sqlite\" -DPACKAGE_TARNAME=\"sqlite\" -DPACKAGE_VERSION=\"3.8.4.3\" "-DPACKAGE_STRING=\"sqlite 3.8.4.3\"" -DPACKAGE_BUGREPORT=\"http://www.sqlite.org\" -DPACKAGE_URL=\"\" -DPACKAGE=\"sqlite\" -DVERSION=\"3.8.4.3\" -D_FILE_OFFSET_BITS=64 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_FDATASYNC=1 -DHAVE_USLEEP=1 -DHAVE_LOCALTIME_R=1 -DHAVE_GMTIME_R=1 -DHAVE_DECL_STRERROR_R=1 -DHAVE_STRERROR_R=1 -DHAVE_READLINE=1 -DHAVE_POSIX_FALLOCATE=1 -I. -D_REENTRANT=1 -DSQLITE_THREADSAFE=1 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE -Os -MT sqlite3.lo -MD -MP -MF .deps/sqlite3.Tpo -c sqlite3.c -o sqlite3.o sqlite3.c: In function 'sqlite3_bind_value': sqlite3.c:66518: warning: passing argument 1 of 'sqlite3_value_type' discards qualifiers from pointer target type mv -f .deps/sqlite3.Tpo .deps/sqlite3.Plo /bin/sh ./libtool --tag=CC --mode=link arm_v5t_le-gcc -D_REENTRANT=1 -DSQLITE_THREADSAFE=1 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE -Os -no-undefined -version-info 8:6:8 -o libsqlite3.la -rpath /usr/local/filesystem_omapl138/lib sqlite3.lo -ldl -lpthread libtool: link: arm_v5t_le-ar cru .libs/libsqlite3.a sqlite3.o libtool: link: arm_v5t_le-ranlib .libs/libsqlite3.a libtool: link: ( cd ".libs" && rm -f "libsqlite3.la" && ln -s "../libsqlite3.la" "libsqlite3.la" ) arm_v5t_le-gcc -DPACKAGE_NAME=\"sqlite\" -DPACKAGE_TARNAME=\"sqlite\" -DPACKAGE_VERSION=\"3.8.4.3\" -DPACKAGE_STRING=\"sqlite\ 3.8.4.3\" -DPACKAGE_BUGREPORT=\"http://www.sqlite.org\" -DPACKAGE_URL=\"\" -DPACKAGE=\"sqlite\" -DVERSION=\"3.8.4.3\" -D_FILE_OFFSET_BITS=64 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_FDATASYNC=1 -DHAVE_USLEEP=1 -DHAVE_LOCALTIME_R=1 -DHAVE_GMTIME_R=1 -DHAVE_DECL_STRERROR_R=1 -DHAVE_STRERROR_R=1 -DHAVE_READLINE=1 -DHAVE_POSIX_FALLOCATE=1 -I. -D_REENTRANT=1 -DSQLITE_THREADSAFE=1 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE -Os -MT shell.o -MD -MP -MF .deps/shell.Tpo -c -o shell.o shell.c mv -f .deps/shell.Tpo .deps/shell.Po /bin/sh ./libtool --tag=CC --mode=link arm_v5t_le-gcc -D_REENTRANT=1 -DSQLITE_THREADSAFE=1 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE -Os -o sqlite3 shell.o ./libsqlite3.la -lreadline -lcurses -ldl -lpthread libtool: link: arm_v5t_le-gcc -D_REENTRANT=1 -DSQLITE_THREADSAFE=1 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE -Os -o sqlite3 shell.o ./.libs/libsqlite3.a -lreadline -lcurses -ldl -lpthread root@INFCH05297:~/Titus_Linux_Backup/ti-e2e/sqlite-autoconf-3080403# make ^C root@INFCH05297:~/Titus_Linux_Backup/ti-e2e/sqlite-autoconf-3080403# root@INFCH05297:~/Titus_Linux_Backup/ti-e2e/sqlite-autoconf-3080403# root@INFCH05297:~/Titus_Linux_Backup/ti-e2e/sqlite-autoconf-3080403# root@INFCH05297:~/Titus_Linux_Backup/ti-e2e/sqlite-autoconf-3080403# make install make[1]: Entering directory `/root/Titus_Linux_Backup/ti-e2e/sqlite-autoconf-3080403' /bin/mkdir -p '/usr/local/filesystem_omapl138/lib' /bin/sh ./libtool --mode=install /usr/bin/install -c libsqlite3.la '/usr/local/filesystem_omapl138/lib' libtool: install: /usr/bin/install -c .libs/libsqlite3.lai /usr/local/filesystem_omapl138/lib/libsqlite3.la libtool: install: /usr/bin/install -c .libs/libsqlite3.a /usr/local/filesystem_omapl138/lib/libsqlite3.a libtool: install: chmod 644 /usr/local/filesystem_omapl138/lib/libsqlite3.a libtool: install: arm_v5t_le-ranlib /usr/local/filesystem_omapl138/lib/libsqlite3.a /bin/mkdir -p '/usr/local/filesystem_omapl138/bin' /bin/sh ./libtool --mode=install /usr/bin/install -c sqlite3 '/usr/local/filesystem_omapl138/bin' libtool: install: /usr/bin/install -c sqlite3 /usr/local/filesystem_omapl138/bin/sqlite3 /bin/mkdir -p '/usr/local/include' /usr/bin/install -c -m 644 sqlite3.h sqlite3ext.h '/usr/local/include' /bin/mkdir -p '/usr/local/share/man/man1' /usr/bin/install -c -m 644 sqlite3.1 '/usr/local/share/man/man1' /bin/mkdir -p '/usr/local/filesystem_omapl138/lib/pkgconfig' /usr/bin/install -c -m 644 sqlite3.pc '/usr/local/filesystem_omapl138/lib/pkgconfig' make[1]: Leaving directory `/root/Titus_Linux_Backup/ti-e2e/sqlite-autoconf-3080403' root@titus:~/Titus_Linux_Backup/ti-e2e/sqlite-autoconf-3080403#
After completion it can be found,
bin --> sqlite3
lib --> libsqlite3.a libsqlite3.la libsqlite3.so libsqlite3.so.0 libsqlite3.so.0.8.6 pkgconfig
include --> sqlite3ext.h sqlite3.h
i got bin with sqlite3
in lib only libsqlite3.a ,libsqlite3.la and pkgconfig.. but other 3 .so file i didnt get
include folder not created
Hi,
"include" folder is not required and you can install those files driectly to your rootfs and try to execute "sqlite3",
Note:
Please ensure that you have depency libraries for sqlite3 such as libncurses.so.5, libreadline.so.5, libtinfo.so.5 etc,
otherwise you may get a error like "sqlite3: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory" while you executing the "sqlite3"
after that i added sqlite3 executable file from bin to my omap sdk bin folder.
when i execute sqlite3 test.dB
i got error that cannot execute binary file
Hi,
when i execute sqlite3 test.dB
As of now, Don't give any database file input while executing sqlite3 instead just type "sqlite3" command,
What is your toolchain and version?
If arm arago, then check your CC tool version,
arm-arago-linux-gnueabi-gcc --version
my gcc version
arm-arago-linux-gnueabi-gcc (GCC) 4.5.3 20110311 (prerelease)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
how to execute sqlite3 in lcdk.
Hi,
Untar the attached file into your filesystem,
Here is the log,
root@arago:/# tar -zxvf sqlite.tar.gz
bin/
bin/sqlite3
lib/
lib/pkgconfig/
lib/pkgconfig/sqlite3.pc
lib/libsqlite3.a
lib/libncurses.so.5
lib/libtinfo.so.5
lib/libtinfo.so.5.7
lib/libreadline.so.5
lib/libreadline.so.5.2
lib/libncurses.so.5.7
lib/libtinfo.so
lib/libreadline.so
lib/libsqlite3.la
root@arago:/#
root@arago:/# sqlite3
SQLite version 3.8.4.3 2014-04-03 16:53:12
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite>
Please let us know the results.