<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7985388249085447931</id><updated>2012-02-10T13:30:58.112-08:00</updated><category term='Motivity'/><category term='Rockets in General'/><category term='Computing'/><category term='Rocket Simulation'/><title type='text'>Specific Impulses</title><subtitle type='html'>...ravings of a mad (rocket) scientist</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://specificimpulses.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7985388249085447931/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://specificimpulses.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Mike Long</name><uri>http://www.blogger.com/profile/07495674918137786297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://2.bp.blogspot.com/_SV3KDeJVzp0/TFs0iIuc2XI/AAAAAAAAAEM/0hO9pwkZev0/S220/Scorpius_R2_Small.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>18</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7985388249085447931.post-6321265057973737722</id><published>2011-10-21T22:14:00.000-07:00</published><updated>2012-02-10T13:28:41.381-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Computing'/><title type='text'>Android Fortran Step-by-Step Part 3: Bringing it All Together</title><content type='html'>&lt;i&gt;&lt;b&gt;***UPDATED For NDK-r7*** &lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
Now that we have a working Fortran compiler for our Android hardware, it's time to show the NDK tools how to use it to build native applications.&amp;nbsp; Be warned:&amp;nbsp; I am not pretending to be a master of the GNU make system and I have done the minimum amount of hacking required so this will work for my own use... &lt;a href="http://en.wiktionary.org/wiki/your_mileage_may_vary"&gt;YMMV&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
If you haven't spent any time using the Android NDK then this will probably not be very informative.&amp;nbsp; Still, I am guessing that anyone who has gotten this far probably has at least tried to build the example applications that come with the development kit.&amp;nbsp; Specifically, I am referring to the &lt;a href="http://developer.android.com/reference/android/app/NativeActivity.html"&gt;Native Activity example&lt;/a&gt;, which is the only one I've seen so far that uses 0% Java and 100% native C code.&amp;nbsp; My original plan was to gut most of the C and replace it with calls to Fortran routines packaged as a library with interfaces bound to the skeleton C code via ISO_C_BINDING.&amp;nbsp; As I'm planning to demonstrate in the near future, this works well within reason.&lt;br /&gt;
&lt;br /&gt;
I've also decided to avoid using Eclipse for the time being and stick to doing everything with text editors (gvim) and the command line.&amp;nbsp; The main reasons for this is that the Fortran plugins for Eclipse are not great and the apk package refuses to rebuild when changes are made to the native source files... I've really tried to like Eclipse, but I just can't shake the opinion that it's difficult to install, bloated, buggy and really only meant for Java programming.&amp;nbsp; I suppose if I was a computer science major in college then I would probably be hooked on some IDE or other, but I wasn't, so I'm not.&amp;nbsp; Give me a text editor with decent syntax highlighting and a compiler that produces reasonable debugging information and I'm happy.&lt;br /&gt;
&lt;br /&gt;
On with the show...&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Step 1:&amp;nbsp; Prep the new toolchain for the ndk-build script&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
The GNU Make based native build system needs a couple of things before it will recognize the new compiler.&amp;nbsp; The first thing to do is to copy two files from the old toolchain directory into the new one:&lt;br /&gt;
&lt;br /&gt;
Starting in the NDK toolchains directory; if you are following the previous instructions, that will be here:&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: #cc0000;"&gt;
/opt/Android/android-ndk-r7/toolchains&lt;/div&gt;
&lt;br /&gt;
&lt;div style="color: #6aa84f;"&gt;
cp arm-linux-androideabi-4.4.3/config.mk arm-linux-androideabi-4.7.0/&lt;/div&gt;
&lt;div style="color: #6aa84f;"&gt;
cp arm-linux-androideabi-4.4.3/setup.mk arm-linux-androideabi-4.7.0/&lt;/div&gt;
&lt;br /&gt;
Now, if you built the 64-bit versions of the compiler executables, you will need to fake out the build script by making a symbolic link from the (non-existant) 32-bit tools to the 64-bit ones.&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: #6aa84f;"&gt;
cd arm-linux-androideabi-4.7.0/prebuilt&lt;/div&gt;
&lt;div style="color: #6aa84f;"&gt;
ln -s linux-x86_64 linux-x86&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt; Step 2: Add gfortran support to ndk-build&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
This was by far the hardest part for me since I am not a shell scripting master and definitely not a Make system master, but the result works well enough, although it could be much better I'm certain.&amp;nbsp; I would just make some diff patches, but I don't have a reliable way to post them here, so I'll just put the text of the changes in their entirety with instructions as to where to put them.&lt;br /&gt;
&lt;br /&gt;
The first thing to do is to set an environment variable that tells the NDK which toolchain to use.&amp;nbsp; Add the following to your ~/.bashrc file:&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: #3d85c6;"&gt;
export NDK_TOOLCHAIN=arm-linux-androideabi-4.7.0&lt;/div&gt;
&lt;br /&gt;
(remember that you need to start a new terminal for the variable to be used)&lt;br /&gt;
&lt;br /&gt;
&lt;b style="color: #cc0000;"&gt;UPDATE&lt;/b&gt;&lt;span style="color: #cc0000;"&gt;: &lt;/span&gt;If you followed the &lt;a href="http://specificimpulses.blogspot.com/2011/10/android-fortran-step-by-step-part-2.html"&gt;new instructions in the previous post&lt;/a&gt; then skip the next section and go straight to the bottom.. you're done!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strike&gt;Edit this file:&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;br /&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;div style="color: #cc0000;"&gt;
&lt;strike&gt;/opt/Android/android-ndk-r6b/build/core/build-binary.mk&lt;/strike&gt;&lt;/div&gt;
&lt;strike&gt;Change line 195 to this:&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;br /&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;div style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;
&lt;strike&gt;all_source_extensions := .c .s .S $(LOCAL_CPP_EXTENSION) .f .f90&lt;/strike&gt;&lt;/div&gt;
&lt;strike&gt;&lt;br /&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;Add these lines starting at line 223:&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;br /&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;div style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;
&lt;strike&gt;# handle free-form Fortran (.f90)&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;$(foreach src,$(filter %.f90,$(LOCAL_SRC_FILES)), $(call compile-f90-source,$(src)))&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;# handle fixed form Fortran (.f)&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;$(foreach src,$(filter %.f,$(LOCAL_SRC_FILES)), $(call compile-fc-source,$(src)))&lt;/strike&gt;&lt;/div&gt;
&lt;strike&gt;&lt;br /&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;Edit this file:&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;br /&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;div style="color: #cc0000;"&gt;
&lt;strike&gt;/opt/Android/android-ndk-r6b/build/core/default-build-commands.mk&lt;/strike&gt;&lt;/div&gt;
&lt;strike&gt;&lt;br /&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;Add these lines starting at line 93:&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;br /&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;div style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;
&lt;strike&gt;TARGET_FC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = $(TOOLCHAIN_PREFIX)gfortran&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;TARGET_FFLAGS&amp;nbsp;&amp;nbsp; = &lt;/strike&gt;&lt;/div&gt;
&lt;strike&gt;&lt;br /&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;Now for the big one...&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;br /&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;Edit this file:&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;br /&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;div style="color: #cc0000;"&gt;
&lt;strike&gt;/opt/Android/android-ndk-r6b/build/core/definitions.mk&lt;/strike&gt;&lt;/div&gt;
&lt;strike&gt;&lt;br /&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;Add this chunk starting at line 1040:&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;br /&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;# slightly modified version for Fortran source files&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;define ev-build-fc-file&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;$$(_OBJ): PRIVATE_SRC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; := $$(_SRC)&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;$$(_OBJ): PRIVATE_OBJ&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; := $$(_OBJ)&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;$$(_OBJ): PRIVATE_DEPS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; := $$(call host-path,$$(_OBJ).d)&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;$$(_OBJ): PRIVATE_MODULE&amp;nbsp;&amp;nbsp; := $$(LOCAL_MODULE)&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;$$(_OBJ): PRIVATE_TEXT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; := "$$(_TEXT)"&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;$$(_OBJ): PRIVATE_CC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; := $$(_CC)&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;$$(_OBJ): PRIVATE_CFLAGS&amp;nbsp;&amp;nbsp; := $$(_FLAGS)&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;$$(_OBJ): $$(_SRC) $$(LOCAL_MAKEFILE) $$(NDK_APP_APPLICATION_MK)&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @mkdir -p $$(dir $$(PRIVATE_OBJ))&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @echo "$$(PRIVATE_TEXT)&amp;nbsp; : $$(PRIVATE_MODULE) &amp;lt;= $$(notdir $$(PRIVATE_SRC))"&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(hide) $$(PRIVATE_CC) $$(PRIVATE_CFLAGS) $$(call host-path,$$(PRIVATE_SRC)) -o $$(call host-path,$$(PRIVATE_OBJ))&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;endef&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;br /&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;# This assumes the same things than ev-build-fc-file, but will handle&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;# the definition of LOCAL_FILTER_ASM as well.&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;define ev-build-fc-source-file&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;LOCAL_DEPENDENCY_DIRS += $$(dir $$(_OBJ))&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;ifndef LOCAL_FILTER_ASM&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; # Trivial case: Directly generate an object file&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; $$(eval $$(call ev-build-fc-file))&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;else&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; # This is where things get hairy, we first transform&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; # the source into an assembler file, send it to the&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; # filter, then generate a final object file from it.&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; #&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;br /&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; # First, remember the original settings and compute&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; # the location of our temporary files.&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; #&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; _ORG_SRC := $$(_SRC)&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; _ORG_OBJ := $$(_OBJ)&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; _ORG_FLAGS := $$(_FLAGS)&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; _ORG_TEXT&amp;nbsp; := $$(_TEXT)&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;br /&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; _OBJ_ASM_ORIGINAL := $$(patsubst %.o,%.s,$$(_ORG_OBJ))&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; _OBJ_ASM_FILTERED := $$(patsubst %.o,%.filtered.s,$$(_ORG_OBJ))&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;br /&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; # If the source file is a plain assembler file, we're going to&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; # use it directly in our filter.&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; ifneq (,$$(filter %.s,$$(_SRC)))&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; _OBJ_ASM_ORIGINAL := $$(_SRC)&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; endif&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;br /&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; #$$(info SRC=$$(_SRC) OBJ=$$(_OBJ) OBJ_ORIGINAL=$$(_OBJ_ASM_ORIGINAL) OBJ_FILTERED=$$(_OBJ_ASM_FILTERED))&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;br /&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; # We need to transform the source into an assembly file, instead of&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; # an object. The proper way to do that depends on the file extension.&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; #&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; # For C and C++ source files, simply replace the -c by an -S in the&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; # compilation command (this forces the compiler to generate an&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; # assembly file).&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; #&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; # For assembler templates (which end in .S), replace the -c with -E&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; # to send it to the preprocessor instead.&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; #&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; # Don't do anything for plain assembly files (which end in .s)&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; #&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; ifeq (,$$(filter %.s,$$(_SRC)))&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; _OBJ&amp;nbsp;&amp;nbsp; := $$(_OBJ_ASM_ORIGINAL)&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ifneq (,$$(filter %.S,$$(_SRC)))&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _FLAGS := $$(patsubst -c,-E,$$(_ORG_FLAGS))&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _FLAGS := $$(patsubst -c,-S,$$(_ORG_FLAGS))&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; endif&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $$(eval $$(call ev-build-fc-file))&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; endif&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;br /&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; # Next, process the assembly file with the filter&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; $$(_OBJ_ASM_FILTERED): PRIVATE_SRC&amp;nbsp;&amp;nbsp;&amp;nbsp; := $$(_OBJ_ASM_ORIGINAL)&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; $$(_OBJ_ASM_FILTERED): PRIVATE_DST&amp;nbsp;&amp;nbsp;&amp;nbsp; := $$(_OBJ_ASM_FILTERED)&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; $$(_OBJ_ASM_FILTERED): PRIVATE_FILTER := $$(LOCAL_FILTER_ASM)&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; $$(_OBJ_ASM_FILTERED): PRIVATE_MODULE := $$(LOCAL_MODULE)&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; $$(_OBJ_ASM_FILTERED): $$(_OBJ_ASM_ORIGINAL)&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @echo "AsmFilter&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : $$(PRIVATE_MODULE) &amp;lt;= $$(notdir $$(PRIVATE_SRC))"&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(hide) $$(PRIVATE_FILTER) $$(PRIVATE_SRC) $$(PRIVATE_DST)&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;br /&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; # Then, generate the final object, we need to keep assembler-specific&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; # flags which look like -Wa,&lt;option&gt;:&lt;/option&gt;&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; _SRC&amp;nbsp;&amp;nbsp; := $$(_OBJ_ASM_FILTERED)&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; _OBJ&amp;nbsp;&amp;nbsp; := $$(_ORG_OBJ)&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; _FLAGS := $$(filter -Wa%,$$(_ORG_FLAGS)) -c&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; _TEXT&amp;nbsp; := "Assembly&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; $$(eval $$(call ev-build-fc-file))&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;endif&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;endef&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;br /&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;...And this chunk at line 1213:&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;br /&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;# -----------------------------------------------------------------------------&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;# Template&amp;nbsp; : ev-compile-fc-source&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;# Arguments : 1: single Fortran source file name (relative to LOCAL_PATH)&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2: target object file (without path)&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;# Returns&amp;nbsp;&amp;nbsp; : None&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;# Usage&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : $(eval $(call ev-compile-fc-source,&lt;srcfile&gt;,&lt;objfile&gt;)&lt;/objfile&gt;&lt;/srcfile&gt;&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;# Rationale : Internal template evaluated by compile-fc-source&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;# -----------------------------------------------------------------------------&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;br /&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;define&amp;nbsp; ev-compile-fc-source&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;_SRC:=$$(LOCAL_PATH)/$(1)&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;_OBJ:=$$(LOCAL_OBJS_DIR)/$(2)&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;_FLAGS := $$($$(my)FFLAGS) \&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $$(call get-src-file-target-cflags,$(1)) \&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $$(call host-c-includes, $$(LOCAL_C_INCLUDES) $$(LOCAL_PATH)) \&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $$(LOCAL_CFLAGS) \&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $$(NDK_APP_CFLAGS) \&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $$(LOCAL_FFLAGS) \&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $$(NDK_APP_FFLAGS) \&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $$(call host-c-includes,$$($(my)C_INCLUDES)) \&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -c \&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;br /&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;_CC&amp;nbsp;&amp;nbsp; := $$(TARGET_FC)&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;_TEXT := "Compile-fortran $$(call get-src-file-text,$1)"&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;br /&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;$$(eval $$(call ev-build-fc-source-file))&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;endef&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;br /&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;# -----------------------------------------------------------------------------&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;# Function&amp;nbsp; : compile-fc-source&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;# Arguments : 1: single Fortran source file name (relative to LOCAL_PATH)&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;# Returns&amp;nbsp;&amp;nbsp; : None&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;# Usage&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : $(call compile-fc-source,&lt;srcfile&gt;)&lt;/srcfile&gt;&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;# Rationale : Setup everything required to build a single Fortran source file&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;# -----------------------------------------------------------------------------&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;compile-fc-source = $(eval $(call ev-compile-fc-source,$1,$(1:%.f=%.o)))&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;span style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;compile-f90-source = $(eval $(call ev-compile-fc-source,$1,$(1:%.f90=%.o)))&lt;/span&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;br /&gt;
These are just slightly modified versions of the functions that handle C/C++ source code.&amp;nbsp; Once this is done, you should be able to put fixed form (.f) and free-form (.f90) Fortran source files in the jni folder of your native application, add them to LOCAL_SRC_FILES in ./jni/Android.mk, and then run ndk-build like normal to compile your Fortran into the shared library for your Android application.&amp;nbsp; If you are using Eclipse you should be able to build and deploy directly to your device, but remember that it will not regenerate the apk if you make changes to the source code (at least that's what happened to me).&amp;nbsp; If you are on the command line then you can use ant to build the apk and deploy it from within the project folder:&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: #6aa84f;"&gt;
ndk-build -B V=1 &lt;/div&gt;
&lt;div style="color: #6aa84f;"&gt;
ant release&lt;/div&gt;
&lt;div style="color: #6aa84f;"&gt;
ant install&lt;/div&gt;
&lt;br /&gt;
When I find some more time, I'll put up an example of a working native application that demonstrates how to package some assets, move them to the device SD card and then use them to do something fun in Fortran using OpenGLES and the device sensors.&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7985388249085447931-6321265057973737722?l=specificimpulses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://specificimpulses.blogspot.com/feeds/6321265057973737722/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://specificimpulses.blogspot.com/2011/10/android-fortran-step-by-step-part-3.html#comment-form' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7985388249085447931/posts/default/6321265057973737722'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7985388249085447931/posts/default/6321265057973737722'/><link rel='alternate' type='text/html' href='http://specificimpulses.blogspot.com/2011/10/android-fortran-step-by-step-part-3.html' title='Android Fortran Step-by-Step Part 3: Bringing it All Together'/><author><name>Mike Long</name><uri>http://www.blogger.com/profile/07495674918137786297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://2.bp.blogspot.com/_SV3KDeJVzp0/TFs0iIuc2XI/AAAAAAAAAEM/0hO9pwkZev0/S220/Scorpius_R2_Small.png'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7985388249085447931.post-8108991577165418547</id><published>2011-10-20T06:47:00.000-07:00</published><updated>2012-02-10T13:11:37.932-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Computing'/><title type='text'>Android Fortran Step-by-Step Part 2: Building a Custom GCC Toolchain</title><content type='html'>&lt;b&gt;&lt;i&gt;***Updated for NDK-r7***&amp;nbsp;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&amp;nbsp;&lt;/i&gt;&lt;/b&gt;This part is relatively tricky.&amp;nbsp; I would never have gotten this far without the help of another clever person who needed a newer GCC toolchain for Android, but for a completely different set of reasons.&lt;br /&gt;
&lt;br /&gt;
Thank you: &lt;a href="http://glandium.org/blog/?p=2146"&gt;http://glandium.org/blog/?p=2146&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
There are a lot of steps here, so I'll try not to clutter it up with jabber.&amp;nbsp; If you have completed Part 1, then you should be ready to dive right in and start cutting and pasting the following commands.&amp;nbsp; Maybe if I find some time, I'll make this into a shell or Python script that will automate the process, maybe not.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Step 0:&amp;nbsp; Get a few more required packages&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: #6aa84f;"&gt;
sudo yum install subversion ncurses-devel flex bison texinfo&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Step 1:&amp;nbsp; Get the NDK build package&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
This would normally be installed by the ./build/tools/download-toolchain-sources.sh script included with the NDK, &lt;strike&gt;but since kernel.org was hacked a couple of months ago that doesn't seem to be working.&amp;nbsp; Luckily it is available from the glandium.org post, so get it here:&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;br /&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;a href="https://bugzilla.mozilla.org/attachment.cgi?id=549787"&gt;https://bugzilla.mozilla.org/attachment.cgi?id=549787&lt;/a&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;div style="color: black;"&gt;
&lt;strike&gt;&lt;br /&gt;&lt;/strike&gt;&lt;/div&gt;
&lt;div style="color: black;"&gt;
&lt;strike&gt;Copy the ndk-build-r6.tar.gz2 file into /opt/Android/android-ndk-r6b and extract it there:&lt;/strike&gt;&lt;/div&gt;
&lt;div style="color: #6aa84f;"&gt;
&lt;strike&gt;&amp;nbsp;tar jxvf ndk-build-r6.tar.bz2&lt;/strike&gt;&lt;/div&gt;
&lt;div style="color: black;"&gt;
&lt;strike&gt;You should now have a directory called:&lt;/strike&gt;&lt;/div&gt;
&lt;div style="color: #6aa84f;"&gt;
&lt;strike&gt;&lt;span style="color: #cc0000;"&gt;&amp;nbsp;/opt/Android/android-ndk-r6b/src/build&lt;/span&gt;&lt;/strike&gt;&lt;/div&gt;
&lt;br /&gt;
UPDATE: The google source repositories are back, so you don't need to use the download-toolchain-sources.sh script.&amp;nbsp; Simply use git (yum install git if you don't have it already):&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #6aa84f;"&gt;mkdir src&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6aa84f;"&gt;git clone https://android.googlesource.com/toolchain/build src/build&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Step 2:&amp;nbsp; Put the GCC sources into your Android NDK install&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: #6aa84f;"&gt;
cd /opt/Android/android-ndk-r7&lt;/div&gt;
&lt;div style="color: #6aa84f;"&gt;
mkdir -p src/gcc&lt;/div&gt;
&lt;div style="color: #6aa84f;"&gt;
svn export -r182917 svn://gcc.gnu.org/svn/gcc/trunk src/gcc/gcc-4.7.0&lt;/div&gt;
This will give you the exact set of sources that I used.&amp;nbsp; Depending on your connection speed this could also take some time to finish.&amp;nbsp; If you want to be adventurous, you can get the bleeding edge sources by omitting the -r182917 from the command above.&amp;nbsp; You can also use checkout instead of export if you want to be able to keep your sources up-to-date via 'svn update'.&amp;nbsp; Of course, as of the date of this post, this version IS the bleeding edge ;)&lt;br /&gt;
&lt;br /&gt;
&lt;strike&gt;&lt;b&gt;Step 3: Patch the GCC sources&lt;/b&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;br /&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;There is an anoying 'bug' in the GCC gfortran configure process when building a cross-compiler (at least this one anyway).&amp;nbsp; Fortunately, this is much easier with the latest sources than it was &lt;a href="http://specificimpulses.blogspot.com/2011/01/my-android-speaks-fortran-yours-can-too.html"&gt;the first time I tried it&lt;/a&gt;, but it still is a bit of a hack.&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;br /&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;Open this file:&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;br /&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;div style="color: #cc0000;"&gt;
&lt;strike&gt;/opt/Android/android-ndk-r6b/src/gcc/gcc-4.7.0/libgfortran/configure&lt;/strike&gt;&lt;/div&gt;
&lt;div style="background-color: white; color: #3d85c6;"&gt;
&lt;strike&gt;&lt;b&gt;Change 'exit $1' on lines 279 and 26306 to 'echo $1'&lt;/b&gt;&lt;/strike&gt;&lt;/div&gt;
&lt;strike&gt;This will keep the configure script from crashing because of a link test that can't be done for the cross-compiler.&amp;nbsp; If anyone has a more elegant solution to this then please post it in the comments!&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;br /&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;Now open this file:&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;br /&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;div style="color: #cc0000;"&gt;
&lt;strike&gt;/opt/Android/android-ndk-r6b/src/gcc/gcc-4.7.0/libgfortran/io/unix.c&lt;/strike&gt;&lt;/div&gt;
&lt;div style="color: #3d85c6;"&gt;
&lt;strike&gt;&lt;b&gt;Add the following starting on line 1113:&lt;/b&gt;&lt;/strike&gt;&lt;/div&gt;
&lt;div style="color: #3d85c6;"&gt;
&lt;strike&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;#if !defined(S_IREAD) &amp;amp;&amp;amp; defined(S_IRUSR)&lt;/span&gt;&lt;/strike&gt;&lt;/div&gt;
&lt;div style="color: #3d85c6;"&gt;
&lt;strike&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;#define S_IREAD&amp;nbsp; S_IRUSR&lt;/span&gt;&lt;/strike&gt;&lt;/div&gt;
&lt;div style="color: #3d85c6;"&gt;
&lt;strike&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;#define S_IWRITE S_IRUSR&lt;/span&gt;&lt;/strike&gt;&lt;/div&gt;
&lt;div style="color: #3d85c6;"&gt;
&lt;strike&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;#endif&lt;/span&gt;&lt;/strike&gt;&lt;/div&gt;
&lt;strike&gt;&lt;br /&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;This fixes a file permission issue when linking against the Android Bionic C library instead of the normal glibc.&lt;/strike&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Step 4: Get all of the extra sources you will need&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
There are a number of extra packages that are required in order to build a fully functional GCC cross-compiler.&amp;nbsp; These also need to be put in the right location for the Android helper script to use.&amp;nbsp; Note that the sources for gcc binutils and gdb need to be extracted, the others can stay packed up.&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: #6aa84f;"&gt;
cd src&lt;/div&gt;
&lt;div style="color: #6aa84f;"&gt;
mkdir binutils&lt;/div&gt;
&lt;div style="color: #6aa84f;"&gt;
cd binutils&lt;br /&gt;
wget http://sourceware.mirrors.tds.net/pub/sourceware.org/binutils/snapshots/binutils-2.22.51.tar.bz2&lt;/div&gt;
&lt;div style="color: #6aa84f;"&gt;
tar -jxvf binutils-2.22.51.tar.bz2&lt;/div&gt;
&lt;div style="color: #6aa84f;"&gt;
cd ..&lt;/div&gt;
&lt;div style="color: #6aa84f;"&gt;
mkdir gmp&lt;/div&gt;
&lt;div style="color: #6aa84f;"&gt;
cd gmp&lt;/div&gt;
&lt;div style="color: #6aa84f;"&gt;
wget http://ftp.gnu.org/gnu/gmp/gmp-5.0.2.tar.bz2&lt;/div&gt;
&lt;div style="color: #6aa84f;"&gt;
cd ..&lt;/div&gt;
&lt;div style="color: #6aa84f;"&gt;
mkdir mpfr&lt;/div&gt;
&lt;div style="color: #6aa84f;"&gt;
cd mpfr&lt;/div&gt;
&lt;div style="color: #6aa84f;"&gt;
wget http://ftp.gnu.org/gnu/mpfr/mpfr-3.0.1.tar.bz2&lt;/div&gt;
&lt;div style="color: #6aa84f;"&gt;
cd ..&lt;/div&gt;
&lt;div style="color: #6aa84f;"&gt;
mkdir mpc&lt;/div&gt;
&lt;div style="color: #6aa84f;"&gt;
cd mpc&lt;/div&gt;
&lt;div style="color: #6aa84f;"&gt;
wget http://www.multiprecision.org/mpc/download/mpc-0.9.tar.gz&lt;/div&gt;
&lt;div style="color: #6aa84f;"&gt;
cd ..&lt;/div&gt;
&lt;div style="color: #6aa84f;"&gt;
mkdir gdb&lt;/div&gt;
&lt;div style="color: #6aa84f;"&gt;
cd gdb&lt;/div&gt;
&lt;div style="color: #6aa84f;"&gt;
wget http://ftp.gnu.org/gnu/gdb/gdb-7.3a.tar.bz2&lt;/div&gt;
&lt;div style="color: #6aa84f;"&gt;
tar -jxvf gdb-7.3a.tar.bz2&lt;/div&gt;
&lt;div style="color: #6aa84f;"&gt;
cd ..&lt;/div&gt;
&lt;br /&gt;
&lt;div style="color: #cc0000;"&gt;
!!!IMPORTANT!!!&lt;/div&gt;
&lt;div style="color: #cc0000;"&gt;
Use the exact versions of each of the above that are shown.&amp;nbsp; There is a problem building with mpfr-3.1 and it will make it a lot harder for me to help you if you are using other versions!&lt;/div&gt;
&lt;br /&gt;
You should now have a directory structure like this:&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: #3d85c6;"&gt;
/opt/Android/android-ndk-r7/src:&lt;/div&gt;
&lt;br /&gt;
&lt;div style="color: #6aa84f; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;
ls *&lt;/div&gt;
&lt;span style="color: #6aa84f; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;src/binutils:&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6aa84f; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;binutils-2.22.51&amp;nbsp; binutils-2.22.51.tar.bz2&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #6aa84f; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;src/build:&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6aa84f; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;build-sysroot.sh&amp;nbsp; config.guess&amp;nbsp; configure&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; COPYING&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dejagnu&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Makefile.in&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6aa84f; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;clear_header.sh&amp;nbsp;&amp;nbsp; config.sub&amp;nbsp;&amp;nbsp;&amp;nbsp; configure.ac&amp;nbsp; COPYING.LIB&amp;nbsp; install-sh&amp;nbsp; README&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #6aa84f; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;src/gcc:&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6aa84f; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;gcc-4.7.0&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #6aa84f; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;src/gdb:&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6aa84f; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;gdb-7.3&amp;nbsp; gdb-7.3a.tar.bz2&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #6aa84f; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;src/gmp:&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6aa84f; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;gmp-5.0.2.tar.bz2&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #6aa84f; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;src/mpc:&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6aa84f; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;mpc-0.9.tar.gz&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #6aa84f; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;src/mpfr:&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6aa84f; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;mpfr-3.0.1.tar.bz2&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt; Step 5: Setting up the NDK helper script&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
The Android NDK comes with a nice script that takes care of most of the build process, as long as it knows where to find what it needs.&amp;nbsp; That requires a little bit of editing...&lt;br /&gt;
&lt;br /&gt;
&lt;strike&gt;Open up:&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;br /&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;div style="color: #cc0000;"&gt;
&lt;strike&gt;/opt/Android/android-ndk-r6b/build/tools/build-gcc.sh&lt;/strike&gt;&lt;/div&gt;
&lt;strike&gt;&lt;br /&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;and make the following changes:&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;br /&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;div style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;
&lt;strike&gt;GDB_VERSION=7.3&lt;/strike&gt;&lt;/div&gt;
&lt;div style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;
&lt;strike&gt;BINUTILS_VERSION=2.22.51&lt;/strike&gt;&lt;/div&gt;
&lt;div style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;
&lt;strike&gt;GMP_VERSION=5.0.2&lt;/strike&gt;&lt;/div&gt;
&lt;div style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;
&lt;strike&gt;MPFR_VERSION=3.0.1&lt;/strike&gt;&lt;/div&gt;
&lt;strike&gt;&lt;br /&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;Add a new definition for MPC just below the one for GDB:&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;br /&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;div style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;
&lt;strike&gt;MPC_VERSION=0.9&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;register_var_option "--mpc-version=&lt;version&gt;&amp;lt;version&amp;gt;" MPC_VERSION "Specify mpc version"&lt;/version&gt;&lt;/strike&gt;&lt;/div&gt;
&lt;strike&gt;&lt;br /&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;Add a new option to control the languages that are to be built.&amp;nbsp; This can be placed anywhere in the upper portion of the script.&amp;nbsp; I placed it right under the line that starts: register_var_option "--keep-libstdcxx"&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;br /&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;div style="color: #3d85c6;"&gt;
&lt;strike&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;ENABLE_LANGUAGES="c,c++,fortran"&lt;/span&gt;&lt;/strike&gt;&lt;/div&gt;
&lt;div style="color: #3d85c6;"&gt;
&lt;strike&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;register_var_option "--enable-languages=&lt;name&gt;&lt;name&gt;&amp;lt;name&amp;gt;" ENABLE_LANGUAGES "Experimental: specify which languages to build"&lt;/name&gt;&lt;/name&gt;&lt;/span&gt;&lt;/strike&gt;&lt;/div&gt;
&lt;strike&gt;&lt;br /&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;Now add the new definitions to the configure command about 2/3rds down in the script:&lt;/strike&gt;&lt;br /&gt;
&lt;strike&gt;&lt;br /&gt;&lt;/strike&gt;&lt;br /&gt;
&lt;div style="color: #999999; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;
&lt;strike&gt;mkdir -p $BUILD_OUT &amp;amp;&amp;amp; cd $BUILD_OUT &amp;amp;&amp;amp; run \&lt;/strike&gt;&lt;/div&gt;
&lt;div style="color: #999999; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;
&lt;strike&gt;$BUILD_SRCDIR/configure --target=$ABI_CONFIGURE_TARGET \&lt;/strike&gt;&lt;/div&gt;
&lt;div style="color: #999999; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;
&lt;strike&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --enable-initfini-array \&lt;/strike&gt;&lt;/div&gt;
&lt;div style="color: #999999; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;
&lt;strike&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --host=$ABI_CONFIGURE_HOST \&lt;/strike&gt;&lt;/div&gt;
&lt;div style="color: #999999; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;
&lt;strike&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --build=$ABI_CONFIGURE_BUILD \&lt;/strike&gt;&lt;/div&gt;
&lt;div style="color: #999999; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;
&lt;strike&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --disable-nls \&lt;/strike&gt;&lt;/div&gt;
&lt;div style="color: #999999; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;
&lt;strike&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --prefix=$TOOLCHAIN_PATH \&lt;/strike&gt;&lt;/div&gt;
&lt;div style="color: #999999; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;
&lt;strike&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --with-sysroot=$TOOLCHAIN_SYSROOT \&lt;/strike&gt;&lt;/div&gt;
&lt;div style="color: #999999; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;
&lt;strike&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --with-binutils-version=$BINUTILS_VERSION \&lt;/strike&gt;&lt;/div&gt;
&lt;div style="color: #999999; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;
&lt;strike&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --with-mpfr-version=$MPFR_VERSION \&lt;/strike&gt;&lt;/div&gt;
&lt;div style="color: #999999; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;
&lt;strike&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --with-gmp-version=$GMP_VERSION \&lt;/strike&gt;&lt;/div&gt;
&lt;div style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;
&lt;strike&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --with-mpc-version=$MPC_VERSION \&lt;/b&gt;&lt;/strike&gt;&lt;/div&gt;
&lt;div style="color: #999999; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;
&lt;strike&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --with-gcc-version=$GCC_VERSION \&lt;/strike&gt;&lt;/div&gt;
&lt;div style="color: #999999; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;
&lt;strike&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --with-gdb-version=$GDB_VERSION \&lt;/strike&gt;&lt;/div&gt;
&lt;div style="color: #3d85c6; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;
&lt;strike&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --enable-languages=$ENABLE_LANGUAGES \&lt;/b&gt;&lt;/strike&gt;&lt;/div&gt;
&lt;div style="color: #999999; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;
&lt;strike&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ABI_CONFIGURE_EXTRA_FLAGS&lt;/strike&gt;&lt;/div&gt;
&lt;br /&gt;
UPDATE:&lt;br /&gt;
Since makefiles are notorious for crapping out due to invisible typos, I've decided to post a patch that should get your ndk-r7 directory all fixed up.&lt;br /&gt;
&lt;br /&gt;
http://www.scientific-sims.com/files/blog/ndk-r7-fortran.patch&lt;br /&gt;
&lt;br /&gt;
Copy the above patch into your android-ndk-r7 directory and then patch as follows:&lt;br /&gt;
&lt;br /&gt;
patch -p1 -i ndk-r7-fortran.patch&lt;br /&gt;
&lt;br /&gt;
If it patches five files successfully then you should be ready to start the build...&lt;br /&gt;
&lt;br /&gt;
Make sure you are in the NDK base directory:&lt;br /&gt;
&lt;div style="color: #6aa84f;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="color: #6aa84f;"&gt;
cd /opt/Android/android-ndk-r7&lt;/div&gt;
&lt;br /&gt;
Start the script and go to bed.. :)&lt;br /&gt;
&lt;div style="color: #6aa84f;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="color: #6aa84f;"&gt;
./build/tools/build-gcc.sh --try-64 $PWD/src $PWD arm-linux-androideabi-4.7.0&lt;/div&gt;
&lt;br /&gt;
If everything goes ok, this will take quite a while, possibly an hour or more.  When it finishes, your shiny new Fortran enabled compiler suite will be here:&lt;br /&gt;
&lt;div style="color: #cc0000;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="color: #cc0000;"&gt;
/opt/Android/android-ndk-r7/toolchains/arm-linux-androideabi-4.7.0/prebuilt/linux-x86_64/bin&lt;/div&gt;
&lt;br /&gt;
Now you can remove the old compiler from your ~/.bashrc file and replace it with the new one (see the last post).&lt;br /&gt;
&lt;div style="color: #6aa84f;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="color: #6aa84f;"&gt;
[mike@fedorocks bin]$ arm-linux-androideabi-gfortran --version&lt;/div&gt;
&lt;span style="color: #6aa84f;"&gt;GNU Fortran (GCC) &lt;b&gt;4.7.0&lt;/b&gt; 20111019 (experimental)&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6aa84f;"&gt;Copyright (C) 2011 Free Software Foundation, Inc.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #6aa84f;"&gt;GNU Fortran comes with NO WARRANTY, to the extent permitted by law.&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6aa84f;"&gt;You may redistribute copies of GNU Fortran&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6aa84f;"&gt;under the terms of the GNU General Public License.&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #6aa84f;"&gt;For more information about these matters, see the file named COPYING&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: black;"&gt;&lt;span style="font-family: inherit;"&gt;If you've made it this far then congratulations! You can now use your shiny new Arm enabled Fortran compiler just as you would your regular Fortran compiler.&amp;nbsp; I've already tested this with the Linpack benchmark as well as several other codes, so I am confident that it works.&amp;nbsp; While that is all well and good, our ultimate goal is to fix up the Android build system so we can put Fortran native code in our Android applications and pack them up for distribution on the Android Market.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: black;"&gt;&lt;span style="font-family: inherit;"&gt;Stay tuned... &lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7985388249085447931-8108991577165418547?l=specificimpulses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://specificimpulses.blogspot.com/feeds/8108991577165418547/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://specificimpulses.blogspot.com/2011/10/android-fortran-step-by-step-part-2.html#comment-form' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7985388249085447931/posts/default/8108991577165418547'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7985388249085447931/posts/default/8108991577165418547'/><link rel='alternate' type='text/html' href='http://specificimpulses.blogspot.com/2011/10/android-fortran-step-by-step-part-2.html' title='Android Fortran Step-by-Step Part 2: Building a Custom GCC Toolchain'/><author><name>Mike Long</name><uri>http://www.blogger.com/profile/07495674918137786297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://2.bp.blogspot.com/_SV3KDeJVzp0/TFs0iIuc2XI/AAAAAAAAAEM/0hO9pwkZev0/S220/Scorpius_R2_Small.png'/></author><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7985388249085447931.post-1428341977101762531</id><published>2011-10-17T22:07:00.000-07:00</published><updated>2012-02-10T13:10:42.513-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Computing'/><title type='text'>Android Fortran Step-by-Step Part 1: Preparing Your Build Machine</title><content type='html'>&lt;b&gt;&lt;i&gt;***Updated for NDK-r7*** &lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
I'm going to keep these next few posts light on the humor if that's alright.. being funny takes too much time and effort.. :(&lt;br /&gt;
&lt;br /&gt;
In case this is your first visit to this blog, you might want to have a look at some background..&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://specificimpulses.blogspot.com/2011/01/my-android-speaks-fortran-yours-can-too.html"&gt;here..&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://specificimpulses.blogspot.com/2011/05/short-update-android-fortran-linpack.html"&gt;and here..&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://specificimpulses.blogspot.com/2010/05/pedal-to-metal-for-scorpius.html"&gt;This is nice too&lt;/a&gt; if your into that sort of thing.&lt;br /&gt;
&lt;br /&gt;
So, if you're still with me, lets start by assuming that you are using a Windows computer.&amp;nbsp; If not, then good for you, and I'll try to keep this as neutral as possible.&amp;nbsp; As much as I like to endorse a Microsoft free lifestyle (well, they do make good mice), I am not so much of a Linux snob that I believe there aren't people out there who have a good reason to run Windows.&amp;nbsp; So, if that is you, go ahead and log out of Call of Duty, stand up, stretch, focus on an object across the room for a moment, then head over to &lt;a href="http://www.virtualbox.org/"&gt;www.virtualbox.org&lt;/a&gt; and install the latest version.&amp;nbsp; Let's just pretend that VirtualBox isn't owned by Oracle for a little while.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-ejnmf91lOx8/TpzjoOjDgAI/AAAAAAAAAH4/OtPWi6dbzhg/s1600/Virtualbox_Main_Window.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="475" src="http://2.bp.blogspot.com/-ejnmf91lOx8/TpzjoOjDgAI/AAAAAAAAAH4/OtPWi6dbzhg/s640/Virtualbox_Main_Window.PNG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
I'm going to let someone else show you &lt;a href="http://www.sysprobs.com/install-fedora-15-virtualbox-steps-install-virtualbox-guest-additions-fedora-15"&gt;how to get Fedora 15 installed&lt;/a&gt;.. I'm sure that those of you who prefer Ubuntu or another Linux version could make most of this work as well, but lets stick to Fedora for the moment, OK?&lt;br /&gt;
&lt;br /&gt;
Come back when you have something that looks like this:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-cFc4dI0Qqmk/Tpzynl6LhyI/AAAAAAAAAIA/mny0714riX4/s1600/Fedora_Clean.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="520" src="http://1.bp.blogspot.com/-cFc4dI0Qqmk/Tpzynl6LhyI/AAAAAAAAAIA/mny0714riX4/s640/Fedora_Clean.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
Now here's a little short-cut that should help you get all of the necessary 32-bit junk installed to support the Android development tools.&amp;nbsp; Open a terminal and type this:&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: #6aa84f;"&gt;
sudo yum install wine wine-devel wget&lt;/div&gt;
&lt;br /&gt;
If you are running 64 bit Fedora then this is the quickest way I know to setup the machine for 32 bit applications, plus you'll be able to run quite a few Windows programs with wine if you feel the need to.&amp;nbsp; There are actually a lot of Windows 95/98 games that run better under wine than under Windows XP (haven't tried any in Win7, but can't imagine it would be better).&amp;nbsp; Notice I also included the wget package, we'll need that soon enough.&lt;br /&gt;
&lt;br /&gt;
Now install Java (the horror!)&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: #6aa84f;"&gt;
sudo yum install java java-devel&lt;/div&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-7OLkaC4PL6I/Tpz1sXes2FI/AAAAAAAAAII/DLMRFESBavo/s1600/OpenJDK_Installed.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="521" src="http://1.bp.blogspot.com/-7OLkaC4PL6I/Tpz1sXes2FI/AAAAAAAAAII/DLMRFESBavo/s640/OpenJDK_Installed.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
This should install openjdk by default, which has been working fine for me.&lt;br /&gt;
&lt;br /&gt;
Now you should have everything you need to install the Android SDK and NDK.&amp;nbsp; I usually put this kind of thing under /opt and I recomment you do the same for now...&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: #6aa84f;"&gt;
sudo mkdir /opt/Android&lt;/div&gt;
&lt;div style="color: #6aa84f;"&gt;
sudo chmod 777 /opt/Android&lt;/div&gt;
&lt;br /&gt;
Those commands should be all you need to make a place for your Android stuff to live that will have the right permissions for you to work without needing root privileges. So, without further ado:&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: #6aa84f;"&gt;
cd /opt/Android&lt;br /&gt;
&lt;/div&gt;
&lt;div style="color: #6aa84f;"&gt;
wget http://dl.google.com/android/android-sdk_r16-linux.tgz&lt;/div&gt;
&lt;div style="color: #6aa84f;"&gt;
wget http://dl.google.com/android/ndk/android-ndk-r7-linux-x86.tar.bz2&lt;/div&gt;
&lt;br /&gt;
Isn't that wget handy?&lt;br /&gt;
&lt;br /&gt;
Now unpack the SDK and NDK:&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: #6aa84f;"&gt;
tar -zxvf android-sdk_r16-linux.tgz&lt;/div&gt;
&lt;div style="color: #6aa84f;"&gt;
tar -jxvf android-ndk-r7-linux-x86.tar.bz2&lt;/div&gt;
&lt;br /&gt;
Notice the -z and -j above.. Google appears to have warring internal factions over the preferred compression scheme for tar archives.&amp;nbsp; I'll let history decide which is better, bzip or gzip.. nah, just kidding, it's bzip ;)&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-CspmbRBMhq4/Tpz6FneMqMI/AAAAAAAAAIQ/0jFXSj8Q7fs/s1600/Android_sdk_ndk_unpacking.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="520" src="http://3.bp.blogspot.com/-CspmbRBMhq4/Tpz6FneMqMI/AAAAAAAAAIQ/0jFXSj8Q7fs/s640/Android_sdk_ndk_unpacking.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&amp;nbsp;Almost ready for the fun stuff.. just have to add a couple of things to our environment.. open .bashrc in your home directory and add these two lines:&lt;br /&gt;
&lt;br /&gt;
UPDATE: I forgot to include the SDK platform-tools directory, where the android debug bridge (adb) lives.. can't get far without that!&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: #3d85c6;"&gt;
PATH=/opt/Android/android-sdk-linux/tools:/opt/Android/android-sdk-linux/platform-tools:/opt/Android/android-ndk-r7:$PATH&lt;/div&gt;
&lt;div style="color: #3d85c6;"&gt;
export PATH&lt;/div&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-wu-jCgxMql0/Tpz8qBM0h3I/AAAAAAAAAIY/8HbHyMT2UyQ/s1600/bashrc_setup.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="520" src="http://1.bp.blogspot.com/-wu-jCgxMql0/Tpz8qBM0h3I/AAAAAAAAAIY/8HbHyMT2UyQ/s640/bashrc_setup.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
As an alternative to monkeying around with .bashrc, I highly recommend using &lt;a href="http://modules.sourceforge.net/"&gt;environment modules&lt;/a&gt;, especially if you use a lot of different development tools like I do on a daily basis.&amp;nbsp; For now, let's stick with the simplest approach.&lt;br /&gt;
&lt;br /&gt;
So, you should now be ready to fire up the Android SDK.. just open a new terminal and type:&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: #6aa84f;"&gt;
android&lt;/div&gt;
&lt;br /&gt;
If your environment is configured correctly then you should see this:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-iZs-rgGJb8E/Tpz970XkIwI/AAAAAAAAAIg/L6xUBMcScmg/s1600/Android_first_start.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="520" src="http://1.bp.blogspot.com/-iZs-rgGJb8E/Tpz970XkIwI/AAAAAAAAAIg/L6xUBMcScmg/s640/Android_first_start.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Now you need to install the android packages that are required for a basic development platform.&amp;nbsp; I've been working with 2.3, so I recommend starting there as well.&amp;nbsp; I think there is a good chance that the newer platforms will work also (maybe even better), but my phone is 2.3, so that's what I'm targeting.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/--xxTQqM7Bq0/Tp0AOHftkSI/AAAAAAAAAIo/8PVj1Q4Z5Io/s1600/Android_package_selection.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="520" src="http://1.bp.blogspot.com/--xxTQqM7Bq0/Tp0AOHftkSI/AAAAAAAAAIo/8PVj1Q4Z5Io/s640/Android_package_selection.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
I have to admit I like Windows 7's snip tool, and no, my handwriting isn't much better when I'm not trying to write with a mouse!&amp;nbsp; When the install is done, you should see something like this:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-4NZBR6Cc1tw/Tp0C83J_U3I/AAAAAAAAAIw/62j1q3bnmlo/s1600/Android_package_installed.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="520" src="http://1.bp.blogspot.com/-4NZBR6Cc1tw/Tp0C83J_U3I/AAAAAAAAAIw/62j1q3bnmlo/s640/Android_package_installed.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
DO NOT push that innocent looking Update All button... unless you want every available package installed!&amp;nbsp; This is also a good time to &lt;a href="http://developer.android.com/guide/developing/devices/index.html"&gt;set up an AVD&lt;/a&gt; (virtual device) if you don't have a real device to develop on.&amp;nbsp; Let me know in the comments if you need help with that.&lt;br /&gt;
&lt;br /&gt;
We're almost done with this part... In order to build our fancy new Fortran enabled tool chain, we need to temporarily add the crusty old one to the shell environment path.&amp;nbsp; So, open your .bashrc file again and add this line above the export PATH line from before:&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: #3d85c6;"&gt;
PATH=/opt/Android/android-ndk-r7/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin:$PATH&lt;/div&gt;
&lt;br /&gt;
Now if you open a new terminal, you should have the native Android compilers available:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-HsD5iBoi9XY/Tp0HBmCICMI/AAAAAAAAAI4/PPMT2-Gqwhw/s1600/Android_ndk_4.4.3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="520" src="http://4.bp.blogspot.com/-HsD5iBoi9XY/Tp0HBmCICMI/AAAAAAAAAI4/PPMT2-Gqwhw/s640/Android_ndk_4.4.3.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
At this point, you have everything you need to start working with native code in C and C++.&amp;nbsp; In the next post, I'll get to the good stuff... adding gfortran to the mix and telling the Android build system how to use it!&lt;br /&gt;
&lt;br /&gt;
Almost there... &lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7985388249085447931-1428341977101762531?l=specificimpulses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://specificimpulses.blogspot.com/feeds/1428341977101762531/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://specificimpulses.blogspot.com/2011/10/android-fortran-step-by-step-part-1.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7985388249085447931/posts/default/1428341977101762531'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7985388249085447931/posts/default/1428341977101762531'/><link rel='alternate' type='text/html' href='http://specificimpulses.blogspot.com/2011/10/android-fortran-step-by-step-part-1.html' title='Android Fortran Step-by-Step Part 1: Preparing Your Build Machine'/><author><name>Mike Long</name><uri>http://www.blogger.com/profile/07495674918137786297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://2.bp.blogspot.com/_SV3KDeJVzp0/TFs0iIuc2XI/AAAAAAAAAEM/0hO9pwkZev0/S220/Scorpius_R2_Small.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-ejnmf91lOx8/TpzjoOjDgAI/AAAAAAAAAH4/OtPWi6dbzhg/s72-c/Virtualbox_Main_Window.PNG' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7985388249085447931.post-2092997419696570162</id><published>2011-10-05T15:37:00.000-07:00</published><updated>2011-10-05T15:56:08.239-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Computing'/><title type='text'>Fortran pining for the Fjords? Not even close!</title><content type='html'>Since I've started down this rabbit hole, I may as well keep digging until I reach bedrock.&amp;nbsp; It's been interesting to me that I've gotten more feedback on this subject than any of the rocket related stuff.&amp;nbsp; Well, when I say feedback, I don't just mean comments on the posts, but include e-mails that I've received from people with questions about how to get it to work for them.&amp;nbsp; Not that I mind fielding these questions, but I think in the future I'd like to keep as much of these discussions public as possible.&amp;nbsp; By that I mean, if you have a question or comment, don't be shy... post it in the comments and I'll do my best to respond there quickly.&lt;br /&gt;
&lt;br /&gt;
It would be a shame if something you or I learned together wasn't available for other people to benefit from!&lt;br /&gt;
&lt;br /&gt;
So, where to begin... One of the reasons I haven't put anything out here for so long is that I've been making such steady progress that I couldn't find a good stopping point.&amp;nbsp; I would get a little further along and then say 'hmm.. it would be so cool if I could just get that one thing working and then people would REALLY be impressed'.&amp;nbsp; Well, as a German flight test engineer friend of mine once said, it's time for a 'Full Stop'.&amp;nbsp; Pack up the equipment, go home, forget about it for a long weekend and start sorting through the data with a clear head on Monday.&lt;br /&gt;
&lt;br /&gt;
That is the spirit that I've decided to adopt with this project.&amp;nbsp; Since I'm calling it a 'project' now, there probably should be a set of goals:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Help Fortran become a viable companion to C and C++ for developing native applications for the Android OS.&lt;/li&gt;
&lt;li&gt;Make it easier for other people to get in on the fun.&lt;/li&gt;
&lt;li&gt;Convince Google to abandon the Dalvik virtual machine altogether.&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
That last point deserves a little expansion.&amp;nbsp; If Android is to ever really compete with iOS in responsiveness and stability, they are going to have to drop the extra layer.&amp;nbsp; Android has all the right ingredients: a Linux kernel, a decent C runtime, OpenGL, OpenSL and, let's not forget, the backing of a giant corporation with almost limitless resources.&amp;nbsp; Unfortunately, that last item carries with it a level of institutional inertia that gives it the maneuverability of an ocean liner sitting on top of an aircraft carrier.&amp;nbsp; Still, what do I know?&amp;nbsp; As someone who has no formal computer science education and no real programming credentials to speak of, I accept that my opinion probably has approximately zero weight, but I can dream, can't I?&lt;br /&gt;
&lt;ul&gt;
&lt;/ul&gt;
That's about it.&amp;nbsp; I wish I could come up with something funny to say here, but there really is nothing funny about working with the Android development tools, so I'll just fall back on my old standby.&lt;br /&gt;
&lt;br /&gt;
JAVA SUCKS™&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;Really.&lt;br /&gt;
&lt;br /&gt;
No, seriously.&lt;br /&gt;
&lt;br /&gt;
I should devote an entire post to the time that I've spent trying to do anything useful with Java and C++ and contrast that with the one long weekend it took me to go from zero to comfortable with Python.&amp;nbsp; Unfortunately, if I did that, I would be wasting even more of my time, so it's not too likely.&amp;nbsp; Not to worry though, Java is now owned by the one company in the world most likely to drive it toward extinction.. and, amazingly enough, that's &lt;a href="http://theagileadmin.com/2010/08/19/oracle-declares-war-on-open-source/"&gt;NOT Microsoft&lt;/a&gt;.&amp;nbsp; Seriously, though, time will tell, but I'm just getting this out there so I can link back to this post 20 years from now and say CALLED IT!&lt;br /&gt;
&lt;br /&gt;
Sadly, I believe we are stuck with C++.&amp;nbsp; In the giant ball of mess that the language is, there are a handful of things that make it useful for people who are already comfortable with C.&amp;nbsp; That's not me, but I can envision a future where it is. &lt;br /&gt;
&lt;br /&gt;
Before anyone jumps on a high horse and starts quoting the &lt;a href="http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html"&gt;tiobe index&lt;/a&gt; or saying that &lt;a href="http://c2.com/cgi/wiki?DeadLanguageFortran"&gt;Fortran is dying, dead, buried&lt;/a&gt; and/or in some other way not relevant today, I say..&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt; Why are you reading this in the first place?&lt;/li&gt;
&lt;li&gt;If you Fortran, you know.&lt;/li&gt;
&lt;li&gt;See item #1&lt;/li&gt;
&lt;/ol&gt;
&amp;nbsp;There is a saying that is part of Fortran lore that I've seen a number of variations on over the years and it goes something like this:&lt;br /&gt;
&lt;br /&gt;
"Letter O &lt;a href="http://en.wikipedia.org/wiki/Considered_harmful" title="Considered harmful"&gt;considered harmful&lt;/a&gt;" &lt;br /&gt;
&lt;br /&gt;
Oh wait, it was this one:&lt;br /&gt;
&lt;br /&gt;
"I don't know what the syntax or features of the preferred programming language of scientists and engineers will be in the future, but I know that it will be called Fortran"&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;img border="0" src="http://3.bp.blogspot.com/-EOV4ho4TVUE/TozMxCdfGHI/AAAAAAAAAH0/UYmogWDcWWI/s1600/oldefortran.jpg" /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Next up.. getting your Android on.. or.. Learning Linux for fun and profit!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7985388249085447931-2092997419696570162?l=specificimpulses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://specificimpulses.blogspot.com/feeds/2092997419696570162/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://specificimpulses.blogspot.com/2011/10/fortran-pining-for-fjords-not-even.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7985388249085447931/posts/default/2092997419696570162'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7985388249085447931/posts/default/2092997419696570162'/><link rel='alternate' type='text/html' href='http://specificimpulses.blogspot.com/2011/10/fortran-pining-for-fjords-not-even.html' title='Fortran pining for the Fjords? Not even close!'/><author><name>Mike Long</name><uri>http://www.blogger.com/profile/07495674918137786297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://2.bp.blogspot.com/_SV3KDeJVzp0/TFs0iIuc2XI/AAAAAAAAAEM/0hO9pwkZev0/S220/Scorpius_R2_Small.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-EOV4ho4TVUE/TozMxCdfGHI/AAAAAAAAAH0/UYmogWDcWWI/s72-c/oldefortran.jpg' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7985388249085447931.post-8022486790876195101</id><published>2011-05-04T22:46:00.000-07:00</published><updated>2011-05-05T11:02:58.311-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Computing'/><title type='text'>Short Update.. Android Fortran Linpack</title><content type='html'>Sorry I haven't had much time for blogging lately, hopefully I will be able to make some soon.&amp;nbsp; Until then, I wanted to put some more information on the Fortran compiler that &lt;a href="http://specificimpulses.blogspot.com/2011/01/my-android-speaks-fortran-yours-can-too.html"&gt;I hacked together for android&lt;/a&gt; and the modified Linpack benchmark.&amp;nbsp; I've gotten several e-mails from people with comments about the procedure and questions about how to make it work for themselves.&amp;nbsp; Some of the comments might even allow me to make the compiler work correctly without the ugly hacks, but alas, it works ok right now, so my motivation is low.&lt;br /&gt;
&lt;br /&gt;
Anyway, a couple of days ago, I dug all of it back out and verified that it still worked.&amp;nbsp; Then I made a couple of small changes to the code to make it easier to install and pushed it back out to my phone and tried it out.&amp;nbsp; It was a bit frustrating since my phone had lost it's ability to give me superuser access after the last update from Verizon.&amp;nbsp; Technically, it wasn't entirely necessary for me to root the phone for this, but I decided &lt;a href="http://www.droidforums.net/forum/droid-labs/74028-root-droid-1-regardless-os-version.html"&gt;I wanted to re-root it&lt;/a&gt; before I installed the new version of the benchmark, just in case I ran into any trouble.&amp;nbsp; Eventually, I'd like to pack all this up nicely in a signed apk and drop it for free on the android market, but that is really low on my priority list right now.&lt;br /&gt;
&lt;br /&gt;
So, I've made the source code and the pre-compiled arm-android executables available here:&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://aeromonkey.homeip.net/public/android"&gt;http://aeromonkey.homeip.net/public/android&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
There isn't too much to say about the code that you won't learn by looking at it.&amp;nbsp; The makefile is probably the most useful thing, since it handles the linking step that gave me so much trouble before.&amp;nbsp; Installing the executable is easy enough if you have the adb bridge set up.&amp;nbsp; You just need to put it where it can be executed.. in my case:&lt;br /&gt;
&lt;br /&gt;
adb push linpack_d /data/local/&lt;br /&gt;
&lt;br /&gt;
Then it can be run using a terminal app (or the adb shell).&amp;nbsp; Once you have a terminal open, just go to where you put it and run it.&lt;br /&gt;
&lt;br /&gt;
cd /data/local&lt;br /&gt;
./linpack_d {Matrix-Size} {Results-File}&lt;br /&gt;
&lt;br /&gt;
or more specifically,&lt;br /&gt;
&lt;br /&gt;
./linpack_d 500 /mnt/sdcard/tmp/linpack.results&lt;br /&gt;
&lt;br /&gt;
There is a definite bug in the compiler right now that makes it fail when trying to overwrite an existing results file, so it's best to remove the file manually before running the benchmark if you want to save the results.&lt;br /&gt;
&lt;br /&gt;
I've also included the python script I wrote that lets the benchmark be run in a more interactive way.&amp;nbsp; This requires the &lt;a href="http://code.google.com/p/android-scripting/"&gt;Scripting Layer for Android&lt;/a&gt; and is left as an exercise for the reader. (Hint: put it in /mnt/sdcard/sl4a/scripts)&lt;br /&gt;
&lt;br /&gt;
I hope some industrious people out there can get this to work on a few other phones.. my Droid 1 seems to top out at just under 25 MFlops using the best compiler options I could find for the cortex-a8.&amp;nbsp; I ran it on a friend's Droid 2 a while ago and got about 40 (if I remember right).&lt;br /&gt;
&lt;br /&gt;
It would be fun to hear how it runs on some newer hardware, so let me know in the comments section below!&lt;br /&gt;
&lt;br /&gt;
DISCLAIMER:&amp;nbsp; if you break your phone it ain't my fault.. and besides, you really shouldn't be installing random apps you downloaded from some guy's blog anyway.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7985388249085447931-8022486790876195101?l=specificimpulses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://specificimpulses.blogspot.com/feeds/8022486790876195101/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://specificimpulses.blogspot.com/2011/05/short-update-android-fortran-linpack.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7985388249085447931/posts/default/8022486790876195101'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7985388249085447931/posts/default/8022486790876195101'/><link rel='alternate' type='text/html' href='http://specificimpulses.blogspot.com/2011/05/short-update-android-fortran-linpack.html' title='Short Update.. Android Fortran Linpack'/><author><name>Mike Long</name><uri>http://www.blogger.com/profile/07495674918137786297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://2.bp.blogspot.com/_SV3KDeJVzp0/TFs0iIuc2XI/AAAAAAAAAEM/0hO9pwkZev0/S220/Scorpius_R2_Small.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7985388249085447931.post-7659797603738290314</id><published>2011-01-14T22:37:00.000-08:00</published><updated>2011-10-21T22:32:46.159-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Computing'/><title type='text'>My Android speaks Fortran.. yours can too!</title><content type='html'>UPDATE: This is inferior technology... &lt;a href="http://specificimpulses.blogspot.com/2011/10/android-fortran-step-by-step-part-1.html"&gt;see here for the new way!&lt;/a&gt;&lt;br /&gt;
 &lt;br /&gt;
