Quote:
Originally Posted by Peter Johnson
Great job! How hard would it be to get gfortran working? Fortran is the primary dependency I've been missing to get numpy ported to the cRIO.
|
OK, so I have a fortran compiler working. The issue: I don't have a build script yet. I'm not going to make one, as I'm working on transitioning from a build-script system to a package-based system. I think this will be easier for 90% of people, and the 10% who need to compile it themselves can use the command line themselves :-D.
I have a series of patches, which I'll attach, but they're based off of the trunk. I'm working with the gcc devs to get them committed, so hopefully by gcc-4.8 vxworks will compile out of the box.
There's also a series of patches which need to be applied to the C headers. Finally, there's a patch that needs to be applied while GCC builds and then reverted after the build.
So, some build instructions.
First, install the cross binutils from earlier- those will still work for building gcc.
Then download all of the attachments to this post. Remove the .txt extension from the patch file:
Code:
$ mv headers-build.patch{.txt,}
Untar the patches:
Code:
$ tar -xf gcc-patches.tgz
$ tar -xf wrs-patches.tgz
Get the latest gcc trunk:
Code:
$ svn checkout svn://gcc.gnu.org/svn/gcc/trunk gcc
Get the gccdist and unzip it:
Code:
$ wget ftp://ftp.ni.com/pub/devzone/tut/updated_vxworks63gccdist.zip
$ unzip updated_vxworks63gccdist.zip
Apply the permanent patches to gccdist:
Code:
$ cat wrs-patches/*.patch | patch -p1 -l -d gccdist/WindRiver/vxworks-6.3/target/h
And apply the temporary gcc build patch:
Code:
$ patch -p1 -l -d gccdist/WindRiver/vxworks-6.3/target/h < headers-build.patch
Now switch to the gcc directory.
Since I made changes to configure.ac you'll need to regenerate that:
If it barfs at you about not having the right autoconf version, go into config/override.m4 and change the lines that look like this:
Code:
dnl Ensure exactly this Autoconf version is used
m4_ifndef([_GCC_AUTOCONF_VERSION],
[m4_define([_GCC_AUTOCONF_VERSION], [2.64])])
to look like this (note that my autoconf verison is 2.68):
Code:
dnl Ensure exactly this Autoconf version is used
m4_ifndef([_GCC_AUTOCONF_VERSION],
[m4_define([_GCC_AUTOCONF_VERSION], [2.68])])
Then re-run autoconf.
OK, if you're still with me, now it's time to run configure. Switch out of the gcc directory (cd ..) and make a new directory called build (mkdir build), then switch into the build directory. Here's how to invoke configure:
Code:
# ../gcc/configure \
--prefix=/usr \
--target=powerpc-wrs-vxworks \
--with-gnu-as \
--with-gnu-ld \
--with-headers="../gccdist/WindRiver/vxworks-6.3/target/h" \
--disable-shared \
--disable-libssp \
--disable-multilib \
--with-float=hard \
--enable-languages=c,c++,fortran \
--enable-libstdc++-v3 \
--enable-threads=vxworks \
--without-gconv \
--disable-libgomp \
--disable-nls \
--disable-libmudflap \
--with-cpu-PPC603 \
--disable-symvers
You'll need to have the development libraries for libmpfr, libmpc, and libgmp on your system (libmpfr-dev, libmpc-dev, and libgmp-dev on debian) installed for this to work. Also note the #; configure needs to be run as root here.
Now for the fun part. Hopefully, if you've done everything up to this point, you can just say
[code]
$ make -j4
[/code
and everything will work just fine. Then just make install as root.
Finally, clean up some of the unnecessary fixes:
Code:
# patch -p1 -l -R -d /usr/powerpc-wrs-vxworks/sys-include < headers-build.patch
And you should hopefully have a working compiler!
This will become much simpler once I update the build script, but in case any of you want to try this out and understand how to do it, I posted this.
If you have any questions, let me know.
Note that fortran support is untested as I have nothing to test it with. It would be nice if somebody could test this.
Libgfortran's configure is acting funny too - gotta fix that.