octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: update: cross compiling Octave for MinGW systems


From: Philip Nienhuis
Subject: Re: update: cross compiling Octave for MinGW systems
Date: Wed, 12 Dec 2012 14:51:58 -0800 (PST)

John W. Eaton wrote
> Last month I posted some info about cross compiling Octave for Windows
> systems with MinGW using MXE (http://mxe.cc).  I now have nearly all
> the Octave dependencies building this way, along with a recent
> snapshot of the current Octave development sources.
> 
> To see the current state of the project, here is what you need to do
> (on a GNU/Linux system; I've used Debian, it should also work on
> Fedora and the other systems listed on the MXE requirements page):
>  
>   * install the required packages as described here:
>     http://mxe.cc/#requirements
> 
>   * clone my fork of mxe:
> 
>       hg clone http://hg.octave.org/mxe-octave
> 
>   * build the cross tools and Octave:
> 
>       cd mxe-octave
>       make octave
> 
>     If you have more than one core available, you can run
> 
>       make octave JOBS=4
> 
>     or similar to do parallel builds.
> 
> You'll end up with an almost complete version of Octave built for
> Windows with MinGW.  At this point, you can run
> 
>   ./mk-dist
> 
> to build the a version of GCC that can run on Windows and create a
> file dist/octave.tar.bz2 that includes Octave and all its
> dependencies.  You can copy this file over to a Windows system.  Start
> a MinGW/MSys or Cygwin shell and unpack it with
> 
>   tar jxf octave.tar.bz2
> 
> If you do this in your MinGW/MSys or Cygwin home directory, you can set
> then environment variable
> 
>   OCTAVE_HOME=$HOME/octave
> 
> and add $HOME/octave/bin to your path:
> 
>   PATH=$HOME/octave/bin:$PATH
> 
> Then you should be able to start Octave.
> 
> If you also add
> 
>   CC=gcc
>   CXX=g++
>   F77=gfortran
>   CXX_LD=g++
>   DL_LD=g++
> 
> to your environment, you should be able to build a package.  For
> example,
> 
>   octave> pkg -forge install control
> 
> works for me.
> 
> The missing dependencies that I know of are
> 
>   HDF5:  I have not yet found a way to build the HDF5 libraries for
>          MinGW, and they seemed to have dropped support recently.
> 
>   ghostscript, pstoedit, fig2dev:
>          These are needed for printing figures.  I think it should be
>          possible to get them to build with MXE, but I have not tried
>          yet.

For ghostscript there are binary packages for win32.
I grabbed he pstoedit and fig2dev stuff from earlier MinGW binaries.


>   Qt, Qscintilla:
>          These libraries are only needed for the GUI that will be
>          included in an upcoming release of Octave.
> 
>   LLVM:  This package is only needed for the experimental JIT compiler
>          that will be included in an upcoming release of Octave.
> 
>   Java:  This dependency is only needed for the experimental Java
>          interface that will be included in an upcoming release of
>          Octave.
> 
> I'm working on building these and including them in my fork of MXE.
> 
> If this is to be made truly stand alone and independent of MinGW/MSys
> or Cygwin, then the dependencies would also need to include things
> like less, Texinfo, make, bison, flex, etc. and other tools that might
> be needed to either build packages that contain C++, C, or Fortran
> files, or to build Octave itself on Windows systems.  I'm not sure it
> whether to go that far, or just require that people install MinGW if
> they want to do development.
> 
> In addition to missing dependencies, I'm working on fixing the
> following problems:
> 
>   * we should not have to set OCTAVE_HOME, CC, CXX, F77, etc. in the
>     environment.

In the current MinGW binaries that isn't needed either. But it can easily be
tackled with a batch script (*.cmd file).


>   * make the build work for the stable released version of Octave.
> 
>   * include everything necessary to run Octave so that it can be
>     installed without requiring MinGW/MSys to be installed.
> 
>   * modify MXE so that all of this can be done "natively" in a Cygwin
>     or MinGW/MSys shell, or any other Unix-like system so that we can
>     easily build Octave and all its dependencies on other systems that
>     don't have package systems to provide all the required
>     dependencies.
> 
>   * see whether this approach will also work for cross compiling for
>     OS X systems.
> 
> I'm also thinking about distributing the dependency libraries that I
> build with this system so that people who have no way of cross
> compiling Octave but want to build it with MinGW running on a Windows
> system can easily do so without having to build everything from
> source.

More or less like Tatsuro did?


> I don't recall seeing any responses to the last post I made about this
> topic.  Is anyone else interested in it?  Has anyone tried using my
> fork of MXE to build Octave?

Sorry I could have responded earlier, true.

Well, at least I am interested. But currently I simply lack time to even
prepare for starting a moderately big project like that.
My only Linux build box is a 1.1 Ghz Pentium-M subnotebook with limited disk
space and a build there usually takes overnight.
My other box needs a major overhaul (backup, clean up, reorganize disk
layout, upgrade to newer Linux). Once that is done (hopefully around Xmas)
I'd like to try MXE.

I think it would be desirable to aim at being able to build the dev version
(incl. Qt, JIT & Java) as very very few Windows users would be interested in
building a stable version if binary packages can be downloaded.

But the first thing would be to create a self-contained Octave-f-Windows
starting from your results.

Do you think building a 64-bit version would be possible using MXE?

Philip




--
View this message in context: 
http://octave.1599824.n4.nabble.com/cross-compiling-Octave-for-MinGW-systems-tp4646732p4647823.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]