Compilers needed

This is where you talk about the NXJ software itself, installation issues, and programming talk.

Moderators: roger, 99jonathan, imaqine

Compilers needed

Postby traisen » Wed Dec 05, 2012 6:40 pm

Hi
I am want to compile the Lejos code from SourceForge.
I am using the info in last chapter of the Bagnall lejos book Intelligence Unleashed

Which versions of Java - 1.6 or 1.7 do you recommend?
What C++ compiler and version to you recommend?
I have the gcc that runs under cygwin for PC side and for arm side arm-elf-g++ (3.4?).

Anything else? Using Eclipse (win32) SVN is installed, but had a 1.7 and 1.6 choice for SVN Kit mentioned in the book.

Thanks
traisen
New User
 
Posts: 20
Joined: Mon Dec 15, 2008 6:53 am

Re: Compilers needed

Postby skoehler » Wed Dec 05, 2012 7:55 pm

traisen wrote:Hi
I am want to compile the Lejos code from SourceForge.


All of it? For example: you want to rebuild the leJOS firmware?

traisen wrote:I am using the info in last chapter of the Bagnall lejos book Intelligence Unleashed


I don't know that book. We don't get free copies of it, unfortunately.
What information does he give in the last chapter?

traisen wrote:Which versions of Java - 1.6 or 1.7 do you recommend?


The leJOS you can download is built with Java 1.5 and a custom arm-elf toolchain.

traisen wrote:What C++ compiler and version to you recommend?


I'm not sure what you are talking about. You only need a C++ compiler for some of the JNI wrappers.
To build them all, you need OS X Snow Leopard with Xcode, Windows with the Windows SDK or mingw-w64 installed, and on Linux you need g++ that comes with your distribution.

traisen wrote:I have the gcc that runs under cygwin for PC side and for arm side arm-elf-g++ (3.4?).


For the firmware, you should build an arm-elf toolchain with the script in the nxtvm directory. The script will also take of applying two fixes for gcc's floating point emulation. Under cygwin, there are at least 4 gccs available:
- gcc 3.x for building cygwin executables
- gcc 4.x for building cygwin executables
- mingw.org gcc for building 32bit native windows executables
- mingw-w64 toolchains for building 32bit and 64bit native windows executables.

To build the windows JNI wrapper, you only need to install the 32bit mingw-w64 toolchain.
I'm don't remember, whether I tested the bash script in the nxtvm directory for building the arm toolchain under cygwin. But if it runs fine, building the firmware under cygwin should not be a problem.

traisen wrote:Anything else? Using Eclipse (win32) SVN is installed, but had a 1.7 and 1.6 choice for SVN Kit mentioned in the book.


If you're planning to use any subversion 1.7 based client (like tortoise, not sure what subversion versions cygwin provides) or not.
If you plan to do so, install SVNKit 1.7. Otherwise, install SVNKit 1.3 (1.6 never existed, as far as I am aware). But you don't need Eclipse to build leJOS. Just run ant in the release subdirectory. It should take care of building everything Java related. Whether you use Java 1.6 or 1.7 doesn't really matter. But the version you use, is the minimum requirement for everybody who uses your build. The ant script does not rebuild the firmware or the JNI wrappers. It just takes the binaries in the snapshot subdirectory.
skoehler
leJOS Team Member
 
Posts: 1114
Joined: Thu Oct 30, 2008 4:54 pm

Re: Compilers needed

Postby traisen » Thu Dec 06, 2012 8:02 am

traisen wrote:Hi
I am want to compile the Lejos code from SourceForge.

skoehler wrote:All of it? For example: you want to rebuild the leJOS firmware?.

Firmware Yes, plus enough of Java side to prove I compiled the firmware right. Possibly a little on the PC also mainly for testing...
Why?.....
Want to include the motor/sensor drivers as part of other firmware similar to nxtOSEK (using Lejos firmware drivers) and Zenon using Lego Open Source firmware drivers).
First step will be to compile all of Lejos and have it work.
Lego NXT would be used as a hardware example with our project, fordiac. Since our project is EPL, separate license would have to be listed for drivers like nxtOSEK did with parts having different licenses.
My real (education thesis) project is an online (open source) course using fordiac and Lego MS NXT.

traisen wrote:I am using the info in last chapter of the Bagnall lejos book Intelligence Unleashed

skoehler wrote:I don't know that book. We don't get free copies of it, unfortunately.
What information does he give in the last chapter?.

Book is listed on the Lejos page and is good overview of most or all major Lejos feature. Chap.29 Open Source Development explains how to checkout and compile Classes dir under Eclipse using SVN plug-in. Tries to encourage contributing to the project.

traisen wrote:Which versions of Java - 1.6 or 1.7 do you recommend?

skoehler wrote:The leJOS you can download is built with Java 1.5 and a custom arm-elf toolchain.

Trunk is 9.1.3.x - right?

traisen wrote:What C++ compiler and version to you recommend?

