ECP-VeloC/VELOC

command.hpp: error: array used as initializer command_t() { }

tonyhutter opened this issue · 4 comments

I'm unable to build VeloC master (using GCC 4.9.3):

$ cmake -DCMAKE_BUILD_TYPE=Debug -DWITH_AXL_PREFIX=`pwd`/install -DWITH_ER_PREFIX=`pwd`/install -DBoost_NO_BOOST_CMAKE=TRUE -DBoost_NO_SYSTEM_PATHS=TRUE -DBOOST_ROOT=/g/g0/hutter2/boost_1_69_0 .
-- The C compiler identification is GNU 4.9.3
-- The CXX compiler identification is GNU 4.9.3
-- Check for working C compiler: /usr/tcetmp/bin/cc
-- Check for working C compiler: /usr/tcetmp/bin/cc -- 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: /usr/tcetmp/bin/c++
-- Check for working CXX compiler: /usr/tcetmp/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Boost version: 1.69.0
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found MPI_C: /usr/tce/packages/spectrum-mpi/ibm/spectrum-mpi-rolling-release/lib/libmpiprofilesupport.so;/usr/tce/packages/spectrum-mpi/ibm/spectrum-mpi-rolling-release/lib/libmpi_ibm.so  
-- Found MPI_CXX: /usr/tce/packages/spectrum-mpi/ibm/spectrum-mpi-rolling-release/lib/libmpiprofilesupport.so;/usr/tce/packages/spectrum-mpi/ibm/spectrum-mpi-rolling-release/lib/libmpi_ibm.so  
-- Found AXL: /g/g0/hutter2/VELOC/install/lib64/libaxl.a  
-- Found ER: /g/g0/hutter2/VELOC/install/lib64/liber.a;/g/g0/hutter2/VELOC/install/lib64/libkvtree.a;/g/g0/hutter2/VELOC/install/lib64/libredset.a;/g/g0/hutter2/VELOC/install/lib64/libshuffile.a;/g/g0/hutter2/VELOC/install/lib64/librankstr.a;z  
-- Configuring done
-- Generating done
-- Build files have been written to: /g/g0/hutter2/VELOC

$ make
[  5%] Building CXX object src/modules/CMakeFiles/veloc-modules.dir/module_manager.cpp.o
In file included from /g/g0/hutter2/VELOC/src/modules/module_manager.hpp:4:0,
                from /g/g0/hutter2/VELOC/src/modules/module_manager.cpp:1:
/g/g0/hutter2/VELOC/src/common/command.hpp: In constructor 'command_t::command_t()':
/g/g0/hutter2/VELOC/src/common/command.hpp:16:17: error: array used as initializer
    command_t() { }
                ^
/g/g0/hutter2/VELOC/src/common/command.hpp:16:17: error: array used as initializer
/g/g0/hutter2/VELOC/src/common/command.hpp: In constructor 'command_t::command_t(int, int, int, const string&)':
/g/g0/hutter2/VELOC/src/common/command.hpp:17:95: error: array used as initializer
    command_t(int r, int c, int v, const std::string &s) : unique_id(r), command(c), version(v) {
                                                                                              ^
/g/g0/hutter2/VELOC/src/common/command.hpp:17:95: error: array used as initializer
make[2]: *** [src/modules/CMakeFiles/veloc-modules.dir/build.make:63: src/modules/CMakeFiles/veloc-modules.dir/module_manager.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:110: src/modules/CMakeFiles/veloc-modules.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

@gonsie this is still a bug that needs to be fixed. We need to either:

  1. Update the code to work with the older compiler. In fact, we should target whatever GCC version RHEL 7 is running, since a lot of sites are going to be running it. I believe it's currently GCC 4.8.5.

  2. Put a GCC version requirement in CMakeLists.txt

if (CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9.4)
    message(FATAL_ERROR "GCC version is tool old" )
endif()

Tony, you bring a very good point. Unfortunately though, we will need to support many compilers not just GCC. Therefore, it will be a nightmare to maintain the CMakeLists.txt file for all possible alternatives. A better approach is to maintain a good documentation with up to date installation instructions. Feel free to update the documentation as needed (it's in the "docs" subdirectory).

Here's a fix: #10