From: Arlindo da S. <da...@al...> - 2008-07-25 04:25:32
|
On Thu, Jul 24, 2008 at 3:11 PM, Jennifer Adams <jm...@co...> wrote: > Dear All, > I am finally getting around to working on the build environment. I need > help!!! > I have changed the expected directory structure of $supplibs/include/ so now > GrADS will look for subdirectories for each library. This led to me editing > configure.in, acinclude.m4, and src/Makefile.am. I am using the latest > opengrads src (2.0.a2.oga.1) as a guide. My approach is to update things > slowly, making sure they work before updating the next. This may work, but it could be very painful. We also evolved slowly before we reached the current configuration, with a lot of fine tuning along the way. Trying to retrace the same steps may be very time consuming. Another approach is for you to start with the autoconf structure from opengrads, and replace the *.c, *.h under src with your current sources and give it a go (If you give me your current sources I can make sure it builds with the opengrads autoconf structure without touching your sources). > So, the > dynamic-supplib-detection is not in yet. One thing that is not working is > adding the proper include directory for netcdf.h when compiling grads and > gradsdap. This is done with a variable called nc_include, which is set in > configure.in: > use_nc=no > if test "$with_nc" != "no" ; then > echo "Checking netcdf support..." > GA_CHECK_NC([use_nc=yes], {}) > fi > if test $use_nc = "yes" ; then > nc_include = "-I\$(supp_include_dir)/netcdf" > AC_SUBST(nc_include) > GA_SET_LIB_VAR(nc_libs, [netcdf udunits]) > AC_SUBST(nc_libs) > AC_DEFINE(USESDF, 1, [Enable netcdf]) > echo "+ netcdf enabled" > else > AC_DEFINE(USESDF, 0, [Enable netcdf]) > echo "- netcdf disabled" > fi > I put the nc_include variable in src/Makefile.am like this: > COMPILE_C = $(COMPILE) $(nc_include) -DUSEDAP=0 -DUSEGADODS=0 > But after running ./bootstrap and ./configure, nc_include is empty in the > Makefile. The bootstrap script is deprecated; I usually use "autoreconf". Also, keeping up with current practice, configure.in has been renamed configure.ac ("in" kind of files is usually produced after running autoconf, like Makefile.in). Which version of autoconf are you using? > Here I grep for it in the top level, and the directories below: >> grep nc_include * > Makefile:nc_include = > Makefile.in:nc_include = @nc_include@ > config.log:nc_include='' > config.status:s,@nc_include@,,;t t > configure:ac_subst_vars='SHELL <....snipped...> nc_include <...snipped...> > configure: nc_include = "-I\$(supp_include_dir)/netcdf" > configure:s,@nc_include@,$nc_include,;t t > configure.in: nc_include = "-I\$(supp_include_dir)/netcdf" > configure.in: AC_SUBST(nc_include) >> grep nc_include */* > autom4te.cache/output.0:ac_subst_vars='SHELL <....snipped...> nc_include > <...snipped...> > autom4te.cache/output.0: nc_include = "-I\$(supp_include_dir)/netcdf" > autom4te.cache/output.0:s,@nc_include@,$nc_include,;t t > autom4te.cache/traces.0:m4trace:configure.in:358: -1- AC_SUBST([nc_include]) > src/Makefile:nc_include = > src/Makefile:COMPILE_C = $(COMPILE) $(nc_include) -DUSEDAP=0 -DUSEGADODS=0 > src/Makefile.am:COMPILE_C = $(COMPILE) $(nc_include) -DUSEDAP=0 > -DUSEGADODS=0 > src/Makefile.in:nc_include = @nc_include@ > src/Makefile.in:COMPILE_C = $(COMPILE) $(nc_include) -DUSEDAP=0 > -DUSEGADODS=0 > > What am I doing wrong? I remember having similar issues, but frankly I cannot remember exactly what I did. I'd have to get your tarball and poke around. In the new structure we now define NC_CFLAGS which among other things, define the include dirs; parts of NC_CFLAGS is defined inside the netcdf/hdf specific m4 macros. Pat has a good eye for these things, perhaps he can spot something from your output. Can you make sense of our configure.ac/Makefile.am? I could give you a walk thru if you would like. There is no rocket science in this --- simply little gotchas here and there that after lots of experimentation and testing one gets it working. Are you sure you want to go thru the same teething pain? Either way, I'd be glad to help, but I'd need to have your sandbox to see what is going on. Arlindo -- Arlindo da Silva da...@al... |