[Nexus-developers] Autoconf

Akeroyd, FA (Freddie) F.A.Akeroyd at rl.ac.uk
Tue Feb 17 17:57:27 GMT 2004


Ray,

Darwin may or may not need to be a special case. autoconf works by running a
series of tests to determine things about the system - there is a mechanism
for you to create your own tests and some built in ones (though these mainly
Determine the existence of library functions/headers rather than the
behaviour of compilers etc.) If the test you want to do has not been
written, it is often easier to treat the specific operating system/product
as a special case. For example, it is very easy to write a test to check if
"-no-cpp-precomp" is a valid compiler option; harder to write one that as
well as checking it was a valid option also checked that this option did
what you wanted. However, I expect in our case "use -no-cpp-precomp whenever
it is a valid compiler option" would suffice and we would not need to check
for the name/operating system we are running on. Autoconf makes writing
tests easier, but unfortunately doesn't solve everything for you ...
To automatically determine if "-p" was the option you need to specify a f90
module search path I would need to write a test that tried to compile a
fortran module and went through a list of possible compiler options until it
found one that worked ... is -p universally used? If so all we need to do is
check it is a valid option etc. and not what it actually does

Napi.h could be simplified, but it would then be "platform specific" i.e. we
would ship a "napi.h.in" from which autoconf would build a "napi.h" for the
system NeXus was being installed on; users could not use this napi.h on
another architecture. Is that OK? We could go halfway - leave napi.h in a
"cleaner" way and get "napi.h" to include an "nxconfig.h" file (generated
from nxconfig.h.in) which contains the operating system dependent bits and
Funny macros; two files, but maybe clearer?   

All I could find on H5F_CLOSE_STRONG is that it is new in HDF5 version 1.6.0
- I'm afraid I haven't build with HDF5 myself yet so can't say any further.
I'll put back a modified configure with hopefully a fix for -p and the cpp
and await any comments on "nxconfig.h.in" or "napi.h.in"

Regards,

Freddie  

-----Original Message-----
From: nexus-developers-bounces at anl.gov
[mailto:nexus-developers-bounces at anl.gov] On Behalf Of Ray Osborn
Sent: 10 February 2004 23:05
To: Nexus-Developers (E-mail)
Subject: [Nexus-developers] Autoconf

Freddie,
Many thanks for getting the autoconf working.  I particularly appreciated
that you inserted some Mac OS X compilation switches for the Darwin
platform, which means that it worked out of the box, at least for HDF4.
However, I guess that begs the question:

Do we need to install all these switches into "configure.ac" for every
compiler/operating system combo, or is Darwin a special case?  For example,
it is now well-known that most ported unix programs need to be compiled with
-no-cpp-precomp on Darwin.  Now that Darwin is getting integrated into
autoconf, I wonder if autoconf might have a way of inserting it
automatically.  Otherwise, we will have to tweak "configure.ac" for every
operating system, and I thought that autoconf was meant to make that
unnecessary.

The other switches are all to do with the Fortran bindings.  Is there a way
of simplifying the napi.h now that we are using autoconf so that we don't
need so many ifdefs in the Fortran name mangling.  The -D__unix switch for
Darwin is only necessary so that napi.h treats Mac OS X as unix, so if
napi.h were to be simplified, another Darwin-specific flag might be
unnecessary.  

There is a problem with the makefiles in applications/ and test/ because
they don't find the Fortran 90 modules in bindings/f90.  For the Absoft
compiler, we need to add a -p../bindings/f90 flag, at least to those
makefiles.  Is that easy to do?  If I add it to "configure.ac", I presume
that it would attempt to use the flag in creating the F90 library itself,
and might get the wrong path.

Finally, I was only able to install the HDF4 version because the HDF5 build
failed with

napi5.c: In function `NX5open':
napi5.c:196: warning: passing arg 3 of `H5Pget_cache' from incompatible
pointer type
napi5.c:204: error: `H5F_CLOSE_STRONG' undeclared (first use in this
function)
napi5.c:204: error: (Each undeclared identifier is reported only once
napi5.c:204: error: for each function it appears in.)

Do any of the developers know why I get this error?

Thanks again, Freddie.  I think the NeXus distribution looks a lot more
professional already.

Regards,
Ray  
-- 
Dr Ray Osborn                Tel: +1 (630) 252-9011
Materials Science Division   Fax: +1 (630) 252-7777
Argonne National Laboratory  E-mail: ROsborn at anl.gov
Argonne, IL 60439-4845


_______________________________________________
NeXus-developers mailing list
NeXus-developers at anl.gov
http://www.neutron.anl.gov/mailman/listinfo/nexus-developers




More information about the NeXus-developers mailing list