Author Topic: WebbotLib and Mac  (Read 6891 times)

0 Members and 1 Guest are viewing this topic.

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
WebbotLib and Mac
« on: November 02, 2009, 11:14:40 AM »
Webbot and I are making sure WebbotLib is compatible with both Linux and Mac.

In theory it should work, but we are looking for a beta tester to verify.

If you get it to work with Mac, let us know!


(neither of us use/own a Mac)
« Last Edit: November 02, 2009, 11:16:41 AM by Admin »

Offline chelmi

  • Supreme Robot
  • *****
  • Posts: 496
  • Helpful? 15
    • Current projects
Re: WebbotLib and Mac
« Reply #1 on: November 02, 2009, 12:47:32 PM »
I will commit my changes for Linux a soon as I can access the CVS. They should be needed for MacOSX as well.

Chelmi.

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: WebbotLib and Mac
« Reply #2 on: November 02, 2009, 01:25:01 PM »
I will commit my changes for Linux a soon as I can access the CVS. They should be needed for MacOSX as well.

Chelmi.

Chelmi - coz I'm trying to get a new release together I've made your changes. But it would still be good to know if you can now access CVs ok.
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline chelmi

  • Supreme Robot
  • *****
  • Posts: 496
  • Helpful? 15
    • Current projects
Re: WebbotLib and Mac
« Reply #3 on: November 02, 2009, 01:42:36 PM »
I will commit my changes for Linux a soon as I can access the CVS. They should be needed for MacOSX as well.

Chelmi.

Chelmi - coz I'm trying to get a new release together I've made your changes. But it would still be good to know if you can now access CVs ok.

Ok, I will try again tonight. I'd also like to write a Makefile to compile the lib under linux and mac.

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: WebbotLib and Mac
« Reply #4 on: November 02, 2009, 02:01:46 PM »
Quote
I'd also like to write a Makefile to compile the lib under linux and mac.
I'd rather avoid this if possible . . . if not, perhaps just like sys files we can also have OS files. Just put in a header file for your selected OS. No header file defaults to Windows.

Or something like that - Webbot usually has better ideas than me for this! ;D

Offline chelmi

  • Supreme Robot
  • *****
  • Posts: 496
  • Helpful? 15
    • Current projects
Re: WebbotLib and Mac
« Reply #5 on: November 02, 2009, 02:19:00 PM »
Quote
I'd also like to write a Makefile to compile the lib under linux and mac.
I'd rather avoid this if possible . . . if not, perhaps just like sys files we can also have OS files. Just put in a header file for your selected OS. No header file defaults to Windows.

Or something like that - Webbot usually has better ideas than me for this! ;D

I'm not sure to understand what you mean here :p

I just want a way to compile the lib under Linux, nothing specific to linux here. Right now there is nothing to build the lib without WinAVR :p

Chelmi.

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: WebbotLib and Mac
« Reply #6 on: November 02, 2009, 02:58:09 PM »
Hi Chelmi

Quote
I'd also like to write a Makefile to compile the lib under linux and mac.
I'd rather avoid this if possible . . . if not, perhaps just like sys files we can also have OS files. Just put in a header file for your selected OS. No header file defaults to Windows.

Or something like that - Webbot usually has better ideas than me for this! ;D

I'm not sure to understand what you mean here :p

I just want a way to compile the lib under Linux, nothing specific to linux here. Right now there is nothing to build the lib without WinAVR :p

Chelmi.

I currently build the library from a command line - but using Ant - which non-Java folk probably wont know about.
Equally I tend to build my 'example' files (unpublished so far) using Ant as well.

But when working on a given project I tend to use AVRStudio or Eclipse IDEs

So I don't really tend to use C makefiles much. But I'm sure that others do.
So it would be great if you were willing to contribute say:
1 - A generic makefile for an end application that just uses the lib (ie one C file, many H files, + the lib)
2 - A generic makefile to build the library itself. Hopefully one that will cope, unmodified, with any new *.c files and also allow the whole lib to built for various different mcus and clock speeds.

