LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices

Reply
 
Search this Thread
Old 04-18-2013, 01:50 PM   #1
Newbie89
LQ Newbie
 
Registered: Apr 2013
Posts: 9

Rep: Reputation: Disabled
How to Cross Compile SQLite3 inside the SBC TS-5500


Any idea to make it?
Is it new to use sqlite3 inside the SBC?
Because my project is to use sqlite3 inside my SBC...

Can show me the step to make it?And I also need to know how to install the sqliteman into the sbc...because I need to link between sqlite and c language...

Last edited by Newbie89; 04-19-2013 at 01:33 AM.
 
Old 04-19-2013, 08:20 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 11,803

Rep: Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721
Welcome to LinuxQuestions.

How is your SBC configured including any peripherals. Do you have the development kit?

sqliteman is a QT based GUI tool so your not going to be able to install it on the your TS-5500. The SQLite website has information on the C API. It might be possible to run sqlite on the SBC.

http://www.sqlite.org/index.html
 
Old 04-19-2013, 10:44 AM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,522

Rep: Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503
And : No cross compiling. The processor is plain "x86".

You may even be able to use an sqlite binary package for the OS on your TS-5500.
>> No compilation at all.
 
Old 04-19-2013, 10:58 AM   #4
Newbie89
LQ Newbie
 
Registered: Apr 2013
Posts: 9

Original Poster
Rep: Reputation: Disabled
Thanks for reply

I found the step of cross compile

Steps are as follows:

1. Download "sqlite-amalgamation-3071300.z​ip" from http://www.sqlite.org/​download.html

2. Extract and execute the following command on cross-compile environment:

gcc -DSQLITE_THREADSAFE=0 shell.c sqlite3.c -ldl

Where, the -ldl library is needed to support dynamic loading, the sqlite3_load_extension() interface and the load_extension() SQL function.

3. Transfer file "a.out" to the embedded computer (TS5500) and execute there "./a.out".

the method correct?
 
Old 04-20-2013, 04:11 AM   #5
Newbie89
LQ Newbie
 
Registered: Apr 2013
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
Welcome to LinuxQuestions.

How is your SBC configured including any peripherals. Do you have the development kit?

sqliteman is a QT based GUI tool so your not going to be able to install it on the your TS-5500. The SQLite website has information on the C API. It might be possible to run sqlite on the SBC.

http://www.sqlite.org/index.html
SBC configured not include any peripherals...nope...

oic...thanks for your information...

---------- Post added 04-20-13 at 04:12 AM ----------

Quote:
Originally Posted by knudfl View Post
And : No cross compiling. The processor is plain "x86".

You may even be able to use an sqlite binary package for the OS on your TS-5500.
>> No compilation at all.
I'm not quite understand...can you explain a bit?
 
Old 04-20-2013, 04:27 AM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 11,803

Rep: Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721
In a nutshell cross compiling means your compiling an application on a system i.e. processor, OS etc that is different then the actual system that will be running it. Since the SBC is an x86 just like a desktop computer cross compiling is not required.

It isn't obvious what arch i.e. 386,486,586 etc the x86 precompiled binaries are using so they may or may not work.
 
1 members found this post helpful.
Old 04-21-2013, 01:00 PM   #7
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,395
Blog Entries: 2

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
There is such a thing as cross-native compilation. The CPU is not the only aspect of a compiler/toolchain. There are many factors that dictate whether a toolchain's resutlant object code will run on a particular target: OS/kernel, libc, floating point implementation in some cases, threading model, and others. If the build host is not the same as the target host, then there is some real possibility that the code will fail on the target.
If the OP's target host includes a native toolchain, then it is probably simple to build the package there. Sqlite seems to be distributed in a tarball that includes the usual 'configure; make; make install' support. This should be simple enough to perform in the native target environment if there is a toolchain present there. I just built it that way on the Debian desktop host I'm using to write this, and it took all of 1 minute.
As someone has already pointed out, the very simplest method may be to download a package already built for the target architecture.
--- rod.
 
2 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Interface the SBC TS-5500 with PIC 18F4550? mr project student Linux - Newbie 2 05-29-2012 08:25 PM
How to Interface the SBC TS-5500 with PIC 18F4550? mr project student Programming 1 05-29-2012 11:21 AM
How to Interface the SBC TS-5500 with PIC 18F4550 mr project student Linux - Embedded & Single-board computer 1 05-29-2012 10:58 AM


All times are GMT -5. The time now is 12:07 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration