ecmwf / eckit

A C++ toolkit that supports development of tools and applications at ECMWF.

Home Page:https://confluence.ecmwf.int/display/eckit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compile failure in test_configuration.cc

DJDavies2 opened this issue · comments

[ 63%] Building CXX object tests/config/CMakeFiles/eckit_test_config_configuration.dir/test_configuration.cc.o
cd /home/david/src/oops-stuff/eckit/eckit-build/tests/config && /home/david/installs/gcc/7.1.0/v1/bin/g++ -D_FILE_OFFSET_BITS=64 -I/home/david/src/oops-stuff/eckit/src -I/home/david/src/oops-stuff/eckit/eckit-build/src -I/home/david/installs/oops-stuff/eigen/include/eigen3 -L/home/david/installs/gcc/7.1.0/v1/lib -lgfortran -g -pipe -O2 -g -std=gnu++11 -o CMakeFiles/eckit_test_config_configuration.dir/test_configuration.cc.o -c /home/david/src/oops-stuff/eckit/tests/config/test_configuration.cc
/home/david/src/oops-stuff/eckit/tests/config/test_configuration.cc: In function ‘void eckit::test::test_46(std::__cxx11::string&, int&, int)’:
/home/david/src/oops-stuff/eckit/tests/config/test_configuration.cc:57:60: error: conversion from ‘std::vector’ to non-scalar type ‘std::vector’ requested
std::vector<size_t> value_arr_size_t = make_vector(6ul,7ul);
~~~~~~~~~~~^~~~~~~~~

david@david-System-Product-Name ~/src/oops-stuff $ /home/david/installs/gcc/7.1.0/v1/bin/g++ -v
Using built-in specs.
COLLECT_GCC=/home/david/installs/gcc/7.1.0/v1/bin/g++
COLLECT_LTO_WRAPPER=/home/david/installs/gcc/7.1.0/v1/libexec/gcc/i686-pc-linux-gnu/7.1.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: /home/david/src/downloads/gcc-7.1.0/configure --prefix=/home/david/installs/gcc/7.1.0/v1 --enable-languages=all
Thread model: posix
gcc version 7.1.0 (GCC)

david@david-System-Product-Name ~/src/oops-stuff $ uname -a
Linux david-System-Product-Name 3.13.0-149-generic #199-Ubuntu SMP Thu May 17 10:12:57 UTC 2018 i686 athlon i686 GNU/Linux

I think the problem here is that the LHS is a vector of size_t's but unsigned long is not size_t on this platform so the assignment is invalid. Seems fixable by making the RHS

make_vector(std::size_t{6},std::size_t{7});