[mpas-developers] Fwd: Building MPAS with external libraries

Michael Duda duda at ucar.edu
Mon May 7 15:34:32 MDT 2012


Agreed -- these changes would be generally useful!

Michael


On Mon, May 07, 2012 at 02:03:39PM -0600, Doug Jacobsen wrote:
> Personally, I think this change would be welcome. It would make it much
> easier to test external libraries without having to hard code the Makefile.
> 
> Doug
> 
> On Mon, May 7, 2012 at 1:43 PM, Hoffman, Matthew J <mhoffman at lanl.gov>wrote:
> 
> > Hi Everyone,
> >
> > Since I have not heard any comments back on my proposal to modify the MPAS
> > build system to support external libraries, I will make the commit tomorrow.
> >
> > Cheers,
> > Matt
> >
> >
> > Begin forwarded message:
> >
> > > Date: May 1, 2012 9:05:59 AM MDT
> > > To: <mpas-developers at ucar.edu>
> > > Subject: Building MPAS with external libraries
> > >
> > > Hi Everyone,
> > >
> > > As you may have noticed, the land ice core is being actively developed
> > in a branch, and we will be thinking about merging our branch into the
> > trunk relatively soon (weeks to months).  The land ice core includes
> > options to use external libraries to solve higher-order approximations of
> > the ice sheet momentum balance.  These libraries are part of the LifeV
> > project (http://www.lifev.org/) and are written in C++ by researchers at
> > Florida State University, University of South Carolina, and the Chinese
> > Academy of Sciences (primarily Mauro Perego and Wei Leng).
> > >
> > > Leveraging the work of these other groups has allowed us to make rapid
> > progress on developing the land ice core. However, including the external
> > libraries will require modifying the build system of MPAS, and I am writing
> > to propose a modification to the existing build system to allow this.  We
> > recognize that the modification cannot be core-specific and should be
> > extensible to other situations.
> > >
> > > The external libraries need to be linked when the land_ice_model.exe
> > executable is built in src/Makefile on line 6:
> > > 6         $(FC) $(LDFLAGS) -o $(CORE)_model.exe driver/*.o -L. -ldycore
> > -lops -lframework $(LIBS) -I./external/esmf_time_f90
> > -L./external/esmf_time_f90 -lesmf_time
> > > Therefore, the specification of the needed external libraries cannot be
> > confined to the Makefile in src/core_land_ice.
> > >
> > > My proposal (with some consultation from Doug) is to allow the root
> > Makefile to accept an optional command-line argument (or environment
> > variable) called MPAS_EXTERNAL_LIBS.  If this variable is specified, then
> > those external libraries will be provided for linking (recursively to
> > src/Makefile); if the variable is absent, the build process remains
> > unchanged.  Specifically, this would be implemented by adding the following
> > code in the root Makefile (e.g. after the check for NetCDF 4 occurs and
> > before the definition of 'all' at line 273):
> > >
> > > ####################################################
> > > # Section for adding external libraries and includes
> > > ####################################################
> > > ifdef MPAS_EXTERNAL_LIBS
> > >   LIBS += $(MPAS_EXTERNAL_LIBS)
> > > endif
> > > ifdef MPAS_EXTERNAL_INCLUDES
> > >   CPPINCLUDES += $(MPAS_EXTERNAL_INCLUDES)
> > >   FCINCLUDES += $(MPAS_EXTERNAL_INCLUDES)
> > > endif
> > > ####################################################
> > >
> > >
> > > In our situation we do not need external includes, but I have added that
> > for completeness.  I have implemented this in the root Makefile in our
> > branch, and it suits our needs.  This approach is extensible - for example,
> > LifeV requires Trilinos, and we provide libraries for both with this method.
> > >
> > > I'd like to open a discussion on this topic, and to put a time limit on
> > it, I propose we come to a consensus by the end of the week (Friday, May
> > 4), at which point I would commit the change to the trunk.
> > >
> > > Thanks!
> > >
> > > Matt Hoffman
> > >
> > >
> > >>
> > >
> >
> > _______________________________________________
> > mpas-developers mailing list
> > mpas-developers at mailman.ucar.edu
> > http://mailman.ucar.edu/mailman/listinfo/mpas-developers
> >

> _______________________________________________
> mpas-developers mailing list
> mpas-developers at mailman.ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/mpas-developers



More information about the mpas-developers mailing list