skoehler wrote:I'm not sure what you are talking about. You only need a C++ compiler for some of the JNI wrappers.
To build them all, you need OS X Snow Leopard with Xcode, Windows with the Windows SDK or mingw-w64 installed, and on Linux you need g++ that comes with your distribution.

thanks

traisen wrote:I have the gcc that runs under cygwin for PC side and for arm side arm-elf-g++ (3.4?).

skoehler wrote:For the firmware, you should build an arm-elf toolchain with the script in the nxtvm directory. The script will also take of applying two fixes for gcc's floating point emulation. Under cygwin, there are at least 4 gccs available:
- gcc 3.x for building cygwin executables
- gcc 4.x for building cygwin executables
- mingw.org gcc for building 32bit native windows executables
- mingw-w64 toolchains for building 32bit and 64bit native windows executables.

To build the windows JNI wrapper, you only need to install the 32bit mingw-w64 toolchain.
I'm don't remember, whether I tested the bash script in the nxtvm directory for building the arm toolchain under cygwin. But if it runs fine, building the firmware under cygwin should not be a problem..

Thanks

traisen wrote:Anything else? Using Eclipse (win32) SVN is installed, but had a 1.7 and 1.6 choice for SVN Kit mentioned in the book.

skoehler wrote:If you're planning to use any subversion 1.7 based client (like tortoise, not sure what subversion versions cygwin provides) or not.
If you plan to do so, install SVNKit 1.7. Otherwise, install SVNKit 1.3 (1.6 never existed, as far as I am aware). But you don't need Eclipse to build leJOS. Just run ant in the release subdirectory. It should take care of building everything Java related. Whether you use Java 1.6 or 1.7 doesn't really matter. But the version you use, is the minimum requirement for everybody who uses your build. The ant script does not rebuild the firmware or the JNI wrappers. It just takes the binaries in the snapshot subdirectory.

Thanks for the minimum requirement for my users -hint, although think for Java code I will be the only one.

Now to give it a try. Thanks for what appears to be a very complete answer.
traisen
New User
 
Posts: 20
Joined: Mon Dec 15, 2008 6:53 am

Re: Compilers needed

Postby gloomyandy » Thu Dec 06, 2012 10:12 am

Hi,
I'd just like to point out that the leJOS firmware does not really provide very much in the way of sensor and motor drivers. This is by design, in leJOS we try and do as much as possible in Java, so by far the bulk of the motor control logic and sensor handling code is actually in Java, the firmware simply provides the minimum we can get away with to interface to the hardware. This may or may not be what you are looking for...

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3004
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Compilers needed

Postby traisen » Thu Dec 06, 2012 6:19 pm

Thanks I will look at exactly where the line is closer then. The online course will not just use sensors/ motors, but also ask the students to create an interface for a sensor. Something simple like some A/D sensor as example, but then at advanced level ask them to do it for other sensors.

Sounds like I will probably have more questions to get it exactly right.
traisen
New User
 
Posts: 20
Joined: Mon Dec 15, 2008 6:53 am

Re: Compilers needed

Postby skoehler » Thu Dec 06, 2012 7:44 pm

traisen wrote:
traisen wrote:Which versions of Java - 1.6 or 1.7 do you recommend?

skoehler wrote:The leJOS you can download is built with Java 1.5 and a custom arm-elf toolchain.

Trunk is 9.1.3.x - right?

No. 0.9.1-x is under branches.
trunk contains the next release - 0.9.2, 0.10.0, or 1.0 or whatever we will call it.
skoehler
leJOS Team Member
 
Posts: 1114
Joined: Thu Oct 30, 2008 4:54 pm

Re: Compilers needed

Postby skoehler » Thu Dec 06, 2012 7:46 pm

traisen wrote:Thanks I will look at exactly where the line is closer then. The online course will not just use sensors/ motors, but also ask the students to create an interface for a sensor. Something simple like some A/D sensor as example, but then at advanced level ask them to do it for other sensors.


The firmware provides a very basic interface to access the hardware (I2C, ADC, motor counter, PWM settings). Everything else is written in Java.
What you write sounds your students would have to write some Java classes.
skoehler
leJOS Team Member
 
Posts: 1114
Joined: Thu Oct 30, 2008 4:54 pm

Re: Compilers needed

Postby traisen » Fri Jan 18, 2013 3:42 am

Hi Was distracted by holidays. Getting back to this. Reading closer the info is really what I need. Hope .sh file to build toolchain works. My next step.

And Yes students would have to write code to bridge the gap. Probably in C++.
That is part of the reason for using Lejos. So those more advanced have basics device interfaces there, to save time, and add to what sensors are supported as an exercise.
And everything stays open source.

Thanks again, Carolyn
traisen
New User
 
Posts: 20
Joined: Mon Dec 15, 2008 6:53 am

Re: Compilers needed

Postby traisen » Mon Jan 21, 2013 6:48 pm

