This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Julia docs #15454
Merged
Merged
Julia docs #15454
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
9be03e1
add julia docs generation option
aaronmarkham 690ad13
add julia docs to website build
aaronmarkham a950907
update links to point to local julia site
aaronmarkham 46a399c
fix mxnet build setting bug
aaronmarkham ff687cc
fix link for site
aaronmarkham 3dca150
update ubuntu guide for julia
aaronmarkham b203552
turn building mxnet on by default
aaronmarkham 6a6c5b3
readd env var since CI uses it
aaronmarkham a26b84b
fold julia docs into main website jenkins routine
aaronmarkham 9761646
fix ubuntu julia setup steps
aaronmarkham 25112dd
cleanup mentions of the old julia docs pipeline
aaronmarkham File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -310,25 +310,93 @@ Refer to the [Clojure setup guide](https://github.com/apache/incubator-mxnet/tre | |
|
||
### Install the MXNet Package for Julia | ||
|
||
The MXNet package for Julia is hosted in a separate repository, MXNet.jl, which is available on [GitHub](https://github.com/dmlc/MXNet.jl). To use Julia binding it with an existing libmxnet installation, set the ```MXNET_HOME``` environment variable by running the following command: | ||
#### Install Julia | ||
The package available through `apt-get` is old and not compatible with the latest version of MXNet. | ||
Fetch the latest version (1.0.3 at the time of this writing). | ||
|
||
```bash | ||
export MXNET_HOME=/<path to>/libmxnet | ||
wget -qO julia-10.tar.gz https://julialang-s3.julialang.org/bin/linux/x64/1.0/julia-1.0.3-linux-x86_64.tar.gz | ||
``` | ||
|
||
The path to the existing libmxnet installation should be the root directory of libmxnet. In other words, you should be able to find the ```libmxnet.so``` file at ```$MXNET_HOME/lib```. For example, if the root directory of libmxnet is ```~```, you would run the following command: | ||
Place the extracted files somewhere like a julia folder in your home dir. | ||
|
||
```bash | ||
export MXNET_HOME=/~/libmxnet | ||
mkdir ~/julia | ||
mv julia-10.tar.gz ~/julia | ||
cd ~/julia | ||
tar xvf julia-10.tar.gz | ||
``` | ||
|
||
You might want to add this command to your ```~/.bashrc``` file. If you do, you can install the Julia package in the Julia console using the following command: | ||
Test Julia. | ||
```bash | ||
cd julia-1.0.3/bin | ||
julia -e 'using InteractiveUtils; versioninfo()' | ||
``` | ||
|
||
If you're still getting the old version, remove it. | ||
```bash | ||
sudo apt remove julia | ||
``` | ||
|
||
Update your PATH to have Julia's new location. Add this to your `.zshrc`, `.bashrc`, `.profile` or `.bash_profile`. | ||
```bash | ||
export PATH=~/julia/julia-1.0.3/bin:$PATH | ||
``` | ||
|
||
Validate your PATH. | ||
```bash | ||
echo $PATH | ||
``` | ||
|
||
Validate Julia works and is the expected version. | ||
```bash | ||
julia -e 'using InteractiveUtils; versioninfo()' | ||
``` | ||
|
||
#### Setup Your MXNet-Julia Environment | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These steps come from CI's runtime_functions.sh: |
||
|
||
**For each of the following environment variables, add the commands to your `.zshrc`, `.bashrc`, `.profile` or `.bash_profile` to make them persist.** | ||
|
||
Create a `julia-depot` folder and environment variable. | ||
```bash | ||
mkdir julia-depot | ||
export JULIA_DEPOT_PATH=$HOME/julia/julia-depot | ||
``` | ||
|
||
To use the Julia binding with an existing `libmxnet` installation, set the `MXNET_HOME` environment variable to the MXNet source root. For example: | ||
```bash | ||
export MXNET_HOME=$HOME/incubator-mxnet | ||
``` | ||
|
||
```julia | ||
Pkg.add("MXNet") | ||
Now set the `LD_LIBRARY_PATH` environment variable to where `libmxnet.so` is found. If you can't find it, you might have skipped the building MXNet step. Go back and [build MXNet](#build-the-shared-library) first. For example: | ||
```bash | ||
export LD_LIBRARY_PATH=$HOME/incubator-mxnet/lib:$LD_LIBRARY_PATH | ||
``` | ||
|
||
Verify the location of `libjemalloc.so` and set the `LD_PRELOAD` environment variable. | ||
```bash | ||
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so:$LD_PRELOAD | ||
``` | ||
|
||
With all of these updates, here's an example of what you might want to have in your `.zshrc`, `.bashrc`, `.profile` or `.bash_profile`. | ||
|
||
``` | ||
export PATH=$HOME/bin:$HOME/.local/bin:$HOME/julia/julia-1.0.3/bin:$PATH | ||
export JULIA_DEPOT_PATH=$HOME/julia/julia-depot | ||
iblislin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
export MXNET_HOME=$HOME/incubator-mxnet | ||
export LD_LIBRARY_PATH=$HOME/incubator-mxnet/lib:$LD_LIBRARY_PATH | ||
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so:$LD_PRELOAD | ||
``` | ||
|
||
Install MXNet with Julia: | ||
|
||
```bash | ||
julia --color=yes --project=./ -e \ | ||
'using Pkg; \ | ||
Pkg.develop(PackageSpec(name="MXNet", path = joinpath(ENV["MXNET_HOME"], "julia")))' | ||
iblislin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
``` | ||
|
||
For more details about installing and using MXNet with Julia, see the [MXNet Julia documentation](http://dmlc.ml/MXNet.jl/latest/user-guide/install/). | ||
For more details about installing and using MXNet with Julia, see the [MXNet Julia documentation](../api/julia/site/). | ||
<hr> | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am using CI's Julia setup as a guide.
https://github.com/apache/incubator-mxnet/blob/master/ci/docker/install/ubuntu_julia.sh