"If" you understand Ant then I can send you (or you can get from CVS) the build.xml that builds my library across each target processor - which may be of help.




Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline chelmi

  • Supreme Robot
  • *****
  • Posts: 496
  • Helpful? 15
    • Current projects
Re: WebbotLib and Mac
« Reply #7 on: November 02, 2009, 03:33:54 PM »
Hi Chelmi

Quote
I'd also like to write a Makefile to compile the lib under linux and mac.
I'd rather avoid this if possible . . . if not, perhaps just like sys files we can also have OS files. Just put in a header file for your selected OS. No header file defaults to Windows.

Or something like that - Webbot usually has better ideas than me for this! ;D

I'm not sure to understand what you mean here :p

I just want a way to compile the lib under Linux, nothing specific to linux here. Right now there is nothing to build the lib without WinAVR :p

Chelmi.

I currently build the library from a command line - but using Ant - which non-Java folk probably wont know about.
Equally I tend to build my 'example' files (unpublished so far) using Ant as well.

But when working on a given project I tend to use AVRStudio or Eclipse IDEs

So I don't really tend to use C makefiles much. But I'm sure that others do.
So it would be great if you were willing to contribute say:
1 - A generic makefile for an end application that just uses the lib (ie one C file, many H files, + the lib)
2 - A generic makefile to build the library itself. Hopefully one that will cope, unmodified, with any new *.c files and also allow the whole lib to built for various different mcus and clock speeds.

"If" you understand Ant then I can send you (or you can get from CVS) the build.xml that builds my library across each target processor - which may be of help.


That's more or less what I was planing to do :)

Chelmi.

Offline jzaun

  • Jr. Member
  • **
  • Posts: 18
  • Helpful? 0
Re: WebbotLib and Mac
« Reply #8 on: December 18, 2009, 11:09:30 PM »
I can pull the latest CVS and compile on a mac (Snow Leopard) with ant. I did not need to install anything special besides xcode and the avr package (CrossPack-AVR-20090415). I did have to remove some chips that my compiler didnt know about from the build.xml but that was painless to do.

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
    • dunk's robot
Re: WebbotLib and Mac
« Reply #9 on: February 08, 2010, 08:38:50 AM »
That's more or less what I was planing to do :)
hi Chelmi,
did you ever produce a working Makefile?
i'm just digging into this now but my experience with GCC is limited.

if not then no worries, i'll keep hacking away.

dunk.

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: WebbotLib and Mac
« Reply #10 on: February 09, 2010, 08:02:54 PM »
There are a couple of points here.

1. Compiling WebbotLib itself
There isn't really any reason why you would want to do this. The *.a files are 'pre-compiled' versions of the library. Its done for you.
The only other reasons you may choose to build the library are:-
a) coz you've changed the library source (and you known what you are doing!). The preferred solution is to use Apache Ant. Thats what I use. Doesn't need a GUI, and is supported on all the Java platforms (so Win/Unix/Mac etc). Other folk on this thread have used it as well. Note that if you come up with your own build process / makefile then I cannot support your output - I only support my code and build.
b) coz you are trying to add a non-supported mcu. Believe me it aint worth it. I can do it in 10% of the time - or tell you why it cannot be supported. Believe me - if I see emails that it doesn't support 'my home made support for the Milton Keynes ATMega123 processor' then I may just fall asleep.

