For the detailed user guide, please see the DVID Wiki.
Pre-built binary distributions (with all necessary dependencies) are provided on the github releases downloads page.
Alternatively, conda users can simply install the dvid
package:
Install:
$ conda create -n dvidenv -c flyem-forge -c conda-forge dvid
Run:
$ conda activate dvidenv
$ dvid about
-
If you are using a bare OS, you will need some essentials (gcc, bzip2, etc) before installing anything else. In Ubuntu, you can easily install this with
sudo apt-get install build-essential gcc bzip2
. Then Installconda
(specifically the miniconda distribution) and enable theactivate
command for your shell.Note: At the time of this writing, the Miniconda installer will give you conda-4.5, but these instructions require conda-4.6. Immediately after installing Miniconda, upgrade
conda
:$ conda update -n base -c defaults conda
...and then activate it for your shell:
$ conda init bash
...and then open a new terminal window.
-
Install (or upgrade)
conda-build
andanaconda-client
:$ conda activate base $ conda install -n base -c defaults conda-build anaconda-client
-
Add
flyem-forge
andconda-forge
to your.condarc
file:$ cat ~/.condarc channels: - flyem-forge - conda-forge - defaults
-
Create a conda environment for dvid development. Activate it.
$ conda create -y -n dvid-devel $ conda activate dvid-devel
-
Define
GOPATH
and clone the dvid source code into the appropriate subdirectory:$ export GOPATH=/path/to/gopath-dir $ DVID_SRC=${GOPATH}/src/github.com/janelia-flyem/dvid $ git clone http://github.com/janelia-flyem/dvid ${DVID_SRC}
-
Install the developer dependencies
$ cd ${DVID_SRC} $ ./scripts/install-developer-dependencies.sh
-
Reactivate the environment
Important: Yes, you must do this after
install-developer-dependencies.sh
, even though yourdvid-devel
environment is already active. Activating the environment again ensures that environment variables likeCC
andCXX
are set correctly.$ conda activate dvid-devel
Note: as of May 2024, the basho leveldb backend is no longer included as a
default option because the project has not been actively developed for 5 years. You may add it back by exporting
an environment variable DVID_BACKENDS
that includes the "basholeveldb" keyword.
g cam
$ make dvid
$ make test
$ make install # Optional: Install bin/dvid into dvid-devel environment
For each platform (Mac and Linux):
-
Fetch the latest tags:
$ git fetch --tags origin
Or make your own release tag:
$ git tag -a 'v0.8.20' -m "This is release v0.8.20" $ git push --tags origin
-
Build the conda package and upload it to the
flyem-forge
channel onhttp://anaconda.org
:$ conda activate base $ GOMAXPROCS=4 conda build scripts/conda-recipe $ anaconda upload -u flyem-forge $(conda info --base)/conda-bld/osx-64/dvid-someVersionPlusHash-0.tar.bz2 # Mac $ anaconda upload -u flyem-forge $(conda info --base)/conda-bld/linux-64/dvid-someVersionPlusHash-0.tar.bz2 # Linux
(The exact name of the tarball to upload to Anaconda will be described by the script output.)
Note: For maximum Linux compatibility, build within the
flyem-build
Docker container:Click here to see Docker container commands
Note: Make sure your Docker container has plenty of RAM, or DVID's test suite may encounter random unexplained failures. (Set at least 16GB in Docker Preferences > Advanced.)
# Launch the container git clone https://github.com/janelia-flyem/flyem-build-container cd flyem-build-container ./launch.sh # (or resume.sh) # Within the container # Note: It's recommended to use GOMAXPROCS to limit the cpus used in the build/tests conda activate cd /flyem-workspace/gopath/src/github.com/janelia-flyem/dvid git pull git checkout <tag> GOMAXPROCS=4 conda build scripts/conda-recipe anaconda upload -u flyem-forge /opt/conda/conda-bld/linux-64/dvid-someVersion-someHash_0.tar.bz2 scripts/make-release-distribution.sh someVersion
You can move the generated tarball to the host from your container with the following:
% docker cp flyem-build:/flyem-workspace/gopath/src/github.com/janelia-flyem/dvid/dvid-0.9.6-dist-linux.tar.bz2 .
Note: For maximum macOS compatibility, make sure you have the SDK for MacOSX 10.13, which can be installed via the xcodelegacy project. (We use go 1.18, which [requires at least MacOSX 10.13.)
Click here for MacOSX 10.13 SDK installation commands
curl https://raw.githubusercontent.com/devernay/xcodelegacy/master/XcodeLegacy.sh > XcodeLegacy.sh chmod +x XcodeLegacy.sh ./XcodeLegacy.sh -osx1013 buildpackages sudo ./XcodeLegacy.sh -osx1013 install
Note: The XcodeLegacy script will probably tell you that the 10.13 SDK can only be built/installed by an old version of Xcode, and ask you to download the old version (but not install it).
Follow the download instructions it gives you, and then re-run
XcodeLegacy.sh
from the directory where you downloaded the Xcode.dmg
file.(Also note that downloading Xcode requires an Apple Developer login.)
-
Generate a release distribution. (This doesn't build dvid again; it uses the conda package you uploaded in the previous step.)
$ ./scripts/make-release-distribution.sh 0.9.10 $ ls dvid-0.9.10-dist-mac.tar.bz2 # <--- Distribution tarball includes dvid and all dependencies
-
New compiled (C/C++) dependencies should be packaged for conda and uploaded to the
flyem-forge
channel, if they aren't already available on theconda-forge
channel. Then list them in therequirements
sections ofscripts/conda-recipe/meta.yaml
. Also add them to the appropriate line ofscripts/install-developer-dependencies.sh
. -
Of course, new DVID sources should be listed in the
Makefile
as needed.
DVID uses an integrated memory profiling system. To start memory profiling, visit http://path-to-dvid-server/profiler/start
. You can then visit http://path-to-dvid-server/profiler/info.html
to view the real-time graph of memory usage. Stop profiling by visiting http://path-to-dvid-server/profiler/stop
.