undeclared identifier use in timing_.c

Questions regarding the compilation of VASP on various platforms: hardware, compilers and libraries, etc.


Moderators: Global Moderator, Moderator

Locked
Message
Author
User avatar
paulfons
Full Member
Full Member
Posts: 100
Joined: Sun Nov 04, 2012 2:40 am
License Nr.: 5-1405
Location: Yokohama, Japan
Contact:

undeclared identifier use in timing_.c

#1 Post by paulfons » Mon Feb 10, 2025 7:12 am

I am attempting to compile vasp 6.5.0 using the latest oneapi from Intel. I initially had problems with the (old) ipx compiler and modified the makefile to use the new intel icpx compiler (clang-based). The compiler version is Intel(R) oneAPI DPC++/C++ Compiler 2025.0.4 (2025.0.4.20241205). Most of the compilation seems to work, but I encountered an error as make was attempting to compile the timing_.c source file. There seem to be multiple undeclared identifiers in the source code and I was hoping there may be some suggestions as to how to proceed.

icpx: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
timing_.c:10:32: error: use of undeclared identifier 'now'; did you mean 'new'?
10 | void timing_C(mode,utime,stime,now,minpgf,majpgf,maxrsize,avsize,swaps,ios,cswitch,ierr)
| ^~~
| new
timing_.c:10:6: error: variable has incomplete type 'void'
10 | void timing_C(mode,utime,stime,now,minpgf,majpgf,maxrsize,avsize,swaps,ios,cswitch,ierr)
| ^
timing_.c:10:15: error: use of undeclared identifier 'mode'
10 | void timing_C(mode,utime,stime,now,minpgf,majpgf,maxrsize,avsize,swaps,ios,cswitch,ierr)
| ^
timing_.c:10:20: error: use of undeclared identifier 'utime'
10 | void timing_C(mode,utime,stime,now,minpgf,majpgf,maxrsize,avsize,swaps,ios,cswitch,ierr)
| ^
timing_.c:10:26: error: use of undeclared identifier 'stime'
10 | void timing_C(mode,utime,stime,now,minpgf,majpgf,maxrsize,avsize,swaps,ios,cswitch,ierr)
| ^
timing_.c:10:35: error: expected a type
10 | void timing_C(mode,utime,stime,now,minpgf,majpgf,maxrsize,avsize,swaps,ios,cswitch,ierr)
| ^
timing_.c:10:89: error: expected ';' after top level declarator
10 | void timing_C(mode,utime,stime,now,minpgf,majpgf,maxrsize,avsize,swaps,ios,cswitch,ierr)
| ^
| ;
timing_.c:15:1: error: expected unqualified-id
15 | {
| ^
8 errors generated.


manuel_engel1
Global Moderator
Global Moderator
Posts: 212
Joined: Mon May 08, 2023 4:08 pm

Re: undeclared identifier use in timing_.c

#2 Post by manuel_engel1 » Mon Feb 10, 2025 12:28 pm

Hello!

Thanks for reaching out. The timing_.c source file is written in C but the compiler treats it as C++ source code in your case. This is incorrect and will not compile. Make sure that your icpx compiler is treating the C source files correctly as C code and not C++. That should resolve the error.

Manuel Engel
VASP developer


Locked