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

**URL:** https://calculix.discourse.group/t/updated-intel-mkl-to-v2023-2-on-ubuntu-now-ccx-wont-compile/1862
**Category:** Uncategorized
**Created:** [October 7, 2023, 9:28pm UTC](https://calculix.discourse.group/t/updated-intel-mkl-to-v2023-2-on-ubuntu-now-ccx-wont-compile/1862 "2023-10-07T21:28:27Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![manny9808](https://yyz2.discourse-cdn.com/free1/user_avatar/calculix.discourse.group/manny9808/32/143_2.png) [@manny9808](https://calculix.discourse.group/u/manny9808)
#### Post date: [October 7, 2023, 9:28pm UTC](https://calculix.discourse.group/t/updated-intel-mkl-to-v2023-2-on-ubuntu-now-ccx-wont-compile/1862/1 "2023-10-07T21:28:27Z")

</div>

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.

 ![image](https://global.discourse-cdn.com/free1/uploads/calculix/original/2X/b/b3e2ed55508cccc70e5f2b58db025711dd5ba0f2.png)

---

<div class="post-metadata">

### Author: ![jbr](https://avatars.discourse-cdn.com/v4/letter/j/ecccb3/32.png) [@jbr](https://calculix.discourse.group/u/jbr)
#### Post date: [October 7, 2023, 10:02pm UTC](https://calculix.discourse.group/t/updated-intel-mkl-to-v2023-2-on-ubuntu-now-ccx-wont-compile/1862/2 "2023-10-07T22:02:00Z")

</div>

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

---

<div class="post-metadata">

### Author: ![manny9808](https://yyz2.discourse-cdn.com/free1/user_avatar/calculix.discourse.group/manny9808/32/143_2.png) [@manny9808](https://calculix.discourse.group/u/manny9808)
#### Post date: [October 7, 2023, 11:16pm UTC](https://calculix.discourse.group/t/updated-intel-mkl-to-v2023-2-on-ubuntu-now-ccx-wont-compile/1862/3 "2023-10-07T23:16:14Z")

</div>

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  
`

---

<div class="post-metadata">

### Author: ![jbr](https://avatars.discourse-cdn.com/v4/letter/j/ecccb3/32.png) [@jbr](https://calculix.discourse.group/u/jbr)
#### Post date: [October 8, 2023, 12:46am UTC](https://calculix.discourse.group/t/updated-intel-mkl-to-v2023-2-on-ubuntu-now-ccx-wont-compile/1862/4 "2023-10-08T00:46:11Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![feacluster](https://yyz2.discourse-cdn.com/free1/user_avatar/calculix.discourse.group/feacluster/32/394_2.png) [@feacluster](https://calculix.discourse.group/u/feacluster)
#### Post date: [October 10, 2023, 1:37pm UTC](https://calculix.discourse.group/t/updated-intel-mkl-to-v2023-2-on-ubuntu-now-ccx-wont-compile/1862/5 "2023-10-10T13:37:43Z")

</div>

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](https://feacluster.com/install/install)

To run:

# perl install

---

<div class="post-metadata">

### Author: ![jbr](https://avatars.discourse-cdn.com/v4/letter/j/ecccb3/32.png) [@jbr](https://calculix.discourse.group/u/jbr)
#### Post date: [October 10, 2023, 10:23pm UTC](https://calculix.discourse.group/t/updated-intel-mkl-to-v2023-2-on-ubuntu-now-ccx-wont-compile/1862/6 "2023-10-10T22:23:32Z")

</div>

`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.`

---

<div class="post-metadata">

### Author: ![jbr](https://avatars.discourse-cdn.com/v4/letter/j/ecccb3/32.png) [@jbr](https://calculix.discourse.group/u/jbr)
#### Post date: [October 10, 2023, 10:24pm UTC](https://calculix.discourse.group/t/updated-intel-mkl-to-v2023-2-on-ubuntu-now-ccx-wont-compile/1862/7 "2023-10-10T22:24:33Z")

</div>

> [@manny9808](#):
>
> CC=gcc  
> FC=gfortran

Can you try compiling with `icc` and `ifort`?

---

<div class="post-metadata">

### Author: ![manny9808](https://yyz2.discourse-cdn.com/free1/user_avatar/calculix.discourse.group/manny9808/32/143_2.png) [@manny9808](https://calculix.discourse.group/u/manny9808)
#### Post date: [October 11, 2023, 2:21am UTC](https://calculix.discourse.group/t/updated-intel-mkl-to-v2023-2-on-ubuntu-now-ccx-wont-compile/1862/8 "2023-10-11T02:21:09Z")

</div>

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.

```auto
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,

```

---

<div class="post-metadata">

### Author: ![Gong1999](https://avatars.discourse-cdn.com/v4/letter/g/ecd19e/32.png) [@Gong1999](https://calculix.discourse.group/u/Gong1999)
#### Post date: [November 22, 2023, 1:00pm UTC](https://calculix.discourse.group/t/updated-intel-mkl-to-v2023-2-on-ubuntu-now-ccx-wont-compile/1862/9 "2023-11-22T13:00:47Z")

</div>

Thanks! helps a lot!

---

<div class="post-metadata">

### Author: ![feacluster](https://yyz2.discourse-cdn.com/free1/user_avatar/calculix.discourse.group/feacluster/32/394_2.png) [@feacluster](https://calculix.discourse.group/u/feacluster)
#### Post date: [April 30, 2024, 1:36am UTC](https://calculix.discourse.group/t/updated-intel-mkl-to-v2023-2-on-ubuntu-now-ccx-wont-compile/1862/10 "2024-04-30T01:36:57Z")

</div>

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 .
