0

I am trying to compile hdf5-1.8.22 using Intel oneAPI Base Toolkit/HPC Toolkit 2022.1. The configuration without Intel oneAPI was performed with the following command:

CC=$DIR/mpich/bin/mpicc FC=$DIR/mpich/bin/mpif90 CXX=$DIR/mpich/bin/mpicxx CFLAGS=-fPIC ./configure --prefix=$DIR/hdf5 --enable-parallel --enable-fortran --enable-production --enable-shared

The process completed successfully. The configuration with Intel oneAPI looks like this:

CC=$INTEL/oneapi/compiler/latest/linux/bin/intel64/icc CXX=$INTEL/oneapi/compiler/latest/linux/bin/intel64/icpc F77=$INTEL/oneapi/compiler/latest/linux/bin/intel64/ifort MPIF90=$INTEL/oneapi/mpi/latest/bin/mpif90 MPICC=$INTEL/oneapi/mpi/latest/bin/mpicc MPICXX=$INTEL/oneapi/mpi/latest/bin/mpiicpc CFLAGS="-fPIC -O3 -xHost -ip -fno-alias -align" FFLAGS="-fPIC -O3 -xHost -ip -fno-alias -align" CXXFLAGS="-fPIC -O3 -xHost -ip -fno-alias -align" FFLAGS="-I$INTEL/oneapi/mpi/latest/include -L$INTEL/oneapi/mpi/latest/lib" ./configure --prefix=$DIR/hdf5 --enable-parallel --enable-fortran --enable-production --enable-shared --enable-static --enable-hl --with-szlib=$DIR/szip-2.1 --with-zlib=$DIR/zlib-1.2.7

It fails with the following log:

checking for an ANSI C-conforming const... yes
checking if the compiler understands  __inline__... yes
checking if the compiler understands __inline... yes
checking if the compiler understands inline... yes
checking for __attribute__ extension... yes
checking for __func__ extension... yes
checking for __FUNCTION__ extension... yes
checking for C99 designated initialization support... yes
checking how to print long long... %unknownd and %unknownu
checking Threads support system scope... no
checking enable debugging symbols... no
checking enable developer warnings... no
checking profiling... no
checking optimization level... high
checking for debug flags... none
checking whether function stack tracking is enabled... no
checking whether metadata trace file code is enabled... no
checking for API tracing... no
checking for instrumented library... no
checking whether to clear file buffers... yes
checking whether a memory checking tool will be used... no
checking for parallel support files... provided by compiler
checking whether a simple MPI-IO C program can be linked... no
configure: error: unable to link a simple MPI-IO C program

How to fix this error?

UPD: If I use CC=mpiicc the full error log looks like this:

configure:4562: $? = 0
configure:4551: /../../intel/oneapi/mpi/latest/bin/mpiicc -qversion >&5
icc: command line warning #10006: ignoring unknown option '-qversion'
ld: cannot find -lmpifort
ld: cannot find -lmpi
configure:4562: $? = 1
configure:4582: checking whether the C compiler works
configure:4604: /../../intel/oneapi/mpi/latest/bin/mpiicc  -fPIC -O3 -xHost -ip -fno-alias -align     conftest.c  >&5
ld: cannot find -lmpifort
ld: cannot find -lmpi
configure:4608: $? = 1
configure:4646: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "HDF5"
| #define PACKAGE_TARNAME "hdf5"
| #define PACKAGE_VERSION "1.8.22"
| #define PACKAGE_STRING "HDF5 1.8.22"
| #define PACKAGE_BUGREPORT "help@hdfgroup.org"
| #define PACKAGE_URL ""
| #define PACKAGE "hdf5"
| #define VERSION "1.8.22"
| /* end confdefs.h.  */
|
| int
| main ()
| {
|
|   ;
|   return 0;
| }
configure:4651: error: in `/../../hdf5-1.8.22':
configure:4653: error: C compiler cannot create executables
k4k
  • 31
  • 1
  • 4

1 Answers1

0

I found a solution, maybe not quite correct, but it solves my problem. I changed the version from hdf5-1.8.22 to hdf5-1.12.1 and configured with the following command:

CC=$INTEL/oneapi/mpi/latest/bin/mpiicc CFLAGS="-I$INTEL/oneapi/mpi/latest/include -L$INTEL/oneapi/mpi/latest/lib/release -L$INTEL/oneapi/mpi/latest/lib -fPIC -O3 -xsse4.2 -align" FC=$INTEL/oneapi/mpi/latest/bin/mpiifort FCFLAGS="-I$INTEL/oneapi/mpi/latest/include -L$INTEL/oneapi/mpi/latest/lib/release -L$INTEL/oneapi/mpi/latest/lib -fPIC -O3 -xsse4.2 -lgfortran -nofor-main" ./configure --prefix=$DIR/hdf5 --enable-parallel --enable-fortran --enable-build-mode=production --enable-shared --enable-static --with-szlib=$DIR/szip-2.1 --with-zlib=$DIR/zlib-1.2.7
k4k
  • 31
  • 1
  • 4