Problems compiling with icpc 16.0

Issue #80 resolved
Jonas Glesaaen created an issue

I am going to assume there is something wrong with my setup, but I was wondering if maybe you could help me locate where it all goes wrong. I am having some problems compiling my program (which used blaze) on a new cluster I have access to, and can't see what is wrong. I'd assume it is related to missing C++14 features, but here goes.

I have tried icpc v. 16.0.0.109 and 16.0.3.210, which makes no difference. The underlying g++ version is 5.3.0. A minimal example to reproduce my problem I get by doing an inversion assignment:

#include<blaze/Math.h>
using blaze::DynamicMatrix;

constexpr std::size_t NN = 10;

int main(int, char**)
{
  DynamicMatrix<double> M(NN,NN), N;
  N = blaze::inv(M);
}

The example compiles with g++, but it does not compile with icpc. If I comment out the N = blaze::inv(M); line, it also compiles with icpc. Here is a short snippet of the compile error (the full error is in the attached log file, I have replaced my home folder with [$HOME]):

icpc -I/app/compilers/intel/16.0.0/compilers_and_libraries/linux/mkl/include -I/app/libraries/boost//boost-1.53.0/include -I/app/libraries/boost//boost-1.53.0/include -std=c++14 -mavx -fopenmp -I[$HOME]/usr/include example1.cpp -o example1.out -L/app/compilers/intel/16.0.0/compilers_and_libraries/linux/mkl/lib/intel64 -L/app/libraries/boost//boost-1.53.0/lib -L/app/libraries/boost//boost-1.53.0/lib -Wl,--no-as-needed -lmkl_intel_ilp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread -lm -ldl
[$HOME]/usr/include/blaze/math/expressions/DMatInvExpr.h(204): error: a constexpr function must contain exactly one return statement
        else if( IsUniUpper<MT>::value  ) return asUniUpper;
                                          ^
          detected during:
            instantiation of "blaze::EnableIf_<blaze::And<blaze::IsDenseMatrix<MT1>, blaze::Or<blaze::Not<blaze::IsSMPAssignable<MT1>>, blaze::Not<blaze::IsSMPAssignable<MT2>>>>, void> blaze::smpAssign(blaze::Matrix<MT1, SO1> &, const blaze::Matrix<MT2, SO2> &) [with MT1=blaze::DynamicMatrix<double, false>, SO1=false, MT2=blaze::DMatInvExpr<blaze::DynamicMatrix<double, false>, false>, SO2=false]" at line 786 of "[$HOME]/usr/include/blaze/math/dense/DynamicMatrix.h"
            instantiation of "blaze::DynamicMatrix<Type, SO>::DynamicMatrix(const blaze::Matrix<MT, SO2> &) [with Type=double, SO=false, MT=blaze::DMatInvExpr<blaze::DynamicMatrix<double, false>, false>, SO2=false]" at line 1319 of "[$HOME]/usr/include/blaze/math/dense/DynamicMatrix.h"
            instantiation of "blaze::DynamicMatrix<Type, SO> &blaze::DynamicMatrix<Type, SO>::operator=(const blaze::Matrix<MT, SO2> &) [with Type=double, SO=false, MT=blaze::DMatInvExpr<blaze::DynamicMatrix<double, false>, false>, SO2=false]" at line 12 of "example1.cpp"

Do you have any idea what is going wrong?

Edit: I am using the blaze 3.0 release version

Comments (7)

  1. Klaus Iglberger

    Hi Jonas!

    Unfortunately Intel does not yet fully implement the C++14 standard with regards to constexpr (see the C++14 feature list for the Intel compilers). In C++14 it is allowed to have multiple return statements, C++11 was restricted to a single return statement.

    Although this can be seen as a problem of the Intel compiler, we will try to fix this issue. Thanks a lot for pointing it out,

    Best regards,

    Klaus!

  2. Klaus Iglberger

    The fix has been implemented and tested as required. It is immediately available via cloning the Blaze repository and will be officially released in Blaze 3.1.

  3. Jonas Glesaaen reporter

    Dear Klaus,

    Thank you very much for a speedy fix. This does indeed fix my issue, and my code compiles.

    Cheers, Jonas

  4. Log in to comment