Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dgl
Commits
1209978d
Commit
1209978d
authored
Oct 05, 2018
by
Minjie Wang
Browse files
install doc
parent
1b069984
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
74 additions
and
4 deletions
+74
-4
docs/source/install/index.rst
docs/source/install/index.rst
+71
-1
python/dgl/batched_graph.py
python/dgl/batched_graph.py
+3
-3
No files found.
docs/source/install/index.rst
View file @
1209978d
Install DGL
Install DGL
============
============
TBD: installation instructions
At this stage, we recommend installing DGL from source. To quickly try out DGL and its demo/tutorials, checkout `Install from docker`_.
Get source codes
----------------
First, download the source files from github. Note you need to use the ``--recursive`` option to
also clone the submodules.
.. code:: bash
git clone --recursive https://github.com/jermainewang/dgl.git
You can also clone the repository first and type following commands:
.. code:: bash
git submodule init
git submodule update
Build shared library
--------------------
Before building the library, please make sure the following dependencies are installed
(use ubuntu as an example):
.. code:: bash
sudo apt-get update
sudo apt-get install -y python
We use cmake (minimal version 2.8) to build the library.
.. code:: bash
mkdir build
cd build
cmake ..
make -j4
Build python binding
--------------------
DGL's python binding depends on following packages (tested version):
* numpy (>= 1.14.0)
* scipy (>= 1.1.0)
* networkx (>= 2.1)
To install them, use following command:
.. code:: bash
pip install --user numpy scipy networkx
There are several ways to setup DGL's python binding. We recommend developers at the current stage
use environment variables to find python packages.
.. code:: bash
export DGL_HOME=/path/to/dgl
export PYTHONPATH=$DGL_HOME$/python:${PYTHONPATH}
export DGL_LIBRARY_PATH=$DGL_HOME$/build
The ``DGL_LIBRARY_PATH`` variable is used for our python package to locate the shared library
built above. Use following command to test whether the installation is successful or not.
.. code:: bash
python -c 'import dgl'
Install from docker
-------------------
TBD
python/dgl/batched_graph.py
View file @
1209978d
...
@@ -76,15 +76,15 @@ class BatchedDGLGraph(DGLGraph):
...
@@ -76,15 +76,15 @@ class BatchedDGLGraph(DGLGraph):
# override APIs
# override APIs
def
add_nodes
(
self
,
num
,
reprs
=
None
):
def
add_nodes
(
self
,
num
,
reprs
=
None
):
"""Add nodes."""
"""Add nodes.
Disabled because BatchedDGLGraph is read-only.
"""
raise
RuntimeError
(
'Readonly graph. Mutation is not allowed.'
)
raise
RuntimeError
(
'Readonly graph. Mutation is not allowed.'
)
def
add_edge
(
self
,
u
,
v
,
reprs
=
None
):
def
add_edge
(
self
,
u
,
v
,
reprs
=
None
):
"""Add one edge."""
"""Add one edge.
Disabled because BatchedDGLGraph is read-only.
"""
raise
RuntimeError
(
'Readonly graph. Mutation is not allowed.'
)
raise
RuntimeError
(
'Readonly graph. Mutation is not allowed.'
)
def
add_edges
(
self
,
u
,
v
,
reprs
=
None
):
def
add_edges
(
self
,
u
,
v
,
reprs
=
None
):
"""Add many edges."""
"""Add many edges.
Disabled because BatchedDGLGraph is read-only.
"""
raise
RuntimeError
(
'Readonly graph. Mutation is not allowed.'
)
raise
RuntimeError
(
'Readonly graph. Mutation is not allowed.'
)
# new APIs
# new APIs
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment