Compile BRL-CAD with GCC 4.7+ on Raspberry PiBRL-CAD
Status: ClosedTime to complete: 72 hrs Mentors: SeanTags: portability, compile, raspberry pi, benchmark

BRL-CAD is considered "extensively" portable given our long-standing history of running on everything from embedded systems to desktop systems to massive supercomputers.  We actively seek out new computing platforms to help improve portability.  The Raspberry Pi is an inexpensive ($25) computer the size of a credit card that typically runs Linux.  We had a previous task that confirmed BRL-CAD will mostly compile with GCC 4.4 but there were internal compiler errors.

This task involves compiling BRL-CAD on a Raspberry Pi with a newer 4.7+ GCC compiler and running the BRL-CAD benchmark.  WE WILL PROVIDE REMOTE SSH ACCESS to a Raspberry Pi that we've set up on the interview and is  ready to go.

You will be tasked with downloading the BRL-CAD sources from our Subversion repository, running cmake, compiling at least enough of BRL-CAD to run the benchmark (make benchmark), and submitting the resulting benchmark performance log.  If any step fails, you'll be expected to submit a complete transcript of what commands you ran to make sure it's not something simple we can fix or work around.

You will need to compile GCC 4.7+ yourself or it may be available precompiled online (see the references or do a search).

References

  • http://en.wikipedia.org/wiki/Raspberry_Pi
  • http://brlcad.org/wiki/Compiling
  • http://raspberrypi.stackexchange.com/questions/1/how-do-i-build-a-gcc-4-7-toolchain-for-cross-compiling
pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 2px; border-color: initial; font-size: 12px; vertical-align: baseline; width: auto; font-family: 'Droid Sans Mono', Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; background-color: #eeeeee; border-left-style: dotted; border-left-color: #cccccc; padding: 5px;">git clone https://github.com/raspberrypi/tools.git --depth 1
Uploaded Work
File name/URLFile sizeDate submitted
make_debug_gcc4.7.log256.5 KBJanuary 04 2013 22:46 UTC
make_gcc4.7_new.log10.9 MBJanuary 05 2013 10:20 UTC
commands.txt236 bytesJanuary 05 2013 22:31 UTC
d.log1.0 KBJanuary 05 2013 22:31 UTC
cmake_debug-gcc4.7.log25.3 KBJanuary 11 2013 18:35 UTC
make_debug-gcc4.7.log2.6 MBJanuary 11 2013 18:36 UTC
Comments
Tition January 4 2013 22:04 UTCTask Claimed

I would like to work on this task.

Andrei Popescu on January 4 2013 22:33 UTCTask Assigned

This task has been assigned to Titi. You have 72 hours to complete this task, good luck!

Tition January 4 2013 22:46 UTCReady for review

The work on this task is ready to be reviewed.

Sean on January 5 2013 16:42 UTCcan you explain

Can you explain the steps you took?  What commands did you run (exactly)?


Your build log seems to indicate that the installed compiler wasn't built or set up correctly.  It's generating symbols for the wrong type of environment.


The errors look like they may be specific to g++ and C++ compilation, but it's hard to tell for sure without some testing.


How far does it get if you run "make benchmark"?  What was your cmake configuration command?


 

Sean on January 5 2013 16:42 UTCTask Needs More Work

One of the mentors has sent this task back for more work. Talk to the mentor(s) assigned to this task to satisfy the requirements needed to complete this task, submit your work again and mark the task as complete once you re-submit your work.

Tition January 5 2013 20:47 UTChi

cmake .. -DBRLCAD_ENABLE_X11=OFF -DBRLCAD_BUNDLED_LIBS=ON -DCMAKE_BUILD_TYPE=Debug


make CROSS_COMPILE=arm-bcm2708hardfp-linux-gnueabi- -k VERBOSE=1 21 | tee  make_debug.log


How to setup the compiler correctly?

Tition January 5 2013 21:53 UTCI found the problem with the commands

but when i try to run the compiler its give me: -bash: ./arm-bcm2708hardfp-linux-gnueabi-gcc-4.7.1: cannot execute binary file


Can you help me?

Tition January 5 2013 22:32 UTCReady for review

The work on this task is ready to be reviewed.

Sean on January 6 2013 05:16 UTCcross-compilation?

You shouldn't need to cross-compile.  Can you delete your CMakeCache.txt file and re-run cmake while capturing all output?  Post that then try to also not cross-compile (while capturing all make output).

Sean on January 6 2013 05:16 UTCTask Needs More Work

One of the mentors has sent this task back for more work. Talk to the mentor(s) assigned to this task to satisfy the requirements needed to complete this task, submit your work again and mark the task as complete once you re-submit your work.

Tition January 6 2013 22:02 UTCdone

I delete CMakeCache.txt an re-run cmake and the result is same.


When I try to no cross-compile it give me: brlcad@raspberrypi ~/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin $ ~/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc-4.7.2
-bash: /home/brlcad/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc-4.7.2: cannot execute binary file

Tition January 6 2013 22:34 UTCReady for review

The work on this task is ready to be reviewed.

Melange on January 7 2013 22:33 UTCNo more Work can be submitted

Melange has detected that the deadline has passed and no more work can be submitted. The submitted work should be reviewed.

Sean on January 8 2013 09:13 UTCwrong compiler

Titi, cannot execute binary file implies that the arm-bcm2708 compiler that you are attempting to use is the wrong compiler.  The reference we provided was merely a guide, not instruction.


Have you tried to simply run: apt-get install gcc-4.7



Sean on January 8 2013 09:13 UTCTask Needs More Work

One of the mentors has sent this task back for more work. Talk to the mentor(s) assigned to this task to satisfy the requirements needed to complete this task, submit your work again and mark the task as complete once you re-submit your work.

Sean on January 8 2013 09:14 UTCDeadline extended

The deadline of the task has been extended with 2 days and 0 hours.

Tition January 8 2013 10:26 UTCyes

I tried but for this command I must to be sudo.


brlcad@raspberrypi ~ $ apt-get install gcc-4.7
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?


brlcad@raspberrypi ~ $ sudo apt-get install gcc-4.7
[sudo] password for brlcad:
brlcad is not in the sudoers file.  This incident will be reported.

Sean on January 9 2013 05:02 UTClooking to get it installed

Looking to get it installed, I'll update you soon.

Sean on January 9 2013 05:03 UTCDeadline extended

The deadline of the task has been extended with 1 days and 0 hours.

Tition January 9 2013 21:04 UTCokay

okay thanks

Sean on January 10 2013 05:50 UTCinstalled

4.7 has been installed along with 4.6

Melange on January 11 2013 15:20 UTCTask Reopened

Melange has detected that the final deadline has passed and it has reopened the task.

Tition January 11 2013 15:21 UTCTask Claimed

I would like to work on this task.

Tition January 11 2013 15:22 UTCI am done

I am done but melange has reopened the task

Sean on January 11 2013 15:23 UTCTask Assigned

This task has been assigned to Titi. You have 72 hours to complete this task, good luck!

Tition January 11 2013 18:36 UTCReady for review

The work on this task is ready to be reviewed.

Sean on January 11 2013 20:00 UTCTask Closed

Congratulations, this task has been completed successfully.

Sean on January 11 2013 20:02 UTCwell done

Now that looks like a much better compile attempt.  I made a change to the file that failed (src/libfb/tcl.c) so it might actulaly complete successfully now if you run "svn update" in the source directory and try "make" again in the build directory.