GSoC Update

There have been a lot of changes in the project lately, thanks to Michael, Philip, and others. It is now possible to cross-compile Octave with Java support enabled. Earlier I was having trouble getting Java support. The fix was to patch configure.ac of Octave to add “-Wl,–export-all-symbols” to the load flags (see bug# 39454), recalculate its SHA1 checksum, and put it in the src/octave.mk file.

Meanwhile, Jordi has set up a Mercurial repo for me where I can make my changes publicly available. Here is the public link to my repo. I have done some work on the installer scripts. Hopefully we will have a fully working installer for Octave before the mid-term evaluations. I also found some time to learn about how to use Mercurial from Hg Init. It helped me understand the basics of Mercurial in a very short time. I seem to like Mercurial now. :)

During this week, I will focus on adding more features to the installer script. I will write another post detailing about the planned features in the installer, and also about the work I have already done.

Cheers!

Writing an installer for GNU Octave

It’s time I updated my blog about the recent things I have been working on. After my last post, I have moved back to my college for a new academic semester (I am in 3rd semester now). During the last weekend, I was without an active internet connection since our Internet backbone was disrupted due to heavy lightning. Luckily, Internet has been restored now.

With more and more features being added into mxe-octave, I thought it was time to look into the installer that will be used to distribute Octave. Initially, I had started my work on NSIS. Patrick Noffke who has offered to be my backup mentor for this project suggested me to use Windows Installer XML (WiX) because of some reasons which I did find valid. Unlike NSIS which produces .exe installers, WiX produces an MSI file (.msi) which is more stable if built properly.  According to me, WiX is more customizable if compared with NSIS, which needs external plugins for adding most features. Uninstalls are automatically handled by the MSI and is very reliable.

I have written a working installer for Octave which can perform a  basic installation. I will add some option for letting the user choose the BLAS library (reference BLAS or OpenBLAS) during the next week. The WXS file which I composed can be found here. Before building the MSI file from it, you must make sure the path to all the files are set correctly. The installer has Mondo user interface with red and white colour scheme. All the contents of Octave are compressed inside an archive octave.cab. WiX provides us the choice to either embed the CAB file in the MSI installer or keep it separate. I chose to keep it embedded in order to produce a single file output, which will be easier to download.

There are two challenges I am facing right now. One is to find some way to automate the process of adding new files to the WXS file for new builds from mxe-octave. We already have a shell script in mxe-octave to generate an NSI file from the built octave directory. The other problem is to eliminate the need of a Windows installation to build an MSI from the WXS file. I am not sure if it is even needed since the XML file doesn’t need to be written from scratch. I also don’t know how to implement this as of now. I will try to complete the deliverables of the project first.

That’s all for now. See you next week.

Enabled Java in native MinGW but yet to add full support

Since my last update, I have been working only on natively compiling mxe-octave in MinGW/MSYS environment. My mentor Michael Goffioul had advised me to enable more features in my build like LLVM/JIT and Java. But including Java in my cross build was a pain. I was interrupted by missing DLL files (jvm.dll) which do not happen to exist in OpenJDK on Linux. Unwillingly enough, I had to try using the Java installation present in Windows while still cross compiling from Linux. This I had achieved by specifying in the configure options to search for the Java SDK installed inside Windows. Philip Nienhuis had previously tried the same thing using a symlink trick but his work was also interrupted by similar errors. To sum up, I couldn’t get Java enabled in cross-builds which forced me to switch to native builds in MinGW. I will probably continue my work on native builds.

I am specifying the configuration details related to Java libraries from mxe-octave/log/octave.txt. It might be useful for those who are trying to get Java support in native builds.


checking for java... /c/Java/jdk1.7.0_25/jre/bin/java
checking for javac... /c/Java/jdk1.7.0_25/bin/javac
checking for jar... /c/Java/jdk1.7.0_25/bin/jar
checking for Java version... 1.7.0_25
checking for jvm.dll... c:\Java\jdk1.7.0_25\jre\bin/client
checking for include file <jni.h>... /c/Java/jdk1.7.0_25/include


Java home: /c/Java/jdk1.7.0_25
Java JVM path: c:\Java\jdk1.7.0_25\jre\bin/client
Java CPPFLAGS: -I/c/Java/jdk1.7.0_25/include -I/c/Java/jdk1.7.0_25/include/win32
Java libraries: -ladvapi32

The configure options I used:
--with-java-homedir="/c/Java/jdk1.7.0_25"
--with-java-includedir="/c/Java/jdk1.7.0_25"

If configure options are specified then it overrides environment variables. Still I am mentioning it:
JAVA_HOME="/c/Java"

So the details of my current build are as follows:

Build Octave GUI: yes
JIT compiler for loops: no
Build Java interface: yes
Do internal array bounds checking: no
Use octave_allocator: no
Build static libraries: no
Build shared libraries: yes
Dynamic Linking: yes (LoadLibrary)
Include support for GNU readline: yes
64-bit array dims and indexing: no

Java support is yet to be actually added in my build. I am facing the same problem which Philips has reported here.

In my build I also have Ghostscript included (in pstoedit package). I had experienced an issue which you can see here. If anyone else is experiencing this, you can either add ac_cv_path_GS="/c/gs/gs9.07/bin' to the configure options (like I did), or more simply rename your file gswin32.exe to gs.exe (See #36076 in Octave bug tracker).

Since I couldn’t launch Octave GUI on my Windows 8 (there seems to be a problem specific to Windows 8), I asked a friend of mine to test my Octave build who was kind enough to send me screenshots of the GUI.