Undefined reference to pardiso_ with Intel MKL (oneAPI toolkit)

Hello,
icc and ifort are intel compilers. I wanted to use GNU compilers, hence gcc and gfortran.

I managed to get my makefile to work (added below for record).While I am not sure what made it work, I made following changes: upon installation of intel library, ran

./varsh.sh intel64

in env directory in installation; then in makefile

$(LDFLAGS) before $(LIBS)

and

“space” before -Wl

(threw me error if not done).

Makefile:

OPT = -g -O2
CFLAGS = -Wall $(OPT) -fopenmp -DARCH="Linux" -DARPACK -DPARDISO -DMATRIXSTORAGE -DUSE_MT=1 -DMKL_LP64 -I{MKL_INCLUDE}
FFLAGS = -Wall $(OPT) $(OPTIONS) -I$(MKL_INCLUDE) -fopenmp

#ARPACK
#CFLAGS+= -I /usr/local/ARPACK -DARPACK

#SPOOLES
#CFLAGS+= -I /usr/local/SPOOLES.2.2 -DSPOOLES

#BLAS and LAPACK
#CFLAGS+= -llpack -lblas

CC=gcc
FC=gfortran

OPTIONS = -w -fno-second-underscore -fcray-pointer -x f77-cpp-input
FPPSTOP= -x none

#INTEL MKL
MKL_LIB = /opt/intel/oneapi/mkl/2021.1.1/lib/intel64
MKL_INCLUDE=/opt/intel/oneapi/mkl/2021.1.1/include
CMPLR_PATH = /opt/intel/oneapi/compiler/2021.1.1/linux/compiler/lib/intel64 


.c.o :
	$(CC) $(CFLAGS) -c $<
.f.o :
	$(FC) $(FFLAGS) -c $<

include Makefile.inc

SCCXMAIN = ccx_2.15.c

OCCXF = $(SCCXF:.f=.o)
OCCXC = $(SCCXC:.c=.o)
OCCXMAIN = $(SCCXMAIN:.c=.o)


LIBS= ../../../ARPACK/libarpack_UBUNTU.a -lpthread -lm -lc

ccx_PardisoMKL_gcc: $(OCCXMAIN) ccx_PardisoMKL_gcc.a $(LDFLAGS) $(LIBS)\
        ./date.pl; $(CC) $(CFLAGS) -c ccx_2.15.c; \
        $(FC) $(OPT)p $(FFLAGS) -o $@ $(FPPSTOP) $(OCCXMAIN) ccx_PardisoMKL_gcc.a $(LDFLAGS) $(LIBS)\
         -Wl,--start-group \
        $(MKL_LIB)/libmkl_gf_lp64.a \
        $(MKL_LIB)/libmkl_gnu_thread.a \
        $(MKL_LIB)/libmkl_core.a \
        $(MKL_LIB)/libmkl_blacs_openmpi_lp64.a \
         -Wl,--end-group \
        -L$(CMPLR_PATH) -lgomp -lpthread -lm -ldl

ccx_PardisoMKL_gcc.a: $(OCCXF) $(OCCXC)
	ar vr $@ $?
clean:
	rm *.a *.o ccx_PardisoMKL_gcc

I am getting significant gains in computation vs SPOOLES, still, the gain in multithreading for pardiso is not where I want it to be. For simple cantilever with 200k hex elements:

Hence,I will be looking to compile with MPI.

1 Like