Page 1 of 1

Error from timing_C as compiling

Posted: Tue Jun 03, 2025 3:47 pm
by jianming_cui

Hi,

I was trying to compile VASP.6.5.1 at a RHEL 9 HPC with AMD cpu nodes. I got the following errors during 'make DEPS=1 -j8 all'.

Code: Select all

make[3]: *** [makefile:31: timing_.o] Error 1
make[3]: Leaving directory '/dartfs-hpc/rc/home/c/f007nhc/VASP/vasp_amd/vasp.6.5.1/build/ncl/lib'
make[2]: *** [makefile:18: all] Error 2
make[2]: Leaving directory '/dartfs-hpc/rc/home/c/f007nhc/VASP/vasp_amd/vasp.6.5.1/build/ncl/lib'
make[1]: *** [makefile:169: lib] Error 2
make[1]: *** Waiting for unfinished jobs....
gcc -O -c -o timing_.o timing_.c
timing_.c: In function ‘timing_C’:
timing_.c:10:6: warning: old-style function definition [-Wold-style-definition]
   10 | void timing_C(mode,utime,stime,now,minpgf,majpgf,maxrsize,avsize,swaps,ios,cswitch,ierr)
      |      ^~~~~~~~
timing_.c:20:19: error: conflicting types for ‘getrusage’; have ‘int(void)’
   20 |    int            getrusage();
      |                   ^~~~~~~~~
In file included from timing_.c:8:
/usr/include/sys/resource.h:87:12: note: previous declaration of ‘getrusage’ with type ‘int(__rusage_who_t,  struct rusage *)’ {aka ‘int(int,  struct rusage *)’}
   87 | extern int getrusage (__rusage_who_t __who, struct rusage *__usage) __THROW;
      |            ^~~~~~~~~
timing_.c:25:31: error: too many arguments to function ‘getrusage’; expected 0, have 2
   25 |    if ( *mode == 0 ) {*ierr = getrusage(RUSAGE_SELF,&rudata);};
      |                               ^~~~~~~~~ ~~~~~~~~~~~
timing_.c:20:19: note: declared here
   20 |    int            getrusage();
      |                   ^~~~~~~~~
timing_.c:26:31: error: too many arguments to function ‘getrusage’; expected 0, have 2
   26 |    if ( *mode != 0 ) {*ierr = getrusage(RUSAGE_CHILDREN,&rudata);};
      |                               ^~~~~~~~~ ~~~~~~~~~~~~~~~
timing_.c:20:19: note: declared here
   20 |    int            getrusage();
      |                   ^~~~~~~~~
timing_.c:33:16: error: too many arguments to function ‘gettimeofday’; expected 0, have 2
   33 |    dumerr    = gettimeofday(&realtime,NULL);
      |                ^~~~~~~~~~~~ ~~~~~~~~~
timing_.c:21:19: note: declared here
   21 |    int            gettimeofday();
      |                   ^~~~~~~~~~~~
make[3]: *** [makefile:31: timing_.o] Error 1
make[3]: Leaving directory '/dartfs-hpc/rc/home/c/f007nhc/VASP/vasp_amd/vasp.6.5.1/build/std/lib'
make[2]: *** [makefile:18: all] Error 2
make[2]: Leaving directory '/dartfs-hpc/rc/home/c/f007nhc/VASP/vasp_amd/vasp.6.5.1/build/std/lib'
make[1]: *** [makefile:169: lib] Error 2

The following is my make.include, adapted from makefile.include.gnu_ompi_aocl:

Code: Select all

# Default precompiler options
CPP_OPTIONS = -DHOST=\"LinuxGNU\" \
              -DMPI -DMPI_BLOCK=8000 -Duse_collective \
              -DscaLAPACK \
              -DCACHE_SIZE=4000 \
              -Davoidalloc \
              -Dvasp6 \
              -Dtbdyn \
              -Dfock_dblbuf

