Difference between revisions of "Downloading and Building Fiji From Source"

(Cloning source as unknown contributor: hint at using github.com for the initial clone)
(Submodules: refrain from suggesting to check out any submodule)
Line 33: Line 33:
 
  git submodule update
 
  git submodule update
  
The build system will attempt to use the system Java installation if it is available.  However, on some platforms this may not work (or you may not have a recent enough Java installation) so we recommend that you also initialize and update the appropriate Java submodule for your system.  To do this, run one of these commands:
+
'''Note:''' in the common case, you do not need <u>any</u> submodule to be checked out (except the Java submodule, which will be checked out automatically once you run the [[Fiji Build System|Fiji Build]] with:
 
 
git submodule init java/linux          # For 32-bit Linux systems
 
git submodule init java/linux-amd64    # For 64-bit Linux systems
 
git submodule init java/macosx-java3d  # For MacOS X systems
 
git submodule init java/win32          # For 32-bit Windows systems
 
git submodule init java/win64          # For 64-bit Windows systems
 
 
 
Then update the submodules again with:
 
 
 
git submodule update java/<the-name-for-your-OS>
 
  
 +
./Build.sh
  
 
Note: using <b>git submodule update</b> without specifying which submodule, will update <b>all</b> submodules. What <i>update</i> 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 <b>(no branch)</b> situation. To fix it, just cd to that submodule <i>git checkout master</i> or whatever branch you were working on.
 
Note: using <b>git submodule update</b> without specifying which submodule, will update <b>all</b> submodules. What <i>update</i> 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 <b>(no branch)</b> situation. To fix it, just cd to that submodule <i>git checkout master</i> or whatever branch you were working on.

Revision as of 17:56, 11 March 2010

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 (Windows users, please go here). 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 git://pacific.mpi-cbg.de/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/dscho/fiji
cd fiji
git config remote.origin.url git://pacific.mpi-cbg.de/fiji.git
git pull

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 pacific.mpi-cbg.de, then you should clone fiji with the following command:

git clone username@pacific.mpi-cbg.de:/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.) These submodules must be initialized and updated with the following commands:

git submodule init ImageJA TrakEM2 VIB micromanager1.1 mpicbg
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.

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