Difference between revisions of "Installing TinyOS-2.x on Mac OS X (Snow Leopard)"
m |
|||
(6 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | * Install NesC, the AVR GCC compiler and the MSP GCC compiler by following the instructions at the [ | + | * Install NesC, the AVR GCC compiler and the MSP GCC compiler by following the instructions at the [https://github.com/razvanm/macports Unofficial MacPorts for TinyOS] page. |
* Install gcc44 from MacPorts and softlink <tt>/opt/local/bin/gcc-mp-4.4</tt> to <tt>gcc</tt>, and <tt>/opt/local/bin/g++-mp-4.4</tt> to <tt>g++</tt>, in the directory <tt>/usr/bin</tt>. | * Install gcc44 from MacPorts and softlink <tt>/opt/local/bin/gcc-mp-4.4</tt> to <tt>gcc</tt>, and <tt>/opt/local/bin/g++-mp-4.4</tt> to <tt>g++</tt>, in the directory <tt>/usr/bin</tt>. | ||
Line 7: | Line 7: | ||
Note: the apple-gcc* compiler does not work because it will complain that "-c" is not a valid option to the preprocessor. | Note: the apple-gcc* compiler does not work because it will complain that "-c" is not a valid option to the preprocessor. | ||
− | * Put "<tt>-D_FORTIFY_SOURCE=0</tt>" in your Makefile. | + | * Put "<tt>CFLAGS+=-D_FORTIFY_SOURCE=0</tt>" in your Makefile. |
* For simulations that involve opening a lot of files, e.g. simulations involving Flash memories, in the shell, type "ulimit -n <number>" where <number> is a high-enough value. | * For simulations that involve opening a lot of files, e.g. simulations involving Flash memories, in the shell, type "ulimit -n <number>" where <number> is a high-enough value. | ||
+ | |||
+ | == Troubleshooting == | ||
+ | |||
+ | * If Java complains about not finding the JNI libraries (getenv, toscomm), try running it using sudo. | ||
+ | |||
+ | * If you encounter the error <tt>can't open config file "/etc/avrdude/avrdude.conf"</tt>, either softlink <tt>/opt/local/etc/avrdude.conf</tt> to <tt>/etc/avrdude/avrdude/conf</tt>, or put the following code in the file <tt>$TOSROOT/support/make/avr/avr.rules</tt> after the line <tt>AVRDUDE_CONF ?= /etc/avrdude/avrdude.conf</tt>: | ||
+ | ifeq ($(findstring Darwin, $(shell uname)), Darwin) | ||
+ | AVRDUDE_CONF := /opt/local/etc/avrdude.conf | ||
+ | endif | ||
+ | |||
+ | * For more troubleshooting, some of the [http://www.mobilab.unina.it/TinyOSMAC.htm tips here written for Tiger] maybe applicable. | ||
+ | |||
+ | * If tools don't compile because of the following error '''"jni.h: No such file or directory"''', it may be because the Java for Mac OS X 10.6 Update 3 moved the Headers directory from /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK to /System/Library/Frameworks/JavaVM.framework/Versions/Current. If you don't have the Headers directory in /System/Library/Frameworks/JavaVM.framework/Versions/Current, download the Java Developer Package from https://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wa/getSoftware?bundleID=20719. Then, change the line "jhome=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK" to "jhome=/System/Library/Frameworks/JavaVM.framework" in '''tools/tinyos/misc/tos-locate-jre'''. | ||
+ | |||
+ | |||
[[Category:Installation]] | [[Category:Installation]] |
Latest revision as of 23:55, 27 October 2011
- Install NesC, the AVR GCC compiler and the MSP GCC compiler by following the instructions at the Unofficial MacPorts for TinyOS page.
- Install gcc44 from MacPorts and softlink /opt/local/bin/gcc-mp-4.4 to gcc, and /opt/local/bin/g++-mp-4.4 to g++, in the directory /usr/bin.
Note: gcc43 works too.
Note: the apple-gcc* compiler does not work because it will complain that "-c" is not a valid option to the preprocessor.
- Put "CFLAGS+=-D_FORTIFY_SOURCE=0" in your Makefile.
- For simulations that involve opening a lot of files, e.g. simulations involving Flash memories, in the shell, type "ulimit -n <number>" where <number> is a high-enough value.
Troubleshooting
- If Java complains about not finding the JNI libraries (getenv, toscomm), try running it using sudo.
- If you encounter the error can't open config file "/etc/avrdude/avrdude.conf", either softlink /opt/local/etc/avrdude.conf to /etc/avrdude/avrdude/conf, or put the following code in the file $TOSROOT/support/make/avr/avr.rules after the line AVRDUDE_CONF ?= /etc/avrdude/avrdude.conf:
ifeq ($(findstring Darwin, $(shell uname)), Darwin) AVRDUDE_CONF := /opt/local/etc/avrdude.conf endif
- For more troubleshooting, some of the tips here written for Tiger maybe applicable.
- If tools don't compile because of the following error "jni.h: No such file or directory", it may be because the Java for Mac OS X 10.6 Update 3 moved the Headers directory from /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK to /System/Library/Frameworks/JavaVM.framework/Versions/Current. If you don't have the Headers directory in /System/Library/Frameworks/JavaVM.framework/Versions/Current, download the Java Developer Package from https://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wa/getSoftware?bundleID=20719. Then, change the line "jhome=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK" to "jhome=/System/Library/Frameworks/JavaVM.framework" in tools/tinyos/misc/tos-locate-jre.