ncrystal icon indicating copy to clipboard operation
ncrystal copied to clipboard

Support for intel compilers

Open KBGrammer opened this issue 1 year ago • 20 comments

Compilation of NCrystal with the intel compiler fails. I'm attempting this with NCrystal 3.7.1. The build works with gcc, and I usually use 9.4.0.

Additional context Build was attempted with cmake 3.25.1 and intel oneapi 2021.1.1 (no longer available, but a 2023.2 and 2023.1 are) and with 2023.2.1. Build was attempted using these commands:

cmake . -DCMAKE_INSTALL_PREFIX=${NCDIR}/intel3.7.1 -DCMAKE_BUILD_TYPE=RelWithInfo
make VERBOSE=1

The build log is as follows for 2021.1.1:

Loading 2021.1.1 version 2021.1.1
Loading tbb version 2021.1.1
Loading debugger version 10.1.2
Loading compiler-rt version 2021.1.1
Loading dpl version 2021.1.1

Loading intel/2021.1.1
  Loading requirement: tbb/2021.1.1 debugger/latest compiler-rt/2021.1.1 dpl/2021.1.1
-- The CXX compiler identification is Intel 2021.1.0.20201112
-- The C compiler identification is Intel 2021.1.0.20201112
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: icpc - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: icc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- NCrystal-cfg: NCRYSTAL_ENABLE_EXAMPLES=OFF
-- NCrystal-cfg: NCRYSTAL_ENABLE_MCSTAS=ON
-- NCrystal-cfg: NCRYSTAL_ENABLE_GEANT4=OFF
-- NCrystal-cfg: NCRYSTAL_ENABLE_PYTHON=ON
-- NCrystal-cfg: NCRYSTAL_ENABLE_DATA=ON
-- NCrystal-cfg: NCRYSTAL_ENABLE_SETUPSH=ON
-- NCrystal-cfg: NCRYSTAL_MODIFY_RPATH=ON
-- NCrystal-cfg: NCRYSTAL_ENABLE_DYNLOAD=IFAVAILABLE
-- NCrystal-cfg: NCRYSTAL_SKIP_PYMODINST=OFF
-- NCrystal-cfg: NCRYSTAL_BUILD_STRICT=OFF
-- NCrystal-cfg: NCRYSTAL_ENABLE_CPACK=OFF
-- NCrystal-cfg: NCRYSTAL_QUIET=OFF
-- NCrystal-cfg: NCRYSTAL_SKIP_INSTALL=OFF
-- NCrystal-cfg: NCRYSTAL_BUILTIN_PLUGINS=
-- Configuring done
-- Generating done
-- Build files have been written to: ${NCDIR}/buildintel
cmake -P ${NCDIR}/buildintel/CMakeFiles/VerifyGlobs.cmake
cmake -S${NCDIR}/buildintel -B${NCDIR}/buildintel --check-build-system CMakeFiles/Makefile.cmake 0
cmake -E cmake_progress_start ${NCDIR}/buildintel/CMakeFiles ${NCDIR}/buildintel/CMakeFiles/progress.marks
make  -f CMakeFiles/Makefile2 all
make[1]: Entering directory '${NCDIR}/buildintel'
make  -f CMakeFiles/NCrystal.dir/build.make CMakeFiles/NCrystal.dir/depend
make[2]: Entering directory '${NCDIR}/buildintel'
cd ${NCDIR}/buildintel && cmake -E cmake_depends "Unix Makefiles" ${NCDIR}/buildintel ${NCDIR}/buildintel ${NCDIR}/buildintel ${NCDIR}/buildintel ${NCDIR}/buildintel/CMakeFiles/NCrystal.dir/DependInfo.cmake --color=
make[2]: Leaving directory '${NCDIR}/buildintel'
make  -f CMakeFiles/NCrystal.dir/build.make CMakeFiles/NCrystal.dir/build
make[2]: Entering directory '${NCDIR}/buildintel'
[  1%] Building CXX object CMakeFiles/NCrystal.dir/ncrystal_core/src/NCAbsOOV.cc.o
icpc -DNCRYSTAL_DATADIR=${NCINST}/share/NCrystal/data -DNCRYSTAL_NO_CMATH_CONSTANTS -DNCrystal_EXPORTS -I${NCDIR}/buildintel/ncrystal_core/src -I${NCDIR}/buildintel/ncrystal_core/include -O2 -g -DNDEBUG -fPIC -MD -MT CMakeFiles/NCrystal.dir/ncrystal_core/src/NCAbsOOV.cc.o -MF CMakeFiles/NCrystal.dir/ncrystal_core/src/NCAbsOOV.cc.o.d -o CMakeFiles/NCrystal.dir/ncrystal_core/src/NCAbsOOV.cc.o -c ${NCDIR}/buildintel/ncrystal_core/src/NCAbsOOV.cc
In file included from ${NCDIR}/buildintel/ncrystal_core/include/NCrystal/NCTypes.hh(31),
                 from ${NCDIR}/buildintel/ncrystal_core/include/NCrystal/NCProcImpl.hh(24),
                 from ${NCDIR}/buildintel/ncrystal_core/include/NCrystal/internal/NCAbsOOV.hh(24),
                 from ${NCDIR}/buildintel/ncrystal_core/src/NCAbsOOV.cc(21):