Hi again. Making progress, but need some help. (Using cygwin until I hit a show stopper.)
Where does nxtvm/src directory come from?

I have gcc 4.5.3 installed. But the directory seems to be hard coded to 4.3.2.
Also I don't have a nxtvm/src directory.

Is it created as part of the build of the toolchain?
If I change to 4.5.3, what/where do I have to change things?

Thanks again.

Error Messages:
-uThe system cannot find the file specified.
/bin/sh /cygdrive/c/Apps/Lejos/lejos-code/nxtvm/src/gcc-4.3.2/gcc/../move-if-change tmp-fixinc_list fixinc_list
echo timestamp > s-fixinc_list
Makefile:3459: recipe for target `s-macro_list' failed
make[1]: *** [s-macro_list] Error 1
make[1]: Leaving directory `/cygdrive/c/Apps/Lejos/lejos-code/nxtvm/build/gcc-4.
3.2/gcc'
Makefile:4760: recipe for target `all-gcc' failed
make: *** [all-gcc] Error 2
Compiling/Installing gcc failed
traisen
New User
 
Posts: 20
Joined: Mon Dec 15, 2008 6:53 am

Re: Compilers needed

Postby gloomyandy » Mon Jan 21, 2013 8:41 pm

Assuming that you are in a directory called nxtvm then nxtvm/src is the location used to hold the toolchain src.

I'm not at all sure that using cygwin is a good idea, certainly I don't know of anyone that has used that.

It is also not a good idea to change the version of gcc used to compile leJOS. The scripts that come with the source build a specific version of the gcc toolchain this is the toolchain that works the best with the leJOS firmware and I would strongly recommend that you use it. Note that this version is the cross compiler that is built by the script and is not the compiler version that you need to have installed on your host system.
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3004
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Compilers needed

Postby skoehler » Mon Jan 21, 2013 9:26 pm

Cygwin should not be a problem. I successfully built an arm-elf toolchain via the build_arm_toolchain.sh in SVN. It's no problem.

traisen executed that script already. It creates src, build, and some other folder in the current working directory.
@traisen: you shouldn't mess with the version numbers in that script. They have been carefully chosen.
skoehler
leJOS Team Member
 
Posts: 1114
Joined: Thu Oct 30, 2008 4:54 pm

Re: Compilers needed

Postby traisen » Wed Jan 23, 2013 5:35 am

Hi actually I am in the middle of executing that script and hit this error. Most errors I just had to install another package. Getting to the right version numbers I don't how to set /get a specific gcc version number and unfortunately don't have a linux set-up at the moment.

Is the source needed for the patches in nxtvm/src ?


If so then my first guess a sub-script is looking in the wrong place for the source first and not getting to nxtvm/src.
But build sh is short and I haven't found the sub-scripts yet.
More hints welcome if you have ideas.
Thanks
traisen
New User
 
Posts: 20
Joined: Mon Dec 15, 2008 6:53 am

Re: Compilers needed

Postby skoehler » Thu Jan 24, 2013 12:07 am

I updated my cygwin installed, and built an arm-elf toolchain from scratch using the script in trunk/nxtvm. The were no troubles at all. Some packages were missing, like iconv and mpfr, but eventually the script just finish successfully. I even built the leJOS firmware with the compiled toolchain. It worked.

When you open your cygwin shell, what do you see when you run "gcc --version"?
If it is not gcc 4.x, then install the gcc4 package and try again.
skoehler
leJOS Team Member
 
Posts: 1114
Joined: Thu Oct 30, 2008 4:54 pm

Re: Compilers needed

Postby traisen » Thu Jan 24, 2013 4:16 pm

gcc version is 4.5.3
Ran the script several times because of missing packages.
Just out of curiosity to understand what I did wrong. Could you run the build script again and see if you get an error message?

I will do a clean svn check-out and sounds like it should run the first time.
I will let know probably later today.

Many thanks
traisen
New User
 
Posts: 20
Joined: Mon Dec 15, 2008 6:53 am

Re: Compilers needed

Postby traisen » Wed Jan 30, 2013 8:19 am

Hi Skoehler,
OK Good to know it should work, but I am still see same error message. All packages are there.
I was hoping to get further before posting again. Same exact error message. And out of ideas.

It just can't find what looks like a tmp file with some include list(?)
What is your path?
What happens if you run the build script again after it worked?


Where is the toolchain when you are finished? arm-elf-gcc for example?
What / where do I look for outputs? (sorry if this seems obvious)
If it worked would it do an install $prefix for me?

If I check out lejos again, can it be built again?

Better from bash command line or under eclipse? (get same error either way at moment)
(and looking of a machine I can install Linux on.)
Thanks, Carolyn
traisen
New User
 
Posts: 20
Joined: Mon Dec 15, 2008 6:53 am

Next

Return to NXJ Software

Who is online

Users browsing this forum: No registered users and 3 guests

cron
more stuff