Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

WRF 4.5.1 compiling failed with INTEL 2023 version of ifort Fortran and icc 223.

zwu

New member
We tried to compile WRF 4.5.1 using latest INTEL (2023) ifort and icc (Compiling option 15 and for basic 1). Compiling failed with numerous errors. Sample errors are like these:

get_region_center.c:40:3: 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(MemoryOrder,MemoryOrderIn,strlen1);
.....
open_file.c:43:3: error: call to undeclared library function 'strncpy' with type 'char *(char *, const char *, unsigned long)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
strncpy(filename2,filename,strlen1);

Anyone has the same issue? Is there any way to solve the problem?
 
Hi Song,

I am not sure. I didn't install the Intel package. The intel package was installed in April 2023. The package path seems indicating something of "oneapi":

/usr/local/opt/intel/oneapi/compiler/2023.1.0/linux/bin/intel64/ifort

I compiled successfully the same WRF 4.5.1 using the Intel 2020 version.

Do you know any difference between the two versions of Intel compiler?

Thanks,

Zhong
 
Hi Song,

I am not sure. I didn't install the Intel package. The intel package was installed in April 2023. The package path seems indicating something of "oneapi":

/usr/local/opt/intel/oneapi/compiler/2023.1.0/linux/bin/intel64/ifort

I compiled successfully the same WRF 4.5.1 using the Intel 2020 version.

Do you know any difference between the two versions of Intel compiler?

Thanks,

Zhong
Your intel2023 is onapi2023. I did not compile WRF v4.5.1 with intel2023.
But I have compiled WRF4.5 with oneapi2023(intel2023) successfully!
You can change the ifort to ifx in your configure.wrf.
Unfortunately,I compiled wrf4.5 with intel2020,but it failed.
 
Hi Rob,

Great. Would you mind sharing your experience with us, such as configure.wrf and configer.wps? It may be helpful to solve the problems with OneApi 2023.

Thanks.

Zhong
 
Hi Song,

The ifx seems not work, same errors show up. Thanks for your suggestion.

Zhong
 
Hi Song,

I think the Intel 2023 is working. We used it to compile other Fortran codes successfully.
It seems that the C compiler of Intel 2023 is the major problems for WRF. Many C codes in WRF failed in compiling, such as the samples in my previous message. Do you have any suggestions? Are there ICC compiling swatches needed in configure.wrf file (such as flags to make the 2023 CC compiler accept CC code in previous version of CC)?

Thanks,

Zhong
 
Hi all,


I am having the same problem. I was able to solve the errors mentioned above with some compiler flags. After running the configure step, set the CFLAGS_LOCAL variable in the configure.wrf file:
Code:
CFLAGS_LOCAL    =       -w -O3 -ip --std=c89 -Wno-incompatible-pointer-types -Wno-int-conversion

Note: Intel oneAPI 2023.1 removes the icc compiler. You must replace icc with icx in arch/configure.defaults before running the configure step. The ifort compiler is also deprecated, so you might as well replace ifort with ifx at the same time.
Code:
cat arch/configure.defaults | \
sed "s/SFC             =       ifort/SFC             =       ifx/g" | \
sed "s/SCC             =       icc/SCC             =       icx/g" | \
sed "s/CCOMP           =       icc/CCOMP           =       icx/g" > arch/configure.defaults.mod
mv arch/configure.defaults.mod arch/configure.defaults

The steps above solved many errors, but I still have many errors to deal with, such as:


Code:
mpicc -cc=icx -w -O3 -ip --std=c89 -w -Wno-incompatible-pointer-types -Wno-int-conversion -Wno-implicit-function-declaration  -DDM_PARALLEL -DLANDREAD_STUB=1 -DMAX_HISTORY=25 -DNMM_CORE=0  -c buf_for_proc.c
c_code.c:1071:21: error: variable has incomplete type 'struct timezone'
    struct timezone tzp ;
                    ^   
c_code.c:1071:12: note: forward declaration of 'struct timezone'
    struct timezone tzp ;
           ^

This error can be solved by changing code to typedef struct timezone tzp; but I do not want to change the code and have to keep my own modified version. Still digging for compiler options, but if anyone has solved this, it would be very helpful.

There are still many errors after this, so I am not sure how much more effort it will take.

Thanks,
-David
 
Hi all,


I am having the same problem. I was able to solve the errors mentioned above with some compiler flags. After running the configure step, set the CFLAGS_LOCAL variable in the configure.wrf file:
Code:
CFLAGS_LOCAL    =       -w -O3 -ip --std=c89 -Wno-incompatible-pointer-types -Wno-int-conversion