2. Compiling your application
A makefile for a project application is a very valid thing to require. Mainly coz those poor Mac folk (you know - the guys that tell you that the Mac can do anything 10 x better and easier than a PC!) cant use a simple app like AVRStudio  ;). So we PC folk have to help them to create a makefile script so that they can run it mainframe/batch mode.
So I have attached an example. Although IMHO a makefile is just SOOOOO inflated with all sorts of useless rubbish. (Ok so now I've annoyed all Mac users and all C programmers. Uhmm! You guys really need to get hold of Ant!).

Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
    • dunk's robot
Re: WebbotLib and Mac
« Reply #11 on: February 09, 2010, 10:22:03 PM »
hi Webbot.
out of interest,
what is in your ant build.xml file?
any chance of a link to where you got it?

i've been reading up on ant all day but am unable to find much on building C applications with it.
everything i've found so far has been either very dated or aimed at Java.
(i do keep finding misspellings of "and" in my search results though...)
i'm sure i could work it out eventually but there is obviously a source of documentation i'm missing out there somewhere...

dunk.

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: WebbotLib and Mac
« Reply #12 on: February 09, 2010, 10:31:50 PM »
hi Webbot.
out of interest,
what is in your ant build.xml file?
any chance of a link to where you got it?
Just open it. Where did I get it - well I just wrote it!


Quote
i've been reading up on ant all day but am unable to find much on building C applications with it.
everything i've found so far has been either very dated or aimed at Java.
(i do keep finding misspellings of "and" in my search results though...)
i'm sure i could work it out eventually but there is obviously a source of documentation i'm missing out there somewhere...
You just have to do a mind shift. Ant is cool at executing all sorts of things during a build process.
Although its aimed at Java then it can also execute external commands (ie another program like avr-gcc rather than the Java compiler).
So now that you've got Ant can you rebuild the libraries by going to the WebbotLib folder and just typing:
ant
or if you want to see all choices then
ant -projecthelp
will list things like 'clean' - to delete ALL compiled code/libs etc


Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: WebbotLib and Mac
« Reply #13 on: February 09, 2010, 10:37:34 PM »
Going back to an email me and Webbot had on Ant last year, we really need an 'Ant for WebbotLib developers tutorial' ::)

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: WebbotLib and Mac
« Reply #14 on: February 09, 2010, 10:43:45 PM »
Going back to an email me and Webbot had on Ant last year, we really need an 'Ant for WebbotLib developers tutorial' ::)

Other folk on the forum have already successfully used Ant to build the lib. So it  does work. If it didn't then I wouldn't be able to make releases!

Dunk is a 'crash dummy'  :D

So as a non-Java/Ant person he may come up with useful comments - whereas other folk said 'yep-it works!'.

Dunk - doc what you do !
Exams later!

Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
    • dunk's robot
Re: WebbotLib and Mac
« Reply #15 on: February 11, 2010, 11:35:14 AM »
hi Webbot.
out of interest,
what is in your ant build.xml file?
any chance of a link to where you got it?
Just open it. Where did I get it - well I just wrote it!
o yes.
make fun of the non Java guy.
(poor me.)

so,

