Bug #1064

EnsureOutOfSourceBuild.cmake mis-identifying a build

Added by Marc Paterno over 9 years ago. Updated over 9 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:


I have run art's setup_for_development, and then cmake, from my build directory (not source directory) . EnsureOutOfSourceBuild.cmake complains that I am doing an in-source build. I can't tell if this is some sort of pilot error, or a problem in the cmake module itself. Here's the output I get from my session:

art-build$ rm -r *
art-build$ source ../art/ups/setup_for_development
The workng build directory is /home/paterno/SprintWork/art-build

/home/paterno/SprintWork/art-build/lib has been added to LD_LIBRARY_PATH
/home/paterno/SprintWork/art-build/bin has been added to PATH

LD_LIBRARY_PATH is now /home/paterno/SprintWork/art-build/lib:/products/libsigcpp/v2_2_7/Linux64bit+2.6-2.5-gcc45/lib:/products/cppunit/v1_12_1/Linux64bit+2.6-2.5-gcc45/lib:/products/boost/v1_45_0/Linux64bit+2.6-2.5-gcc45/lib:/products/root/v5_28_00_p02/Linux64bit+2.6-2.5-gcc45/lib:/products/clhep/v2_1_0_1/Linux64bit+2.6-2.5-gcc45/lib:/products/cpp0x/v1_01_00/slf5.x86_64.a2/lib:/products/cetlib/v0_05_00/slf5.x86_64.a2/lib:/products/fhiclcpp/v2_11_09/slf5.x86_64.a2/lib:/products/messagefacility/v1_8_12/slf5.x86_64.a2/lib:/usr/local/lib:/usr/local/lib/mysql

PATH is now /home/paterno/SprintWork/art-build/bin:/products/cmake/v2_8_4/Linux64bit+2.6-2.5/bin:/products/gcc/v4_5_1/Linux64bit+2.6-2.5/bin:/products/gccxml/v0_9_20101128/Linux64bit+2.6-2.5-gcc45/bin:/products/cppunit/v1_12_1/Linux64bit+2.6-2.5-gcc45/bin:/products/root/v5_28_00_p02/Linux64bit+2.6-2.5-gcc45/bin:/products/clhep/v2_1_0_1/Linux64bit+2.6-2.5-gcc45/bin:/products/cetlib/v0_05_00/slf5.x86_64.a2/bin:/products/fhiclcpp/v2_11_09/slf5.x86_64.a2/bin:/products/cetbuildtools/v1_08_00/bin:/products/ups/v4_9_0/Linux64bit+2.6-2.5/bin:/usr/krb5/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin

art-build$ cmake DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/home/paterno/products/ ../art
The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /products/gcc/v4_5_1/Linux64bit+2.6-2.5/bin/gcc
-- Check for working C compiler: /products/gcc/v4_5_1/Linux64bit+2.6-2.5/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /products/gcc/v4_5_1/Linux64bit+2.6-2.5/bin/c++
-- Check for working CXX compiler: /products/gcc/v4_5_1/Linux64bit+2.6-2.5/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- module path is /products/cetbuildtools/v1_08_00/Modules;/mnt/disk1/products/cmake/v2_8_4/Linux64bit+2.6-2.5/share/cmake-2.8/Modules
CMake Error at /products/cetbuildtools/v1_08_00/Modules/EnsureOutOfSourceBuild.cmake:10 (message):

ERROR: In source builds of this project are not allowed.
A separate build directory is required.
Please create one and run cmake from the build directory.
Also note that cmake has just added files to your source code directory.
We suggest getting a new copy of the source code.
Otherwise, delete `CMakeCache.txt' and the directory `CMakeFiles'.

Call Stack (most recent call first):
CMakeLists.txt:43 (cet_ensure_out_of_source_build)

-- Configuring incomplete, errors occurred!
art-build$ echo $PWD
art-build$ echo $ART_SOURCE

After some debugging with Chris, it seems that the problem lies in the regular expression used to check whether the build directory is a subdirectory of the source directory.


#1 Updated by Christopher Green over 9 years ago

To add to Marc's initial information, a successful workaround is to rename the source area, (eg) art-devel in order to avoid triggering the over-enthusiastic regex check.

#2 Updated by Lynn Garren over 9 years ago

  • Status changed from Assigned to Resolved
  • % Done changed from 0 to 100

The fix was trivial and is now in place. Please use cetbuildtools v1_08_01

#3 Updated by Lynn Garren over 9 years ago

  • Status changed from Resolved to Closed
  • Target version set to 0.06.00

Also available in: Atom PDF