Page 1 of 1

Best programming environment

Posted: Mon Jan 13, 2014 7:49 pm
by ronaldolsthoorn
Dear pi community,

I have a few questions that you experienced Pi c/c++ programmers can answer about the different programming environment setups that are available:

1. Pi vs PC. Programming natively on the Pi has its lack of performance. Though compiling issues due to the different processors is also a pain when using a pc (windows/linux, whatever). Which is best?

2. What is the best programming environment on the Pi? And what is the best environment on the PC? I've got eclipse running now but that is a pretty broad tool (not specifically meant for c/c++).

3. Last but not least: How do I properly setup ssh for a qemu raspbian emulator running on ubuntu? I have been able to do simple commands with ssh with success, but I have not been able to transfer files to the qemu, so that I can test hello world on it. Is there a clear tutorial on this?

Many thanks in advance

Re: Best programming environment

Posted: Mon Jan 13, 2014 10:03 pm
by Nr90
1. Are you programming for the Pi?
If you're just starting out, the apps you'll write will run fine on the Pi. If you'll be compiling large projects, the extra performance from a regular PC would be nice.

2. QT Creator, code::blocks are complete IDE's. My advice would be to start out with a simple editor and g++. Personal choice would be VIM, but for some people some seem to prefer emacs :mrgreen:

3. Have a look at scp, or set up an ftp server.

Re: Best programming environment

Posted: Wed Jan 15, 2014 5:31 pm
by Noggin01
I'm new to Pi myself having received mine only on this past Monday. I spent hours yesterday trying to figure out how to come up with a solution for programming on my Pi. I eventually settled on using cygwin and crosstools-ng on my Windows laptop. After about an hour of trying to understand the guides on how to set it up, I said, "F it" and rebooted my laptop into Linux.

From there, I started trying to install crosstools-ng, and after about 2 hours of the download not progressing, I said "F it" again and set up a VNC server on my RPi. I connected to the GUI and installed codeblocks and it just worked with very little hassle. Writing in an editor over a Wi-Fi VNC connection could get annoying as rendering was a little on the slow side though.

I want to compile programs I write on my RPi, not a full kernel or OS image. The RPI can do that just fine.

My plan for my lunch break today is to go home, install Sublime on my laptop, install samba on my RPi, share my RPi project directory with my Windows system, and write my code on Windows and save the files to my RPi. When I'm ready to compile, I'll pull up my VNC client and hit the compile button.

Re: Best programming environment

Posted: Wed Jan 15, 2014 5:48 pm
by ejurgensen
I compile in a qemu raspbian emulator running on Ubuntu. It's a bit faster than doing it on the RPi itself, but not much. Regarding no. 3, you can mount the emulator with sshfs, which makes everything much easier:

sshfs [email protected]:[dir] [mount point] -p 5022

I can't remember if port 5022 is something I set up or if it was standard.

Re: Best programming environment

Posted: Wed Jan 15, 2014 10:10 pm
by frodo
So, and all this hassle is supposed to be more comfortable and more user friendly than just 'slogin -X [email protected] xterm'? :?

Re: Best programming environment

Posted: Fri Jan 17, 2014 6:49 pm
by mthinkcpp
Options for compilation:
1. Compile on the RPi.

2. Cross-compile, install the gcc cross-compiler.

Code: Select all

gcc-arm-none-eabi
This has the best of both worlds, fast compilations and the result runs the the RPi. Copy the resulting executable across using something like scp. Compile using arm-none-eabi-gcc.
Note: This package is only available on Debian testing (jessie) - not on stable.

If you want to use clang instead (like me), install the same package and specify the new target when compiling using clang (-arch armv6).

Re: Best programming environment

Posted: Fri Jan 24, 2014 3:54 am
by cdoty
Using Netbeans through a samba share was super easy. It's a bit slow, but I was able to get my Super Play game engine (http://superplay.info/) compiled and working. Although, it will need some of work to run at full speed.