diff --git a/arch/configure.defaults b/arch/configure.defaults index cdb94071..14e985fb 100644 --- a/arch/configure.defaults +++ b/arch/configure.defaults @@ -892,6 +892,33 @@ CPPFLAGS = -D_UNDERSCORE -DBYTESWAP -DLINUX -DIO_NETCDF -DIO_BINARY - ARFLAGS = CC_TOOLS = +######################################################################################################################## +#ARCH AMD Linux x86_64, AOCC flang compiler with AOCC clang # serial serial_NO_GRIB2 dmpar dmpar_NO_GRIB2 +# +COMPRESSION_LIBS = CONFIGURE_COMP_L +COMPRESSION_INC = CONFIGURE_COMP_I +FDEFS = CONFIGURE_FDEFS +SFC = flang +SCC = clang +DM_FC = mpifort +DM_CC = mpicc +FC = CONFIGURE_FC +CC = CONFIGURE_CC +LD = $(FC) +FFLAGS = $(FORMAT_FREE) -Ofast -ffast-math -fPIC -Mbyteswapio -Mstack_arrays -funroll-loops -ftree-vectorize -fopenmp -fveclib=AMDLIBM +F77FLAGS = $(FORMAT_FIXED) -Ofast -ffast-math -fPIC -Mbyteswapio -Mstack_arrays -funroll-loops -ftree-vectorize -fopenmp -fveclib=AMDLIBM +FORMAT_FREE = -Mfreeform +FORMAT_FIXED = -Mfixed +FCSUFFIX = +FNGFLAGS = $(FFLAGS) +LDFLAGS = -m64 -Ofast -Mstack_arrays -fopenmp -lomp -Wl,--allow-multiple-definition -Wl,-mllvm -Wl,-enable-loop-reversal -Wl,-mllvm -Wl,-enable-gather -Wl,-mllvm -Wl,-vectorize-non-contiguous-memory-aggressively -lamdlibm +CFLAGS = -w -O3 -fPIC -fopenmp -D_UNDERSCORE +CPP = /usr/bin/cpp -P -traditional +CPPFLAGS = -D_UNDERSCORE -DBYTESWAP -DLINUX -DIO_NETCDF -DIO_BINARY -DIO_GRIB1 -DBIT32 -DNO_SIGNAL CONFIGURE_MPI +ARFLAGS = +RANLIB = llvm-ranlib +CC_TOOLS = + ######################################################################################################################## #ARCH NULL # serial serial_NO_GRIB2 dmpar dmpar_NO_GRIB2 diff --git a/compile b/compile index dfee3b5d..bc323c53 100755 --- a/compile +++ b/compile @@ -2,7 +2,7 @@ if ( ! -e configure.wps ) then echo "Do 'configure' first" - exit ( 1 ) + exit ( 1 ) endif if ( ( ! $?NETCDF ) && ( -d netcdf_links ) ) then @@ -109,6 +109,18 @@ else exit(1) endif +# Build list of final executables that should exist for the selected target. +set expected_exes = ( ) +set count = 1 +foreach f ( $names ) + if ( ( "$NAMES[$count]" == "UTIL" ) || ( "$NAMES[$count]" == "GRIBUTIL" ) ) then + set expected_exes = ( $expected_exes util/${f}.exe ) + else + set expected_exes = ( $expected_exes ${f}.exe ) + endif + @ count ++ +end + # Print out WPS version, system info, and compiler/version echo "============================================================================================== " echo " " @@ -141,26 +153,106 @@ else endif echo " " +set START_OF_COMPILE = `date` +set build_failed = 0 + set count = 1 foreach f ( $names ) + + set exe_path = "" + set link_path = "" + if ("$NAMES[$count]" == "UTIL") then ( cd util ; make -i -r WRF_DIR_PRE="${WRF_DIR_PRE}" DEV_TOP="${DEV_TOP}" TARGET="${f}.exe" CPP_TARGET="$NAMES[$count]" all ) + set exe_path = "util/src/${f}.exe" + set link_path = "util/${f}.exe" else if ("$NAMES[$count]" == "GRIBUTIL") then ( cd ungrib ; make -i -r WRF_DIR_PRE="${WRF_DIR_PRE}" DEV_TOP="${DEV_TOP}" TARGET="${f}.exe" CPP_TARGET="$NAMES[$count]" all ) + set exe_path = "ungrib/src/${f}.exe" + set link_path = "util/${f}.exe" if ( -e ungrib/src/${f}.exe ) then ( cd util ; ln -sf ../ungrib/src/${f}.exe . ) endif else ( cd $f ; make -i -r WRF_DIR_PRE="${WRF_DIR_PRE}" DEV_TOP="${DEV_TOP}" TARGET="${f}.exe" CPP_TARGET="$NAMES[$count]" all ) + set exe_path = "${f}/src/${f}.exe" + set link_path = "${f}.exe" if ( -e ${f}/src/${f}.exe ) then ln -sf ${f}/src/${f}.exe . endif endif + + echo " " + echo "==========================================================================" + echo "build started: ${START_OF_COMPILE}" + echo "build completed:" `date` + echo " " + + if ( -e ${exe_path} && -e ${link_path} ) then + echo "---> ${f}.exe successfully built <---" + echo " " + ls -l ${exe_path} ${link_path} + else + echo "---> Problems building ${f}.exe, look for errors in the build log <---" + echo " " + if ( ! -e ${exe_path} ) then + echo "Missing executable: ${exe_path}" + endif + if ( ! -e ${link_path} ) then + echo "Missing linked executable: ${link_path}" + endif + set build_failed = 1 + endif + + echo " " + echo "==========================================================================" + echo " " + @ count ++ end +echo " " +echo "==========================================================================" +echo "Final WPS executable check" +echo "build started: ${START_OF_COMPILE}" +echo "build completed:" `date` +echo " " + +set final_failed = 0 + +foreach exe ( $expected_exes ) + if ( ! -e ${exe} ) then + set final_failed = 1 + endif +end + +if ( $final_failed == 0 ) then + echo "---> Requested executables successfully built <---" + echo " " + ls -l $expected_exes +else + echo "---> Problems building one or more requested executables, look for errors in the build log <---" + echo " " + foreach exe ( $expected_exes ) + if ( -e ${exe} ) then + ls -l ${exe} + else + echo "Missing executable: ${exe}" + endif + end + set build_failed = 1 +endif + +echo " " +echo "==========================================================================" +echo " " + if ( $temp_netcdf == 1 ) then unsetenv NETCDF endif +if ( $build_failed == 1 ) then + exit(1) +endif + exit(0)