${NCDIR}/buildintel/ncrystal_core/include/NCrystal/NCVariant.hh(117): error: static assertion failed with ""
    static_assert(!std::is_default_constructible<Variant<double,int,VariantAllowEmpty::No>>::value,"");
    ^

In file included from ${NCDIR}/buildintel/ncrystal_core/include/NCrystal/NCProcImpl.hh(24),
                 from ${NCDIR}/buildintel/ncrystal_core/include/NCrystal/internal/NCAbsOOV.hh(24),
                 from ${NCDIR}/buildintel/ncrystal_core/src/NCAbsOOV.cc(21):
${NCDIR}/buildintel/ncrystal_core/include/NCrystal/NCTypes.hh(498): warning #2164: attributes are ignored on an enum declaration that is not also a definition
        enum class NCRYSTAL_API VarId : std::uint32_t;/only fwd decl here
                   ^

${NCDIR}/buildintel/ncrystal_core/include/NCrystal/NCVariant.hh(122): error: static assertion failed with ""
      static_assert(std::is_default_constructible<Variant>::value == (ALLOW_EMPTY==VariantAllowEmpty::Yes),"");
      ^
          detected during:
            instantiation of class "NCrystal::Variant<T1, T2, ALLOW_EMPTY>::Impl [with T1=NCrystal::CrystalAxis, T2=NCrystal::HKLPoint, ALLOW_EMPTY=NCrystal::VariantAllowEmpty::No]" at line 186
            instantiation of "const T &NCrystal::Variant<T1, T2, ALLOW_EMPTY>::get<T>() const [with T1=NCrystal::CrystalAxis, T2=NCrystal::HKLPoint, ALLOW_EMPTY=NCrystal::VariantAllowEmpty::No, T=NCrystal::CrystalAxis]" at line 247
            instantiation of "bool NCrystal::Variant<T1, T2, ALLOW_EMPTY>::operator==(const NCrystal::Variant<T1, T2, ALLOW_EMPTY> &) const [with T1=NCrystal::CrystalAxis, T2=NCrystal::HKLPoint, ALLOW_EMPTY=NCrystal::VariantAllowEmpty::No]" at line 380 of "${NCDIR}/buildintel/ncrystal_core/include/NCrystal/NCTypes.hh"

compilation aborted for ${NCDIR}/buildintel/ncrystal_core/src/NCAbsOOV.cc (code 2)
make[2]: *** [CMakeFiles/NCrystal.dir/build.make:76: CMakeFiles/NCrystal.dir/ncrystal_core/src/NCAbsOOV.cc.o] Error 2
make[2]: Leaving directory '${NCDIR}/buildintel'
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/NCrystal.dir/all] Error 2
make[1]: Leaving directory '${NCDIR}/buildintel'
make: *** [Makefile:136: all] Error 2

