Skip to content

Commit

Permalink
Vagrant instead of Docker
Browse files Browse the repository at this point in the history
[av skip]
  • Loading branch information
tkelman committed Jun 14, 2015
1 parent c257a16 commit c37be60
Showing 1 changed file with 25 additions and 18 deletions.
43 changes: 25 additions & 18 deletions README.windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,29 +189,36 @@ Julia can be also compiled from source in [Cygwin](http://www.cygwin.com), using

If you prefer to cross-compile, the following steps should get you started.

For maximum compatibility with packages that use [WinRPM.jl](https://github.com/JuliaLang/WinRPM.jl) for binary dependencies on Windows, it is recommended that you use OpenSUSE 13.1 for cross-compiling a Windows build of Julia. If you use a different Linux distribution (or OS X), install [Docker](https://docs.docker.com/installation) and use the following `Dockerfile`:
For maximum compatibility with packages that use [WinRPM.jl](https://github.com/JuliaLang/WinRPM.jl) for binary dependencies on Windows, it is recommended that you use OpenSUSE 13.1 for cross-compiling a Windows build of Julia. If you use a different Linux distribution or OS X, install [Vagrant](http://www.vagrantup.com/downloads) and use the following `Vagrantfile`:
```
# Dockerfile for MinGW-w64 cross-compilation of Julia
FROM opensuse:13.1
# Vagrantfile for MinGW-w64 cross-compilation of Julia
$script = <<SCRIPT
# Change the following to i686-w64-mingw32 for 32 bit Julia:
ENV XC_HOST x86_64-w64-mingw32
export XC_HOST=x86_64-w64-mingw32
# Change the following to 32 for 32 bit Julia:
ENV BITS 64
RUN zypper addrepo http://download.opensuse.org/repositories/windows:mingw:win$BITS/openSUSE_13.1/windows:mingw:win$BITS.repo && \
zypper --gpg-auto-import-keys refresh && \
zypper -n install --no-recommends git make cmake tar wine which curl \
python python-xml patch gcc-c++ m4 p7zip.i586 libxml2-tools && \
zypper -n install mingw$BITS-cross-gcc-c++ mingw$BITS-cross-gcc-fortran \
mingw$BITS-libstdc++6 mingw$BITS-libgfortran3 mingw$BITS-libssp0
export BITS=64
zypper addrepo http://download.opensuse.org/repositories/windows:mingw:win$BITS/openSUSE_13.1/windows:mingw:win$BITS.repo
zypper --gpg-auto-import-keys refresh
zypper -n install --no-recommends git make cmake tar wine which curl \
python python-xml patch gcc-c++ m4 p7zip.i586 libxml2-tools
zypper -n install mingw$BITS-cross-gcc-c++ mingw$BITS-cross-gcc-fortran \
mingw$BITS-libstdc++6 mingw$BITS-libgfortran3 mingw$BITS-libssp0
# opensuse packages the mingw runtime dlls under sys-root/mingw/bin, not /usr/lib64/gcc
RUN cp /usr/$XC_HOST/sys-root/mingw/bin/*.dll /usr/lib*/gcc/$XC_HOST/*/ && \
git clone git://github.com/JuliaLang/julia.git /home/user/julia && \
git config --global url."git://".insteadOf https://
# use git:// to avoid SSL certificate problems with JuliaDoc
WORKDIR /home/user/julia
RUN make -j4 win-extras binary-dist
cp /usr/$XC_HOST/sys-root/mingw/bin/*.dll /usr/lib*/gcc/$XC_HOST/*/
git clone git://github.com/JuliaLang/julia.git julia
cd julia
make -j4 win-extras binary-dist
SCRIPT
Vagrant.configure("2") do |config|
config.vm.box = "chef/opensuse-13.1"
config.vm.provider :virtualbox do |vb|
# Use VBoxManage to customize the VM. For example to change memory:
vb.memory = 2048
end
config.vm.provision :shell, :inline => $script
end
```

### Cross-building Julia
Expand Down

0 comments on commit c37be60

Please sign in to comment.