dash-project / dash

DASH, the C++ Template Library for Distributed Data Structures with Support for Hierarchical Locality for HPC and Data-Driven Science
http://www.dash-project.org/
Other
154 stars 44 forks source link

error: expression must have a constant value w/ Intel 18 #437

Closed jeffhammond closed 7 years ago

jeffhammond commented 7 years ago

I tried to compile DASH with Intel 18, which was released a few days ago. I see some discussion of this topic in https://github.com/dash-project/dash/issues/231. ICC is associated with the system default of GCC 5.4.1, which should be new enough to support C++11 features.

cd $HOME/Work/PGAS/DASH/github/build/dash && /opt/intel/compilers_and_libraries_2018.0.128/linux/mpi/intel64/bin/mpiicpc    -I$HOME/Work/PGAS/DASH/github/dash/include -I$HOME/Work/PGAS/DASH/github/dash/src -I$HOME/Work/PGAS/DASH/github/dart-if/include -I$HOME/Work/PGAS/DASH/github/build/gtest/src/GTestExternal/googletest/include  -DDART_HAVE_SYNC_BUILTINS -pthread -DDART_HAVE_PTHREADS -O3 -DNDEBUG  -std=c++17 -qopenmp -O3 -DDASH_RELEASE -DDASH_ENABLE_ASSERTIONS -DDART_ENABLE_ASSERTIONS -D_XOPEN_SOURCE=700    -qopenmp -DDASH -DDASH_ENABLE_DEFAULT_INDEX_TYPE_LONG -DDASH_ENABLE_THREADSUPPORT -DDASH_ENABLE_UNIFIED_MEMORY_MODEL -DDASH_ENABLE_TEST_LOGGING -DDASH_ENABLE_PAPI -DDASH_ENABLE_HWLOC -DDASH_ENABLE_BLAS -DDASH_ENV_HOST_SYSTEM_ID='default' -Wno-sign-compare -DMPI_IMPL_ID='intelmpi' -Wno-unused -Wno-sign-compare -o CMakeFiles/dash-test-mpi.dir/test/meta/ConstexprTest.cc.o -c $HOME/Work/PGAS/DASH/github/dash/test/meta/ConstexprTest.cc
$HOME/Work/PGAS/DASH/github/dash/test/meta/ConstexprTest.cc(98): error: expression must have a constant value
    constexpr auto arr_rev = dash::ce::reverse(arr);
                             ^
$HOME/Work/PGAS/DASH/github/dash/include/dash/util/ArrayExpr.h(290): note: access to uninitialized object
            : values);
              ^
$HOME/Work/PGAS/DASH/github/dash/include/dash/util/ArrayExpr.h(287): note: called from:
                  dash::ce::reverse(
                                   ^
$HOME/Work/PGAS/DASH/github/dash/include/dash/util/ArrayExpr.h(287): note: called from:
                  dash::ce::reverse(
                                   ^
$HOME/Work/PGAS/DASH/github/dash/include/dash/util/ArrayExpr.h(287): note: called from:
                  dash::ce::reverse(
                                   ^
$HOME/Work/PGAS/DASH/github/dash/include/dash/util/ArrayExpr.h(287): note: called from:
                  dash::ce::reverse(
                                   ^
$HOME/Work/PGAS/DASH/github/dash/include/dash/util/ArrayExpr.h(287): note: called from:
                  dash::ce::reverse(
                                   ^
$HOME/Work/PGAS/DASH/github/dash/include/dash/util/ArrayExpr.h(287): note: called from:
                  dash::ce::reverse(
                                   ^
$HOME/Work/PGAS/DASH/github/dash/include/dash/util/ArrayExpr.h(287): note: called from:
                  dash::ce::reverse(
                                   ^
$HOME/Work/PGAS/DASH/github/dash/include/dash/util/ArrayExpr.h(287): note: called from:
                  dash::ce::reverse(
                                   ^

compilation aborted for $HOME/Work/PGAS/DASH/github/dash/test/meta/ConstexprTest.cc (code 2) 
$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.1-11ubuntu2~16.04' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.4.1 20170519 (Ubuntu 5.4.1-11ubuntu2~16.04) 
fuchsto commented 7 years ago

@jeffhammond Thank you for reporting, it's the first time I see a problem in the dash::ce implementation. I will put icc-18 on one of our machines and try to reproduce this. You use -std=c++17 which should be okay in principle, but did you also try -std=c++11 or -std=c++14?

rkowalewski commented 7 years ago

Pull request #438 fixes this issue.

[Update]: This issue is not specific to icc-18 but manifests in older versions (tested with icc-17) as well.

rkowalewski commented 7 years ago

Pull request is merged.