SixTrack / sixtracklib

Library for single charged particle simulations in accelerators
GNU Lesser General Public License v2.1
12 stars 16 forks source link

Making: set-up without tests still requires tests #66

Closed aoeftiger closed 5 years ago

aoeftiger commented 5 years ago

The make fails when trying to compile the tools having set the unit tests and benchmarking tests OFF in the Settings.cmake. (Based on gcc 9.1.0 and cmake 3.11.1.)

Settings.cmake

[...]
# ---- Backends and computing architectures:

option( SIXTRACKL_ENABLE_AUTOVECTORIZATION "Enable Autovectorization"     ON )
option( SIXTRACKL_ENABLE_MANUAL_SIMD       "Enable manual SIMD backend"   OFF )
option( SIXTRACKL_ENABLE_OPENMP            "Enable OpenMP backend"        ON )
option( SIXTRACKL_ENABLE_OPENCL            "Enable OpenCL 1.x backend"    OFF )
option( SIXTRACKL_ENABLE_CUDA              "Enable CUDA backend"          OFF )
option( SIXTRACKL_ENABLE_MPFR4             "Enable GMP/MPFR4 backend"     OFF )

option( SIXTRACKL_ENABLE_CXX               "Enable C++ bindings"          ON  )
option( SIXTRACKL_ENABLE_PYTHON            "Enable Python bindings"       ON  )

# ------------------------------------------------------------------------------
# ---- Program logistic options:

option( SIXTRACKL_BUILD_EXAMPLES         "Build sixtracklib examples"     OFF  )
option( SIXTRACKL_ENABLE_PROGRAMM_TESTS  "Enable programmatic unit-tests" OFF )
option( SIXTRACKL_ENABLE_BENCHMARK_TESTS "Enable benchmark tests"         OFF )
[...]

cmake output in ./build/

$ cmake ..
-- The C compiler identification is GNU 9.1.0
-- The CXX compiler identification is GNU 9.1.0
-- Check for working C compiler: /cvmfs/it.gsi.de/compiler/gcc/9.1.0/bin/gcc
-- Check for working C compiler: /cvmfs/it.gsi.de/compiler/gcc/9.1.0/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /cvmfs/it.gsi.de/compiler/gcc/9.1.0/bin/g++
-- Check for working CXX compiler: /cvmfs/it.gsi.de/compiler/gcc/9.1.0/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- ---- Project sixtracklib
-- ---- Inside main CMakeLists.txt
-- ---- Setting build type to 'Release' as none was specified.
-- ---- Loaded local settings file
                 /lustre/nyx/bhs/aoeftige/sixtracklib_kronos/sixtracklib/Settings.cmake
-- ---- cmake_module_path: /lustre/nyx/bhs/aoeftige/sixtracklib_kronos/sixtracklib/cmake
-- ---- Processing cmake/SetupCxx.cmake
-- ---- Processing cmake/SetupPython.cmake
-- Found PythonInterp: /u/aoeftige/anaconda3/bin/python3.7 (found version "3.7.3") 
-- Found PythonLibs: /u/aoeftige/anaconda3/lib/libpython3.7m.so (found version "3.7.3") 
-- ---- Processing cmake/SetupUnitTesting.cmake
-- ---- Disable creation unit-tests using CTest / GTest
-- ---- Processing cmake/SetupMultiPrecision.cmake
-- ---- Processing cmake/SetupAutoVecSIMD.cmake
-- ------ Optimizing for SSE2 architecture
-- ---- Processing cmake/SetupOpenMP.cmake
-- Found OpenMP_C: -fopenmp (found version "4.5") 
-- Found OpenMP_CXX: -fopenmp (found version "4.5") 
-- Found OpenMP: TRUE (found version "4.5")  
-- OpenMP_FOUND: TRUE
-- OPENMP_FOUND: TRUE
-- ---- Processing cmake/SetupOpenCL.cmake
-- ---- Processing cmake/SetupCuda.cmake
-- ---- processing sixtracklib/CMakeLists.txt
-- ---- processing sixtracklib/common/CMakeLists.txt
-- ------ python: providing a copy of library to /lustre/nyx/bhs/aoeftige/sixtracklib_kronos/sixtracklib/python/pysixtracklib/libsixtrack.so
-- Configuring done
make-- Generating done
-- Build files have been written to: /lustre/nyx/bhs/aoeftige/sixtracklib_kronos/sixtracklib/build

make output

$ make -j 20 VERBOSE=1
[...]
[ 92%] Building C object tools/CMakeFiles/dump_cbuffer.dir/dump_cbuffer.c.o
cd /lustre/nyx/bhs/aoeftige/sixtracklib_kronos/sixtracklib/build/tools && /cvmfs/it.gsi.de/compiler/gcc/9.1.0/bin/gcc  -I/lustre/nyx/bhs/aoeftige/sixtracklib_kronos/sixtracklib  -O3 -DNDEBUG   -msse2 -Wall -Werror -pedantic -std=gnu99 -o CMakeFiles/dump_cbuffer.dir/dump_cbuffer.c.o   -c /lustre/nyx/bhs/aoeftige/sixtracklib_kronos/sixtracklib/tools/dump_cbuffer.c
/lustre/nyx/bhs/aoeftige/sixtracklib_kronos/sixtracklib/tools/dump_cbuffer.c:6:10: fatal error: sixtracklib/testlib.h: No such file or directory
    6 | #include "sixtracklib/testlib.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
tools/CMakeFiles/dump_cbuffer.dir/build.make:62: recipe for target 'tools/CMakeFiles/dump_cbuffer.dir/dump_cbuffer.c.o' failed
make[2]: *** [tools/CMakeFiles/dump_cbuffer.dir/dump_cbuffer.c.o] Error 1
make[2]: Leaving directory '/lustre/nyx/bhs/aoeftige/sixtracklib_kronos/sixtracklib/build'
CMakeFiles/Makefile2:739: recipe for target 'tools/CMakeFiles/dump_cbuffer.dir/all' failed
make[1]: *** [tools/CMakeFiles/dump_cbuffer.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/lustre/nyx/bhs/aoeftige/sixtracklib_kronos/sixtracklib/tools/normalize_cobject_dump.c:7:10: fatal error: sixtracklib/testlib.h: No such file or directory
    7 | #include "sixtracklib/testlib.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
tools/CMakeFiles/normalize_cobject_dump.dir/build.make:62: recipe for target 'tools/CMakeFiles/normalize_cobject_dump.dir/normalize_cobject_dump.c.o' failed
make[2]: *** [tools/CMakeFiles/normalize_cobject_dump.dir/normalize_cobject_dump.c.o] Error 1
make[2]: Leaving directory '/lustre/nyx/bhs/aoeftige/sixtracklib_kronos/sixtracklib/build'
CMakeFiles/Makefile2:776: recipe for target 'tools/CMakeFiles/normalize_cobject_dump.dir/all' failed
make[1]: *** [tools/CMakeFiles/normalize_cobject_dump.dir/all] Error 2
make[1]: Leaving directory '/lustre/nyx/bhs/aoeftige/sixtracklib_kronos/sixtracklib/build'
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
aoeftiger commented 5 years ago

PS: this happens when trying to circumvent #67 which fails 3x for tests/ or examples related files -- so I tried to switch off the examples and tests in Settings.cmake

martinschwinzerl commented 5 years ago

Pull request #68 should take care of this problem, please re-open if the problem persists