User Tools

Site Tools


Multiple Builds from a Common Source

The script install-difx now allows DiFX to be built and installed from a directory hierarchy outside of the SVN source tree. For example, if you need to compile DiFX for multiple architectures you can have independent build and root directories for each. Also, since the built files are not in the source tree, an svn status command will mostly only list files that are in the SVN distribution (i.e. no built files).

The steps now are:

  1. run svn update to bring your sources up-to-date (or not)
  2. prepare and source a setup script as before
  3. create a build directory somewhere
  4. run /fullpathto/install-difx in this build directory

If you have previously (as most developers have) been building in the source SVN directory, the first configure process will complain that the “source is already configured, run make distclean” and halt. (This is a feature designed to prevent you from accidentally misconfiguring a build for one architecture as another.) Since there are multiple subdirectories to the DiFX project, fixing this could be tedious, so there is an option (–pristine) to do this for you. There are quite a few options to install-difx; use –help for brief descriptions.

So, For Example

You might plan to have your root, source and build directories all in some parent directory somewhere–e.g. $DIFXROOT, $DIFXROOT/../difx-svn and $DIFXROOT/../difx-bld. So first we would bring the sources up-to-date and check on our modifications:

  source setup-difx.bash
  cd $DIFXROOT/../difx-svn
  svn update
  svn status

Then we make a build directory. install-difx prepends a directory therein (pkgconfig) to the $PKG_CONFIG_PATH so that you can place custom pkg-config files there if you need to handle some special cases (e.g. IPP):

  cd $DIFXROOT/..
  mkdir difx-bld
  cd difx-bld
  mkdir pkgconfig
  cd pkgconfig
  $DIFXROOT/../difx-svn/setup/genipppc $IPPROOT
  cd ..

If you have previously been building in the SVN directory, you will need to remove some configuration files (e.g. config.status) left over from your last install with

  $DIFXROOT/../difx-svn/setup/install-difx --pristine
  svn status $DIFXROOT/../difx-svn

(There may be some error messages which you can ignore. At this point the svn status should list a relatively small number of ?, ~, ! or M files. If you're not sure, you can run with –pristine again.) Now you can proceed with the build itself:


There are several independent packages within the DiFX project, and system configuration will be required for each of them. If you are developing code and are frequently rebuilding, install-difx can create a cache to speed up this configuration somewhat:

  $DIFXROOT/../difx-svn/setup/install-difx -v --cache=difx-config-cache

The -v argument provides some additional diagnostics on what directories are being created or traversed.

Once the build has completed (you will see “Done!”) you can remove the build directory if you like. Alternatively you can leave it around for your next svn update and build cycle. Another useful option to install-difx is the –targ option which lets you pass certain targets to all the make steps in the tree. For example:

  $DIFXROOT/../difx-svn/setup/install-difx -v --targ='-n'

will traverse the DiFX build heirarchy and tell you what it would build. (I.e. it invokes make -n within each Makefile, in order.)


The setup directory presently (Dec 7, 2011) contains the original version of install-difx as donotuse-difx, and a copy named build-difx. Both of these will disappear at some point.

difx/build.txt · Last modified: 2015/10/21 10:08 (external edit)