Dave Allured wrote:
Dave Allured wrote:
Ed Hartnett wrote:
Dave Allured <dave.allured@xxxxxxxx> writes:
Netcdf support,
We have run into a minor problem with the Netcdf 3.6.3 configure
script. When building the Fortran 90 API from source on a *case
insensitive* file system, module files netcdf.MOD and typesizes.MOD
are generated with uppercase file name extensions. This is
mysterious, because the standard lowercase file names would work
equally well *on the same computer*.
Actually the file system is quirky. Mac OS X 10.4 and 5. On a
so-called case insensitive file system, upper and lower case are
*written* on disk, but the names are case insensitive only on read
back when *opening* files.
This causes trouble with Fortran compilers on *case sensitive*
computers elsewhere on our local network. They can't find the
module files unless the extensions are made lower case. The
compilers see the network drives as case sensitive, due to the way
the network transports file names. (Yes indeed, this might also be
considered a bug.)
Our workaround was to hack the configure script and force a
conditional to make lower case. Since we are using an automatic
library maintenance system, we needed something more persistent than
manually renaming the two files. (We tried that once, and the
automatic system helpfully gave us back the uppercase file names the
next morning.)
What is the "right" way to control whether Netcdf module file
extensions are upper or lower case? I did not find anything like
this in the 3.6.3 configure options or the installation and
troubleshooting guides.
Would you be able to change the distribution scripts to be more
restrictive about generating upper case module extensions? Such as
making upper case *only* for the platforms that require this?
Howdy Dave!
Do you mean it capitalizes the filename, or the filename extension?
For example, on some of my test machines, I get TYPESIZES.mod, and on
others typesizes.mod. But the "mod" is always lower-case for me.
In any case, this is something beyond the control of the configure
script. The configure script just checks to see what the fortran
compiler produces, and uses that. From the configure output:
checking if Fortran 90 compiler capitalizes .mod filenames... no
Are there any command line options with g95 and gfortran to control
this? I can't find any.
So I am a bit stumped. I don't know how to control the names of .mod
files from fortran compilers.
Sorry,
Ed
Ed,
On the case-insensitive Mac OS computer, the Netcdf build under Fink
makes the module file names lower.UPPER: netcdf.MOD and so on. Odd
that you have scenarios that get the exact reverse of this.
I have no idea what is causing this. I compiled a trivial test case
with gfortran on the same platform, and got all lower case, e.g.
module.mod. This is not consistent with the automatic build. A
quick check of the gfortran bug reports did not come up with
anything about uppercase .MOD.
I was mistaken in my initial message. We did not hack the Netcdf
configure script. Instead we changed the installer script to rename
the module files after the Netcdf build. netcdf.MOD to netcdf.mod,
same for typesizes.MOD. Each rename must be done in two stages to
avoid "same file name" errors.
FYI the installer for Mac OS is Fink, and the local script that was
actually changed was netcdf-gfortran.info.
I need to investigate more deeply into how the uppercase names are
generated, and get back to you. Any further insights would be welcome.
--Dave
Darn, faulty memory, more misinformation. Sorry.
It *was* the first part of the file names that was made uppercase,
not the last part. So there never were any *.MOD files.
Here are the actual renames that I just got from the installer
script netcdf-gfortran.info. This is what we added to make our
installation work.
mv -f NETCDF.mod ncdf.mod
mv -f ncdf.mod netcdf.mod
mv -f TYPESIZES.mod typ.mod
mv -f typ.mod typesizes.mod
Everything else I said still applies. I will look into this more a
little later.
--Dave
Ed,
Here is a related problem in the Netcdf 3.6.3 configure script.
Under "checking if Fortran 90 compiler capitalizes .mod filenames":
if test -f CONFTEST.mod ; then
ac_cv_prog_f90_uppercase_mod=yes
my test case returns True when it should be False. This is because
the case insensitivity affects this usage. At this point, gfortran
had actually made conftest.mod with the correct lower case file name.
g5s2:/tmp/dallured/copy-debug 121> ls -l conftest* CONFTEST*
-rw-r--r-- 1 dallured wheel 52 Oct 7 11:26 conftest.f90
-rw-r--r-- 1 dallured wheel 420 Oct 7 11:26 conftest.mod
How about something like this instead:
if `ls -1 conftest.mod` = CONFTEST.mod ; then
Now this may or may not be the root of the final problem. I suspect
that gfortran is actually making correct lowercase module file
names, but something later in make or install is changing them. I
did not track it down that far. What do you think?
--Dave