Out of tree builds

April 27, 2017

Recently I was asked “what’s a vpath build?” If you regularly build postgres from source it’s something you should know about. A vpath build is one where the build tree is kept completely separate from the source tree, so you can completely remove the build tree and your source tree is still there, clean and pristine. It’s very easy to set up unless you’re building with the Microsoft toolset. Essentially what you do is create the root of your build tree, change directory into that directory, and then call configure in your source tree from there.  configure knows all about setting up the vpath tree and does all the work for you. After that, you just run make etc just like you would normally. So it looks like this:

mkdir mybuild
cd mybuild
/path/to/postgresql-source/configure
make

You can even do this inside your source tree, so that mybuild is a subdirectory of the postgresql source root.

Another advantage of this is that if you’re working on several git  branches at once in a given work tree, you can keep a build tree for each branch and then switch between branches.

The Buildfarm client has support for this type of build in its configuration file, and it’s actually the most efficient way to run the client.

Share this

Relevant Blogs

Random Data

This post continues from my report on Random Numbers. I have begun working on a random data generator so I want to run some tests to see whether different random...
December 03, 2020

More Blogs

Full-text search since PostgreSQL 8.3

Welcome to the third – and last – part of this blog series, exploring how the PostgreSQL performance evolved over the years. The first part looked at OLTP workloads, represented...
November 05, 2020

Números aleatorios

He estado trabajando gradualmente en el desarrollo desde cero de herramientas para probar el rendimiento de los sistemas de bases de datos de código abierto. Uno de los componentes de...
November 04, 2020