Development

What is the easiest way to get a development environment running for the
RPi ?
Which flavor of Linux has a good IDE and compiler ?
I am looking at application not kernel development.
Thanks
hamilton
Reply to
hamilton
Loading thread data ...
The compiler on Linux is the GNU C Compiler, GCC and its derivatives for other languages. For developing RPi code on an Intel based PC, you need a cross-compiler. There is little difference between the Linux distributions as hosts for the cross-compiler.
I'd like to separate the IDE and compiler. If your PC has enough capacity, I'll recommend Eclipse with CDT (C development toolkit). It matches well with several different flavors of GCC.
--

Tauno Voipio
Reply to
Tauno Voipio
install the compiler and dev packages
no different
--
Ineptocracy 

(in-ep-toc?-ra-cy) ? a system of government where the least capable to lead are elected by the least capable of producing, and where the members of society least likely to sustain themselves or succeed, are rewarded with goods and services paid for by the confiscated wealth of a diminishing number of producers.
Reply to
The Natural Philosopher
What I do is to use a text editor on the dsesktop with te files on the (headless) server - or Pi in his case - which is NFS mounted.
Then use a telnet or ssh session to run the compiler.
--
Ineptocracy 

(in-ep-toc?-ra-cy) ? a system of government where the least capable to lead are elected by the least capable of producing, and where the members of society least likely to sustain themselves or succeed, are rewarded with goods and services paid for by the confiscated wealth of a diminishing number of producers.
Reply to
The Natural Philosopher
Set the RPi up for headless operation. Configure it for access to whatever version control system you run on your Linux box(es).
Do development on the RPi because that avoids any hardware incompatibility issues. That said, I had no issues when I moved my favourite editor, microemacs, from Linux to the RPi.
For what language(s)?
Both the RPi and Linux have IDLE for Python.
Most folks seem to like Eclipse for C/C++/Java and AFAIK it does others as well. I don't use IDE's unless I can help it. I get by just fine with microEmacs and cvs version control for all languages. In addition I use make+gcc for C and ant+javac for Java. Python/bash scripts, SQL, awk and Perl don't have compilation systems.
Same here.
--
martin@   | Martin Gregorie 
gregorie. | Essex, UK 
 Click to see the full signature
Reply to
Martin Gregorie
Don't we all?
To the OP: if you haven't worked this way, with a properly set up network (sshd with X11 forwarding and ftpd on all boxes, a LAN-wide source code repository. Matching user names is nice) with two or more Linux boxes on it, it doesn't really matter where you're doing development relative to the box you're sitting in front of - indeed, you'll scarcely notice any difference between working locally or logging onto one of the remote systems and developing on it.
Having a central source repository is nearly essential though, if only so that access to private common code libraries, their extension and maintenance is as painless as possible.
--
martin@   | Martin Gregorie 
gregorie. | Essex, UK 
 Click to see the full signature
Reply to
Martin Gregorie
Please add links.
Reply to
hamilton
Ok, I would like to know what people are using for C/C++ development.
I know of GCC, but how do you use it ?
How do you download compiled code to the RasPi ?
Is there any kind of IDE are available ?
What beginner level web sites are available to learn about these tools ?
I have reviewed 100s of web sites about RasPi projects, but none have ever mentions how they compile code or download to the Pi.
Thank You
Hamilton
Reply to
hamilton
[]
Here are a couple of examples with step-by-step instructions:
formatting link

formatting link

In these examples, development is done on the RPi directly, with command-line tools. No "downloading" or cross-compiling involved.
--
Cheers, 
David 
 Click to see the full signature
Reply to
David Taylor
you type 'gcc' into a command line?
compile it ON the pi. Use ftp, NFS, samba...or any of a number of file tranfer/file sharinfg protocols.
I prefer to compile on the target than cross compile and download.
--
Ineptocracy 

(in-ep-toc?-ra-cy) ? a system of government where the least capable to lead are elected by the least capable of producing, and where the members of society least likely to sustain themselves or succeed, are rewarded with goods and services paid for by the confiscated wealth of a diminishing number of producers.
Reply to
The Natural Philosopher
Use the APT package management system to download and install everything I've mentioned on the RPi, though make, gcc and an editor or two should already be there. You many need to install a source repository (cvs is the old, traditional one or you might prefer svn or git). Editors: nano (which I don't like, is standard for the RPi). I can supply source, docs and a termcap file for microEmacs. It needs libtermcap, with source from the Free Software Foundation. Both 'just compile' with make recipes.
The headless setup is described here:
formatting link

--
martin@   | Martin Gregorie 
gregorie. | Essex, UK 
 Click to see the full signature
