Log in

View Full Version : *nix support?


Validius
01-01-2006, 20:17
How would i develop robot software on my Linux box/Mac? I can understand if its impossable on the Mac because Mac's are PPC based but isnt there a way on Linux? If possable i'd like to avoid WINE at all costs.

I think that everyone can agree that MPLab really sucks. I'd rather use VI.

Kyle Fenton
01-01-2006, 20:40
Your post is a little confusing, what kind of computer do you have? Are you saying that you have a Mac with a PPC linux installed on it.

Compiler design is a little confusing, but it usually has to processor and not really the operating system. The C18 complier has been used with a x86 linux box, and there are several posts about it.

Dave Flowerday
01-01-2006, 23:15
If possable i'd like to avoid WINE at all costs.Not possible unfortunately. The MCC18 compiler is compiled to run under Windows (meaning it uses the Windows APIs etc) so WINE is needed to provide that compatibility layer. This is also why you can't run it on anything other than x86 (unless you use something like VMware or Virtual PC). Others have gotten it to work under Linux, but personally I think the hoops you have to jump through just aren't worth it.
I think that everyone can agree that MPLab really sucks. I'd rather use VI.So use VI then. On Wildstang all of our software people develop for the robot controller using vim and make. Since you can run the mcc18 compiler from the command line outside of MPLAB it is really easy to avoid it. My recommendation for people who prefer Unix-like OSes (I'm one of them) is just to install Cygwin on a Windows computer, and use Makefiles to build.

Greg Marra
01-01-2006, 23:20
There are some Linux programs developed specifically for FIRST. I'm not too familiar with them, but there is this sourceforge project (http://sourceforge.net/projects/ifi-picloader/) designed to download compiled code onto the robot. I don't know how you'd compile the actual code in linux. Maybe you can just run the compiler in WINE and do all your editing and downloading in native Linux?

sciguy125
01-01-2006, 23:28
I haven't gotten around to trying it yet, but SDCC (http://sdcc.sourceforge.net/) supports the 18F8520 that's in the RC. I believe that mcc18 has some optimizations, so if you use SDCC, your milage may vary.

Validius
01-01-2006, 23:55
Not possible unfortunately. The MCC18 compiler is compiled to run under Windows (meaning it uses the Windows APIs etc) so WINE is needed to provide that compatibility layer. This is also why you can't run it on anything other than x86 (unless you use something like VMware or Virtual PC). Others have gotten it to work under Linux, but personally I think the hoops you have to jump through just aren't worth it.
So use VI then. On Wildstang all of our software people develop for the robot controller using vim and make. Since you can run the mcc18 compiler from the command line outside of MPLAB it is really easy to avoid it. My recommendation for people who prefer Unix-like OSes (I'm one of them) is just to install Cygwin on a Windows computer, and use Makefiles to build.

OK, i have a Mac with OS X and PPC Linux. I understand how that wouldnt work for obvious archatectual reasons. I also have a whitebox PC with Linux. Yes, i'l get VI for win32 and use that. You use make? I have never dabled with Make. You just wriet your own makefile and have it use the compiler as its compiler command?

See you guys in Novi for the kickoff!

Validius
01-01-2006, 23:57
I haven't gotten around to trying it yet, but SDCC (http://sdcc.sourceforge.net/) supports the 18F8520 that's in the RC. I believe that mcc18 has some optimizations, so if you use SDCC, your milage may vary.

that looks really sweet, It has a mac version too. I bet i can get it and kdevelop together (gotta love X11+Fink project)

Dave Flowerday
02-01-2006, 00:09
You just wriet your own makefile and have it use the compiler as its compiler command?Yes. Attached is our Makefile (renamed to Makefile.txt due to file type restrictions) that was modified to work with the default camera code from last year. To use it under Cygwin you should be able to just edit the list of .o files that need to be compiled and also edit the location of the compiler. Remember that the MCC18 compilers have a ridiculous length restriction on the path where they're located so make sure it's located in a short path.

Ryan M.
02-01-2006, 07:10
These threads helped me get everything working under Linux: (Should apply similarly to OS X.)

http://www.chiefdelphi.com/forums/showthread.php?t=36377
http://www.chiefdelphi.com/forums/showthread.php?t=38853
http://www.chiefdelphi.com/forums/showthread.php?t=37736

Astronouth7303
02-01-2006, 13:41
I haven't gotten around to trying it yet, but SDCC (http://sdcc.sourceforge.net/) supports the 18F8520 that's in the RC. I believe that mcc18 has some optimizations, so if you use SDCC, your milage may vary.

You probably should. The documentation makes little assertion of compatibility (either source-level or binary-level) with MCC18. This is critical for us, seeing as we must use the libraries provided for us by IFI, which are probably compiled with MCC18.

If it can't link MCC libraries, we can't use it.

Eldarion
02-01-2006, 14:04
OK, i have a Mac with OS X and PPC Linux. I understand how that wouldnt work for obvious archatectual reasons.

I haven't looked into SDCC, but standard GCC supports something called cross-compiling where you can compile programs for one platform (say PowerPC) on another platfom (x86).

tux
14-01-2006, 15:53
I did all of our programming last year on a linux box. A 486 laptop that I found at the curb in fact. People looked at it kind of funny, and it took about 10 minutes to run the linker, but it worked fine. At least I did not have to work in windows.

Getting the compiler to run on linux is really pretty easy. I did need to install on windows and then copy over the mcc18 directory though. Wine would not run the installer, but it runs the compiler without any problems.

I also have a customized Makefile which I can post. I added a python script to parse the (sometimes less than helpful) compiler output to find where any errors are located.

My only concern for this year is that the PICloader has not been updated. I know that the official one has changed to match the new controller. Has anyone tried to load code with the old IFI Linux PICloader yet?

Astronouth7303
15-01-2006, 14:15
My only concern for this year is that the PICloader has not been updated. I know that the official one has changed to match the new controller. Has anyone tried to load code with the old IFI Linux PICloader yet?

According to a fellow developer, both pictools and picloader work on the new control system. (I don't know if that's CVS or the last release, though.)

jdong
15-01-2006, 18:01
Yes, the current loader versions (0.4.1, 0.4.97, CVS) all work great with the old and new controllers, as far as my testing was concerned (2006 default, camera code).