danieljprice / phantom

Phantom Smoothed Particle Hydrodynamics and Magnetohydrodynamics code
https://phantomsph.github.io
Other
94 stars 210 forks source link

compilation fails with new version of ifort #558

Closed lsiess closed 2 weeks ago

lsiess commented 3 weeks ago

ifort is now depreciated and with the latest version of the intel compiler (package intel-oneapi-compiler-fortran, version 2024.1.2-995 on linux) the compilation fails.

ifort -c -O3 -inline-factor=500 -shared-intel -warn uninitialized -warn unused -warn truncated_source -no-wrap-margin -fPIC -qopenmp -r8 -DSINK_RADIATION -DDUST_NUCLEATION -DINJECT_PARTICLES ../src/main/kdtree.F90 -o kdtree.o ifort: remark #10448: Intel(R) Fortran Compiler Classic (ifort) is now deprecated and will be discontinued late 2024. Intel recommends that customers transition now to using the LLVM-based Intel(R) Fortran Compiler (ifx) for continued Windows and Linux support, new language support, new language features, and optimizations. Use '-diag-disable=10448' to disable this message. ../src/main/kdtree.F90(112): error #7002: Error in opening the compiled module file. Check INCLUDE paths. [OMP_LIB] !$ use omp_lib -------^ ../src/main/kdtree.F90(175): error #6404: This name does not have a type, and must have an explicit type. [OMP_GET_NUM_THREADS] !$ numthreads = omp_get_num_threads() -----------------^ ../src/main/kdtree.F90(892): remark #7712: This variable has not been used. [XYZH] subroutine getneigh(node,xpos,xsizei,rcuti,ndim,listneigh,nneigh,xyzh,xyzcache,ixyzcachesize,ifirstincell,& -----------------------------------------------------------------^ ../src/main/kdtree.F90(459): remark #7712: This variable has not been used. [XYZH] ncells, ifirstincell, minlevel, maxlevel, ndim, xyzh, wassplit, & ------------------------------------------------------------^ ../src/main/kdtree.F90(319): remark #7712: This variable has not been used. [IFIRSTINCELL] subroutine construct_root_node(np,nproot,irootnode,ndim,xmini,xmaxi,ifirstincell,xyzh) --------------------------------------------------------------------^ compilation aborted for ../src/main/kdtree.F90 (code 1)

But the code compiles if one uses ifx

It is easy to fix by creating a makefile_default_ifx similar to makefile_default_ifort but with FC=ifx. Note that ifx does not (yet?) support the option '-inline-factor=500' Would that missing option substantially impact the code speed ?

Any suggestion on how to proceed Daniel ?

danieljprice commented 3 weeks ago

yes we should make a Makefile_defaults_ifx and SYSTEM=ifx as suggested...