Skip to content

Commit

Permalink
Added MXNET_COMMIT env variable for upstream commit/tag (#260)
Browse files Browse the repository at this point in the history
Setting the `MXNET_COMMIT` environment variable to a tag, branch or hash
will use that version of the upstream mxnet repo in building the libmxnet
shared object.

Additionally, the upstream submodules are cleared (and reinitialised)
every build to prevent some issues when submodules make changes
(squashes, etc).
  • Loading branch information
joshbode authored and pluskid committed Jun 23, 2017
1 parent e7d1b62 commit 10ad90b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
9 changes: 5 additions & 4 deletions deps/build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import JSON
# First try to detect and load existing libmxnet
################################################################################
libmxnet_detected = false
libmxnet_curr_ver = "master"
libmxnet_curr_ver = get(ENV, "MXNET_COMMIT", "master")
curr_win = "20170502"

if haskey(ENV, "MXNET_HOME")
Expand Down Expand Up @@ -138,14 +138,15 @@ if !libmxnet_detected
@build_steps begin
BinDeps.DirectoryRule(_mxdir, @build_steps begin
ChangeDirectory(_srcdir)
`git clone --recursive https://github.com/dmlc/mxnet`
`git clone https://github.com/dmlc/mxnet`
end)
@build_steps begin
ChangeDirectory(_mxdir)
`git -C mshadow checkout -- make/mshadow.mk`
`git submodule deinit --force .`
`git fetch`
`git checkout $libmxnet_curr_ver`
`git submodule update --init`
`git submodule update --init --recursive`
`git -C mshadow checkout -- make/mshadow.mk`
`make clean`
`sed -i -s "s/MSHADOW_CFLAGS = \(.*\)/MSHADOW_CFLAGS = \1 $ilp64/" mshadow/make/mshadow.mk`
end
Expand Down
5 changes: 4 additions & 1 deletion docs/src/user-guide/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@ MXNet.jl is built on top of [libmxnet](https://github.com/dmlc/mxnet).
Upon installation, Julia will try to automatically download and build
libmxnet.

There are two environment variables that change this behaviour. If you
There are three environment variables that change this behaviour. If you
already have a pre-installed version of mxnet you can use `MXNET_HOME`
to point the build-process in the right direction. If the automatic
cuda detection fails you can also set `CUDA_HOME` to override the process.
To control which version of libmxnet will be compiled, you can use the
`MXNET_COMMIT` variable to point to either a version tag (e.g. `v0.10.0`), a
branch name (e.g. `master`) or a specific commit hash (e.g. `a0b1c2d3`).

The libmxnet source is downloaded to `Pkg.dir("MXNet")/deps/src/mxnet`.
The automatic build is using default configurations, with OpenCV disabled.
Expand Down

0 comments on commit 10ad90b

Please sign in to comment.