Conversation
Changed treatment of preamble parsing to make it more similar to postamble parsing. It would probably be a good idea to unify the treatment of the three sections. The other option is to change the condition on the #NOWIN section in the postamble, but I'm not sure that works as intended. This way the default is specified before overrides, which is nice.
Mostly names of link libraries, one note about name for whereis/which.
`/usr/bin/peflags.exe --stack-reserve num` works similarly to `ulimit -s num`, except per-executable rather than per-session.
Combine two lines of perl to one, and allow the LIB_EXTERNAL=/LIB_BUNDLED= line to end with a backslash and still be processed sensibly.
These should have been in earlier commits, but I didn't notice them then.
|
How would I exercise the HDF5-fortran dependency? I'd prefer not to build that unless I have some idea how to check that linking to it works, and the tests I was given on the last PR passed fine without it. |
|
I am trying to understand "comments" in these two statements:
Can you give me an example of what this means? |
The only place that we really use HDF5 is when we build the WRF model with netcdf4, and then we can use the HDF5 compression. Since this PR is specifically addressing a Windows implementation, we could probably make the assumption that MASSIVE data sets are not really the focus, and therefore the compression from netcdf4 (via HDF5) would not be all that important. Does that seem reasonable? |
|
That seems reasonable. Out of curiosity, does using HDF5 compression from netCDF4-fortran require the HDF5-Fortran libraries? I would think that netCDF4-Fortran calls netCDF4-C, which in turn calls HDF5-C, requiring
I couldn't figure out how to install Docker, so I installed Windows Subsystem for Linux, which allows running Linux binaries from within Windows, and installed a Debian distribution. I then found the scripts the Docker images were running and called those manually.
I called the same scripts from Cygwin, found that these scripts hard-code build options in the thirties, and changed these to reflect Cygwin having only one compiler. I found that the changes I had made to support Linux builds broke the Cygwin build, and added the sixth commit to get the Cygwin build working again.
The Docker images refer to those mentioned in this comment: |
|
I can successfully compile and run a Fortran program creating a compressed variable in a NetCDF file without -lhdf_fortran. Trying to inspect the file in ncdump results in an HDF5 error, though h5dump has no problems. |
|
@DWesl
|
|
On 1/21/2020 2:24 PM, Dave Gill wrote:
@DWesl
Just for completeness, please verify that the following are true
statements after this PR:
1. The WRF model is now able to be built on a Windows machine using the
cygwin shell emulator.
Yes.
2. The ARW, NMM, and Chemistry components were successfully built and run.
Yes.
|
|
@DWesl |
|
I'm not entirely sure what you mean by "commit message". The only way I know to modify comment messages is to use In case you meant the Was it one of these you meant, or something else entirely? |
|
@DWesl |
|
So is the edit on the first comment enough, or should I add that information to the individual commit messages as well? |
|
@DWesl Click on those three dots on the right, and select "Edit". Change this message (and save it). When we do a squash and merge, the other git-based commit messages will be lost. |
|
What information do you need beyond name and department? |
Nothing - that was my oops. However, please modify / expand the PR message:
|
|
@DWesl Did you encounter such a problem? Any solution? |
|
Odd. I noticed no internal compiler errors when I tried it a year ago. I will attempt to rebuild WRF and check what components are necessary, paying special attention to the radiation schemes. These would be |
|
@DWesl |
|
I probably used whatever was current when I submitted. I am checking with gcc/gfortran 9.2.0, NetCDF-C 4.7.3, NetCDF-Fortran 4.5.2, openmpi 3.1.5, and HDF5 1.10.6. |
|
I see no internal compiler errors in the |
|
Radiation modules seem to be done compiling. The only errors I saw were derived from |
arch/Config.pl
Outdated
|
|
||
| $_ =~ s/CONFIGURE_DEP_LIB_PATH/$sw_dep_lib_path/g ; | ||
|
|
||
| $_ =~ s/CONFIGURE_PERL_PATH/$sw_perl_path/g ; |
There was a problem hiding this comment.
@DWesl
Daniel,
Why do you replicate these 100+ lines of perl? This code already exist from about line 440 through 560.
There was a problem hiding this comment.
Processing preamble. I didn't know what LIB_BUNDLED and LIB_EXTERNAL assumed to be defined, so I just moved everything there.
I'll try paring this down sometime tomorrow. It will likely be next week before I can test dmpar configurations, but I might be able to get to serial and smpar builds before then. I don't remember what I tested the first time through.
There was a problem hiding this comment.
Cleaned to just the variables referenced in LIB_EXTERNAL and LIB_BUNDLED
|
Why do you replicate these 100+ lines of perl? This code already exist
from about line 440 through 560.
Because the bit that already exists only processes the postamble, not
the preamble.
I needed to move LIB_EXTERNAL and LIB_BUNDLED from the postamble to the
preamble
so that I could actually affect those variables in the section copied
from arch/configure.defaults
without having them overwritten, and having the code still compile on
platforms other
than Cygwin requires those variables to be defined somewhere, which then
requires the
#NOWIN ...
blocks to be processed. I don't know how much of this processing is
needed for the preamble
and how much could be removed from the postamble. I could probably try
to pare the duplication
down until the output of configure looks normal.
|
|
@DWesl |
|
I just remembered there was a problem with equivalence statements on Cygwin GCC 7.4, which I filed with GCC here: What isn't compiling still? So far I haven't run into anything big. |
Daniel, |
|
@DWesl |
|
Okay. I will pare down the changes to |
I moved the #NOWIN sections from the postamble to the preamble, and copied the whole postamble processing section to match it. This removes the sections not needed to process the #NOWIN section of the preamble. The #NOWWIN sections set LIB_EXTERNAL and LIB_BUNDLED.

