Downloading and Building Fiji From Source

QR for this page

From Fiji

Jump to: navigation, search
Warning.png This section is out of date, potentially misleading or invalid. Be careful with any instructions here. When in doubt, ask for help on the Mailing Lists.

Downloading the Source Code with Git

Warning: the source code for Fiji is rather large; make sure that you have two gigabytes of disk space free before beginning this.

To fetch the Fiji source code you should use git. If you are not familiar with Git, you might want to read this page or these pages instead.

Cloning source as unknown contributor

Your first step should be to "clone" the fiji repository with the following command:

git clone contrib@fiji.sc:/srv/git/fiji.git

This should start downloading the base fiji repository and unpack it into a directory called "fiji" in your current directory. Once this has successfully completed, change into the newly created "fiji" directory.

If this clone is slow, you might want to try to clone from github.com, and after that switch back to the official repository:

git clone git://github.com/fiji/fiji
cd fiji
git config remote.origin.url git://fiji.sc/fiji.git
git pull

If you are getting errors like this:

github.com[0: 207.97.227.239]: errno=Connection timed out fatal: 
unable to connect a socket (Connection timed out)

then you probably are behind a firewall that does not let you connect to port 9418. Do not panic, though, you might be able to clone the repository with

git clone contrib@fiji.sc:/srv/git/fiji.git

or

git clone https://yourusername@github.com/fiji/fiji.git

... where you should replace yourusername with your GitHub username.

Cloning source as known contributor

The above command creates a unknown contributor copy of Fiji in your computer. If you have your own user account in fiji.sc, then you should clone fiji with the following command:

git clone username@fiji.sc:/srv/git/fiji.git

Just substitute username with your corresponding user name on that machine.

Submodules

Some plugins are managed as submodules. If you want to work on them, you will have to initialize and update them. (For more on submodules, see the Git submodule tutorial.) For example, if you know that you're going to need to work on the ImageJA, TrakEM2 and mpicbg submodules, you should initialize and update them with the following commands:

git submodule init modules/ImageJA modules/TrakEM2 modules/mpicbg modules/imglib
git submodule update

Note: in the common case, you do not need any submodule to be checked out (except the Java submodule, which will be checked out automatically once you run the Fiji Build with:

./Build.sh

Note: using git submodule update without specifying which submodule, will update all submodules. What update means: "put all submodules, if checked out, to the last commit that was committed in the fiji repos". Which is most likely not what you want--will put any submodule that you have been working on into a (no branch) situation. To fix it, just cd to that submodule git checkout master or whatever branch you were working on.

Alternately, if you want to automatically clone, configure and/or update a submodule with all its dependent submodules, you can run (e.g., for TrakEM2):

cd bin
./configure-submodule.py TrakEM2

Getting a snapshot without Git

If you insist on not using Git, you can download a snapshot of Fiji here, but you need to make sure that you have a new enough Java version installed.

Building Fiji from Source

You should now be able to build Fiji with:

sh Build.sh run

... which will invoke Fiji's multi-platform build system. If all goes well, after some time you should see the main Fiji window:

Fiji's main window


Multi-platform build confirmed successes

Typically, multi-platform is plain hell. As of June 2012, Johannes Schindelin put enough effort to ensure that Fiji builds at the very least on the following systems:

  • Windows 64-bit with MSysGit
  • Windows 64-bit using Cygwin (you will need at least the curl & unzip functions to be installed)
  • MacOSX 10.5 (Leopard)
  • MacOSX 10.6 (Snow Leopard)
  • MacOSX 10.7 (Lion)

Missing Java3D

During the build process there might be complaints about missing Java3D features if you already have a Java SDK installed. To force the build system to clone a JDK with everything needed by Fiji (including Java3D support) you need to clear the environment variable JAVA_HOME before building:

unset JAVA_HOME