GEOS-ESM / ESMA_cmake

Custom CMake macros for the GEOS Earth System Model
Apache License 2.0
4 stars 9 forks source link

Add support for Hygon processors #344

Closed mathomp4 closed 8 months ago

mathomp4 commented 9 months ago

A use of GCHP, @TianYangMY, encountered a CMake failure using Intel Fortran, see https://github.com/geoschem/GCHP/issues/370.

Eventually, it was determined they were using an Hygon processor. The user provided cpuinfo output which lists it as avx2 compatible:

flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush 
mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc art rep_good nopl 
nonstop_tsc extd_apicid amd_dcm aperfmperf eagerfpu pni pclmulqdq monitor ssse3 fma cx16 sse4_1 
sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a 
misalignsse 3dnowprefetch osvw skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_l2 
hw_pstate sme retpoline_amd ssbd ibpb vmmcall fsgsbase bmi1 **avx2** smep bmi2 rdseed adx smap 
clflushopt sha_ni xsaveopt xsavec xgetbv1 clzero irperf xsaveerptr arat npt lbrv svm_lock nrip_save 
tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif 
overflow_recov succor smca

(stars added for emphasis).

Because of this, -march=core-avx2 should work for Hygon.