Updated intel mkl to v2023.2 on ubuntu. Now ccx won't compile

Hello,

I am having trouble compiling ccx after updating oneAPI library to c2023.2 from v2021. Now I get strange error at the linking stage (see attached image). Not quite sure if the error lies with the mkl library. The issue persists for ccx2.21 as well as ccx2.15. The same makefile flags worked in the past so not sure what has changed. Many thanks.

Have you checked the OneAPI installation? Maybe run one of their tests or something like that.

Yes. A simple matrix multiplication with mkl library works perfectly. I am assuming issue with my compiler flags I am using to link them. Here is what I have been using till now.
`
CFLAGS = -Wall -O3 -DARCH=“Linux” -DARPACK -DPARDISO -DMATRIXSTORAGE -DNETWORKOUT -DUSE_MT=1 -DMKL_LP64 -I${MKL_INCLUDE}
FFLAGS = -Wall -O3 $(OPTIONS) -I$(MKL_INCLUDE) -fopenmp

CC=gcc
FC=gfortran

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

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

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

include Makefile.inc

SCCXMAIN = ccx_2.21.c

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

LIBS= /home/lincoln/Documents/MDO/Dependencies/ARPACK/libarpack_UBUNTU.a -lpthread -lm -lc

ccx_2.21: $(OCCXMAIN) ccx_2.21.a $(LDFLAGS) $(LIBS)
./date.pl; $(CC) $(CFLAGS) -c ccx_2.21.c;
$(FC) $(OPT) $(FFLAGS) -o $@ $(FPPSTOP) $(OCCXMAIN) ccx_2.21.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_2.21.a: $(OCCXF) $(OCCXC)
ar vr $@ $?

clean:
rm *.a *.o ccx_2.21
`

I don’t see anything suspicious that could be causing any problems. Can you check the intel documentation to see if some of them have changed? When I installed it last year, I recall a message saying that they would deprecate some flags in newer versions.

Your makefile looks different than what I am used to. ( using gcc instead of icc ) . Have you tried my installation script:

https://feacluster.com/install/install

To run:

perl install

2 Likes

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.

Can you try compiling with icc and ifort?

Many thanks for the help. I was able to compile using @feacluster 's Makefile with intel compilers, so the issue is temporarily solved.
However, note that icc and ifort are to be deprecated. Using icx and ifx throws error where they do not recognize the standard library. Perhaps an additional flag needs to be specified.

compfluid.c:123:3: error: call to undeclared library function 'strcpy' with type 'char *(char *, const char *)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  strcpy(fncvg,jobnamec);
  ^
compfluid.c:123:3: note: include the header <string.h> or explicitly provide a declaration for 'strcpy'
compfluid.c:124:3: error: call to undeclared library function 'strcat' with type 'char *(char *, const char *)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  strcat(fncvg,".fcv");
  ^
compfluid.c:124:3: note: include the header <string.h> or explicitly provide a declaration for 'strcat'
compfluid.c:610:7: error: call to undeclared library function 'memcpy' with type 'void *(void *, const void *, unsigned long)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
      memcpy(&veloo[0],&vel[0],sizeof(double)*8**nef);
      ^
compfluid.c:610:7: note: include the header <string.h> or explicitly provide a declaration for 'memcpy'
icx -w -O3 -qopenmp -DARCH="Linux" -DARPACK -DPARDISO -DMATRIXSTORAGE -DUSE_MT=1 -DMKL_ILP64 -I/opt/intel/oneapi/mkl/latest/include -DLONGLONG -c elementcpuload_density.c
compfluid.c:1013:8: error: call to undeclared function 'dslugm_'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
              FORTRAN(dslugm,(nef,&b[0],&vel[4**nef],&nelt,ia,ja,aua,
1 Like

Thanks! helps a lot!

I spent some time and tried to update the script for 2024 Intel compiler. Had to add in these old flags:

CFLAGS = -w -D_POSIX_C_SOURCE=199309L -O2 -std=c90

The script now works, but calculix will hang if you run any frequency/modal calculations. There is some problem in the ARPACK library even though I compiled it with the same ifx flags… Will need some deeper investigation to find the root cause .

2 Likes