The log is as follows for 2023.2.1

Loading 2023.2.1 version 2023.2.1
Loading tbb version 2021.10.0
Loading debugger version latest
Loading compiler-rt version 2023.2.1
Loading dpl version 2022.2.0

Loading intel/2023.2.1
  Loading requirement: tbb/2023.2.1 debugger/latest compiler-rt/2023.2.1 dpl/2023.2.1
-- The CXX compiler identification is Intel 2021.10.0.20230609
-- The C compiler identification is Intel 2021.10.0.20230609
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: icc - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: icc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- NCrystal-cfg: NCRYSTAL_ENABLE_EXAMPLES=OFF
-- NCrystal-cfg: NCRYSTAL_ENABLE_MCSTAS=ON
-- NCrystal-cfg: NCRYSTAL_ENABLE_GEANT4=OFF
-- NCrystal-cfg: NCRYSTAL_ENABLE_PYTHON=ON
-- NCrystal-cfg: NCRYSTAL_ENABLE_DATA=ON
-- NCrystal-cfg: NCRYSTAL_ENABLE_SETUPSH=ON
-- NCrystal-cfg: NCRYSTAL_MODIFY_RPATH=ON
-- NCrystal-cfg: NCRYSTAL_ENABLE_DYNLOAD=IFAVAILABLE
-- NCrystal-cfg: NCRYSTAL_SKIP_PYMODINST=OFF
-- NCrystal-cfg: NCRYSTAL_BUILD_STRICT=OFF
-- NCrystal-cfg: NCRYSTAL_ENABLE_CPACK=OFF
-- NCrystal-cfg: NCRYSTAL_QUIET=OFF
-- NCrystal-cfg: NCRYSTAL_SKIP_INSTALL=OFF
-- NCrystal-cfg: NCRYSTAL_BUILTIN_PLUGINS=
-- Configuring done
-- Generating done
-- Build files have been written to: ${NCDIR}/buildintel
cmake -P ${NCDIR}/buildintel/CMakeFiles/VerifyGlobs.cmake
cmake -S${NCDIR}/buildintel -B${NCDIR}/buildintel --check-build-system CMakeFiles/Makefile.cmake 0
cmake -E cmake_progress_start ${NCDIR}/buildintel/CMakeFiles ${NCDIR}/buildintel//CMakeFiles/progress.marks
make  -f CMakeFiles/Makefile2 all
make[1]: Entering directory '${NCDIR}/buildintel'
make  -f CMakeFiles/NCrystal.dir/build.make CMakeFiles/NCrystal.dir/depend
make[2]: Entering directory '${NCDIR}/buildintel'
cd ${NCDIR}/buildintel && cmake -E cmake_depends "Unix Makefiles" ${NCDIR}/buildintel ${NCDIR}/buildintel ${NCDIR}/buildintel ${NCDIR}/buildintel ${NCDIR}/buildintel/CMakeFiles/NCrystal.dir/DependInfo.cmake --color=
make[2]: Leaving directory '${NCDIR}/buildintel'
make  -f CMakeFiles/NCrystal.dir/build.make CMakeFiles/NCrystal.dir/build
make[2]: Entering directory '${NCDIR}/buildintel'
[  1%] Building CXX object CMakeFiles/NCrystal.dir/ncrystal_core/src/NCAbsOOV.cc.o
icc -DNCRYSTAL_DATADIR=${NCISTDIR}intel3.7.1/share/NCrystal/data -DNCRYSTAL_NO_CMATH_CONSTANTS -DNCrystal_EXPORTS -I${NCDIR}/buildintel/ncrystal_core/src -I${NCDIR}/buildintel/ncrystal_core/include -fPIC -MD -MT CMakeFiles/NCrystal.dir/ncrystal_core/src/NCAbsOOV.cc.o -MF CMakeFiles/NCrystal.dir/ncrystal_core/src/NCAbsOOV.cc.o.d -o CMakeFiles/NCrystal.dir/ncrystal_core/src/NCAbsOOV.cc.o -c ${NCDIR}/buildintel/ncrystal_core/src/NCAbsOOV.cc
icc: remark #10441: The Intel(R) C++ Compiler Classic (ICC) is deprecated and will be removed from product release in the second half of 2023. The Intel(R) oneAPI DPC++/C++ Compiler (ICX) is the recommended compiler moving forward. Please transition to use this compiler. Use '-diag-disable=10441' to disable this message.
In file included from ${NCDIR}/buildintel/ncrystal_core/include/NCrystal/NCTypes.hh(31),
                 from ${NCDIR}/buildintel/ncrystal_core/include/NCrystal/NCProcImpl.hh(24),
                 from ${NCDIR}/buildintel/ncrystal_core/include/NCrystal/internal/NCAbsOOV.hh(24),
                 from ${NCDIR}/buildintel/ncrystal_core/src/NCAbsOOV.cc(21):
