[Nexus-developers] NeXus Makefiles

Akeroyd, FA (Freddie) F.A.Akeroyd at rl.ac.uk
Wed Oct 29 15:42:22 GMT 2003


I think the way round the problem is to have libNeXusF77
include the fortran bindings + the nexus library, but with the
entry points for the nexus library "mangled" in the F77 version so that
linking/loading e.g. libNeXusF77 and libNeXus would not result in multiply
defined symbols, 
but libNeXusF77 would be sufficient in its own right. This could be
acomplished by
appropriate #defines in the napi.h header - long live the C preprocessor :-)

I can't remember all of portinfo, but didn't you just have a separate extra
header
file containing architecture dependent bits? If so, I think configure can do
this - I 
know it can automatically sense the architecture and then it could include a
configuration
file appropriate for the architecture it is run on as well as setting up
other things.  
I'm sure I've seen GCC do something like this during a build. The simplest
way to do
it would be to have configure take "napi.h.in", preprocess + insert e.g.
napi_linux.h
to give a Linux specific "napi.h"; however this napi.h could not be shipped
to 
another architecture. 

Regards,

Freddie

> -----Original Message-----
> From: Ray Osborn [mailto:ROsborn at anl.gov]
> Sent: 28 October 2003 17:34
> To: Nexus-Developers (E-mail)
> Subject: [Nexus-developers] NeXus Makefiles
> 
> 
> Firstly, let me say that I support the autoconf route just 
> for compatibility
> with the rest of the open source world.  People are used to 
> ./configure,
> make install etc., and it would make NeXus seem less of a 
> hack.  I certainly
> thought that Michael Aivazis' portinfo solution was more 
> elegant than the
> autoconf implementations that I have seen, because I feel 
> uncomfortable
> having to put in more complex ifdefs into the main header 
> file.  If I need
> to make changes in order to get the NeXus library to run on the latest
> version of Mac OS X, I don't want to risk breaking every 
> other version by
> putting in the wrong ifdefs.  However, we don't have the resources to
> maintain a portinfo library ourselves, so, unless Michael's 
> scheme gets
> adopted more widely, it may be a dangerous route.
> 
> Is there some way we can get the best of both worlds, i.e., 
> allow autoconf
> to worry about keeping up to date with major operating system 
> changes, but
> encapsulating potential operating system vagaries in, e.g., a separate
> header file?  
> 
> I support the idea of having separate libraries for the C, 
> F77, and F90
> versions, although I had hoped that they could be standalone, 
> i.e., you
> would only link to libnexus.a in C, libnexusf77.a in F77 etc. 
>  In other
> words, it would be good if the entire NeXus library were in 
> each, and name
> mangling would only be necessary for the Fortran versions.  
> However, if this
> could break NeXus implementation in more complex 
> applications, then I can
> accept Freddie's solution.
> 
> 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