Note: Intel oneAPI 2023.1 removes the icc compiler. You must replace icc with icx in arch/configure.defaults before running the configure step. The ifort compiler is also deprecated, so you might as well replace ifort with ifx at the same time.
Code:
cat arch/configure.defaults | \
sed "s/SFC             =       ifort/SFC             =       ifx/g" | \
sed "s/SCC             =       icc/SCC             =       icx/g" | \
sed "s/CCOMP           =       icc/CCOMP           =       icx/g" > arch/configure.defaults.mod
mv arch/configure.defaults.mod arch/configure.defaults

The steps above solved many errors, but I still have many errors to deal with, such as:


Code:
mpicc -cc=icx -w -O3 -ip --std=c89 -w -Wno-incompatible-pointer-types -Wno-int-conversion -Wno-implicit-function-declaration  -DDM_PARALLEL -DLANDREAD_STUB=1 -DMAX_HISTORY=25 -DNMM_CORE=0  -c buf_for_proc.c
c_code.c:1071:21: error: variable has incomplete type 'struct timezone'
    struct timezone tzp ;
                    ^  
c_code.c:1071:12: note: forward declaration of 'struct timezone'
    struct timezone tzp ;
           ^

This error can be solved by changing code to typedef struct timezone tzp; but I do not want to change the code and have to keep my own modified version. Still digging for compiler options, but if anyone has solved this, it would be very helpful.

There are still many errors after this, so I am not sure how much more effort it will take.

Thanks,
-David
Do not modify icc to icx in your configure.wrf.
It will crash.
 
Thank you for confirming which compiler to use.

I am trying to use Intel oneAPI 2023.x, so the only way to get the icc compiler with that version is to install the classic compiler package:
Code:
# dpkg -S /opt/intel/oneapi/compiler/2023.1.0/linux/bin/intel64/icc
intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic-2023.1.0: /opt/intel/oneapi/compiler/2023.1.0/linux/bin/intel64/icc

However, when the compiler is queried for its version number, it shows the older 2021.9.0 version. This version is deprecated and will be removed very soon. Which Intel oneAPI compiler version should be used with WRF v4.5.1 going forward?

Code:
# icc --version
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.
icc (ICC) 2021.9.0 20230302
Copyright (C) 1985-2023 Intel Corporation.  All rights reserved.

Code:
# apt list --installed | grep oneapi-compiler

intel-oneapi-compiler-cpp-eclipse-cfg/all,now 2023.1.0-46305 all [installed,upgradable to: 2023.2.1-16]
intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic-2023.1.0/all,now 2023.1.0-46305 amd64 [installed]
intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic-common-2023.1.0/all,now 2023.1.0-46305 all [installed,automatic]
intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic-runtime-2023.1.0/all,now 2023.1.0-46305 amd64 [installed,automatic]
intel-oneapi-compiler-dpcpp-cpp-classic-fortran-shared-runtime-2023.1.0/all,now 2023.1.0-46305 amd64 [installed,automatic]
intel-oneapi-compiler-dpcpp-cpp-common-2023.1.0/all,now 2023.1.0-46305 all [installed,automatic]
intel-oneapi-compiler-dpcpp-cpp-runtime-2023.1.0/all,now 2023.1.0-46305 amd64 [installed,automatic]
intel-oneapi-compiler-dpcpp-eclipse-cfg/all,now 2023.1.0-46305 all [installed,upgradable to: 2023.2.1-16]
intel-oneapi-compiler-fortran-2023.1.0/all,now 2023.1.0-46305 amd64 [installed]
intel-oneapi-compiler-fortran-common-2023.1.0/all,now 2023.1.0-46305 all [installed,automatic]
intel-oneapi-compiler-fortran-runtime-2023.1.0/all,now 2023.1.0-46305 amd64 [installed,automatic]
intel-oneapi-compiler-shared-2023.1.0/all,now 2023.1.0-46305 amd64 [installed,automatic]
intel-oneapi-compiler-shared-common-2023.1.0/all,now 2023.1.0-46305 all [installed,automatic]
intel-oneapi-compiler-shared-runtime-2023.1.0/all,now 2023.1.0-46305 amd64 [installed,automatic]
 
Hi.
I have managed to build with the intel classic 2023 compiler, setting these lines in configure.wrf
SFC = ifort SCC = icc CCOMP = icc DM_FC = mpiifort DM_CC = mpiicc

Also, you might want to add -diag-disable=10441 to the CFLAGS_LOCAL lines and to the FCOPTIM
That way you won't get the warnings about to-be-deprecated compilers in the log.

Run the compile instruction only after enabling the intel compiler environment variables.
 
Last edited:
Top