[BuildTools] more autoconf issues, w/ suggested fixes

Lou Hafer lou at cs.sfu.ca
Tue Nov 28 18:49:35 EST 2006


Folks,

	The next few posts are copies of some emails exchanged with Andreas, to 
give the rest of you some idea of issues that need work.
	
	I decided I should try to cobble up a full implementation of the
enable-doscompile idea.  I now have it working for msvc and mingw.  (And for
cygwin, but in the end this amounts to the absence of any doscompile option.)

	The bad news:  I decided to get ambitious and incorporate the dense
factorisation features of CoinUtils, but in my cygwin environment, there is no
fortran compiler to match the msvc (cl/link) environment.  Yeah, it's out there,
but I don't have it installed.  And configure does not take this well at all.
To make a long story short, macro expansion from either of AC_COIN_PROG_F77 or
AC_COIN_TRY_FLINK at some point AC_REQUIRES a macro that outright fails if no
Fortran compiler is present.  Because AC_REQUIRE pushes the associated shell
code out in front of the topmost enclosing macro, it's impossible to deal with
this using a shell conditional inside of AC_COIN_HAS_BLAS or AC_COIN_HAS_LAPACK.
I ended up creating a new macro that simply looks for an appropriately named
program and sets a variable accordingly to indicate probably availability of a
Fortran compiler.  Then AC_COIN_HAS_BLAS and AC_COIN_HAS_LAPACK can be guarded
at the level of CoinUtils/configure.ac, so that all associated shell code (even
the stuff that's AC_REQUIRED to the front of the macros) is bypassed unless a
compiler is present.  That begs the question of what should happen when
something like ifort is present for an msvc build, but I'm hoping you already
know what to do there.

	And, just as an added twist, if compiler flags (CXXFLAGS, CFLAGS,
FFLAGS) are unset at the point where AC_COIN_INIT_AUTO_TOOLS is called, and
we're using GCC compilers, something down in autoconf helpfully sets the flags
to -g -O2, so that when the AC_COIN_PROG_XXX macro executes, it skips all of the
code that determines compiler flags.  Which pushes my `find a fortran compiler'
macro, plus a call to AC_COIN_PROG_F77, up toward the beginning of CoinUtils/
configure.ac.

	I'll post the revised coin.m4 and CoinUtils/configure.ac to 
https://projects.coin-or.org/BuildTools/wiki/devel-pre-1.0.


							Lou



More information about the BuildTools mailing list