Skip to content

Commit d0883ed

Browse files
wwlwpdoodler577
andauthored
fix so wgrib2 can compile with chosen compiler (#1449)
Issue 1428: * pinning to a known working version of PDL * fixing wgrib2 on QBC * added back some envars that ended up being needed; added OpenMP flags which I realized were supported * found version 3.1.2 works with 'oneapi_linux' * added cleaning up back in Resolves #1428. --------- Co-authored-by: oodler577 <oodler@cpan.org>
1 parent aeb708d commit d0883ed

File tree

4 files changed

+38
-27
lines changed

4 files changed

+38
-27
lines changed

cloud/general/asgs-brew.pl

+1-1
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,7 @@ sub get_steps {
827827
name => q{Step for wgrib2},
828828
description => q{Downloads and builds wgrib2 on all platforms for ASGS. Note: gfortran is required, so any compiler option passed is overridden.},
829829
pwd => qq{$scriptdir},
830-
command => qq{bash init-wgrib2.sh $asgs_install_path gfortran},
830+
command => qq{bash init-wgrib2.sh $asgs_install_path $asgs_compiler},
831831
clean => qq{bash init-wgrib2.sh $asgs_install_path clean},
832832
skip_if => sub { my ( $op, $opts_ref ) = @_; return -e qq{./bin/wgrib2}; },
833833
precondition_check => sub { 1 },

cloud/general/init-perl-data-language.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ if [[ "$COMPILER" == "clean" || "$COMPILER" == "rebuild" ]]; then
1212
fi
1313
fi
1414

15-
cpanm --verbose PDL
15+
cpanm --verbose PDL@2.099

cloud/general/init-wgrib2.sh

100644100755
+26-13
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,46 @@
33
OPT=${1:-$ASGS_INSTALL_PATH}
44
COMPILER=${2:-intel}
55

6-
VERSION=-3.1.1
6+
VERSION=3.1.2
77

88
if [ $COMPILER == "clean" ]; then
99
make clean
1010
rm -rfv grib2
11-
rm -fv wgrib2${VERSION}.tgz
11+
rm -fv wgrib2-${VERSION}.tgz
1212
exit
1313
fi
1414

1515
pushd $SCRIPTDIR
1616

17-
export COMP_SYS=gnu_linux
18-
export CC=gcc
19-
export FC=gfortran
20-
export CXX=g++
21-
2217
if [ ! -e wgrib2${VERSION}.tgz ]; then
23-
wget https://asgs-static-assets.sfo2.digitaloceanspaces.com/lib/wgrib2${VERSION}.tgz
18+
#wget https://asgs-static-assets.sfo2.digitaloceanspaces.com/lib/wgrib2-${VERSION}.tgz -O wgrib2-${VERSION}.tgz
19+
wget https://ftp.cpc.ncep.noaa.gov/wd51we/wgrib2/wgrib2.tgz.v${VERSION} -O wgrib2-${VERSION}.tgz
20+
fi
21+
22+
rm -rf grib2 > /dev/null 2>&1
23+
tar zxvf wgrib2-${VERSION}.tgz
24+
25+
if [ "$compiler" == "intel" ]; then
26+
CC=gcc
27+
FC=gfortran
28+
COMP_SYS=gnu_linux
29+
fi
30+
if [ "$compiler" == "intel" ]; then
31+
CC=icc
32+
FC=ifort
33+
COMP_SYS=intel_linux
34+
fi
35+
if [ "$compiler" == "intel-oneapi" ]; then
36+
CC=icx
37+
FC=ifx
38+
COMP_SYS=oneapi_linux
2439
fi
2540

26-
rm -rf grib2
27-
tar zxvf wgrib2${VERSION}.tgz
41+
make -j 1 NETCDFPATH=$OPT NETCDF=enable NETCDF4=enable NETCDF4_COMPRESSION=enable MACHINE_NAME=$ASGS_MACHINE_NAME compiler=$COMPILER
2842

29-
make -j 1 NETCDFPATH=$asgs_install_path NETCDF=enable NETCDF4=enable NETCDF4_COMPRESSION=enable MACHINE_NAME=$asgs_machine_name compiler=gfortran
30-
cp $SCRIPTDIR/grib2/wgrib2/wgrib2 $SCRIPTDIR/bin
43+
cp $SCRIPTDIR/grib2/wgrib2/wgrib2 $SCRIPTDIR/bin > /dev/null 2>&1
3144

3245
rm -rfv grib2
33-
rm -fv wgrib2${VERSION}.tgz
46+
rm -fv wgrib2-${VERSION}.tgz
3447

3548
popd

makefile

+10-12
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,15 @@
2424
#
2525
# specify compiler=gfortran on the make command line
2626

27+
$(info Compiler: $(compiler))
28+
29+
export OMP_NUM_THREADS=4
30+
2731
ifeq ($(compiler),gfortran)
2832
export FC := gfortran
2933
export CC := gcc
3034
export COMP_SYS := gnu_linux
31-
FFLAGS := -ffree-line-length-none -ffixed-line-length-none
35+
FFLAGS := -ffree-line-length-none -ffixed-line-length-none -fopenmp
3236
ifeq ($(DEBUG),full)
3337
FFLAGS := -cpp -ffree-line-length-none -g -O0 -fbacktrace -fbounds-check -ffpe-trap=zero,invalid,underflow,overflow,denormal #-Wall
3438
endif
@@ -39,7 +43,7 @@ ifeq ($(compiler),intel)
3943
export FC := ifort
4044
export CC := icc
4145
export COMP_SYS := intel_linux
42-
FFLAGS := -132
46+
FFLAGS := -132 -qopenmp
4347
ifeq ($(DEBUG),full)
4448
FFLAGS := -g -O0 -fpp -traceback -debug -check all
4549
endif
@@ -49,20 +53,14 @@ ifeq ($(compiler),intel-oneapi)
4953
export FC := ifx
5054
export CC := icx
5155
export COMP_SYS := oneapi_linux
52-
FFLAGS := -132
53-
ifeq ($(DEBUG),full)
54-
FFLAGS := -g -O0 -fpp -traceback -debug -check all
55-
endif
56-
endif
57-
ifeq ($(compiler),intel-oneapi)
58-
export FC := ifort
59-
export CC := icx
60-
export COMP_SYS := intel_linux
61-
FFLAGS := -132
56+
FFLAGS := -132 -qopenmp
6257
ifeq ($(DEBUG),full)
6358
FFLAGS := -g -O0 -fpp -traceback -debug -check all
6459
endif
6560
endif
61+
62+
$(info FC: $(FC))
63+
6664
#
6765
INCLUDES :=
6866
#

0 commit comments

Comments
 (0)