Fork me on GitHub

Opened 8 years ago

Last modified 8 years ago

#1067 new Bug

Compilation error on Mac during installation — at Version 2

Reported by: Mogens Dam Owned by:
Priority: minor Milestone:
Component: Delphes code Version: Delphes 3
Keywords: Cc:

Description (last modified by Pavel Demin)

Hello,-
On two different Macs running Sierra I have the same behaviour.
I do

$ wget http://cp3.irmp.ucl.ac.be/downloads/Delphes-3.4.0.tar.gz
$ tar xzvf Delphes-3.4.0.tar.gz 
$ cd Delphes-3.4.0
$ mkdir install
$ mkdir build
$ cd build
$ cmake -DCMAKE_INSTALL_PREFIX=../install ..
$ make install

and then after some time...

[ 94%] Building CXX object examples/CMakeFiles/Validation.dir/Validation.cpp.o
/Users/dam/delphes2/Delphes-3.4.0/examples/Validation.cpp:200:3: warning: 'delete' applied to a pointer that was
      allocated with 'new[]'; did you mean 'delete[]'? [-Wmismatched-new-delete]
  delete new_bins;
  ^
        []
/Users/dam/delphes2/Delphes-3.4.0/examples/Validation.cpp:193:22: note: allocated with 'new[]' here
  Axis_t *new_bins = new Axis_t[bins + 1];
                     ^
/Users/dam/delphes2/Delphes-3.4.0/examples/Validation.cpp:1459:31: error: variable length array of non-POD element
      type 'TGraphErrors'
  TGraphErrors gr_trkpi_res_pt[n_etabins], gr_trkpi_eff_pt[n_etabins], gr_trkpi_res_eta[n_ptbins], gr_trkpi_ef...
                              ^
/Users/dam/delphes2/Delphes-3.4.0/examples/Validation.cpp:1462:44: error: variable length array of non-POD element
      type 'std::vector<resolPlot>'
  std::vector<resolPlot> plots_trkpi_res_pt[n_etabins], plots_trkpi_res_eta[n_ptbins];
                                           ^

Here is my c++ version

$ c++ --version
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin16.3.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Wonder why I see this

Best wishes,
-Mogens

Change History (2)

comment:1 by Pavel Demin, 8 years ago

Thanks for finding this problem.

Looks like our new Validation.cpp code isn't compatible with clang. We use it mainly with GCC that is apparently more permissive.

The easiest workaround is to remove Validation.cpp and build Delphes without it:

rm examples/Validation.cpp
./configure
make
Last edited 8 years ago by Pavel Demin (previous) (diff)

comment:2 by Pavel Demin, 8 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.