[MITgcm-devel] genmake2 and makedepend
Jean-Michel Campin
jmc at ocean.mit.edu
Tue Dec 18 16:00:46 EST 2012
Hi Martin,
I agreee that it would be good to fix this (and check that it works with
our xmakedepend, with the cyrus-makedepend and with some default makedepend),
but would be nicer to put the true path that cpp uses, rather than a list of
potential location for the include (on my laptop, /usr/local/include
is empty but /usr/include is not).
I guess the next question is, "is there a simple way to find
'the standard system include directories' ?"
I can see that "cpp -v" (among many things) give a list include dirs,
but don't know how standard it is (and how easy it is to extract this
list).
Cheers,
Jean-Michel
On Tue, Dec 18, 2012 at 04:36:43PM +0100, Martin Losch wrote:
> Hi Jean-Michel,
>
> you are right, the compilation still works, it just means that the corresponding files, e.g. mmc_file.f do not depend on netcdf.inc anymore, which one can probably live with.
>
> I guess one can fix this by enlarging the default search for make depend, e.g. always add -I/usr/local/include (or the typical search paths of cpp) to the arguments of $(MAKEDEPEND). It's not very nice because the list is likely to expand, but should be safe, because the actual paths have been checked with the test in genmake2. What do you think?
>
> Martin
>
> On Dec 18, 2012, at 2:56 PM, Jean-Michel Campin <jmc at ocean.mit.edu> wrote:
>
> > Hi Martin,
> >
> > It happens manay times to me that "make depend" return some warning/error,
> > but this does not prevent me to compile (with a successful "make").
> > Are you in this situation ?
> >
> > Otherwise, I find your suggestion little bit tricky, since it might
> > prevent to use NetCDF in cases where it is available.
> > My impression is that we should try to fix the makedepend step.
> >
> > Cheers,
> > Jean-Michel
> >
> > On Tue, Dec 18, 2012 at 02:04:54PM +0100, Martin Losch wrote:
> >> Hi there,
> >> my version of Murphy's law: Whenever you want to show how great everything is, it turns against you and does not work.
> >>
> >> I was trying to show to my group in a presentation, how makefiles are generated by genmake2 and how you compile the model etc, when "make depend" returned errors that it cannot find "netcdf.inc". This happened after the genmake_tnc.F test passed. I used darwin_amd64_gfortran with OS X 10.8 (mountain lion).
> >>
> >> The problem is that (on my PowerBook), /usr/bin/cpp finds files in /usr/local/include by default, and gfortran finds libraries in /usr/local/lib by default (that's where my netcdf installation is), so that the test passes without problems (-DHAVE_NETCDF), and more importantly without INCLUDES or INCLUDEPATH being set (I have NETCDF_ROOT unset by default). However, when make depend tries to build the dependencies, the include files are no longer found because apparently, my makedepend (/opt/X11/bin/makedepend) does not search /usr/local/include by default.
> >>
> >> I can easily fix this by specifying a proper NETCDF_ROOT (=/usr/local), but it shows that the netcdf test is not fool-proof. Do you have a suggestion how we can improve the test? E.g. tell cpp not to search anywhere that is not explicitly specified in the INCLUDEPATH?
> >>
> >> Martin
> >>
> >>
> >> _______________________________________________
> >> MITgcm-devel mailing list
> >> MITgcm-devel at mitgcm.org
> >> http://mitgcm.org/mailman/listinfo/mitgcm-devel
> >
> > _______________________________________________
> > MITgcm-devel mailing list
> > MITgcm-devel at mitgcm.org
> > http://mitgcm.org/mailman/listinfo/mitgcm-devel
>
>
> _______________________________________________
> MITgcm-devel mailing list
> MITgcm-devel at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-devel
More information about the MITgcm-devel
mailing list