diff --git a/model/bin/cmplr.env b/model/bin/cmplr.env index 67d50e94e9..656d250c05 100644 --- a/model/bin/cmplr.env +++ b/model/bin/cmplr.env @@ -9,13 +9,14 @@ # # # use : cmplr.env cmplr # # # -# cmplr : keyword based on a value and optional suffix and prefix # +# cmplr : keyword based on a value and optional suffix, prefix and extras # # # # value : mpt / intel / gnu / pgi # # suffix : _debug # # prefix : zeus_ / datarmor_ # +# extras : so_ # # # -# - examples : intel / pgi_debug / datarmor_mpt_debug # +# - examples : intel / pgi_debug / datarmor_mpt_debug / so_intel # # # # remarks : # # # @@ -98,6 +99,7 @@ fi ############################### if [ "$cmplr" == "intel" ] || [ "$cmplr" == "intel_debug" ] || \ + [ "$cmplr" == "so_intel" ] || [ "$cmplr" == "so_intel_debug" ] || \ [ "$cmplr" == "zeus_intel" ] || [ "$cmplr" == "zeus_intel_debug" ] || \ [ "$cmplr" == "datarmor_intel" ] || [ "$cmplr" == "datarmor_intel_debug" ] ; then @@ -149,17 +151,20 @@ if [ "$cmplr" == "intel" ] || [ "$cmplr" == "intel_debug" ] || \ optc="$optc -xhost" optl="$optl -xhost" fi + + if [ ! -z "$(echo $cmplr | grep so)" ] ; then + optc="$optc -fPIC" + optl='-o $prog -p -g' + fi fi - - - ############################### # GNU # ############################### if [ "$cmplr" == "gnu" ] || [ "$cmplr" == "gnu_debug" ] || \ + [ "$cmplr" == "so_gnu" ] || [ "$cmplr" == "so_gnu_debug" ] || \ [ "$cmplr" == "zeus_gnu" ] || [ "$cmplr" == "zeus_gnu_debug" ] || \ [ "$cmplr" == "datarmor_gnu" ] || [ "$cmplr" == "datarmor_gnu_debug" ] ; then @@ -209,11 +214,11 @@ if [ "$cmplr" == "gnu" ] || [ "$cmplr" == "gnu_debug" ] || \ optl="$optl -march=native" fi + if [ ! -z "$(echo $cmplr | grep so)" ] ; then + optc="$optc -fPIC" + fi fi - - - ############################### # PGI # ############################### diff --git a/model/bin/comp.Intel b/model/bin/comp.Intel index fa8ffd4334..5491ecb560 100755 --- a/model/bin/comp.Intel +++ b/model/bin/comp.Intel @@ -77,7 +77,7 @@ # # Intel compiler on Linux ---------------------------------------------------- # 2.b.1 Build options and determine compiler name - + opt="-c $list -O3 -assume byterecl -ip -module $path_m" # opt="-c $list -O3 -assume byterecl -xSSE4.2 -ip -module $path_m" # opt="-c $list -O3 -assume byterecl -prec-div -prec-sqrt -xHost -align array128byte -ip -module $path_m" diff --git a/model/bin/make_makefile.sh b/model/bin/make_makefile.sh index 0afcd54065..2038dcb971 100755 --- a/model/bin/make_makefile.sh +++ b/model/bin/make_makefile.sh @@ -851,6 +851,7 @@ ww3_ounp ww3_gspl ww3_gint ww3_bound ww3_bounc ww3_systrk $tideprog" progs="$progs ww3_multi_esmf ww3_uprstr" progs="$progs libww3" + progs="$progs libww3.so" for prog in $progs do @@ -1059,6 +1060,13 @@ source="w3triamd w3srcemd $dsx $flx $ln $st $nl $bt $ic $is $db $tr $bs $xx $refcode $igcode $uostmd" IO='w3iogrmd w3iogomd w3iopomd w3iotrmd w3iorsmd w3iobcmd w3iosfmd w3partmd' aux="constants w3servmd w3timemd $tidecode w3arrymd w3dispmd w3cspcmd w3gsrumd" ;; + libww3.so) IDstring='Object file archive' + core='w3fldsmd w3initmd w3wavemd w3wdasmd w3updtmd' + data='wmmdatmd w3gdatmd w3wdatmd w3adatmd w3idatmd w3odatmd' + prop="$pr" + source="w3triamd w3srcemd $dsx $flx $ln $st $nl $bt $ic $is $db $tr $bs $xx $refcode $igcode $uostmd" + IO='w3iogrmd w3iogomd w3iopomd w3iotrmd w3iorsmd w3iobcmd w3iosfmd w3partmd' + aux="constants w3servmd w3timemd $tidecode w3arrymd w3dispmd w3cspcmd w3gsrumd" ;; ww3_uprstr) IDstring='Update Restart File' core= data='wmmdatmd w3triamd w3gdatmd w3wdatmd w3adatmd w3idatmd w3odatmd' @@ -1078,7 +1086,7 @@ filesl="$data $core $prop $source $IO $aux" # if program name is libww3, then # the target is compile and create archive - elif [ "$prog" = "libww3" ] + elif [ "$prog" = "libww3" ] || [ "$prog" = "libww3.so" ] then d_string="$prog"' : $(aPo)/' files="$aux $core $data $prop $source $IO" @@ -1123,6 +1131,19 @@ done echo " @cd \$(aPo); $ar_cmd $lib $objs" >> makefile echo ' ' >> makefile + # if program name is libww3.so, then + # the target is compile and create archive + elif [ "$prog" = "libww3.so" ] + then + lib=$prog + objs="" + for file in $filesl + do + objs="$objs $file.o" + done + echo " @cd \$(aPo); ld -o $lib -shared $objs" >> makefile + echo ' ' >> makefile + else echo ' @$(aPb)/link '"$filesl" >> makefile echo ' ' >> makefile diff --git a/model/bin/w3_automake b/model/bin/w3_automake index dc80435e01..ae312067b9 100755 --- a/model/bin/w3_automake +++ b/model/bin/w3_automake @@ -192,6 +192,12 @@ reg_programs="$reg_programs ww3_gspl" fi + if [ -n "`grep -nri fPIC $comp_file`" ] + then + reg_programs="$reg_programs libww3.so" + else + echo 'Shared Object : No' + fi # 1.f sort sequential and parallel programs - - - - - - - - - - - - - - - - - - diff --git a/model/bin/w3_make b/model/bin/w3_make index f2727ea8ae..153da7be7a 100755 --- a/model/bin/w3_make +++ b/model/bin/w3_make @@ -220,6 +220,13 @@ reg_programs="$reg_programs ww3_shel" fi + if [ -n "`grep -nri fPIC $comp_file`" ] + then + reg_programs="$reg_programs libww3.so" + else + echo 'Shared Object : No' + fi + # if no progs in argument if [ -z "$all_programs" ] then @@ -662,6 +669,9 @@ EOF # if program name is libww3, then # the target is compile and create archive elif [ "$prog" = "libww3" ] + then + target="$prog" + elif [ "$prog" = "libww3.so" ] then target="$prog" else diff --git a/model/bin/w3_setup b/model/bin/w3_setup index 78df92a680..bf5cde5d8c 100755 --- a/model/bin/w3_setup +++ b/model/bin/w3_setup @@ -412,9 +412,11 @@ then [ "$cmplr" == "zeus_mpt" ] || [ "$cmplr" == "zeus_mpt_debug" ] || \ [ "$cmplr" == "datarmor_mpt" ] || [ "$cmplr" == "datarmor_mpt_debug" ] || \ [ "$cmplr" == "intel" ] || [ "$cmplr" == "intel_debug" ] || \ + [ "$cmplr" == "so_intel" ] || [ "$cmplr" == "so_intel_debug" ] || \ [ "$cmplr" == "zeus_intel" ] || [ "$cmplr" == "zeus_intel_debug" ] || \ [ "$cmplr" == "datarmor_intel" ] || [ "$cmplr" == "datarmor_intel_debug" ] || \ [ "$cmplr" == "gnu" ] || [ "$cmplr" == "gnu_debug" ] || \ + [ "$cmplr" == "so_gnu" ] || [ "$cmplr" == "so_gnu_debug" ] || \ [ "$cmplr" == "zeus_gnu" ] || [ "$cmplr" == "zeus_gnu_debug" ] || \ [ "$cmplr" == "datarmor_gnu" ] || [ "$cmplr" == "datarmor_gnu_debug" ] || \ [ "$cmplr" == "pgi" ] || [ "$cmplr" == "pgi_debug" ] || \ @@ -422,7 +424,7 @@ then [ "$cmplr" == "datarmor_pgi" ] || [ "$cmplr" == "datarmor_pgi_debug" ] ; then source $path_b/cmplr.env sed -e "s//$optc/" -e "s//$comp_seq/" -e "s//$comp_mpi/" $path_b/comp.tmpl > $path_b/comp - echo " sed $path_b/comp.tmpl => $path_b/comp" + echo " sed $path_b/comp.tmpl => $path_b/comp" else errmsg "$path_b/comp.$cmplr not found" exit 1 @@ -436,9 +438,11 @@ then [ "$cmplr" == "zeus_mpt" ] || [ "$cmplr" == "zeus_mpt_debug" ] || \ [ "$cmplr" == "datarmor_mpt" ] || [ "$cmplr" == "datarmor_mpt_debug" ] || \ [ "$cmplr" == "intel" ] || [ "$cmplr" == "intel_debug" ] || \ + [ "$cmplr" == "so_intel" ] || [ "$cmplr" == "so_intel_debug" ] || \ [ "$cmplr" == "zeus_intel" ] || [ "$cmplr" == "zeus_intel_debug" ] || \ [ "$cmplr" == "datarmor_intel" ] || [ "$cmplr" == "datarmor_intel_debug" ] || \ [ "$cmplr" == "gnu" ] || [ "$cmplr" == "gnu_debug" ] || \ + [ "$cmplr" == "so_gnu" ] || [ "$cmplr" == "so_gnu_debug" ] || \ [ "$cmplr" == "zeus_gnu" ] || [ "$cmplr" == "zeus_gnu_debug" ] || \ [ "$cmplr" == "datarmor_gnu" ] || [ "$cmplr" == "datarmor_gnu_debug" ] || \ [ "$cmplr" == "pgi" ] || [ "$cmplr" == "pgi_debug" ] || \ @@ -453,7 +457,6 @@ then fi chmod 775 $path_b/comp $path_b/link fi - # 3.d Setup switch file if [ $swtch ] then diff --git a/model/bin/ww3_from_ftp.sh b/model/bin/ww3_from_ftp.sh index 6630a5c977..33daa927ee 100755 --- a/model/bin/ww3_from_ftp.sh +++ b/model/bin/ww3_from_ftp.sh @@ -23,7 +23,7 @@ wget ftp://polar.ncep.noaa.gov/tempor/ww3ftp/ww3_from_ftp.v6.07.tar.gz tar -xvzf ww3_from_ftp.v6.07.tar.gz #Move regtest info from data_regtests to regtests: -echo -e "Moving data from data_regtests to regtets" +echo -e "Moving data from data_regtests to regtests" cp -r data_regtests/ww3_tp2.15/input/*.nc regtests/ww3_tp2.15/input/ cp -r data_regtests/ww3_tp2.13/*.png regtests/ww3_tp2.13/ cp -r data_regtests/ww3_tic1.4/input/*.nc regtests/ww3_tic1.4/input/ @@ -53,7 +53,7 @@ else echo -e ' Not deleting tar file.' fi -echo -e "\n\n Files were copied from the data_regtests to the regtets folder." +echo -e "\n\n Files were copied from the data_regtests to the regtests folder." echo -e "Do you want to delete the data_regtests folder? [y|n]: " read wnew2 if [ "${wnew2}" = "Y" ] || [ "${wnew2}" = "y" ]