Reply to
Martin Gregorie
It is just another *n*x system as far as management goes. You have nfs, ftp, sftp and possibly smb available for connectivity. You have a full gcc+make environment for code builds. You have servers and clients for cvs, svn, git etc. available. It drops right in between all the other *n*x stuff.
On my "process control shelf* I have a Trimslice, a Phidgets and a r-pi running Linux, a firewall/via x86 box running openbsd, a via eee running freebsd, and an old laptop running openbsd serving up usb disks via nfs and repos via svn.
I have to use the "hostname" command regularly to see which servers I am logged in to, the environment is so similar.
The r-pi can be completely self-hosting. It can build a full linux kernel for itself if it has to, and does so faster than emulators on intel machines do. I posted dhrystone comparisons about a month back.
-- mrr
Reply to
Morten Reistad
I just have different coloured terminals..
--
Ineptocracy 

(in-ep-toc?-ra-cy) ? a system of government where the least capable to  
 Click to see the full signature
Reply to
The Natural Philosopher
There is a body of opinion (to which I subscribe) which has it that Linux *is* an IDE.
--
Today is Sweetmorn, the 73rd day of Discord in the YOLD 3179 
           "Jesus died for somebody's sins, but not mine"
Reply to
Huge
As other have said, you can easily get away without an IDE under Linux, and just use whatever editor and compiler you fancy. On the other hand, I haven't yet found a Linux debugged which wasn't an abomination. gdb, I'm looking at you.
I expect I'll be shouted down now, and if any of these shouts contain a debugger as good as, for example, the IBM Visual Age one or the Open Watcom one, both of which I used on OS/2, I'll be very happy.
Ian
Reply to
The Real Doctor
Ok, I see that command line operations are favored.
But, I have yet to have anyone show me a quick and easy(dirty) way to create code modules that can be run on the RasPi.
So, I will ask again, what is an easy way to compile code and download to the RasPi ?
I have a RasPi B on its way.
I would like to get familiar with a development environment to I will be ready to run "hello word" when it gets here.
So far, I have nothing. I do have Kubuntu install on an laptop. So, I am ready to get started, if I can find a way "to get started".
hamilton
Reply to
hamilton
Oh, dear.
formatting link

--
Today is Sweetmorn, the 73rd day of Discord in the YOLD 3179 
           "Jesus died for somebody's sins, but not mine"
Reply to
Huge
If "code" ist C/C++ then compiling it on the PI would be easier. Because you would have to set up a cross-compiling toolchain on your laptop (PI is ARM, not x86/x64). script languages (python, shell...) would be portable.
create the source file: $ echo '#include int main() { printf("hello world!\n"); return 0; } ' > hello_world.c
compile it: $ gcc hello_world.c -o hello_world
run the program: $ ./hello_world
optaining gcc depends on your distribution. On debian (raspbian) # apt-get install gcc
should do the trick.
There are a lot of IDEs out there. the easiest way is to use a simple text editor (kate on kde) to just write the code and compile it on the PI. Transferign could be done using an ssh serve on the PI and mounting some PI folder on your laptop using sshfs. Or just "download" it using the file manager sftp://PI_IP/folder
and then compile it on the PI. If the project grows, use a Makefile.
have fun
Reply to
Stefan Enzinger
You have Linux, and a network connection, don't you?
$ sudo -s # apt-get install build-essential # apt-get install emacs # exit $ emacs hello.c #include
int main(int argc, char * argv[]) { printf ("Hello, world\n"); } control-x control-s hello.c return control-x control-c $ gcc hello.c -o hello $ ./hello
Makefiles in the next lesson.
-- mrr
Reply to
Morten Reistad
On Sun, 26 May 2013 15:30:48 -0600, hamilton declaimed the following in comp.sys.raspberry-pi:
Using what language? (As I recall, the "Pi" in the name was a partial nod to an intent that Python would be the primary programming language).
Standard Python installs include IDLE.
Java? Probably Eclipse or NetBeans environment.
GNAT Ada -- maybe a version of GPS
C/C++ or any of the other languages supported by the GCC suite? Learn to edit makefiles and pick the editor of your preference.
Note that if you intend to compile on a laptop and just download executable binaries you are asking for a cross-compiler/linker set-up -- much more complex (as you may have to configure run-time libraries and more source code specific to the target). Instead, the RP should support native compilation/linking and you just need a way to access the device (monitor/keyboard, X-window system), and then pick your choice of the above languages...
--
	Wulfraed                 Dennis Lee Bieber         AF6VN 
        wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/
Reply to
Dennis Lee Bieber

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.