Ok.. this is WAY off-topic, even more so than my last couple of posts.&amp;nbsp; I promise that I'll get back to the rocket business eventually, but I just think this is too cool not to share.&amp;nbsp; Plus I wanted to record what I did somewhere so I don't forget about it.&amp;nbsp; Not to mention the amount of nerd street cred that something like this is worth...&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/_SV3KDeJVzp0/TSPX4yjCRVI/AAAAAAAAAGI/OtKlyfzsaII/s1600/punch+card+power.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://4.bp.blogspot.com/_SV3KDeJVzp0/TSPX4yjCRVI/AAAAAAAAAGI/OtKlyfzsaII/s320/punch+card+power.png" width="173" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
In a nutshell, I've managed, through sheer bullheadedness, to get something that is completely useless to 99.44% of android phone owners.&amp;nbsp; Something that seemed perfectly reasonable to me that was just absent... a Fortran compiler.&lt;br /&gt;
&lt;br /&gt;
A little backgroud...&lt;br /&gt;
&lt;br /&gt;
When I got my shiny new Verizon Droid back in June of last year, I was really excited by the possibilities that the platform presented to me with its open source Linux based Android goodness under the hood.&amp;nbsp; Unfortunately, I quickly discovered that while google has indeed released the source for the Android platform, that platform is lacking some of the things that make life on planet Unix so fun and portable.&amp;nbsp; Most notable of these are the &lt;a href="http://en.wikipedia.org/wiki/X11"&gt;X11 windowing system&lt;/a&gt; and the full &lt;a href="http://gcc.gnu.org/"&gt;GNU Compiler Collection&lt;/a&gt;, lovingly referred to as GCC.&amp;nbsp; Those two major omissions, along with their decision to use a &lt;a href="http://www.netmite.com/android/mydroid/1.5/bionic/libc/docs/OVERVIEW.TXT"&gt;non-standard c library&lt;/a&gt;, mean that it is far from trivial to get applications ported over.&amp;nbsp; Ironically, this is exactly what makes the far less open Apple mobile iOS much easier to develop for (from what I've read anyway), since most of the facilities from the desktop (OSX) are available in some fashion or other and everything is standardized and collected neatly together under the &lt;a href="http://en.wikipedia.org/wiki/Xcode"&gt;Xcode IDE&lt;/a&gt;.&amp;nbsp; The google answer to this was to add a bunch of features to the venerable Eclipse IDE, declare that Java will be the language of choice for the platform and called it good.&lt;br /&gt;
&lt;br /&gt;
Now as someone who has sworn off Java for life on the grounds (small pun intended) that it is a language with all the complexities of C++ and none of the speed, I just refuse to stand by while the company that will one day bring us Skynet attempts to keep me from using my phone the way I want.&amp;nbsp; I actually had high hopes for the so-called &lt;a href="http://code.google.com/p/android-scripting/"&gt;scripting layer for android&lt;/a&gt;, which makes it possible to run Python (my second favorite computer language) on the phone.&amp;nbsp; But once again, google has seen fit to hamstring developers by only providing bindings to a handful of the phone's low level functions, relegating Python and friends to second class citizens in the Android kingdom.&lt;br /&gt;
&lt;br /&gt;
This is where my Odyssey began, a simple desire to do what I wanted on my phone in a language that I understand.. that language being Fortran.&amp;nbsp; Now you might ask me, "Mike, what place does the oldest surviving computer language have on my shiny new personal communication device?".&amp;nbsp; Well, my answer to that is maybe it doesn't, but I think it should get a chance, don't you?&amp;nbsp; Fortran is still the undisputed heavyweight number crunching champion of the world, so why not try to take advantage of that to write some smoking fast applications for the little black phone that could.&amp;nbsp; You might also say, "What's the point since the android API is not accessible from Fortran at all so it's even less useful than Python?".&amp;nbsp; To that, my answer is the magical Fortran fairy dust called &lt;a href="http://gcc.gnu.org/onlinedocs/gfortran/ISO_005fC_005fBINDING.html"&gt;"iso_c_binding"&lt;/a&gt;.&amp;nbsp; Since the &lt;a href="http://developer.android.com/sdk/ndk/index.html"&gt;Android NDK&lt;/a&gt; provides interfaces to most of the phone's functions via C, then I should be able to, at least in theory, access those functions from Fortran by wrapping them in C.&lt;br /&gt;
&lt;br /&gt;
So, with this knowledge in hand, I proceeded to download the latest GCC 4.6 pre-release source code and started looking online for information that I needed to build a cross compiler for the ARM CPU in my phone... two weeks and a few gray hairs later, I marveled at the wonder of 'Hello World' in three lines of Fortran running in a terminal on my droid.&lt;br /&gt;
&lt;br /&gt;
Here's how I did it... but be warned, what follows is full of dirty hacks, workarounds and generally poor execution, so don't expect it to work for you the first time if you attempt to duplicate it.&amp;nbsp; I will, however, try to re-create the process as faithfully as possible.&lt;br /&gt;
&lt;br /&gt;
The first thing you will need is a computer running Linux, in my case &lt;a href="http://fedoraproject.org/"&gt;I am using Fedora 13&lt;/a&gt;, but most other distributions should work without major changes.&amp;nbsp; Don't even think about asking me how to do this under Windows unless you want to be taunted mercilessly until you have no choice but to abandon this blog altogether... seriously.&amp;nbsp; It won't work under Windows so don't try it.&lt;br /&gt;
&lt;br /&gt;
The next thing you need is a functional Android SDK and NDK environment  with the system ABI resources for your phone.&amp;nbsp; I leave installation of  that as an &lt;a href="http://developer.android.com/sdk/ndk/index.html"&gt;exercise for the reader&lt;/a&gt;.&amp;nbsp;  Once you have that, there is a handy script in the NDK under  {ndk-root}/build/tools called make-standalone-toolchain.sh that does  just what its title implies, which is to create a "standalone" compiler  for the desired Android ABI level, in my case, level 8, which  corresponds to Android 2.2, yummy, yummy, &lt;a href="http://developer.android.com/sdk/android-2.2-highlights.html"&gt;Froyo&lt;/a&gt;.&amp;nbsp; After running the  script, add the new compilers to your path, and then congratulate  yourself on having a fully functional Android C compiler and a somewhat  less functional C++ compiler.&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
The remaining steps I'll just lay out by example because that will  hopefully make it easier to follow and it's getting late and I want to  go to bed.&lt;br /&gt;
&lt;br /&gt;
Make one small change to the linux headers in the Android NDK.  In the file &lt;span style="color: #b45f06;"&gt;{path-to}/android-ndk-r5/platforms/android-8/arch-arm/usr/include/linux/stat.h&lt;/span&gt;&lt;br /&gt;
Add the following two lines:&lt;br /&gt;
&lt;span style="color: #38761d;"&gt;#define S_IREAD S_IRUSR&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #38761d;"&gt;#define S_IWRITE S_IWUSR&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
just below the line that says:&lt;br /&gt;
&lt;span style="color: #38761d;"&gt;#define S_IWUSR 00200&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
This fixes a dependency that gfortran has on a couple of deprecated symbols that have been removed in the NDK header files.&lt;br /&gt;
&lt;br /&gt;
Make a directory to build all of the pieces:&lt;br /&gt;
&lt;i&gt;(you can skip building gmp, mpfr and mpc if you have the devel packages for your platform installed already)&lt;/i&gt;&lt;br /&gt;
&lt;span style="color: #38761d;"&gt;mkdir /opt/compilers/gcc/build&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #38761d;"&gt;cd /opt/compilers/gcc/build&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
#Download and build GMP&lt;span style="color: #38761d;"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #38761d;"&gt;wget http://ftp.gnu.org/gnu/gmp/gmp-4.3.2.tar.gz&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #38761d;"&gt;tar zxvf gmp-4.3.2.tar.gz&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #38761d;"&gt;mkdir gmp-build&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #38761d;"&gt;cd gmp-build&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #38761d;"&gt;../gmp-4.3.2/configure --prefix=/opt/compilers/gcc/android-8 --enable-cxx&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #38761d;"&gt;make &amp;amp;&amp;amp; make install&lt;/span&gt;&lt;br /&gt;
&lt;div style="color: #38761d;"&gt;
&lt;/div&gt;
#Download and build MPFR&lt;br /&gt;
&lt;div style="color: #38761d;"&gt;
wget http://ftp.gnu.org/gnu/mpfr/mpfr-2.4.2.tar.gz&lt;br /&gt;
tar zxvf mpfr-2.4.2.tar.gz&lt;br /&gt;
mkdir mpfr-build&lt;br /&gt;
cd mpfr-build&lt;br /&gt;
../mpfr-2.4.2/configure --prefix=/opt/compilers/gcc/android-8 --with-gmp=/opt/compilers/gcc/android-8&lt;br /&gt;
make &amp;amp;&amp;amp; make install&lt;/div&gt;
#Download and build MPC&lt;br /&gt;
&lt;span style="color: #38761d;"&gt;wget http://www.multiprecision.org/mpc/download/mpc-0.8.1.tar.gz&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #38761d;"&gt;tar zxvf mpc-0.8.1.tar.gz&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #38761d;"&gt;mkdir mpc-build&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #38761d;"&gt;cd mpc-build&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #38761d;"&gt;../mpc-0.8.1/configure --prefix=/opt/compilers/gcc/android-8 --with-gmp=/opt/compilers/gcc/android-8 --with-mpfr=/opt/compilers/gcc/android-8&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #38761d;"&gt;make &amp;amp;&amp;amp; make install&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
#Download and build GNU Binutils 2.19.1 for the android target machine &lt;i&gt;(newer versions will probably work just fine, maybe better)&lt;/i&gt;&lt;br /&gt;
&lt;span style="color: #38761d;"&gt;wget http://ftp.gnu.org/gnu/binutils/binutils-2.19.1.tar.gz&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #38761d;"&gt;tar zxvf binutils-2.19.1.tar.gz&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #38761d;"&gt;mkdir binutils-build&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #38761d;"&gt;cd binutils-build&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #38761d;"&gt;../binutils-2.19.1/configure --prefix=/opt/compilers/gcc/android-8 --with-gmp=/opt/compilers/gcc/android-8 --with-mpfr=/opt/compilers/gcc/android-8 --with-mpc=/opt/compilers/gcc/android-8 --target=arm-android-eabi --with-sysroot={path-to}/android-ndk-r5/platforms/android-8/arch-arm&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #38761d;"&gt;make &amp;amp;&amp;amp; make install&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Download the EXACT version of the GCC source that I used:&lt;br /&gt;
&lt;div style="color: #38761d;"&gt;
svn co svn://gcc.gnu.org/svn/gcc/trunk@168097 gcc-trunk&lt;/div&gt;
&lt;div style="color: #38761d;"&gt;
&lt;span style="color: black;"&gt;Download this patch and apply it to the gcc-trunk...&lt;/span&gt;&lt;/div&gt;
&lt;div style="color: #38761d;"&gt;
&lt;a href="http://aeromonkey.homeip.net/public/ugly_gfortran_hacks.patch"&gt;http://aeromonkey.homeip.net/public/ugly_gfortran_hacks.patch&lt;/a&gt;&lt;/div&gt;
&lt;div style="color: #38761d;"&gt;
&lt;/div&gt;
&lt;span style="color: #38761d;"&gt;cp ugly_gfortan_hacks.patch gcc-trunk/. &lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #38761d;"&gt;cd gcc-trunk&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #38761d;"&gt;patch -p0 &amp;lt; ugly_gfortran_hacks.patch&lt;/span&gt;&lt;br /&gt;
&lt;div style="color: #38761d;"&gt;
&lt;/div&gt;
&lt;div style="color: #38761d;"&gt;
&lt;span style="color: black;"&gt;With any luck this should get your GCC source tree into the same sad state that mine is.. sad, but functional!&lt;/span&gt;&lt;/div&gt;
&lt;div style="color: #38761d;"&gt;
&lt;/div&gt;
&lt;div style="color: #38761d;"&gt;
&lt;span style="color: black;"&gt;Now move back out of the GCC source directory and create a new directory in which to build the compilers.&amp;nbsp; If you've ever built GCC before, you know it is a very bad idea to build it in it's own source tree.&lt;/span&gt;&lt;/div&gt;
&lt;div style="color: #38761d;"&gt;
&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;/div&gt;
&lt;span style="color: #38761d;"&gt;cd ..&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #38761d;"&gt;mkdir build-android-8&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #38761d;"&gt;cd build-android-8&lt;/span&gt;&lt;br /&gt;
&lt;div style="color: #38761d;"&gt;
&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div style="color: #38761d;"&gt;
&lt;span style="color: black;"&gt;Now you need to configure and build the compiler suite.&amp;nbsp; This is the part that really took a lot of head scratching and googling since I had never built a 'cross' compiler before.&amp;nbsp; I'll save you the pain of trying to explain what all of this means, so just copy and paste these lines, fix the {path-to} your Android NDK and you should be off to the races.&lt;/span&gt;&lt;/div&gt;
&lt;div style="color: #38761d;"&gt;
&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div style="color: #38761d;"&gt;
../gcc-trunk/configure --prefix=/opt/compilers/gcc/android-8 --disable-libquadmath --target=arm-android-eabi --with-gnu-as --with-gnu-ld --enable-languages=c,fortran --with-mpfr=/opt/compilers/gcc/android-8 --with-gmp=/opt/compilers/gcc/android-8 --with-mpc=/opt/compilers/gcc/android-8 --disable-libssp --enable-threads --disable-nls --disable-libgomp --disable-shared --disable-tls --with-float=soft --with-fpu=vfp --with-arch=armv5te --enable-target-optspace --disable-nls --with-sysroot={path-to}/android-ndk-r5/platforms/android-8/arch-arm&lt;/div&gt;
&lt;div style="color: #38761d;"&gt;
&lt;/div&gt;
&lt;div style="color: #38761d;"&gt;
make &amp;amp;&amp;amp; make install&lt;/div&gt;
&lt;div style="color: #38761d;"&gt;
&lt;/div&gt;
This could take an hour or more to complete, but you can speed things along in the typical 'make' fashion by using a parallel build (assuming you are on a multicore box).. i.e.. on a quad machine..&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #38761d;"&gt;make -j 4 &amp;amp;&amp;amp; make install&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: black;"&gt;
Assuming you get this far, you can now compile and assemble code for Android, but sadly it will not run on the phone quite yet.&amp;nbsp; This is where I nearly threw in the towel since I could get Fortran code to build, but it would &lt;a href="http://en.wikipedia.org/wiki/Segmentation_fault"&gt;segfault &lt;/a&gt;immediately if I tried to run it.. and when I say immediately, I mean before executing even a single line.&amp;nbsp; After a great deal of effort I was ready to accept that I'm more of a code plumber than a trained programmer and that some tiny piece of the puzzle was beyond my grasp.&amp;nbsp; That's when the engineer in me spoke up and said.. hold on, just take a step back, leave it alone for a day and try again tomorrow.&lt;br /&gt;
&lt;br /&gt;
That next day I decided to try to get a better handle on what was going on behind the scenes with the compiler.&amp;nbsp; To do this, I found a simple c program on the internet (btw.. it's amazing how many ways you can calculate the value of pi) and proceeded to build it with both the Android supplied and my newly minted c compilers and push it to the phone.&lt;br /&gt;
&lt;br /&gt;
NDK compiler = success.&amp;nbsp; New compiler = squat.&lt;br /&gt;
&lt;br /&gt;
Now I broke things down a little further.&amp;nbsp; I'm by no means an authority on compilers, but I did know that there are a number of stages that code goes through on it's journey from human readable (some languages less than others) to machine readable.&amp;nbsp; These steps being:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Compile&lt;/li&gt;
&lt;li&gt;Assemble&lt;/li&gt;
&lt;li&gt;Link&lt;/li&gt;
&lt;/ol&gt;
I also knew that while all of these steps often appear to be taken by the single compiler executable (gcc, g++, gfortran, etc.), in reality, the compiler hands off the latter two steps to the 'assembler' and the 'linker'... sneaky little basterd.&lt;br /&gt;
&lt;br /&gt;
This is where things get interesting... Not really expecting to get anywhere, I decided to start mixing and matching the components from the NDK with my new compiler...&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;NDK compiler + NDK assembler + NDK Linker ==&amp;gt; works.&lt;/li&gt;
&lt;li&gt;New compiler + New assembler + New Linker ==&amp;gt; no good. &lt;/li&gt;
&lt;li&gt;NDK compiler + NDK assembler + New Linker ==&amp;gt; no good.&lt;/li&gt;
&lt;li&gt;NDK compiler + New assembler + New Linker ==&amp;gt; no good.&lt;/li&gt;
&lt;li&gt;New compiler + New assembler + NDK Linker ==&amp;gt; WORKS!&lt;/li&gt;
&lt;/ul&gt;
Ok.. so that's the key.&amp;nbsp; For some reason, the new linker is the weak.. uh.&amp;nbsp; link.&lt;br /&gt;
&lt;br /&gt;
After spending some time trying to reverse engineer the linker script used by the NDK linker, I just said forget it, I have something that works.&amp;nbsp; Luckily, &lt;a href="http://www.gnu.org/software/make/"&gt;GNU 'makes'&lt;/a&gt; (wow, the puns just keep coming..) it really easy to use any linker you want when building code.. so, without further ado...&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;object class="BLOGGER-youtube-video" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" data-thumbnail-src="http://i.ytimg.com/vi/0_T7wvUxhbQ/0.jpg" height="266" width="320"&gt;&lt;param name="movie" value="http://www.youtube.com/v/0_T7wvUxhbQ?f=user_uploads&amp;c=google-webdrive-0&amp;app=youtube_gdata" /&gt;
&lt;param name="bgcolor" value="#FFFFFF" /&gt;
&lt;embed width="480" height="400" src="http://www.youtube.com/v/0_T7wvUxhbQ?f=user_uploads&amp;c=google-webdrive-0&amp;app=youtube_gdata" type="application/x-shockwave-flash"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;
&lt;br /&gt;
No, I didn't do the interface bits in Fortran, that's one thing Python IS good for on Android, at least for simple things like this... that and making it talk.&amp;nbsp; FYI.. the Linpack for Android app available on the market only gets about 8 million floating point operations per second on my phone, which is close to what I got with the default compiler options.&amp;nbsp; The 25 MFLOPS shown in the video was after optimizing for the Neon floating point unit in the Droid's &lt;a href="http://www.arm.com/products/processors/cortex-a/cortex-a8.php"&gt;Cortex-A8 processor&lt;/a&gt;.&amp;nbsp; Makes me wonder how many other applications out there are not making very good use of the hardware.&lt;br /&gt;
&lt;br /&gt;
Well. There's that then.&lt;br /&gt;
&lt;br /&gt;
Longest post ever.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7985388249085447931-7659797603738290314?l=specificimpulses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://specificimpulses.blogspot.com/feeds/7659797603738290314/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://specificimpulses.blogspot.com/2011/01/my-android-speaks-fortran-yours-can-too.html#comment-form' title='12 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7985388249085447931/posts/default/7659797603738290314'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7985388249085447931/posts/default/7659797603738290314'/><link rel='alternate' type='text/html' href='http://specificimpulses.blogspot.com/2011/01/my-android-speaks-fortran-yours-can-too.html' title='My Android speaks Fortran.. yours can too!'/><author><name>Mike Long</name><uri>http://www.blogger.com/profile/07495674918137786297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://2.bp.blogspot.com/_SV3KDeJVzp0/TFs0iIuc2XI/AAAAAAAAAEM/0hO9pwkZev0/S220/Scorpius_R2_Small.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_SV3KDeJVzp0/TSPX4yjCRVI/AAAAAAAAAGI/OtKlyfzsaII/s72-c/punch+card+power.png' height='72' width='72'/><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7985388249085447931.post-2761829282627321201</id><published>2010-09-24T23:23:00.000-07:00</published><updated>2010-09-24T23:23:16.496-07:00</updated><title type='text'>Meet Elmer, Part 2 .. or .. Everything's a Noodle</title><content type='html'>Ok, so if you read &lt;a href="http://specificimpulses.blogspot.com/2010/09/meet-my-friend-elmer.html"&gt;my last post,&lt;/a&gt; you know already that I did something a little off of the beaten path for me by dabbling in a little thermodynamics with the Elmer multiphysics package.&amp;nbsp; Now I'm going to get out the machette and really start hacking a new analytical trail for myself.&lt;br /&gt;
&lt;br /&gt;
One of the most basic things that you learn in engineering school is that every solid thing that exists in the universe is flexible and that there are specifically two things that determine the amount of flexibility that a given thing will have.&amp;nbsp; The first is the mechanical properties of the material that the item is made out of.&amp;nbsp; The second and far more interesting is the cross sectional shape of said item.&amp;nbsp; This is the reason I-Beams exist.&amp;nbsp; It's certainly easier to manufacture and transport a hunk of steel as a solid bar, but you definitely don't want to build a bridge or sky scraper out of it.&amp;nbsp; Even though the tensile strength of the bar and the beam are the same if they have the same cross-sectional area, the beam is much stiffer in bending.&amp;nbsp; The engineering term is &lt;a href="http://en.wikipedia.org/wiki/Second_moment_of_area"&gt;'second moment of area'&lt;/a&gt; and I can tell you that calculating the stiffness of an arbitrary beam by manually summing moment areas is certainly fun and easy for simple shapes, but becomes not much fun quickly in the real world.&lt;br /&gt;
&lt;br /&gt;
Even less fun than calculating the stiffness of a beam, but arguably even more important, is determining the &lt;a href="http://en.wikipedia.org/wiki/Normal_mode"&gt;vibrational modes of the beam&lt;/a&gt;.&amp;nbsp; This is something that is nearly impossible to do by hand except for very basic shapes (like musical instrument strings), but is critical to understanding the ways in which structural deflections can become destructively coupled to external forces, like say, aerodynamic loads.&amp;nbsp; One of the most famous examples of this, which most every engineering sophmore has probably seen, is the collapse of the Tacoma Narrows Bridge in 1940.&lt;br /&gt;
&lt;br /&gt;
&lt;div style="text-align: center;"&gt;&lt;object height="385" width="480"&gt;&lt;param name="movie" value="http://www.youtube.com/v/P0Fi1VcbpAI?fs=1&amp;amp;hl=en_US"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/P0Fi1VcbpAI?fs=1&amp;amp;hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The engineers in the 1940's didn't have multi-gigaflop personal computers, but they were smart enough to design the replacement bridge well enough that it is still in use today. &amp;nbsp;&lt;/div&gt;&lt;div style="text-align: left;"&gt; &lt;/div&gt;&lt;div style="text-align: left;"&gt;Now that the history lesson is over, let's take my multi-gigaflop (about six I think) personal computer and see what we can do with it.&amp;nbsp; As a first attempt to do this kind of thing with Elmer, I sketched up a 3D model of a simple wing or maybe a rotor blade depending on how you hold it.&amp;nbsp; After a couple of attempts I got what looks to me to be a decent grid on the thing and put it through the linear elastic solver in Elmer to get the mode shapes, which took less than an hour of compute time on two processor cores.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_SV3KDeJVzp0/TJ2HRJ2INoI/AAAAAAAAAF8/jeMrUnkWILs/s1600/Generic_Blade_Modes_2010-09-20.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="351" src="http://3.bp.blogspot.com/_SV3KDeJVzp0/TJ2HRJ2INoI/AAAAAAAAAF8/jeMrUnkWILs/s400/Generic_Blade_Modes_2010-09-20.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="text-align: left;"&gt;The first four mode shapes for the structure when held rigidly at one end are shown with the surfaces colored by the displacement magnitude to help highlight where the biggest deformations occur.&amp;nbsp; Fortunately, Elmer makes it fairly easy to animate the modes, making it much easier to see what is happening...&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;object height="344" width="425"&gt;&lt;param name="movie" value="http://www.youtube.com/v/e6Y4FqXcLbk?hl=en&amp;amp;fs=1"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/e6Y4FqXcLbk?hl=en&amp;amp;fs=1;loop=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&amp;nbsp;&lt;/div&gt;&lt;div style="text-align: left;"&gt;As you can see, the first mode is simple bending, while the higher modes start to represent more complicated deformations.&amp;nbsp; It's funny to think that a seemingly solid object can take on such strange shapes, but it's very real.. and very scary...&lt;/div&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;object height="385" width="480"&gt;&lt;param name="movie" value="http://www.youtube.com/v/8D7YCCLGu5Y?fs=1&amp;amp;hl=en_US"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/8D7YCCLGu5Y?fs=1&amp;amp;hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Kind of looks like mode #3 to me, what do you think?&lt;/div&gt;&lt;div style="text-align: left;"&gt; &lt;/div&gt;&lt;div style="text-align: left;"&gt; &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7985388249085447931-2761829282627321201?l=specificimpulses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://specificimpulses.blogspot.com/feeds/2761829282627321201/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://specificimpulses.blogspot.com/2010/09/meet-elmer-part-2-or-everythings-noodle.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7985388249085447931/posts/default/2761829282627321201'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7985388249085447931/posts/default/2761829282627321201'/><link rel='alternate' type='text/html' href='http://specificimpulses.blogspot.com/2010/09/meet-elmer-part-2-or-everythings-noodle.html' title='Meet Elmer, Part 2 .. or .. Everything&apos;s a Noodle'/><author><name>Mike Long</name><uri>http://www.blogger.com/profile/07495674918137786297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://2.bp.blogspot.com/_SV3KDeJVzp0/TFs0iIuc2XI/AAAAAAAAAEM/0hO9pwkZev0/S220/Scorpius_R2_Small.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_SV3KDeJVzp0/TJ2HRJ2INoI/AAAAAAAAAF8/jeMrUnkWILs/s72-c/Generic_Blade_Modes_2010-09-20.jpg' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7985388249085447931.post-4927365953515187330</id><published>2010-09-20T16:10:00.000-07:00</published><updated>2010-09-20T16:10:19.751-07:00</updated><title type='text'>Meet my friend Elmer...</title><content type='html'>One of the questions that I've been asked fairly regularly over the years is "Can you do thermal analysis?", and slightly less frequently, "Can you do structural analysis?".&amp;nbsp; Both of these questions I've always answered with sort of a shrug and a non-answer, something like this:&lt;br /&gt;
&lt;br /&gt;
"Well, I've had those classes in school, and I've worked with plenty of people in those fields... I guess a lot of the skills I've developed for &lt;a href="http://en.wikipedia.org/wiki/Computational_Fluid_Dynamics"&gt;Computational Fluid Dynamics&lt;/a&gt; should be portable to those problems."&lt;br /&gt;
&lt;br /&gt;
Then I just sort of stand there reflecting on that until the person walks away scratching their head.&amp;nbsp; After that, I usually feel motivated for a week or two to dig out my favorite non-CFD code, a 'multiphysics' &lt;a href="http://www.csc.fi/english/pages/elmer"&gt;package from Finland called Elmer&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
As a multiphysics package, Elmer takes what I am going to refer to as a 'shotgun' approach to computational physics, by which I mean that they've implemented a couple of generic linear equation solvers for unstructured grids and then added the appropriate equation sets for different classes of problems, specifically fluids, structures, thermodynamics, electro-magnetics, and maybe a few others that I can't think of right now.&amp;nbsp; This approach allows them to do some very cool things, like providing a common interface for all problem types and letting the user string solvers together to do multidisciplinary studies fairly easily.&amp;nbsp; The downside is that since there are so MANY things that can be done with it, there is a correspondingly small amount of validation to go along with all of that capability.&amp;nbsp; Fortunately for me, I've got a lot of work to do to &lt;a href="http://www.grc.nasa.gov/WWW/wind/valid/tutorial/tutorial.html"&gt;validate myself&lt;/a&gt; for thermal and structural analysis, so it suites me just fine.. :)&lt;br /&gt;
&lt;br /&gt;
Round 1: Thermal&lt;br /&gt;
&lt;br /&gt;
I had done some rudimentary heat transfer in Elmer a few years ago, so this time around I wanted to do something a little more complex.&amp;nbsp; I build the &lt;a href="http://en.wikipedia.org/wiki/Computer-aided_engineering"&gt;CAD&lt;/a&gt; model below with the express intention of making Elmer choke on some geometry with things like thin surfaces, intersected fillets and generally just odd shapes.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_SV3KDeJVzp0/TJfXF2iRlqI/AAAAAAAAAE8/JnBsCKnA7S8/s1600/Elmer_Geometry.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_SV3KDeJVzp0/TJfXF2iRlqI/AAAAAAAAAE8/JnBsCKnA7S8/s320/Elmer_Geometry.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;I think I pulled something like this out of a lawn mower when I was a kid.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Amazingly, the &lt;a href="http://www.hpfem.jku.at/netgen/"&gt;NETGEN&lt;/a&gt; plugin for Elmer didn't even break a sweat on this thing and I had a usable grid with only a couple of tweaks to the gridding parameters.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_SV3KDeJVzp0/TJfZcfAy4JI/AAAAAAAAAFE/jMHOrfPQaIo/s1600/Elmer_Grid.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_SV3KDeJVzp0/TJfZcfAy4JI/AAAAAAAAAFE/jMHOrfPQaIo/s320/Elmer_Grid.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Setting up the thermal solver and applying boundary conditions was similarly pain free.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_SV3KDeJVzp0/TJfbOsaCGXI/AAAAAAAAAFk/e2bIdq_yGUk/s1600/Thermal_Boundries.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;/a&gt;&lt;a href="http://3.bp.blogspot.com/_SV3KDeJVzp0/TJfnkpsLIXI/AAAAAAAAAF0/DImcUW6uVgA/s1600/Thermal_Boundries.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_SV3KDeJVzp0/TJfnkpsLIXI/AAAAAAAAAF0/DImcUW6uVgA/s320/Thermal_Boundries.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&amp;nbsp;The steady state solver ran almost instantaneously on my laptop.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt; &lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_SV3KDeJVzp0/TJfcD41rHrI/AAAAAAAAAFs/gDQogoCVHPw/s1600/Elmer_Steady_State_Result.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_SV3KDeJVzp0/TJfcD41rHrI/AAAAAAAAAFs/gDQogoCVHPw/s320/Elmer_Steady_State_Result.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt; The transient (time accurate) solver took about twenty minutes.&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;object height="344" width="425"&gt;&lt;param name="movie" value="http://www.youtube.com/v/prBtqbiaJc4?hl=en&amp;amp;fs=1"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/prBtqbiaJc4?hl=en&amp;amp;fs=1&amp;amp;loop=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;br /&gt;
Based on the results from the steady state run, I didn't let the transient case go long enough, but you get the idea.&lt;br /&gt;
&lt;br /&gt;
All in all, I was amazed at how easy it was to get this done.&amp;nbsp; I used to work with a guy who did finite element thermal analysis &lt;i&gt;BY HAND USING GRAPH PAPER AND A CALCULATOR!&lt;/i&gt;&amp;nbsp; I remember trying to help him get up to speed on one of the commercial 3D thermal codes and feeling sort of bad for him that the world seemed to be making his skill set obsolete faster than he could keep up with it.&amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
Makes me genuinely happy to have grown up in the Atari generation.&lt;br /&gt;
&lt;br /&gt;
Coming up in Round 2, I'll try to talk my friend Elmer into doing a structural mode shape analysis for me...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7985388249085447931-4927365953515187330?l=specificimpulses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://specificimpulses.blogspot.com/feeds/4927365953515187330/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://specificimpulses.blogspot.com/2010/09/meet-my-friend-elmer.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7985388249085447931/posts/default/4927365953515187330'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7985388249085447931/posts/default/4927365953515187330'/><link rel='alternate' type='text/html' href='http://specificimpulses.blogspot.com/2010/09/meet-my-friend-elmer.html' title='Meet my friend Elmer...'/><author><name>Mike Long</name><uri>http://www.blogger.com/profile/07495674918137786297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://2.bp.blogspot.com/_SV3KDeJVzp0/TFs0iIuc2XI/AAAAAAAAAEM/0hO9pwkZev0/S220/Scorpius_R2_Small.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_SV3KDeJVzp0/TJfXF2iRlqI/AAAAAAAAAE8/JnBsCKnA7S8/s72-c/Elmer_Geometry.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7985388249085447931.post-5375898941025778608</id><published>2010-09-13T16:00:00.000-07:00</published><updated>2010-09-23T09:58:56.206-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Rockets in General'/><title type='text'>Down the Armadillo Hole</title><content type='html'>Several months ago I asked Russ at &lt;a href="http://www.armadilloaerospace.com/n.x/Armadillo/Home"&gt;Armadillo&lt;/a&gt; if it would be OK if I dropped by to check out the operation down there in Texas since it was not too far of a drive from central Oklahoma.&amp;nbsp; He said anytime would probably be fine, so two months later the planets were all lined up and it was finally a good time to head down.&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
After backing up all the data on my laptop, I hopped in the family Jeep at about 7:30am and headed south down I-35 out of Norman.&amp;nbsp; Not wanting to make things too easy for myself, I didn't do any real travel planning whatsoever, so my first challenge came when I attempted to figure out exactly what to do once I hit 35-E north of Dallas.&amp;nbsp; About thirty minutes south I selected the navigation function on the nifty new Motorola Droid that I had suction cupped to the windshield and then waited for it to get a GPS signal.&amp;nbsp; After five minutes of waiting I decided to just re-boot the phone and see if that helped, which it did, getting GPS immediately.&lt;br /&gt;
&lt;br /&gt;
At first I attempted to use the 'Speak Destination' function that looked so cool in all the Android marketing demos..&lt;br /&gt;
&lt;br /&gt;
me:&amp;nbsp; "Navigate to Armadillo Aerospace"&lt;br /&gt;
&lt;br /&gt;
droid: (searching for destination)...&lt;br /&gt;
droid: "Finding directions to Amarillo Airport"&lt;br /&gt;
&lt;br /&gt;
me:&amp;nbsp; "Umm..." (re-pushing search key)&lt;br /&gt;
me:&amp;nbsp; "Navigate to ARMADILLO AEROSPACE"&lt;br /&gt;
&lt;br /&gt;
droid: (searching for destination)...&lt;br /&gt;
droid: "Finding directions to Armadillo near Aerodrome Road, Barnet, UK"&lt;br /&gt;
&lt;br /&gt;
me: "Are you for real?" (pushing type destination key)&lt;br /&gt;
me: (entering destination with on-screen keyboard)&lt;br /&gt;
&lt;br /&gt;
droid: (searching for destination)&lt;br /&gt;
droid: "Did you mean:&amp;nbsp; Entek Corporation, Norman, OK"&lt;br /&gt;
&lt;br /&gt;
me: "..." &lt;br /&gt;
me: "No, I did not." (turning off navigation)&lt;br /&gt;
&lt;br /&gt;
At this point, I decided it would be safest to stop for breakfast and enter the address manually.&amp;nbsp; Ten minutes later, Egg McMuffin in hand, I was on my way.&amp;nbsp; Luckily I had verified the address the day before since the address  listed on the Armadillo web page is for their business office, not the  hangar, which is where all the fun is.&lt;br /&gt;
&lt;br /&gt;
Three hours later I was driving east on I-30 out of Dallas (which has a very scenic stretch for several miles across lake Ray Hubbard) when my phone disabled it's navigation feature to inform me that there was a phone call incoming.&amp;nbsp; After releasing the phone from it's cradle I held it to my ear to find Russ calling to make sure I had the directions and was still on schedule.&amp;nbsp; When I mentioned that I was using GPS he informed me that most people who come in that way end up at the sky diving school on the other side of the airport.&amp;nbsp; After hanging up I looked a little closer at the route and it appeared that I was going to the correct hangar, so I kept on that route.&lt;br /&gt;
&lt;br /&gt;
At this point the Okie in me can't help but complain about the way Texas dispenses with the apparently dreadful task of coming up with creative names for large portions of it's roadway system.&amp;nbsp; If I had to find Farm to Market Road 1565, between County Road 2620 and County Road 2624 without GPS, I would probably still be wondering around out there right now.&lt;br /&gt;
&lt;br /&gt;
&lt;div style="text-align: center;"&gt;&lt;br /&gt;
&lt;iframe frameborder="0" height="350" marginheight="0" marginwidth="0" scrolling="no" src="http://maps.google.com/maps?f=q&amp;amp;source=s_q&amp;amp;hl=en&amp;amp;geocode=&amp;amp;q=Caddo+Mills+Muni+Airport-7f3&amp;amp;sll=37.0625,-95.677068&amp;amp;sspn=46.092115,81.826172&amp;amp;ie=UTF8&amp;amp;hq=Muni+Airport-7f3&amp;amp;hnear=Caddo+Mills,+Hunt,+Texas&amp;amp;t=h&amp;amp;ll=33.037593,-96.241693&amp;amp;spn=0.012592,0.018239&amp;amp;z=15&amp;amp;output=embed" width="425"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;small&gt;&lt;a href="http://maps.google.com/maps?f=q&amp;amp;source=embed&amp;amp;hl=en&amp;amp;geocode=&amp;amp;q=Caddo+Mills+Muni+Airport-7f3&amp;amp;sll=37.0625,-95.677068&amp;amp;sspn=46.092115,81.826172&amp;amp;ie=UTF8&amp;amp;hq=Muni+Airport-7f3&amp;amp;hnear=Caddo+Mills,+Hunt,+Texas&amp;amp;t=h&amp;amp;ll=33.037593,-96.241693&amp;amp;spn=0.012592,0.018239&amp;amp;z=15" style="color: blue; text-align: left;"&gt;View Larger Map&lt;/a&gt;&lt;/small&gt;&lt;/div&gt;As I pulled up to the open hangar, I immediately knew I was in the right place when I saw &lt;a href="http://media.armadilloaerospace.com/2009_05_07/CRW_9040.jpg"&gt;the giant crane truck&lt;/a&gt; parked inside.&amp;nbsp; Anyone who has spend much time reading the Armadillo status updates should know that truck well!&lt;br /&gt;
&lt;br /&gt;
After parking the Jeep next to some other cars on what I thought was the front side of the hangar, I pocketed my phone, grabbed the laptop bag and walked into the hangar fully expecting to be met at the door by Russ or some of the other guys working there.&amp;nbsp; Instead, as I walked in, I got the distinct impression that no one was home.&amp;nbsp; There was plenty of hardware stacked in various places, along with the crane truck and a small single engine airplane, but not a person in sight.. and it was eerily quite as well.&amp;nbsp; So, after stepping in a few feet, I noticed a nondescript door just to the left that I had not seen when I walked in.&amp;nbsp; Without a clearly marked door bell or a sign saying 'Visitors please check in with security', my only real option was to open that door and peek inside.&amp;nbsp; When I did, I immediately noticed Pixel, &lt;a href="http://media.armadilloaerospace.com/2008_09_27/pixelHoldDown.jpg"&gt;one of their lunar lander contenders&lt;/a&gt;, sitting directly in front of me.&amp;nbsp; Encouraged by that, I walked in a little more and then turned right, following some tape lines on the floor.&amp;nbsp; At this point I finally saw two people busy working on the base of what could only be a heavily modified Super Mod.&amp;nbsp; They were so busy in fact, that I walked right up to them and stood their for a minute before one of them even noticed me.&amp;nbsp; When he did notice, it was obvious that he had no idea who I was or why I was there, but he was nice about it and asked if there was anything he could do to help me, so I introduced myself and he goes, 'oh yeah, the aero guy... Russ should be down in a minute.', after which he did exactly what I would have done in that situation and went right back to work.&lt;br /&gt;
&lt;br /&gt;
As promised, Russ came down to the shop floor after a minute or two and made the introductions for me to the fellows working on the Mod, James and Joe, along with Phil, who had come down to the shop as well.&amp;nbsp; After a quick discussion about the changes to the Mod, Russ invited me upstairs to tour the office section of the facility and to meet the rest of the crew.&amp;nbsp; Upon entering the office area, I was immediately impressed by the spartan furnishings and no nonsense appearance of the place.&amp;nbsp; The feeling of 'organized chaos' that I was getting on the shop floor definitely continued into the offices... and believe me, this is a good thing.&amp;nbsp; I've spent quite a bit of time on the shop floor at larger aerospace companies and I can tell you that while I understand many of the reasons why big companies operate the way that they do... multiple management layers, design reviews, drawing checkers, quality assurance specialists, union rules, etc... seeing an operation without all of that really highlights the sheer overhead and operational inertia that all of those things bring.&amp;nbsp; I sincerely hope they can find a way to preserve as much of that agility as possible as the organization grows!&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;After lunch (Chicken Fried Steak!), we went back down to the shop and talked a little more about the things that are in their pipeline right now.&amp;nbsp; I'd love to share some of those projects here, but most of that will end up on the AA site at some point in the future, so I won't steal their thunder except to say that there is a lot more happening than I was aware of and I'm excited to see where it all goes.&amp;nbsp; One thing I will mention is that I had a nice conversation with Russ about Pixel.&amp;nbsp; Some time ago they delivered Pixel to NASA as a test platform for some of the technology that was being developed for '&lt;a href="http://robonaut.jsc.nasa.gov/future/"&gt;Project M&lt;/a&gt;' which included JSC's Autonomous Landing and Hazard Avoidance Technology (ALHAT) package, which itself included components that had flown on the Space Shuttle, so that was interesting to see.&amp;nbsp; I am just guessing here, but I would bet that Pixel has more flight time than any other rocket powered vehicle that's ever been built.&amp;nbsp; It was great fun hearing Russ talk about how well they've gotten to know that one machine and how much of a 'personality' it has developed.&lt;br /&gt;
&lt;br /&gt;
I think it is worthwhile to mention that these guys obviously care a great deal about their hardware and that is probably one of the biggest keys to their current success.&amp;nbsp; Before going down there, it seemed reasonable to me to assume that their build-fly-break-rebuild design cycle meant that the things they built were essentially designed to be disposable and that they probably didn't care too much when one of their vehicles bit the dust.&amp;nbsp; I now know that could not be further from the truth!&lt;br /&gt;
&lt;br /&gt;
Anyway, I could probably write several more pages, but I think this is running a little long already.&amp;nbsp; All in all, I had a great time, learned a lot, hopefully contributed a little, and I am looking for ward to seeing what they come up with next.&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_SV3KDeJVzp0/TI6mDqb2aoI/AAAAAAAAAE0/g-9X7DHU-8M/s1600/Armadillo_Team_with_Pixel.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="298" src="http://1.bp.blogspot.com/_SV3KDeJVzp0/TI6mDqb2aoI/AAAAAAAAAE0/g-9X7DHU-8M/s400/Armadillo_Team_with_Pixel.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;Left to right: Recent Masten Space Defectee Ben Brockert, Me, Joseph LaGrave,&amp;nbsp;&lt;/div&gt;&lt;div style="text-align: center;"&gt;Pixel, Russell Blink, James Bauer and Phil Eaton&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7985388249085447931-5375898941025778608?l=specificimpulses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://specificimpulses.blogspot.com/feeds/5375898941025778608/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://specificimpulses.blogspot.com/2010/09/down-armadillo-hole.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7985388249085447931/posts/default/5375898941025778608'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7985388249085447931/posts/default/5375898941025778608'/><link rel='alternate' type='text/html' href='http://specificimpulses.blogspot.com/2010/09/down-armadillo-hole.html' title='Down the Armadillo Hole'/><author><name>Mike Long</name><uri>http://www.blogger.com/profile/07495674918137786297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://2.bp.blogspot.com/_SV3KDeJVzp0/TFs0iIuc2XI/AAAAAAAAAEM/0hO9pwkZev0/S220/Scorpius_R2_Small.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_SV3KDeJVzp0/TI6mDqb2aoI/AAAAAAAAAE0/g-9X7DHU-8M/s72-c/Armadillo_Team_with_Pixel.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7985388249085447931.post-5829931183132007483</id><published>2010-07-16T17:38:00.000-07:00</published><updated>2010-07-19T16:03:55.251-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Rocket Simulation'/><title type='text'>Scorpius Part 2</title><content type='html'>I actually feel sort of bad about this, since my last post was a bit of a teaser, promising something that I probably could have just written up the next day and been done with, but instead, I put it away until today and now it doesn't seem nearly as interesting to me.&amp;nbsp; Anyway, here is my attempt to address some of the aerodynamic problems with the Scorpius module.&amp;nbsp; Pop on a nosecone, tuck in the helium tanks, streamline the landing gear and add a basic boat tail fairing and you get something like this...&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_SV3KDeJVzp0/TEDMSPEucRI/AAAAAAAAADo/2sOLNv0uX24/s1600/Scorpius_V2_Preview.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_SV3KDeJVzp0/TEDMSPEucRI/AAAAAAAAADo/2sOLNv0uX24/s320/Scorpius_V2_Preview.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Now this is really just a sketch.&amp;nbsp; If I put in some serious effort, the end result would probably be quite a bit different.&amp;nbsp; That's the way I like to work.&amp;nbsp; Given a reasonably clean simulation workflow, it doesn't make a lot of sense to spend a great deal of time upfront doing hand calculations when you can just build a model, run the simulation and then use that as the basis for the next iteration.&amp;nbsp; This is actually what Armadillo has been doing all these years with real hardware and is why they are where they are today.&lt;br /&gt;
&lt;br /&gt;
With that in mind, let's see how the new design stacks up.&amp;nbsp; One assumption that I'm making here is that the dry mass of the design is unchanged.&amp;nbsp; I don't think this is actually a bad assumption, since the new landing gear would be significantly lighter (and more delicate).&amp;nbsp; Keeping the mass the same also makes it an apples to apples performance comparison with only the aerodynamics being different.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_SV3KDeJVzp0/TEDogak8YlI/AAAAAAAAADw/mjnPw9ZrEsE/s1600/Compare_Altitude.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="301" src="http://4.bp.blogspot.com/_SV3KDeJVzp0/TEDogak8YlI/AAAAAAAAADw/mjnPw9ZrEsE/s400/Compare_Altitude.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;So, we've gone from the original 44,000 feet to a respectable 56,000 feet with the first cut at reducing the drag of the vehicle... That's a 27% improvement, not too shabby I say.&lt;br /&gt;
&lt;br /&gt;
If we look at the calculated drag coefficient over the flight it looks like this..&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_SV3KDeJVzp0/TEDvJuPX3iI/AAAAAAAAAD4/Z4kDVOmkeR8/s1600/Drag_vs_Time.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="298" src="http://4.bp.blogspot.com/_SV3KDeJVzp0/TEDvJuPX3iI/AAAAAAAAAD4/Z4kDVOmkeR8/s400/Drag_vs_Time.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
We did good for most of the flight, but at least on the surface it looks like the original design isn't so bad over the portion of the flight between about 50 and 70 seconds.&amp;nbsp; As Paul Harvey was fond of saying, here's the rest of the story...&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_SV3KDeJVzp0/TEDxZuhaFRI/AAAAAAAAAEA/ZSveWhuq-bg/s1600/Drag_vs_Mach.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="297" src="http://3.bp.blogspot.com/_SV3KDeJVzp0/TEDxZuhaFRI/AAAAAAAAAEA/ZSveWhuq-bg/s400/Drag_vs_Mach.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
In reality the drag reduction is substantial over the entire range of flight Mach numbers, with the orignal design stubbornly refusing to cross the sound barrier, while the revised design manages to get to nearly Mach 1.2.&amp;nbsp; The reason the drag seems similar or somewhat higher for portions of the trajectory is that the new rocket is traveling faster (and higher) at the same moment in the flight and is seeing higher Mach numbers earlier in the flight.&amp;nbsp; Fortunately, the higher velocity translates into higher altitude at engine cut off and an extra 10 seconds or so of coast to apogee.&lt;br /&gt;
&lt;br /&gt;
Some might say that this is just a computer model, so I could probably turn knobs to get whatever numbers I want.&amp;nbsp; To those I people I say... well, um, yes, there are plenty of knobs to turn, but in this case I made sure I didn't touch any of them when I set up the new simulation.&amp;nbsp; Seriously though, talk to anyone who does any sort of analysis or testing, whether it is in a lab, wind tunnel, or on a computer... and if they are being **brutally** honest, they will admit that there is a lot more uncertainty in life than anything less than life can capture.&lt;br /&gt;
&lt;br /&gt;
There is not an airplane on the planet that has an absolutely known drag coefficient, or a structure that has an absolutely known ultimate failure load, or a Twinkie with an absolutely know shelf life.&amp;nbsp; In practice, it is the deltas that are the most important... and a good engineer is one who can nail those deltas, no matter what their tool of choice happens to be.&lt;br /&gt;
&lt;br /&gt;
So, before I break off those knobs and push my work out into the world, I'm going to be as sure as I can be that the deltas are right.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7985388249085447931-5829931183132007483?l=specificimpulses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://specificimpulses.blogspot.com/feeds/5829931183132007483/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://specificimpulses.blogspot.com/2010/07/scorpius-part-2.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7985388249085447931/posts/default/5829931183132007483'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7985388249085447931/posts/default/5829931183132007483'/><link rel='alternate' type='text/html' href='http://specificimpulses.blogspot.com/2010/07/scorpius-part-2.html' title='Scorpius Part 2'/><author><name>Mike Long</name><uri>http://www.blogger.com/profile/07495674918137786297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://2.bp.blogspot.com/_SV3KDeJVzp0/TFs0iIuc2XI/AAAAAAAAAEM/0hO9pwkZev0/S220/Scorpius_R2_Small.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_SV3KDeJVzp0/TEDMSPEucRI/AAAAAAAAADo/2sOLNv0uX24/s72-c/Scorpius_V2_Preview.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7985388249085447931.post-6251897502933752540</id><published>2010-05-03T14:51:00.000-07:00</published><updated>2010-05-05T07:08:48.128-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Rocket Simulation'/><title type='text'>Pedal to the Metal for Scorpius</title><content type='html'>I've decided to start as many posts as possible with a nice picture..&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_SV3KDeJVzp0/S9tWBeLEuVI/AAAAAAAAAC4/APHzf9hxE9M/s1600/Scorpius_Streamlines_Mach1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="293" src="http://3.bp.blogspot.com/_SV3KDeJVzp0/S9tWBeLEuVI/AAAAAAAAAC4/APHzf9hxE9M/s320/Scorpius_Streamlines_Mach1.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Now that I know I'm not going to get &lt;a href="http://specificimpulses.blogspot.com/2010/03/what-would-i-do-with-48-cores.html"&gt;that awesome machine from AMD&lt;/a&gt;, I'm ready to get back to business.&amp;nbsp; By that I mean putting my Scorpius 'mock-up' model through it's paces for a complete trajectory analysis.&amp;nbsp; In the process of pulling together all of information that I needed to move forward, I contacted Russ Blink over at Armadillo about possibly sharing some more details on the design.&amp;nbsp; Happily for me, he graciously agreed to help me out.&lt;br /&gt;
&lt;br /&gt;
Here are the final numbers that I put into the trajectory solver:&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;Vehicle parameters:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Empty mass : 550 lbm&lt;/li&gt;
&lt;li&gt;Payload mass : 0 lbm&lt;/li&gt;
&lt;li&gt;Propellant mass : 1250 lbm&lt;/li&gt;
&lt;li&gt;Reserve Propellant : 200 lbm&lt;/li&gt;
&lt;li&gt;Engine Vacuum Thrust : 3800 lbf&lt;/li&gt;
&lt;li&gt;Engine Vacuum ISP : 210 seconds&lt;/li&gt;
&lt;li&gt;Engine Chamber Total Pressure : 240 psia&lt;/li&gt;
&lt;li&gt;Engine Chamber Total Temperature : 5500R&lt;/li&gt;
&lt;li&gt;Engine Chamber Gamma : 1.23&lt;/li&gt;
&lt;li&gt;Engine Nozzle Expansion Ratio : 4.0:1&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;Trajectory parameters:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Starting altitude : 0 ft msl&lt;/li&gt;
&lt;li&gt;Starting velocity : 0 ft/sec&lt;/li&gt;
&lt;li&gt;Atmospheric model : 1976 Standard Day&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;Flow solver parameters:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Solver :  NASA FUN3D v10.8.0&lt;/li&gt;
&lt;li&gt;Model size : 770,000 nodes&lt;/li&gt;
&lt;li&gt;Turbulence : Spallart-Almaras 1-equation model&lt;/li&gt;
&lt;li&gt;Iterations per solution : 800&lt;/li&gt;
&lt;/ul&gt;I admit that I was a little surprised at how heavy the Scorpius mod was.&amp;nbsp; If you've read my previous post on the &lt;a href="http://specificimpulses.blogspot.com/2010/02/ground-control-we-have-solution-for-six.html"&gt;trajectory for the six-pack&lt;/a&gt; then you'll notice that my estimate for the dry weight was probably way too low.&amp;nbsp; I was also very generous on the engine performance, so I'll go ahead and state that 150kft for that design is probably not too realistic.&amp;nbsp; Still, it was a nice excercise.&lt;br /&gt;
&lt;br /&gt;
Running on 16 processor cores, this trajectory took about a week.&amp;nbsp; It also helped me identify a serious side effect of putting a video card with a passive heat sink right next to a gigabit ethernet card.&amp;nbsp; On a couple of occasions, the tx transmitter on the card locked up (at least that's what the linux kernel logs reported) and caused the solver to abort.&amp;nbsp; Since this didn't happen before the new video card was installed, I'm guessing that the network card doesn't like being blasted with infrared radiation for long periods.&amp;nbsp; I've since replaced that card with a similar model sporting a fan, so hopefully the problem will not resurface.&amp;nbsp; The passive card with it's offensive heat sink is currently overheating components in my wife's Ubuntu PC, which I can now use to finally finish playing the Linux port of Doom 3.(update.. the problem persists, now we're going to try swapping that network card with one from a slave node, ugh.)&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_SV3KDeJVzp0/S98mA9QGTrI/AAAAAAAAADI/hVpXynS5YQU/s1600/Scorpius_V1_44K_plots.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="640" src="http://3.bp.blogspot.com/_SV3KDeJVzp0/S98mA9QGTrI/AAAAAAAAADI/hVpXynS5YQU/s640/Scorpius_V1_44K_plots.jpg" width="555" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
The highlights from the trajectory are:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;The altitude at apogee is 44,000 ft&lt;/li&gt;
&lt;li&gt;The maximum Mach number is 0.98 at engine cut-off at 36770 ft&amp;nbsp;&lt;/li&gt;
&lt;li&gt;The maximum drag force&amp;nbsp; of 2807 lbf occurs at 34,000 ft at Mach 0.95&lt;/li&gt;
&lt;li&gt;Total engine delivered delta-V = 6028 ft/sec&lt;/li&gt;
&lt;li&gt;Total gravity delta-V loss = 2847 ft/sec&lt;/li&gt;
&lt;li&gt;Total aero drag delta-V loss =&amp;nbsp; 3181 ft/sec&lt;/li&gt;
&lt;/ul&gt;The first thing that jumps out at me is that the delta-V lost to drag is significantly higher than the gravity loss.&amp;nbsp; Surely there is some room for improvement there!&lt;br /&gt;
&lt;br /&gt;
I feel like I should re-iterate that this is a 'mock-up' of the Scorpius design and while I am using the best information available to me, there are plenty of places where this model deviates from the actual hardware and where the computational model needs refinement.&amp;nbsp; That being said, I would bet this is much closer than what could be done with Datcom type analysis or by using existing drag data, no offense &lt;a href="http://www.amazon.com/Fluid-Dynamic-Drag-Information-Hydrodynamic/dp/9991194444/ref=cm_cr_dp_orig_subj"&gt;Dr. Hoerner..&lt;/a&gt;&lt;br /&gt;
Now, I'll freely admit that &lt;a href="http://en.wikipedia.org/wiki/Missile_Datcom"&gt;Missile Datcom&lt;/a&gt; is much faster, more refined and can provide far more design data (especially stability and control inputs) than I am currently mining from my own simulation.&amp;nbsp; However, this is really only true for relatively simple, 'conventional' shapes.&amp;nbsp; If I thought that those methods were sufficient for the wide range of designs being tossed about for sub-orbital vehicles, I probably wouldn't have bothered with all of this.. ;)&lt;br /&gt;
&lt;br /&gt;
Another interesting plot from the trajectory is the 'sensed' acceleration on the vehicle.&amp;nbsp; This is what would be felt by a passenger, in this case we'll assume a mosquito stowed away in the avionics bay.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_SV3KDeJVzp0/S98vsZmW8qI/AAAAAAAAADQ/QJtOtW49FmA/s1600/SenAcc.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="245" src="http://1.bp.blogspot.com/_SV3KDeJVzp0/S98vsZmW8qI/AAAAAAAAADQ/QJtOtW49FmA/s400/SenAcc.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;Now the acceleration is fairly mild while the engine is on during the boost phase, with the increasing aero drag keeping pace with the dwindling mass of the rocket and actually causing a net reduction in the total acceleration as burnout is approached.&amp;nbsp; Unfortunately for our little stowaway, when the engine shuts off the drag force slams on the brakes with an instantaneous, eye-popping, 5g reversal.&amp;nbsp; In reality the engine could be brought down gradually to reduce the jarring nature of the shut-down, but this would still be an unpleasant experience for most anyone (or possibly the highlight of the ride for some I suppose).&lt;br /&gt;
&lt;br /&gt;
If anyone is interested, I've also broken the drag coefficient down per component at Mach 0.98, right at engine cut-off:&lt;br /&gt;
&lt;ul&gt;&lt;li style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Nosecone&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : 0.1154&amp;nbsp;&amp;nbsp;&amp;nbsp; (11.1%)&lt;/li&gt;
&lt;li style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Fuel Tank (fwd) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : 0.4354&amp;nbsp;&amp;nbsp;&amp;nbsp; (41.6%)&lt;/li&gt;
&lt;li style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Oxidizer Tank (aft)&amp;nbsp; : 0.0308&amp;nbsp;&amp;nbsp;&amp;nbsp; (3.0%)&lt;/li&gt;
&lt;li style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Helium Tanks&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : 0.0915&amp;nbsp;&amp;nbsp;&amp;nbsp; (8.8%)&lt;/li&gt;
&lt;li style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Engine Cover&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : 0.0365&amp;nbsp;&amp;nbsp;&amp;nbsp; (3.5%)&lt;/li&gt;
&lt;li style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Chamber/Nozzle&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : 0.0032&amp;nbsp;&amp;nbsp;&amp;nbsp; (0.3%)&lt;/li&gt;
&lt;li style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Landing Gear Feet&amp;nbsp;&amp;nbsp;&amp;nbsp; : 0.0678&amp;nbsp;&amp;nbsp;&amp;nbsp; (6.5%)&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Landing Gear Struts&amp;nbsp; : 0.2634&amp;nbsp;&amp;nbsp;&amp;nbsp; (25.2%)&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Total&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : 1.0440&amp;nbsp;&amp;nbsp;&amp;nbsp; (100%)&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_SV3KDeJVzp0/S982p2GYgaI/AAAAAAAAADY/cU6dAT4vMVU/s1600/Scorpius_V1_Components.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://1.bp.blogspot.com/_SV3KDeJVzp0/S982p2GYgaI/AAAAAAAAADY/cU6dAT4vMVU/s400/Scorpius_V1_Components.jpg" width="295" /&gt;&lt;/a&gt;&lt;/div&gt;It should be obvious where the attention needs to be paid as this design is refined to improve it's aerodynamics, with the nose cone and upper tank bearing more than 50% of the total force.&amp;nbsp; The landing gear are also working hard to keep the rocket firmly planted on the ground, contributing over 30% of the drag.&lt;br /&gt;
&lt;br /&gt;
That's about all I have time for right now... Here's a little sneak peak at an image that will start off a future post.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_SV3KDeJVzp0/S99AiWtWCdI/AAAAAAAAADg/D8jpuR7XXH0/s1600/Scorpius_V2_Preview_Pixelated.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="277" src="http://1.bp.blogspot.com/_SV3KDeJVzp0/S99AiWtWCdI/AAAAAAAAADg/D8jpuR7XXH0/s320/Scorpius_V2_Preview_Pixelated.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;I'm not sure if it will be the &lt;i&gt;next&lt;/i&gt; post since I still have a few things to say about the current design, but I'm getting far enough along on some modifications that I am itching to share those soon.&lt;br /&gt;
&lt;br /&gt;
Also.. the NASA &lt;a href="http://see.msfc.nasa.gov/tte/model_gram.htm"&gt;Global Reference Atmospheric Model&lt;/a&gt; just showed up in my mailbox, so I'm sure I'll have some things to say about that as I work to wrap it in a cozy blanket of Python so it can called from the trajectory solver.&amp;nbsp; When that is done, I'll be able to include seasonally accurate winds aloft for just about anywhere on the planet, which is nice.&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7985388249085447931-6251897502933752540?l=specificimpulses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://specificimpulses.blogspot.com/feeds/6251897502933752540/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://specificimpulses.blogspot.com/2010/05/pedal-to-metal-for-scorpius.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7985388249085447931/posts/default/6251897502933752540'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7985388249085447931/posts/default/6251897502933752540'/><link rel='alternate' type='text/html' href='http://specificimpulses.blogspot.com/2010/05/pedal-to-metal-for-scorpius.html' title='Pedal to the Metal for Scorpius'/><author><name>Mike Long</name><uri>http://www.blogger.com/profile/07495674918137786297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://2.bp.blogspot.com/_SV3KDeJVzp0/TFs0iIuc2XI/AAAAAAAAAEM/0hO9pwkZev0/S220/Scorpius_R2_Small.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_SV3KDeJVzp0/S9tWBeLEuVI/AAAAAAAAAC4/APHzf9hxE9M/s72-c/Scorpius_Streamlines_Mach1.jpg' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7985388249085447931.post-7587992397813604573</id><published>2010-03-24T20:31:00.000-07:00</published><updated>2010-04-28T08:08:26.485-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Computing'/><title type='text'>What Would I Do With 48 Cores?</title><content type='html'>I happened upon &lt;a href="http://blogs.amd.com/work/2010/03/03/48-cores-contest/"&gt;this AMD contest&lt;/a&gt; a couple of weeks ago and decided to have a go at it. &amp;nbsp;The gist of the thing is to promote AMD's as yet unreleased 12-core&amp;nbsp;monstrosities&amp;nbsp;by having people describe some of the nifty things that they would do with that kind of number crunching horsepower. &amp;nbsp;Since &lt;a href="http://aeromonkey.homeip.net/ganglia"&gt;my current computational cluster&lt;/a&gt;&amp;nbsp;grinds away with 18 AMD cores, I think the additional 48 would find themselves right at home helping me &lt;a href="http://specificimpulses.blogspot.com/2010/02/ground-control-we-have-solution-for-six.html"&gt;put virtual rockets into sub-orbital space&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
I've been using mostly AMD processors for my personal machines since I bought my first motherboard with a &lt;a href="http://en.wikipedia.org/wiki/Am386"&gt;40Mhz Am386&lt;/a&gt; and 1MB of RAM around 1993 or so. &amp;nbsp;Through the years I've built K-5's, K6's and K6-II's.. I've&amp;nbsp;over-clocked&amp;nbsp;(and ruined) K6-II+ and K6-III's... I&amp;nbsp;literally&amp;nbsp;cried at the end of &lt;a href="http://en.wikipedia.org/wiki/Socket_7"&gt;Socket 7&lt;/a&gt;... and then cried some more at the introduction of &lt;a href="http://en.wikipedia.org/wiki/Slot_A"&gt;slot processors&lt;/a&gt;, then abruptly stopped crying again when &lt;a href="http://en.wikipedia.org/wiki/Socket_A"&gt;Socket A&lt;/a&gt; came along, after which I ... over-clocked&amp;nbsp;a Duron 600 to 850MHz (or so) using the &lt;a href="http://www.motherboards.org/articles/guides/41_1.html"&gt;'pencil trick'&lt;/a&gt;, under-clocked a faulty 1Ghz&amp;nbsp;&lt;a href="http://en.wikipedia.org/wiki/Athlon#Thunderbird_.28T-Bird.29"&gt;Thunderbird&lt;/a&gt;&amp;nbsp;to 800Mhz.. soldered a variable resistor onto the Thunderbird's motherboard voltage regulator so I could jack up the voltage, after which it was solid as a rock at 1Ghz for years after... and then made a 1.8Ghz &lt;a href="http://en.wikipedia.org/wiki/Athlon#Thoroughbred_.28T-Bred.29"&gt;Thoroughbred&lt;/a&gt; my primary home&amp;nbsp;processor&amp;nbsp;for more than five years. &lt;br /&gt;
&lt;br /&gt;
Not to mention the cluster, of course.. :)&lt;br /&gt;
&lt;br /&gt;
This gives me what I think is a reasonably complete understanding of what has put AMD where they are today.&lt;br /&gt;
&lt;br /&gt;
In addition, the literally thousands of &lt;a href="http://en.wikipedia.org/wiki/Computational_Fluid_Dynamics"&gt;Computational Fluid Dynamics&lt;/a&gt; simulations that I've run over the last dozen years or so gives me a reasonably complete understanding as to why the scientific computing community has leaned so heavily on their hardware. &amp;nbsp;I've run simulations and benchmarked machines with one core, all the way &lt;a href="http://www.nas.nasa.gov/Resources/Systems/pleiades.html"&gt;into the thousands&lt;/a&gt;, with interconnects from &lt;a href="http://www.disi.unige.it/project/gamma/"&gt;IP stack bypass ethernet&lt;/a&gt; to &lt;a href="http://en.wikipedia.org/wiki/Myrinet"&gt;Myrinet&lt;/a&gt; to &lt;a href="http://en.wikipedia.org/wiki/Infiniband"&gt;Infiniband&lt;/a&gt;, using &lt;a href="http://www.scientific-sims.com/nsu3d"&gt;commercial&lt;/a&gt;, &lt;a href="http://fun3d.larc.nasa.gov/"&gt;government&lt;/a&gt;, and &lt;a href="http://www.openfoam.com/"&gt;open-source&lt;/a&gt; flow solvers built with both commercial and open source compilers...&lt;br /&gt;
&lt;br /&gt;
The truth is, I'm a tuner at heart and I love pushing hardware past it's limits, whether that hardware burns gas or electrons... and I'd like nothing better than to find (and surpass) the limits of this new AMD beast.&lt;br /&gt;
&lt;br /&gt;
Finally, here is a bulleted list of reasons AMD should hand over the hardware with all speed:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;I'm getting 65% of &lt;strike&gt;theoretical maximum&lt;/strike&gt; &lt;i&gt;ideal linear&lt;/i&gt; speedup with 8 dual core Athlons on single motherboards with gigabit&amp;nbsp;Ethernet using the &lt;a href="http://www.mcs.anl.gov/research/projects/mpich2/index.php"&gt;MPICH-2&lt;/a&gt; Nemesis channel.&lt;/li&gt;
&lt;li&gt;I tested a 16 core (quad-quad) machine last year and could only get a little better than 50%, &lt;i&gt;with shared memory MPI on HyperTransport!&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;I'm skeptical that I will see much better than 50% on a 48-core single board machine, even with more and faster HyperTransport links.&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;&lt;br /&gt;
Not much of a list really.&lt;/div&gt;&lt;div&gt;Bottom line..&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;Give me that machine and let me prove myself wrong!&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;... now if I can just find someone to pay for 48 gigs of &lt;a href="http://www.newegg.com/Store/SubCategory.aspx?SubCategory=147&amp;amp;name=Desktop-Memory"&gt;DDR3&lt;/a&gt; ... ;)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_SV3KDeJVzp0/S6rW20fxN5I/AAAAAAAAACw/Kf3kXZb2NdQ/s1600/Aeromonkey_and_the_Chimps.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="267" src="http://1.bp.blogspot.com/_SV3KDeJVzp0/S6rW20fxN5I/AAAAAAAAACw/Kf3kXZb2NdQ/s400/Aeromonkey_and_the_Chimps.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;Me (top right) with Dad (Mike Sr.) and brother Matt&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7985388249085447931-7587992397813604573?l=specificimpulses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://specificimpulses.blogspot.com/feeds/7587992397813604573/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://specificimpulses.blogspot.com/2010/03/what-would-i-do-with-48-cores.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7985388249085447931/posts/default/7587992397813604573'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7985388249085447931/posts/default/7587992397813604573'/><link rel='alternate' type='text/html' href='http://specificimpulses.blogspot.com/2010/03/what-would-i-do-with-48-cores.html' title='What Would I Do With 48 Cores?'/><author><name>Mike Long</name><uri>http://www.blogger.com/profile/07495674918137786297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://2.bp.blogspot.com/_SV3KDeJVzp0/TFs0iIuc2XI/AAAAAAAAAEM/0hO9pwkZev0/S220/Scorpius_R2_Small.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_SV3KDeJVzp0/S6rW20fxN5I/AAAAAAAAACw/Kf3kXZb2NdQ/s72-c/Aeromonkey_and_the_Chimps.jpg' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7985388249085447931.post-2823777171299399151</id><published>2010-02-27T17:25:00.000-08:00</published><updated>2010-04-28T08:12:04.495-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Rocket Simulation'/><title type='text'>I only want to do this once... per simulation.</title><content type='html'>Charts, graphs, spreadsheets, databases... those are the primary tools that an engineering analyst uses to communicate their work with the people who need the information.&amp;nbsp; As useful as those things are, they don't provide the impact of a good visualization...&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_SV3KDeJVzp0/S4m0DdM3ZmI/AAAAAAAAACY/nEp1jMPaa1Y/s1600-h/SixPack_Plume_Render.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_SV3KDeJVzp0/S4m0DdM3ZmI/AAAAAAAAACY/nEp1jMPaa1Y/s320/SixPack_Plume_Render.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="" style="clear: both; text-align: left;"&gt;There is also often a legitimate need to dig into the solution to find sources of error, or to adjust the model to capture physical features that might not be resolved without some attention.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Getting a good visualization can be an extremely challenging problem in it's own right, so that is why I have put most of my efforts over the last few weeks into adding an automated visualization capability to the trajectory solver.&amp;nbsp; The key to this effort has been the excellent open source visualization package &lt;a href="http://www.paraview.org/"&gt;ParaView&lt;/a&gt;, which has been my primary visualization tool since I stumbled upon it several years ago while spending some time with the &lt;a href="http://www.openfoam.com/"&gt;OpenFoam&lt;/a&gt; package (that's a story for another time).&amp;nbsp; &lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="text-align: center;"&gt;&amp;nbsp;&lt;a href="http://1.bp.blogspot.com/_SV3KDeJVzp0/S4luUwUWvdI/AAAAAAAAACA/7MGQdmJkTmg/s1600-h/Screenshot-ParaView+3.7.0.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="291" src="http://1.bp.blogspot.com/_SV3KDeJVzp0/S4luUwUWvdI/AAAAAAAAACA/7MGQdmJkTmg/s400/Screenshot-ParaView+3.7.0.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;One of the great things about ParaView is the fact that it was designed from the ground up to run under Linux, which is something that makes me very, very happy, since Linux has historically received fairly short shrift from the 3D graphics community, and there are precious few apps that you can reference when trying to convince your friends that hardware accelerated 3D is alive and well in the open source community.&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Unfortunately for me, the head node on &lt;a href="http://aeromonkey.homeip.net/ganglia"&gt;my CFD cluster&lt;/a&gt; is currently making due with integrated &lt;a href="http://www.x.org/wiki/radeon"&gt;ATI Radeon HD3200&lt;/a&gt; graphics, unlike my laptop, which sports a much better supported (and, like it or not, proprietary) Nvidia 9700M graphics card.&amp;nbsp; Even though I built ParaView from the same source on both machines, I am getting a very impolite segfault on the ATI hardware when I use certain rendering functions.&amp;nbsp; This means that until I upgrade the graphics card in the head node (sometime in the next couple of weeks), I can't get the set of images that I would like to have for the entire trajectory.&amp;nbsp; &lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;The good news is that, once that minor glitch is resolved, then, through the magic of ParaView+Python, I will be able to define any arbitrary view that I want, save the ParaView state file, and then feed a stack of those to the post-processor and get a nice bunch of images to show off later. &lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;One more small step toward the master plan...&amp;nbsp;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&amp;nbsp;&lt;a href="http://4.bp.blogspot.com/_SV3KDeJVzp0/S4nmhVUP9nI/AAAAAAAAACg/Cu4tP4e8Yt0/s1600-h/Paraview_Wireframe2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="366" src="http://4.bp.blogspot.com/_SV3KDeJVzp0/S4nmhVUP9nI/AAAAAAAAACg/Cu4tP4e8Yt0/s400/Paraview_Wireframe2.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_SV3KDeJVzp0/S4nniQaVG-I/AAAAAAAAACo/lriJk9sySnA/s1600-h/Total_Te_mach01.50-epr0260.9.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="346" src="http://2.bp.blogspot.com/_SV3KDeJVzp0/S4nniQaVG-I/AAAAAAAAACo/lriJk9sySnA/s400/Total_Te_mach01.50-epr0260.9.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7985388249085447931-2823777171299399151?l=specificimpulses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://specificimpulses.blogspot.com/feeds/2823777171299399151/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://specificimpulses.blogspot.com/2010/02/i-only-want-to-do-this-onceper.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7985388249085447931/posts/default/2823777171299399151'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7985388249085447931/posts/default/2823777171299399151'/><link rel='alternate' type='text/html' href='http://specificimpulses.blogspot.com/2010/02/i-only-want-to-do-this-onceper.html' title='I only want to do this once... per simulation.'/><author><name>Mike Long</name><uri>http://www.blogger.com/profile/07495674918137786297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://2.bp.blogspot.com/_SV3KDeJVzp0/TFs0iIuc2XI/AAAAAAAAAEM/0hO9pwkZev0/S220/Scorpius_R2_Small.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_SV3KDeJVzp0/S4m0DdM3ZmI/AAAAAAAAACY/nEp1jMPaa1Y/s72-c/SixPack_Plume_Render.jpg' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7985388249085447931.post-570751553931216217</id><published>2010-02-05T21:41:00.000-08:00</published><updated>2010-04-28T08:12:36.973-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Rocket Simulation'/><title type='text'>Ground Control... we have a solution, for a six-pack.</title><content type='html'>&lt;div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;This has been a long time in the making, so without further ado...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;a href="http://2.bp.blogspot.com/_SV3KDeJVzp0/S20DG-U3z4I/AAAAAAAAABY/2VAHGgXgu1k/s1600-h/altitude.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5435003743650697090" src="http://2.bp.blogspot.com/_SV3KDeJVzp0/S20DG-U3z4I/AAAAAAAAABY/2VAHGgXgu1k/s400/altitude.jpg" style="cursor: pointer; display: block; height: 304px; margin: 0px auto 10px; text-align: center; width: 400px;" /&gt;&lt;/a&gt;Tada!&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Almost looks too simple considering all that went into it:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Over a year of (admittedly low priority) labor&lt;/li&gt;
&lt;li&gt;2000+ lines of Python&lt;/li&gt;
&lt;li&gt;Many, many false starts&lt;/li&gt;
&lt;li&gt;106 Flow solver runs&lt;/li&gt;
&lt;li&gt;1200+ CPU hours&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;Of course, that's not the whole story. For the whole story I need to violate my previous declaration that I wouldn't post any actual rocket performance data out here in the wild. The reason I'm comfortable violating that declaration is that this isn't an 'actual' rocket and it certainly wouldn't make a very efficient weapon in any case. Not to mention the fact that all of the data that went into the trajectory calculation was fabricated completely by me without much effort at all, so is more than likely not even close to what Armadillo Aerospace is actually building... and, while I'm not mentioning that fact, I'll also not mention that this design isn't even on their drawing board anymore as far as I know.&lt;/div&gt;&lt;div&gt;So here are the raw materials:&lt;/div&gt;&lt;div&gt;Vehicle parameters:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Empty mass : 670 lb&lt;/li&gt;
&lt;li&gt;Payload mass : 200 lb&lt;/li&gt;
&lt;li&gt;Propellant mass : 6500 lb&lt;/li&gt;
&lt;li&gt;Reserve Propellant : 500 lb&lt;/li&gt;
&lt;li&gt;Engine Vacuum Thrust : 1800 lb * 6 Engines = 10800 lb&lt;/li&gt;
&lt;li&gt;Engine Vacuum ISP : 250 seconds&lt;/li&gt;
&lt;li&gt;Engine Chamber Total Pressure : 165 psi&lt;/li&gt;
&lt;li&gt;Engine Chamber Total Temperature : 5500R&lt;/li&gt;
&lt;li&gt;Engine Chamber Gamma : 1.25&lt;/li&gt;
&lt;li&gt;Engine Nozzle Expansion Ratio : 2.5:1&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;Trajectory parameters:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Planet : Earth (seriously, the earth is now a Python module)&lt;/li&gt;
&lt;li&gt;Starting altitude : 0 ft msl&lt;/li&gt;
&lt;li&gt;Starting velocity : 0 ft/sec&lt;/li&gt;
&lt;li&gt;Atmospheric model : 1976 Standard Day&lt;/li&gt;
&lt;li&gt;Integration time step : 0.01 seconds&lt;/li&gt;
&lt;li&gt;Plotting output time step : 0.25 seconds&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;Flow solver parameters:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Solver : NASA FUN3D v10.8.0&lt;/li&gt;
&lt;li&gt;Model size : ~ 1 million nodes&lt;/li&gt;
&lt;li&gt;Turbulence : Spallart-Almaras 1-equation model&lt;/li&gt;
&lt;li&gt;Iterations per solution : 500-800&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;As your reward for reading all those numbers, here are a few more charts...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;a href="http://4.bp.blogspot.com/_SV3KDeJVzp0/S20YcBQo4FI/AAAAAAAAABg/jgo3EAKkbdM/s1600-h/Sixpack_trajectory_big_data_dump.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5435027194959683666" src="http://4.bp.blogspot.com/_SV3KDeJVzp0/S20YcBQo4FI/AAAAAAAAABg/jgo3EAKkbdM/s320/Sixpack_trajectory_big_data_dump.jpg" style="cursor: pointer; display: block; height: 305px; margin: 0px auto 10px; text-align: center; width: 320px;" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Yeah, I know... charts are sweet.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Before you take out your ruler and start trying to pull numbers, I'll save you some trouble:&lt;/div&gt;&lt;div&gt;====================================&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;T-plus at engine cut-off  =  138.89 sec&lt;/div&gt;&lt;div&gt;Altitude at engine cut-off  =  96824.6 ft&lt;/div&gt;&lt;div&gt;Mach number at engine cut-off  =  2.46&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;T-plus at apogee  =  194.37 sec&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;Altitude at apogee  =  149988.8 ft&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Max q  =  252.3 psf  :  T-plus  =  87.22 sec :  32480.7 ft&lt;/div&gt;&lt;div&gt;Take-off weight  =  7366.7 lbm&lt;/div&gt;&lt;div&gt;Take-off thrust/weight  =  1.25&lt;/div&gt;&lt;div&gt;Total dV delivered by engines  =  12893.6 fps&lt;/div&gt;&lt;div&gt;Total dV lost to gravity  =  6227.5 fps&lt;/div&gt;&lt;div&gt;Total dV lost to aero drag  =  6666.5 fps&lt;/div&gt;&lt;/div&gt;&lt;div&gt;====================================&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Here is a rendering of the flow field just before engine cutoff when the exhaust plume is at it's widest.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;a href="http://1.bp.blogspot.com/_SV3KDeJVzp0/S20i4yEqRPI/AAAAAAAAABw/quH45FnUMjw/s1600-h/Sixpack_at_Engine_Cutoff.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5435038684215395570" src="http://1.bp.blogspot.com/_SV3KDeJVzp0/S20i4yEqRPI/AAAAAAAAABw/quH45FnUMjw/s320/Sixpack_at_Engine_Cutoff.jpg" style="cursor: pointer; display: block; height: 225px; margin: 0px auto 10px; text-align: center; width: 320px;" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;And because ParaView kicks ass, here it is again... IN 3D!!!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;a href="http://3.bp.blogspot.com/_SV3KDeJVzp0/S20kNK_TPQI/AAAAAAAAAB4/pKbLXpsfggo/s1600-h/Sixpack_at_Engine_Cutoff_3D.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5435040134012812546" src="http://3.bp.blogspot.com/_SV3KDeJVzp0/S20kNK_TPQI/AAAAAAAAAB4/pKbLXpsfggo/s320/Sixpack_at_Engine_Cutoff_3D.jpg" style="cursor: pointer; display: block; height: 225px; margin: 0px auto 10px; text-align: center; width: 320px;" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;So there it is... 150k feet, nearly half way to space, and I promise I didn't have any idea going in that is where it would end up.&lt;/div&gt;&lt;div&gt;That's the whole point of this exercise anyway, to develop a tool that can produce accurate trajectories for sub-orbital vehicles without all of the empirical guesswork and expensive wind tunnel testing that is needed right now.  Of course there is still plenty more to do, but the core is there and looks to be functioning correctly.&lt;/div&gt;&lt;div&gt;...more to come&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7985388249085447931-570751553931216217?l=specificimpulses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://specificimpulses.blogspot.com/feeds/570751553931216217/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://specificimpulses.blogspot.com/2010/02/ground-control-we-have-solution-for-six.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7985388249085447931/posts/default/570751553931216217'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7985388249085447931/posts/default/570751553931216217'/><link rel='alternate' type='text/html' href='http://specificimpulses.blogspot.com/2010/02/ground-control-we-have-solution-for-six.html' title='Ground Control... we have a solution, for a six-pack.'/><author><name>Mike Long</name><uri>http://www.blogger.com/profile/07495674918137786297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://2.bp.blogspot.com/_SV3KDeJVzp0/TFs0iIuc2XI/AAAAAAAAAEM/0hO9pwkZev0/S220/Scorpius_R2_Small.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_SV3KDeJVzp0/S20DG-U3z4I/AAAAAAAAABY/2VAHGgXgu1k/s72-c/altitude.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7985388249085447931.post-2063504206974962629</id><published>2009-10-03T22:16:00.000-07:00</published><updated>2010-04-28T08:10:47.759-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Rockets in General'/><title type='text'>What the bleep is a SSTSO!?!?</title><content type='html'>Ok... I was having a conversation with a friend about the best way to waste loads of time while simultaneously not enjoy one's self in the slightest.  After some discussion we came to the conclusion that a perfectly sensible way to accomplish this would be to build a proof-of-concept rocket using as much off-the-shelf hardware as possible.  Mind you, we're talking about some pretty hard to reach shelves.. you know, the ones that have those little signs that read "please ask a sales associate for assistance with items on this shelf"...&lt;br /&gt;
&lt;br /&gt;
Ultimately the shelf that I ended up dangling with my pinkie fingers from while the store manager makes a frantic call to the company lawyer is a shelf with a jet engine on it.  "A jet engine?" you ask, not really caring to hear why, but knowing that I'm going to tell you anyway.  Yes, a jet engine, because the concept that our proof-of-concept vehicle aims to prove is the "Single Stage To Sub-Orbit".  There it is.. the SSTSO in the flesh, or more likely, in the graphite and phenolic honeycomb.&lt;br /&gt;
&lt;br /&gt;
If you read much SSTO literature, you are bound to come across the idea of taking a portion of your oxidizer for free from the atmosphere.  The goal of course is to take advantage of the (in rocket terms) obscenely high Specific Impulse (ha!.. I said it!) of air breathing engines to get off the ground and up to a reasonable altitude before firing conventional rockets for the boost out to apogee, theoretically getting the job done with a much cheaper, safer, sexier vehicle that you might even be able to fly home in, gas back up and make a return trip to the space station to grab that iPod you accidentally left in the Japanese science module.&lt;br /&gt;
&lt;br /&gt;
When compared to conventional staged rockets you get bogged down in the reality of the problem almost immediately:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;You are carrying useless air breathing engines for 90% of your flight&lt;/li&gt;
&lt;li&gt;You now have to design both an airplane and a rocket&lt;/li&gt;
&lt;li&gt;You are carrying substantial additional structural weight&lt;/li&gt;
&lt;li&gt;Re-usable does not always equal cheaper&lt;/li&gt;
&lt;/ul&gt;That last point is a big one for orbital launchers.  I like to think of cigarette lighters as a pretty good analogy.  Imagine a $20 mail ordered Zippo playing the part of the Space Shuttle and a $2 Bic disposable playing the part of say, any other operational launcher.  The Zippo features excellent craftsmanship, let's you re-fill it and replace the flint, and it lights even when it's windy.  All your friends admire the nifty titanium nitride coating and the eagle's head laser etched into the side.  Now imagine if you had to re-fill the fuel and replace the flint &lt;span style="font-style: italic;"&gt;every time you used it&lt;/span&gt;.  Not only that, but you can't re-fill it until you clean the soot off of it, not just around the flame holder, but &lt;span style="font-style: italic;"&gt;everywhere&lt;/span&gt;, even around the pin that holds the flint wheel... and that requires a special tool to replace.  Not only that, but those replacement flints that were supposed to come from multiple suppliers for pennies now cost dollars because Zippo didn't make enough of that particular model for there to be a competitive aftermarket.&lt;br /&gt;
&lt;br /&gt;
That Bic is starting to look pretty good!&lt;br /&gt;
&lt;br /&gt;
Of course that brings me back to the "SSTSO", which is much more attainable in a re-usable platform.  Suddenly you are talking about a vehicle that can meet it's mission objectives with a much lower propellant mass fraction.  This opens up various avenues for using that additional weight... You didn't think I would get into that now did you?... well, suffice it to say I've got a couple of friends who are smarter than the average bear.  At least I think so.  We've got an idea or two, and I'm going to be sharing one of those ideas with you soon...&lt;br /&gt;
&lt;br /&gt;
Mike&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7985388249085447931-2063504206974962629?l=specificimpulses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://specificimpulses.blogspot.com/feeds/2063504206974962629/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://specificimpulses.blogspot.com/2009/10/what-bleep-is-sstso.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7985388249085447931/posts/default/2063504206974962629'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7985388249085447931/posts/default/2063504206974962629'/><link rel='alternate' type='text/html' href='http://specificimpulses.blogspot.com/2009/10/what-bleep-is-sstso.html' title='What the bleep is a SSTSO!?!?'/><author><name>Mike Long</name><uri>http://www.blogger.com/profile/07495674918137786297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://2.bp.blogspot.com/_SV3KDeJVzp0/TFs0iIuc2XI/AAAAAAAAAEM/0hO9pwkZev0/S220/Scorpius_R2_Small.png'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7985388249085447931.post-693288338471266277</id><published>2009-09-24T13:42:00.000-07:00</published><updated>2010-04-28T08:13:02.858-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Rocket Simulation'/><title type='text'>Rise of the Scorpius...</title><content type='html'>In case you haven't heard, Armadillo Aerospace recently qualified to win the 'Level 2' Northrop Grumman Lunar Lander Challenge, worth a cool million to them if no other team can produce a better flight before the end of October. They did this with an upgraded modular platform that they are calling the Scorpius Super Mod, which among other things sports lighter landing gear, lighter helium pressurization tanks and a few engine tweaks. Video of the full flight is on the AA blog here:&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.armadilloaerospace.com/n.x/Armadillo/Home/News?news_id=368"&gt;http://www.armadilloaerospace.com/n.x/Armadillo/Home/News?news_id=368&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Here's a screen grab I took from one of the videos...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://4.bp.blogspot.com/_SV3KDeJVzp0/SrvfSQ5BPAI/AAAAAAAAAAU/uX3rkO4mKXM/s1600-h/Scorpius_Take_Off.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5385143284316322818" src="http://4.bp.blogspot.com/_SV3KDeJVzp0/SrvfSQ5BPAI/AAAAAAAAAAU/uX3rkO4mKXM/s320/Scorpius_Take_Off.png" style="cursor: pointer; display: block; height: 320px; margin: 0px auto 10px; text-align: center; width: 225px;" /&gt;&lt;/a&gt;&lt;br /&gt;
Naturally, when I saw this, I had to build a model of it and run it through my simulation tools...&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://1.bp.blogspot.com/_SV3KDeJVzp0/Srvf-ApbWoI/AAAAAAAAAAc/FA39dbIqwwU/s1600-h/Scorpius_V1M3_EPR10.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5385144035870202498" src="http://1.bp.blogspot.com/_SV3KDeJVzp0/Srvf-ApbWoI/AAAAAAAAAAc/FA39dbIqwwU/s320/Scorpius_V1M3_EPR10.png" style="cursor: pointer; display: block; height: 320px; margin: 0px auto 10px; text-align: center; width: 241px;" /&gt;&lt;/a&gt;Before anyone complains about how rudimentary the geometry is... I only put about an hour into creating the CAD model for this thing.  It's really just a sketch based on what I've gleaned from AA's blog postings and a little guestimation from looking at the pictures.  No, I didn't take calipers to any of their images, which should be obvious from the landing gear splay angle.&lt;br /&gt;
&lt;br /&gt;
Seriously though, it was about three hours from when I picked up my mouse to when I had the flow field meshed and ready to run in the solver.  The next morning I had a nice set of plots at engine pressure ratios up to 6000 and speeds up to Mach 2...&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://2.bp.blogspot.com/_SV3KDeJVzp0/SrvnaYOfYhI/AAAAAAAAAAk/D-w7yQHUrWM/s1600-h/Scorpius_Sweep_Sep24.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5385152219817402898" src="http://2.bp.blogspot.com/_SV3KDeJVzp0/SrvnaYOfYhI/AAAAAAAAAAk/D-w7yQHUrWM/s400/Scorpius_Sweep_Sep24.jpg" style="cursor: pointer; display: block; height: 318px; margin: 0px auto 10px; text-align: center; width: 400px;" /&gt;&lt;/a&gt;&lt;br /&gt;
Of course, I'm not expecting them to fly this thing to Mach 2 or to an engine pressure ratio that corresponds to well over 100,000 feet altitude, but it's easy enough to turn these knobs, so I usually crank them as far as they'll go :) .. incidentally, the solver did crash when I tried to raise the engine pressure even higher.  I didn't look too closely at the solution, but we'll just assume that the engine plume reached the downstream boundary where the simple supersonic extrapolation broke down... I'll ding both NASA for the robustness of their boundary condtions and myself for not extending the flow field further downstream.&lt;br /&gt;
&lt;br /&gt;
In case anyone is wondering, this is a fully 3D, viscous, compressible solution on an unstructured mesh.  The solver is finite-volume, node centered, second order accurate and is using the Spallart-Almaras one equation turbulence model with no wall functions.  I'll buy a moon pie for whoever can guess which NASA flow solver I'm using... &lt;span style="font-size: 85%;"&gt;&lt;span style="font-style: italic;"&gt;(Some exclusions apply.  NASA employees and their immediate family members may not participate.  See back of package for full contest rules.)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
On the down side, the solver is using a single perfect gas model throughout the entire flow field, potentially introducing inaccuracies in the exhaust plume shape, temperature and engine mass flow.  Michael Aftosmis at NASA Ames has put together a &lt;a href="http://people.nas.nasa.gov/%7Eaftosmis/cart3d/howto/rocketNozzle/Site/Cart3D_howto_-_Rocket_Plumes.html"&gt;nice discussion on modelling rocket plumes&lt;/a&gt; with his inviscid Cartesian mesh code, Cart3D, that touches on some of these issues.  I've looked into the mass flow error in the past and it seems to fall in the 10-15% range when using a working fluid with a gamma of 1.4 for the engine where the actual gamma is going to be in the 1.2-1.3 range depending on the propellants and engine design.&lt;br /&gt;
&lt;br /&gt;
After I got back the initial solutions, I wanted to have a better look at the &lt;a href="http://en.wikipedia.org/wiki/Shock_diamond"&gt;Mach diamonds&lt;/a&gt; in the plume at sea level ambient conditions, so I re-meshed the model, putting a lot more resolution downstream of the engine nozzle.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://2.bp.blogspot.com/_SV3KDeJVzp0/SrvxNpM6OyI/AAAAAAAAAAs/q0RvPhOWjpU/s1600-h/Scorpius_V1M3_EPR10_Plume_Mesh.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5385162996152154914" src="http://2.bp.blogspot.com/_SV3KDeJVzp0/SrvxNpM6OyI/AAAAAAAAAAs/q0RvPhOWjpU/s400/Scorpius_V1M3_EPR10_Plume_Mesh.png" style="cursor: pointer; display: block; height: 400px; margin: 0px auto 10px; text-align: center; width: 301px;" /&gt;&lt;/a&gt;&lt;br /&gt;
How very nice!&lt;br /&gt;
&lt;br /&gt;
Unfortunately even with the increased mesh resolution, dissipation of the plume occurs more quickly than it should.  To my knowledge this is unavoidable with low order solvers, especially on tetrahedral meshes.  More refinement would definitely help, but isn't really worth the extra effort at the moment.  I'll have to make a note to post some of my experiences with the mesh-budget/solution-time/solution-accuracy trade space, but for now suffice-it-to-say that given my computational resources, I don't have the luxury of putting the kind of resolution around the whole vehicle that I would like.&lt;br /&gt;
&lt;br /&gt;
That's all for now.. thank you for your time!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7985388249085447931-693288338471266277?l=specificimpulses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://specificimpulses.blogspot.com/feeds/693288338471266277/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://specificimpulses.blogspot.com/2009/09/rise-of-scorpius.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7985388249085447931/posts/default/693288338471266277'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7985388249085447931/posts/default/693288338471266277'/><link rel='alternate' type='text/html' href='http://specificimpulses.blogspot.com/2009/09/rise-of-scorpius.html' title='Rise of the Scorpius...'/><author><name>Mike Long</name><uri>http://www.blogger.com/profile/07495674918137786297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://2.bp.blogspot.com/_SV3KDeJVzp0/TFs0iIuc2XI/AAAAAAAAAEM/0hO9pwkZev0/S220/Scorpius_R2_Small.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_SV3KDeJVzp0/SrvfSQ5BPAI/AAAAAAAAAAU/uX3rkO4mKXM/s72-c/Scorpius_Take_Off.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7985388249085447931.post-1459859327476479035</id><published>2009-04-01T10:10:00.000-07:00</published><updated>2010-04-28T08:13:28.689-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Rocket Simulation'/><title type='text'>Blast Off!</title><content type='html'>Here is something I've been working on for a while in my spare time... The video here shows the results of a simulation that I've been working on using software that is freely available to U.S. Citizens, along with a simulation framework that I'm developing to automate most of the tricky stuff.  For what are hopefully obvious reasons, I won't be including any hard vehicle performance data on my blog, seeing as there are so many uses for rocket design simulations that don't involve communications satellites and space tourists.&lt;br /&gt;
&lt;br /&gt;
&lt;embed allowfullscreen="true" allowscriptaccess="always" id="VideoPlayback" src="http://video.google.com/googleplayer.swf?docid=-5604673245230410730&amp;amp;hl=en&amp;amp;fs=true" style="height: 326px; width: 400px;" type="application/x-shockwave-flash"&gt;&lt;/embed&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The vehicle in the video is my interpretation of one of the rockets being designed at Armadillo Aerospace.  The reason I chose this vehicle is that Armadillo has been extremely open and transparent about their efforts out in the Dallas suburbs so there was enough publicly available information for me to construct a reasonable model for the simulation.&lt;br /&gt;
&lt;br /&gt;
Thank you John Carmack!&lt;br /&gt;
&lt;br /&gt;
The ultimate goal of this work is to tie a high resolution aerodynamic model to a sub-orbital trajectory integrator (that I am also writing), allowing rapid performance estimation and vehicle force and moment calculations for these kinds of launch vehicles in the preliminary design stages, before a large investment is made building and testing actual hardware.&lt;br /&gt;
&lt;br /&gt;
Why am I doing this?.. great question seeing as I'm no longer employed in the rocket industry and my current work is squarely centered around aircraft.&lt;br /&gt;
&lt;br /&gt;
Well, I really like rockets.&lt;br /&gt;
&lt;br /&gt;
Honestly, there aren't too many other fields where you are almost certainly going to witness the fruits of your labor go down in a fiery heap in the desert somewhere.  As an engineer, that is a powerful thing, playing against the odds that you've managed to build something that can harness such massive amounts of energy to produce a controlled movement of a heavy object from Point A to Point B, or in the case of the sub-orbital crowd, Point A to Point A with a short period of weightlessness in between .&lt;br /&gt;
&lt;br /&gt;
After the X-Prize competition was won by Scaled Composites with Spaceship One there was a huge flurry of activity in the space tourism field, or at least what was considered a fledgling field at the time in 2004.  Unfortunately, that initial enthusiasm has waned and the participants have either abandoned their efforts or been severely curtailed by the realities of the problem or in the case of Scaled Composites a tragic accident at their rocket test facility.  My sincere hope is that some of these efforts will eventually bear fruit and with any luck I'll have found a way to make my mark on one or more of them.&lt;br /&gt;
&lt;br /&gt;
And no, no-one is paying me to do this, atleast not yet.. ;)&lt;br /&gt;
&lt;br /&gt;
I've just seen, in the course of my work, a really interesting problem that I believe I have access to the tools to solve and this is the result of that effort.  It is certainly possible that I will pursue some sort of commercialization in the future if there is sufficient interest in the community, but for now, it's going to serve as a back burner distraction that I will do my best to make sure doesn't interfere with my other obligations as a father, husband and engineer.&lt;br /&gt;
&lt;br /&gt;
btw.. I know what day it is.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7985388249085447931-1459859327476479035?l=specificimpulses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://specificimpulses.blogspot.com/feeds/1459859327476479035/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://specificimpulses.blogspot.com/2009/04/blast-off.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7985388249085447931/posts/default/1459859327476479035'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7985388249085447931/posts/default/1459859327476479035'/><link rel='alternate' type='text/html' href='http://specificimpulses.blogspot.com/2009/04/blast-off.html' title='Blast Off!'/><author><name>Mike Long</name><uri>http://www.blogger.com/profile/07495674918137786297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://2.bp.blogspot.com/_SV3KDeJVzp0/TFs0iIuc2XI/AAAAAAAAAEM/0hO9pwkZev0/S220/Scorpius_R2_Small.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7985388249085447931.post-3141050148577483239</id><published>2009-01-13T21:55:00.000-08:00</published><updated>2010-04-28T08:15:04.859-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Motivity'/><title type='text'>Where the Beefalo roam...</title><content type='html'>A couple of years ago, I was sitting at my desk thinking about where I was in my career as an aerospace engineer and how I managed to get there.  What seemingly small decisions or temporally insignificant movements had put me into the situation in which I had found myself... nearly 10 years out of school, in my fourth job since graduation, happy that I was doing something interesting, but worried that it was not going to last nearly as long as I wanted it to.  At the time I didn't really reach any kind of conclusion as to what sort of internal motivational forces were acting on me and why I couldn't seem to stay in one place for more than a few years at a time.&lt;br /&gt;
&lt;br /&gt;
You see... in the past, I've never been too concerned about how I got to a particular place, I'd just be enjoying the ride.  Now I am in my mid-to-late  (..cough..) thirties with a wonderful, beautiful wife and another wonderful, beautiful little baby girl, so yes, I suppose I have good reason to be concerned about a resume that is starting to look far too fragmented and not nearly what I had thought it would be at this point in my career.&lt;br /&gt;
&lt;br /&gt;
So, here I am, in sunny, windy Ooooooklahoma, trying to find some greater purpose in the last four years that I've spend helping design a rocket that will probably never be built and trying to chart a course for my budding little family into an uncertain future... stick around if you'd like to see how it turns out.. ;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7985388249085447931-3141050148577483239?l=specificimpulses.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://specificimpulses.blogspot.com/feeds/3141050148577483239/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://specificimpulses.blogspot.com/2009/01/where-beefalo-roam.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7985388249085447931/posts/default/3141050148577483239'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7985388249085447931/posts/default/3141050148577483239'/><link rel='alternate' type='text/html' href='http://specificimpulses.blogspot.com/2009/01/where-beefalo-roam.html' title='Where the Beefalo roam...'/><author><name>Mike Long</name><uri>http://www.blogger.com/profile/07495674918137786297</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://2.bp.blogspot.com/_SV3KDeJVzp0/TFs0iIuc2XI/AAAAAAAAAEM/0hO9pwkZev0/S220/Scorpius_R2_Small.png'/></author><thr:total>0</thr:total></entry></feed>