TYPE: enhancement
KEYWORDS: compilation, cygwin, new platform, build system
SOURCE: Daniel Wesloh (The Pennsylvania State University Department of Meteorology and Atmospheric Science)
DESCRIPTION OF CHANGES:
The WRF compilation script did not support compiling on Cygwin.
#911 added support for that compilation, and generated feedback to
ensure those changes did not break compilation on other platforms.
This PR incorporates those suggestions and the changes required by them.
I moved the
LIB_BUNDLEDandLIB_EXTERNALdefault definitions from theconfigure.wrfpostamble to the preamble so I could override them inconfigure.defaultson non-Windows platforms. This required copying the processing of the postamble inarch/Config.plto where it processed the preamble so that the variables used in the definitions ofLIB_BUNDLEDandLIB_EXTERNALwould still be substituded.One additional change was necessary: the system version of libjasper on cygwin is recent enough that
struct jas_image_thas noinmem_member, so that the reference toinmem_must be commented out for Grib2 support to work. I did not include that change here as that is related to the version of the Jasper library on all platforms, not just cygwin.Dependency versions for current test:
$ cygcheck -c cygwin gcc-core gcc-fortran libnetcdf-devel libnetcdf-fortran-devel openmpi libjasper-devel perl tcsh libhdf5-devel libopenmpi-devel openmpi $(cygcheck -cd | awk $'/libnetcdf[0-9]/ {print $1;}\n/libhdf5_[0-9]/ {print $1;}\n/libopenmpiusef08_[0-9]/ {print $1;}\n/libgomp[0-9]/ {print $1;}\n/libgfortran[0-9]/ {print $1;}\n/libjasper[0-9]/ {print $1;}\n/libnetcdf-fortran_[0-9]/ {print $1;}') Cygwin Package Information Package Version Status cygwin 3.1.2-1 OK gcc-core 9.2.0-1 OK gcc-fortran 9.2.0-1 OK libgfortran3 6.4.0-5 OK libgfortran4 7.4.0-1 OK libgfortran5 9.2.0-1 OK libgomp1 9.2.0-1 OK libhdf5-devel 1.10.6-1 OK libhdf5_10 1.8.20-1 OK libhdf5_101 1.10.2-1 OK libhdf5_103 1.10.6-1 OK libjasper-devel 2.0.14-1 OK libjasper1 1.900.22-1 OK libjasper4 2.0.14-1 OK libnetcdf-devel 4.7.3-1 OK libnetcdf-fortran-devel 4.5.2-1.1 OK libnetcdf-fortran_6 4.4.4-3 OK libnetcdf-fortran_7 4.5.2-1.1 OK libnetcdf11 4.4.1.1-1 OK libnetcdf13 4.6.1-2 OK libnetcdf15 4.7.3-1 OK libopenmpi-devel 3.1.5-1 OK libopenmpiusef08_11 1.10.7-1 OK libopenmpiusef08_40 3.1.5-1 OK openmpi 3.1.5-1 OK perl 5.26.3-2 OK tcsh 6.22.01-1 OKISSUE:
Replaces #911
LIST OF MODIFIED FILES:
M README
M arch/Config.pl
M arch/configure.defaults
M arch/postamble
M arch/preamble
M configure
M doc/README.cygwin.md
M external/io_netcdf/makefile
M tools/Makefile
TESTS CONDUCTED:
I used the script at
https://github.com/davegill/wrf-coop/blob/master/build.csh
to build and run WRF-ARW, WRF-NMM, and WRF-Chem on Windows Subsystem for Linux (debian) and on Cygwin.
The build script does not consistently work, but running the indicated commands manually usually works fine.
A regression test is successful, but an intermediate branch was required to circumvent
a broken develop branch (from which this is based).
RELEASE NOTE: Introduce a Windows-based WRF build and run via the free Unix-like CYGWIN environment.