ant is fairly straight forward but only does Java in it's native form.
that's why i wasn't finding any reference to C in the manual. (http://ant.apache.org/manual/index.html)

to build C files for an x86 platform needs cpptasks which is part of ant-contrib (http://ant-contrib.sourceforge.net/).

so i am now able to build C for an x86 platform with ant.
i still haven't found anything on using ant to build C for AVRs though.

the guys that are writing wrote cpptasks have done a spectacular job of hiding it from search engines.


dunk.


[edit]
a little progress.
i can set the compiler adapter using the "classname" parameter of the "compiler" element.
i still haven't found a "compiler adapter" for the AVR yet.

interestingly cpptasks has built in support for loads of other compiler types:
[link]http://ant-contrib.sourceforge.net/cpptasks/apidocs/net/sf/antcontrib/cpptasks/CompilerEnum.html[/link]
« Last Edit: February 11, 2010, 12:13:24 PM by dunk »

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: WebbotLib and Mac
« Reply #16 on: February 11, 2010, 12:10:46 PM »
Yep Ant was made to make the Java build process easier. Its good for moving files around, packaging them into JARs and ZIPs etc. A lot of the tasks are Java related.

However: the big get out is the 'apply' task which allows you to run an external command. I use this to run avgr-gcc, the linker, etc. This uses the System Exec function in Java - so cant see why it wouldn't work on a mac, Linux etc. I use the 'mapper' task so that a C file is only rebuilt if it has been modified since the compiled 'O' file was generated. This is good for most purposes - but does mean that if you modify an H file. My get out is to do a 'clean' and then rebuild the lot (which is very quick anyway).

I can't see any reason why you need to load in other 'C specific' tasks. May help with the header issue above but its probably not worth the hassle.

Quote
i still haven't found anything on using ant to build C for AVRs though.
You don't need anything. My 'apply' tasks just run the compiler, linker etc etc..

Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
    • dunk's robot
Re: WebbotLib and Mac
« Reply #17 on: February 11, 2010, 02:26:45 PM »
[edit]
this thread is mostly noise from here on.
caused by a misunderstanding.

the basic, unmodified version of ant is all that is required.

if your AVR is on the list of supported devices you do not need to do any of this.

build.xml can be found from the "Developers" tab on WebbotLib's Sourceforge page. from there got to "CVN" and "Browse Code".
to here: [link]http://webbotavrclib.cvs.sourceforge.net/viewvc/webbotavrclib/webbotavrclib/[/link]

dunk.
« Last Edit: February 11, 2010, 07:50:30 PM by dunk »

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: WebbotLib and Mac
« Reply #18 on: February 11, 2010, 03:03:57 PM »
Would be interesting to see how a Mac build.xml differs from my one - since Java (ie Ant as well) are meant to be platform independent. So cant see why mine won't work straight off the bat - unless its got Windows path names in it.

After all - see previous post on this thread:-
I can pull the latest CVS and compile on a mac (Snow Leopard) with ant. I did not need to install anything special besides xcode and the avr package (CrossPack-AVR-20090415). I did have to remove some chips that my compiler didnt know about from the build.xml but that was painless to do.

The big benefit of Ant over a 'makefile' is I can add new source files and Ant just does it - whereas for a makefile I have to add them all in by hand. Pain. The Ant build.xml file also builds each CPU library seperately or all in one go. I hate makefiles !!
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline chelmi

  • Supreme Robot
  • *****
  • Posts: 496
  • Helpful? 15
    • Current projects
Re: WebbotLib and Mac
« Reply #19 on: February 11, 2010, 03:13:08 PM »
The big benefit of Ant over a 'makefile' is I can add new source files and Ant just does it - whereas for a makefile I have to add them all in by hand. Pain.

You can do that with makefile too :)

The Ant build.xml file also builds each CPU library seperately or all in one go. I hate makefiles !!

Make can do that too :p But I agree, the syntax is awful...

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: WebbotLib and Mac
« Reply #20 on: February 11, 2010, 06:17:24 PM »
No no no. You will never find a version of Ant or its tasks that are aimed at AVR and it has nothing to do with build.xml which also is completely non-platform dependent. You are trying to make this overly complex!!! Aargh.

The build.xml is read by Ant. It sees an 'apply' task. It runs that program. The fact that avr-gcc is reading text source files and outputting another file (compiled stuff) is of no interest to anybody. Ant doesn't care, build.xml doesn't care. All they care about is that one file goes in and another comes out.

The compiler 'avr-gcc' is aimed at ATmel AVRs - ie its a cross compiler. You run it one platform (Windows/Mac/Linux etc) and it generates code for AVRs. Ant doesn't need to know anything about that - its just an an external program that executes.

We need to chat, Skype or something about this. You are making an issue of what your own computer operating system is - when its actually TOTALLY irrelevant. The only difference is making sure you have a Mac/Linux version of 'avr-gcc'. This has nothing to do with WebbotLib, Ant or anything. If you want an AVR C compiler, to host on a Mac, then you will need a compiler (for us Windows folk it comes with avrstudio). Once you've got the compiler then you can control it via the command line. Ant, via your build.xml, does exactly that.

In the same way. If you had an ftp program then Ant could probably call that program to xfer a file to a server somewhere. Wat operating system is running on that server is of no interest to anyone and changes nothing.

We really need to chat - as I think you are wasting an ENORMOUS amount of time producing your own alternative to something that I already ship in the release. And all of this to re-compile WebbotLib itself. Which is a waste of time unless you are going to contribute to the core of WebbotLib.

If you are only WebbotLib to write programs then you don't need to do anything - (no matter what OS you have on your computer).
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
    • dunk's robot
Re: WebbotLib and Mac
« Reply #21 on: February 11, 2010, 07:11:50 PM »
ok,
miss understanding all round.

i though Webbot wanted to see if users could write build.xml...
Webbot thought i had his build.xml...

for future reference it can be found through the "developers" tab on source forge in the CVS tree.

here to be precise:
http://webbotavrclib.cvs.sourceforge.net/viewvc/*checkout*/webbotavrclib/webbotavrclib/build.xml?revision=1.29


dunk.

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: WebbotLib and Mac
« Reply #22 on: February 11, 2010, 07:20:12 PM »
Ive been unfair to Dunk.

There I was believing it was in the release. And it wasn't. My fault entirely. Altho it was in the source control sysem - ie his long link.

Dunk now has the file and will no doubt comment back.

The build.xml will now be included in future releases - at which time forget about that long URL he gave you as you will have it anyway.

Long live arguing at cross purposes! Keeps the little grey cells going.

Tugs forelock and bows out.....
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
    • dunk's robot
Re: WebbotLib and Mac
« Reply #23 on: March 23, 2010, 03:13:14 PM »
for anyone who comes here by search,

there's now a doc on Compiling with WebbotLib without using AVR Studio here:
http://www.societyofrobots.com/member_tutorials/node/381 .
this is the doc you probably want if your using WebbotLib on a Mac.
unfortunately i don't know anything about Maccs so there are still a few gaps.


for anyone looking for info on Building WebbotLib using Ant here:
http://www.societyofrobots.com/member_tutorials/node/382


dunk.

Offline Crunchy Theory

  • Full Member
  • ***
  • Posts: 80
  • Helpful? 0
  • "Well great is ok, but amazing would be great."
Re: WebbotLib and Mac
« Reply #24 on: December 15, 2010, 10:50:24 PM »
Hey guys, just to let you know - I was able to build WebbotLib on Mac OS X. Here are some instructions for how I did it:

1) Install MacPorts. It's a tool that makes it easy to compile, install, upgrade, maintain open-source software for OS X. You can find the installer package here: http://www.macports.org/install.php

2) Run these commands in Terminal (OS X command prompt). Without doing so, the "port" command won't be found:
$ export PATH=$PATH:/opt/local/bin
$ export MANPATH=$MANPATH:/opt/local/share/man
$ export INFOPATH=$INFOPATH:/opt/local/share/info

3) Just to make sure you have the latest version of MacPorts, run this command:
$ port selfupdate --nosync

4) Search the list of Ports for "apache-ant". Or not, because I'll guarantee it's there (at least at the time of this post  ;) )
$ port search apache

5) Install Apache-Ant using this command:
$ port install apache-ant

6) Grab the latest release of WebbotLib and install it anywhere on your Mac. You can get it from here http://webbot.org.uk/iPoint/30.page

7) In Terminal, cd to the directory - for example:
$ cd /Users/Crunchy/Dev/webbotavrclib-1.27

8) Build WebbotLib!
$ ant
« Last Edit: December 15, 2010, 10:52:14 PM by Crunchy Theory »
The only way to top an upright screen, keyboard, and mouse is to eliminate the need for humans to touch a PC at all. Oh, hello there Mr. Robot... what would I like you to do, you ask?

 


Get Your Ad Here

data_list