opencollab / arpack-ng

Collection of Fortran77 subroutines designed to solve large scale eigenvalue problems.
Other
285 stars 123 forks source link

Using ifx fortran compiler from Intel 2024 oneapi gives errors during configure step #455

Open feacluster opened 5 months ago

feacluster commented 5 months ago

I can successfully build arpack-ng with blas and lapack using this comand:

 CXX=icx CC=icx FC=ifort F77=ifort ./configure --with-blas=/home/feacluster/OpenBLAS/build/lib/libopenblas_sapphirerapids-r0.3.27.dev.a --with-lapack=/home/feacluster/OpenBLAS/build/lib/libopenblas_sapphirerapids-r0.3.27.dev.a --enable-icb --enable-static --disable-shared --prefix=/home/feacluster/arpack-ng/build

But if I replace ifort with ifx I get:

checking for dummy main to link with Fortran 77 libraries... unknown
configure: error: in `/home/feacluster/arpack-ng':
configure: error: linking to Fortran libraries from C fails
See `config.log' for more details

The config.log shows this error:

configure:5784: icx -o conftest -O2   conftest.c   -loopopt=1 -L/opt/intel/oneapi/tbb/2021.12/env/../lib/intel64/gcc4.8 -L/opt/intel/oneapi/m>
/usr/bin/ld: cannot find -loopopt=1
icx: error: linker command failed with exit code 1 (use -v to see invocation)
configure:5784: $? = 1
configure: failed program was:

Next if I try and just omit the F77=ifx, with:

INTERFACE64="1" CXX=icx CC=icx FC=ifx  ./configure --with-blas=/home/feacluster/OpenBLAS/build/lib/libopenblas_sapphirerapids-r0.3.27.dev.a --with-lapack=/home/feacluster/OpenBLAS/build/lib/libopenblas_sapphirerapids-r0.3.27.dev.a --enable-icb --enable-static --disable-shared --prefix=/home/feacluster/arpack-ng/build

I get:

checking for sgemm_ in /home/feacluster/OpenBLAS/build/lib/libopenblas_sapphirerapids-r0.3.27.dev.a... yes
checking for cheev_ in /home/feacluster/OpenBLAS/build/lib/libopenblas_sapphirerapids-r0.3.27.dev.a... no
checking for cheev_... no
checking for cheev_ in -llapack... no
checking for cheev_ in -llapack_rs6k... no
configure: error: cannot find LAPACK libraries

Which is strange because it finds it ok with I use ifort instead of ifx. The library is in the same folder as where I am running config.

fghoussen commented 5 months ago

Does ifx implements the Fortran 2003 standard that defines ICB? Did you try without ICB? (no Fortran standard required) Did you try with `cmake?

feacluster commented 5 months ago

Thanks for the quick reply! From AI answers:

Yes, the Intel Fortran Compiler (ifx) implements Fortran 2003, but not parameterized derived types.

I tried without ICB but got the same error. The strange thing is cheeve_ does seem to be in the openblas library:

checking for sgemm_ in /home/feacluster/OpenBLAS/build/lib/libopenblas.a... yes
checking for cheev_ in /home/feacluster/OpenBLAS/build/lib/libopenblas.a... no
checking for cheev_... no
checking for cheev_ in -llapack... no
checking for cheev_ in -llapack_rs6k... no
configure: error: cannot find LAPACK libraries
[feacluster@intel arpack-ng]$ strings /home/feacluster/OpenBLAS/build/lib/libopenblas.a | grep cheev_
cheev_
cheev_2stage_
LAPACKE_cheev_work
LAPACKE_cheev_2stage
LAPACKE_cheev_2stage_work
lapacke_cheev_work.o/
lapacke_cheev_2stage.o/
lapacke_cheev_2stage_work.o/
cheev_
fghoussen commented 4 months ago

Have you double-checked these the following things? If so, you'll need support from Intel, not from here.

Using ifx fortran compiler from Intel 2024 oneapi

OneAPI = new name for MKL: https://github.com/opencollab/arpack-ng?tab=readme-ov-file#using-mkl-instead-of-blas--lapack

Did you make sure the build system you use end up exactly with what's Intel libraries expect: https://www.intel.com/content/www/us/en/developer/tools/oneapi/onemkl-link-line-advisor.html#gs.8i3omj

Example: https://github.com/opencollab/arpack-ng/blob/4caa8f4c703c6408b05b878f376e5df762d9a0e9/.github/workflows/jobs.yml#L156-L163

INTERFACE64="1" ... ./configure ... strange thing is cheeve_ does seem to be in the openblas

https://github.com/opencollab/arpack-ng/blob/4caa8f4c703c6408b05b878f376e5df762d9a0e9/README.md?plain=1#L45

https://github.com/opencollab/arpack-ng/issues/452#issuecomment-2030183407