${NCDIR}/buildintel/ncrystal_core/include/NCrystal/NCVariant.hh(117): error: static assertion failed with ""
    static_assert(!std::is_default_constructible<Variant<double,int,VariantAllowEmpty::No>>::value,"");
    ^

In file included from ${NCDIR}/buildintel/ncrystal_core/include/NCrystal/NCProcImpl.hh(24),
                 from ${NCDIR}/buildintel/ncrystal_core/include/NCrystal/internal/NCAbsOOV.hh(24),
                 from ${NCDIR}/buildintel/ncrystal_core/src/NCAbsOOV.cc(21):
${NCDIR}/buildintel/ncrystal_core/include/NCrystal/NCTypes.hh(498): warning #2164: attributes are ignored on an enum declaration that is not also a definition
        enum class NCRYSTAL_API VarId : std::uint32_t;//only fwd decl here
                   ^

${NCDIR}/buildintel/ncrystal_core/include/NCrystal/NCVariant.hh(122): error: static assertion failed with ""
      static_assert(std::is_default_constructible<Variant>::value == (ALLOW_EMPTY==VariantAllowEmpty::Yes),"");
      ^
          detected during:
            instantiation of class "NCrystal::Variant<T1, T2, ALLOW_EMPTY>::Impl [with T1=NCrystal::CrystalAxis, T2=NCrystal::HKLPoint, ALLOW_EMPTY=NCrystal::VariantAllowEmpty::No]" at line 186
            instantiation of "const T &NCrystal::Variant<T1, T2, ALLOW_EMPTY>::get<T>() const [with T1=NCrystal::CrystalAxis, T2=NCrystal::HKLPoint, ALLOW_EMPTY=NCrystal::VariantAllowEmpty::No, T=NCrystal::CrystalAxis]" at line 247
            instantiation of "bool NCrystal::Variant<T1, T2, ALLOW_EMPTY>::operator==(const NCrystal::Variant<T1, T2, ALLOW_EMPTY> &) const [with T1=NCrystal::CrystalAxis, T2=NCrystal::HKLPoint, ALLOW_EMPTY=NCrystal::VariantAllowEmpty::No]" at line 380 of "${NCDIR}/buildintel/ncrystal_core/include/NCrystal/NCTypes.hh"

compilation aborted for ${NCDIR}/buildintel/ncrystal_core/src/NCAbsOOV.cc (code 2)
make[2]: *** [CMakeFiles/NCrystal.dir/build.make:76: CMakeFiles/NCrystal.dir/ncrystal_core/src/NCAbsOOV.cc.o] Error 2
make[2]: Leaving directory '${NCDIR}/buildintel'
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/NCrystal.dir/all] Error 2
make[1]: Leaving directory '${NCDIR}/buildintel'
make: *** [Makefile:136: all] Error 2

KBGrammer avatar Oct 06 '23 16:10 KBGrammer