CPP         = gcc -E -C -w $*$(FUFFIX) >$*$(SUFFIX) $(CPP_OPTIONS)

FC          = mpif90
FCL         = mpif90

FREE        = -ffree-form -ffree-line-length-none

FFLAGS      = -w -ffpe-summary=none

OFLAG       = -O2
OFLAG_IN    = $(OFLAG)
DEBUG       = -O0

# For what used to be vasp.5.lib
CPP_LIB     = $(CPP)
FC_LIB      = $(FC)
CC_LIB      = gcc
CFLAGS_LIB  = -O
FFLAGS_LIB  = -O1
FREE_LIB    = $(FREE)

OBJECTS_LIB = linpack_double.o

# For the parser library
CXX_PARS    = g++
LLIBS       = -lstdc++

##
## Customize as of this point! Of course you may change the preceding
## part of this file as well if you like, but it should rarely be
## necessary ...
##

# When compiling on the target machine itself, change this to the
# relevant target when cross-compiling for another architecture
VASP_TARGET_CPU ?= -march=native
FFLAGS     += $(VASP_TARGET_CPU)

# For gcc-10 and higher (comment out for older versions)
FFLAGS     += -fallow-argument-mismatch

# BLAS (mandatory)
AMDBLIS_ROOT ?= /dartfs-hpc/rc/home/c/f007nhc/local_builds/aocl/install/5.0.0/aocc
BLAS        = -L${AMDBLIS_ROOT}/lib -lblis

# LAPACK (mandatory)
AMDLIBFLAME_ROOT ?= /dartfs-hpc/rc/home/c/f007nhc/local_builds/aocl/install/5.0.0/aocc
LAPACK      = -L${AMDLIBFLAME_ROOT}/lib -lflame

# scaLAPACK (mandatory)
AMDSCALAPACK_ROOT ?= /dartfs-hpc/rc/home/c/f007nhc/local_builds/aocl/install/5.0.0/aocc
SCALAPACK   = -L${AMDSCALAPACK_ROOT}/lib -lscalapack

LLIBS      += $(SCALAPACK) $(LAPACK) $(BLAS)

# FFTW (mandatory)
AMDFFTW_ROOT  ?= /dartfs-hpc/rc/home/c/f007nhc/local_builds/aocl/install/5.0.0/aocc
LLIBS      += -L$(AMDFFTW_ROOT)/lib -lfftw3
INCS       += -I$(AMDFFTW_ROOT)/include

# HDF5-support (optional but strongly recommended, and mandatory for some features)
#CPP_OPTIONS+= -DVASP_HDF5
#HDF5_ROOT  ?= /path/to/your/hdf5/installation
#LLIBS      += -L$(HDF5_ROOT)/lib -lhdf5_fortran
#INCS       += -I$(HDF5_ROOT)/include

# For the VASP-2-Wannier90 interface (optional)
#CPP_OPTIONS    += -DVASP2WANNIER90
#WANNIER90_ROOT ?= /path/to/your/wannier90/installation
#LLIBS          += -L$(WANNIER90_ROOT)/lib -lwannier

# For machine learning library vaspml (experimental)
#CPP_OPTIONS += -Dlibvaspml
#CPP_OPTIONS += -DVASPML_USE_CBLAS
#CPP_OPTIONS += -DVASPML_DEBUG_LEVEL=3
#CXX_ML      = mpic++
#CXXFLAGS_ML = -O3 -std=c++17 -pedantic-errors -Wall -Wextra
#INCLUDE_ML  = -I${AMDBLIS_ROOT}/include/blis -I${AMDLIBFLAME_ROOT}/include

I installed my own gcc, aocc, aocl and openmpi in my home dir and added them to PATH. Could you please help me with the issue?

Thanks in advance!

Best,
Jianming


Re: Error from timing_C as compiling

Posted: Fri Jun 06, 2025 3:54 pm
by pedro_melo

Dear jianming_cui,

Could you let me know which versions of you compilers and libraries you used during this compilation?

Kind regards,
Pedro