Build fails with icpx: cannot initialize a variable of type 'long long *' with an rvalue of type 'Scalar *' (aka 'int *')
Summary
Using Intel's icpx
with recent MKL leads to a compiler error:
/opt/intel/oneapi/compiler/latest/linux/bin/icpx -isystem /usr/include/eigen3 -isystem /opt/intel/oneapi/mkl/2023.0.0/include -DMKL_ILP64 -MD -MT CMakeFiles/dummy.dir/main.cpp.o -MF CMakeFiles/dummy.dir/main.cpp.o.d -o CMakeFiles/dummy.dir/main.cpp.o -c /home/votca/mkl_test/main.cpp
In file included from /home/votca/mkl_test/main.cpp:2:
In file included from /usr/include/eigen3/Eigen/Eigen:1:
In file included from /usr/include/eigen3/Eigen/Dense:4:
In file included from /usr/include/eigen3/Eigen/QR:45:
/usr/include/eigen3/Eigen/src/QR/ColPivHouseholderQR_LAPACKE.h:85:1: error: cannot initialize a variable of type 'long long *' with an rvalue of type 'Scalar *' (aka 'int *')
EIGEN_LAPACKE_QR_COLPIV(double, double, d, ColMajor, LAPACK_COL_MAJOR)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Environment
- Operating System : Linux / Fedora 37
- Architecture : x86_64
- Eigen Version : 3.4.0
- Compiler Version : Intel(R) oneAPI DPC++/C++ Compiler 2023.0.0 (2023.0.0.20221201)
- Compile Flags : none
- Vector Extension : ?
Minimal Example
#define EIGEN_USE_MKL_ALL
#include <Eigen/Eigen>
int main() {
return 0;
}
with a CMakeLists.txt
like:
cmake_minimum_required(VERSION 3.14)
project(foo CXX)
find_package(Eigen3)
find_package(MKL)
add_executable(dummy main.cpp)
target_link_libraries(dummy Eigen3::Eigen MKL::MKL)
Steps to reproduce
docker run -it ghcr.io/votca/buildenv/fedora:intel
- create
CMakeLists.txt
anddummy.cpp
from the code above CXX=icpx cmake -B builddir && cmake --build builddir --verbose
Anything else that might help
Instead of the docker container one can also use stock Fedora 37 install mkl
and icpx
:
printf "[oneAPI]\nname=Intel oneAPI\nbaseurl=https://yum.repos.intel.com/oneapi\nenabled=1\ngpgcheck=1\nrepo_gpgcheck=1\ngpgkey=https://yum.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB" > /etc/yum.repos.d/intel-oneapi.repo
dnf -y update
dnf -y install intel-oneapi-compiler-dpcpp-cpp intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic intel-oneapi-mkl-devel