Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation of Physics/Elasticity/kinematics fails with icc18 #8410

Closed
anates opened this issue Jul 24, 2019 · 6 comments · Fixed by #8413
Closed

Compilation of Physics/Elasticity/kinematics fails with icc18 #8410

anates opened this issue Jul 24, 2019 · 6 comments · Fixed by #8413

Comments

@anates
Copy link
Contributor

anates commented Jul 24, 2019

When compiling the latest deal.II-version with icc 18, I get a bunch of compilation errors originating from physics/elasticity/kinematics.h. It looks like as some of the recent changes to Tensor<> or SymmetricTensor<> broke something here. The errors are

[ 78%] Building CXX object source/physics/elasticity/CMakeFiles/obj_physics_elasticity_debug.dir/kinematics.cc.o
~/Downloads_ICC/dealii/include/deal.II/physics/elasticity/standard_tensors.h(72): error: expression must have a constant value
          = unit_symmetric_tensor<dim>()
            ^
~/Downloads_ICC/dealii/include/deal.II/base/tensor.h(1144): note: expression cannot be interpreted
        Assert(i < dim, ExcIndexRange(i, 0, dim));
        ^
~/Downloads_ICC/dealii/include/deal.II/base/tensor.h(1181): note: called from:
    return dealii::internal::TensorSubscriptor::subscript(
                                                         ^
~/Downloads_ICC/dealii/include/deal.II/base/symmetric_tensor.h(3190): note: called from:
          tmp.data[0] = 1;
                  ^
~/Downloads_ICC/dealii/include/deal.II/base/symmetric_tensor.h(3219): note: called from:
    return unit_symmetric_tensor<dim, double>();
                                             ^
          detected during:
            instantiation of class "dealii::Physics::Elasticity::StandardTensors<dim> [with dim=1]" at line 283 of "~/Downloads_ICC/dealii/include/deal.II/physics/elasticity/kinematics.h"
            instantiation of "dealii::Tensor<2, dim, Number> dealii::Physics::Elasticity::Kinematics::F(const dealii::Tensor<2, dim, Number> &) [with dim=1, Number=double]" at line 16 of "~/Downloads_ICC/dealii/build/source/physics/elasticity/kinematics.inst"

~/Downloads_ICC/dealii/include/deal.II/physics/elasticity/kinematics.h(354): error: no instance of function template "dealii::symmetrize" matches the argument list
            argument types are: (<error-type>)
           symmetrize(static_cast<SymmetricTensor<2, dim, Number>>(
           ^
~/Downloads_ICC/dealii/include/deal.II/base/symmetric_tensor.h(3450): note: this candidate was rejected because at least one template argument could not be deduced
  symmetrize(const Tensor<2, dim, Number> &t)
  ^
          detected during instantiation of "dealii::SymmetricTensor<2, dim, Number> dealii::Physics::Elasticity::Kinematics::e(const dealii::Tensor<2, dim, Number> &) [with dim=1, Number=double]" at line 44 of "~/Downloads_ICC/dealii/build/source/physics/elasticity/kinematics.inst"

~/Downloads_ICC/dealii/include/deal.II/physics/elasticity/kinematics.h(354): error: no instance of function template "dealii::symmetrize" matches the argument list
            argument types are: (<error-type>)
           symmetrize(static_cast<SymmetricTensor<2, dim, Number>>(
           ^
~/Downloads_ICC/dealii/include/deal.II/base/symmetric_tensor.h(3450): note: this candidate was rejected because at least one template argument could not be deduced
  symmetrize(const Tensor<2, dim, Number> &t)
  ^
          detected during instantiation of "dealii::SymmetricTensor<2, dim, Number> dealii::Physics::Elasticity::Kinematics::e(const dealii::Tensor<2, dim, Number> &) [with dim=1, Number=float]" at line 102 of "~/Downloads_ICC/dealii/build/source/physics/elasticity/kinematics.inst"

~/Downloads_ICC/dealii/include/deal.II/physics/elasticity/standard_tensors.h(72): error: expression must have a constant value
          = unit_symmetric_tensor<dim>()
            ^
~/Downloads_ICC/dealii/include/deal.II/base/tensor.h(1144): note: expression cannot be interpreted
        Assert(i < dim, ExcIndexRange(i, 0, dim));
        ^
~/Downloads_ICC/dealii/include/deal.II/base/tensor.h(1181): note: called from:
    return dealii::internal::TensorSubscriptor::subscript(
                                                         ^
~/Downloads_ICC/dealii/include/deal.II/base/symmetric_tensor.h(3193): note: called from:
          tmp.data[0] = tmp.data[1] = 1;
                  ^
~/Downloads_ICC/dealii/include/deal.II/base/symmetric_tensor.h(3219): note: called from:
    return unit_symmetric_tensor<dim, double>();
                                             ^
          detected during:
            instantiation of class "dealii::Physics::Elasticity::StandardTensors<dim> [with dim=2]" at line 283 of "~/Downloads_ICC/dealii/include/deal.II/physics/elasticity/kinematics.h"
            instantiation of "dealii::Tensor<2, dim, Number> dealii::Physics::Elasticity::Kinematics::F(const dealii::Tensor<2, dim, Number> &) [with dim=2, Number=double]" at line 132 of "~/Downloads_ICC/dealii/build/source/physics/elasticity/kinematics.inst"

~/Downloads_ICC/dealii/include/deal.II/physics/elasticity/kinematics.h(354): error: no instance of function template "dealii::symmetrize" matches the argument list
            argument types are: (<error-type>)
           symmetrize(static_cast<SymmetricTensor<2, dim, Number>>(
           ^
~/Downloads_ICC/dealii/include/deal.II/base/symmetric_tensor.h(3450): note: this candidate was rejected because at least one template argument could not be deduced
  symmetrize(const Tensor<2, dim, Number> &t)
  ^
          detected during instantiation of "dealii::SymmetricTensor<2, dim, Number> dealii::Physics::Elasticity::Kinematics::e(const dealii::Tensor<2, dim, Number> &) [with dim=2, Number=double]" at line 160 of "~/Downloads_ICC/dealii/build/source/physics/elasticity/kinematics.inst"

~/Downloads_ICC/dealii/include/deal.II/physics/elasticity/kinematics.h(354): error: no instance of function template "dealii::symmetrize" matches the argument list
            argument types are: (<error-type>)
           symmetrize(static_cast<SymmetricTensor<2, dim, Number>>(
           ^
~/Downloads_ICC/dealii/include/deal.II/base/symmetric_tensor.h(3450): note: this candidate was rejected because at least one template argument could not be deduced
  symmetrize(const Tensor<2, dim, Number> &t)
  ^
          detected during instantiation of "dealii::SymmetricTensor<2, dim, Number> dealii::Physics::Elasticity::Kinematics::e(const dealii::Tensor<2, dim, Number> &) [with dim=2, Number=float]" at line 218 of "~/Downloads_ICC/dealii/build/source/physics/elasticity/kinematics.inst"

~/Downloads_ICC/dealii/include/deal.II/physics/elasticity/standard_tensors.h(72): error: expression must have a constant value
          = unit_symmetric_tensor<dim>()
            ^
~/Downloads_ICC/dealii/include/deal.II/base/tensor.h(1144): note: expression cannot be interpreted
        Assert(i < dim, ExcIndexRange(i, 0, dim));
        ^
~/Downloads_ICC/dealii/include/deal.II/base/tensor.h(1181): note: called from:
    return dealii::internal::TensorSubscriptor::subscript(
                                                         ^
~/Downloads_ICC/dealii/include/deal.II/base/symmetric_tensor.h(3196): note: called from:
          tmp.data[0] = tmp.data[1] = tmp.data[2] = 1;
                  ^
~/Downloads_ICC/dealii/include/deal.II/base/symmetric_tensor.h(3219): note: called from:
    return unit_symmetric_tensor<dim, double>();
                                             ^
          detected during:
            instantiation of class "dealii::Physics::Elasticity::StandardTensors<dim> [with dim=3]" at line 283 of "~/Downloads_ICC/dealii/include/deal.II/physics/elasticity/kinematics.h"
            instantiation of "dealii::Tensor<2, dim, Number> dealii::Physics::Elasticity::Kinematics::F(const dealii::Tensor<2, dim, Number> &) [with dim=3, Number=double]" at line 248 of "~/Downloads_ICC/dealii/build/source/physics/elasticity/kinematics.inst"

~/Downloads_ICC/dealii/include/deal.II/physics/elasticity/kinematics.h(354): error: no instance of function template "dealii::symmetrize" matches the argument list
            argument types are: (<error-type>)
           symmetrize(static_cast<SymmetricTensor<2, dim, Number>>(
           ^
~/Downloads_ICC/dealii/include/deal.II/base/symmetric_tensor.h(3450): note: this candidate was rejected because at least one template argument could not be deduced
  symmetrize(const Tensor<2, dim, Number> &t)
  ^
          detected during instantiation of "dealii::SymmetricTensor<2, dim, Number> dealii::Physics::Elasticity::Kinematics::e(const dealii::Tensor<2, dim, Number> &) [with dim=3, Number=double]" at line 276 of "~/Downloads_ICC/dealii/build/source/physics/elasticity/kinematics.inst"

~/Downloads_ICC/dealii/include/deal.II/physics/elasticity/kinematics.h(354): error: no instance of function template "dealii::symmetrize" matches the argument list
            argument types are: (<error-type>)
           symmetrize(static_cast<SymmetricTensor<2, dim, Number>>(
           ^
~/Downloads_ICC/dealii/include/deal.II/base/symmetric_tensor.h(3450): note: this candidate was rejected because at least one template argument could not be deduced
  symmetrize(const Tensor<2, dim, Number> &t)
  ^
          detected during instantiation of "dealii::SymmetricTensor<2, dim, Number> dealii::Physics::Elasticity::Kinematics::e(const dealii::Tensor<2, dim, Number> &) [with dim=3, Number=float]" at line 334 of "~/Downloads_ICC/dealii/build/source/physics/elasticity/kinematics.inst"

compilation aborted for ~/Downloads_ICC/dealii/source/physics/elasticity/kinematics.cc (code 2)

and the detailed.log-file is attached
detailed.log

@masterleinad
Copy link
Member

Which commit is this? 180ab00? Can you also share the CMake output?

@anates
Copy link
Contributor Author

anates commented Jul 24, 2019

@rezarastak
Copy link
Contributor

Perhaps we should check whether the Assert macro and the exception classes work in constant evaluation context before enabling DEAL_II_CONSTEXPR

@masterleinad
Copy link
Member

@anates I wasn't precise. Can you provide the output when running CMake? In particular, I wan't to know whether DEAL_II_HAVE_CX14_CONSTEXPR_CAN_CALL_NONCONSTEXPR and DEAL_II_WITH_CXX14 are set. (I assume so from the error messages)

@rezarastak In Utilities::pow the __builtin_expect was problematic so we might need a similar workaround. Let's try to figure what exactly is probelmatic. In the extreme case we could also just disable DEAL_II_CONSTEXPR for Intel compiler.

@anates
Copy link
Contributor Author

anates commented Jul 24, 2019

cmake.log
This one?

@masterleinad
Copy link
Member

I can reproduce the issue and removing __builtin_expect fixes it. I would just undefine DEAL_II_HAVE_BUILTIN_EXPECT if the compiler is Intel and DEAL_II_CONSTEXPR is set (or check these two conditions also when defining Assert).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants