From: Karl T. <k.t...@au...> - 2006-11-08 22:10:56
|
John Peterson writes: > I'm following up to my own previous posting about PETSc's > configuration files and the difficulties of including them > directly in LibMesh's Makefile. Hi John. Thanks for looking into this. I'd been trying to find a good way to do this too because of unresolved mpe symbols as discussed in http://sourceforge.net/mailarchive/message.php?msg_id=37104990 > > What I came up with (thanks also to Roy!) is a simple shell script > which will process the PETSc configuration files separately (i.e. no > more including the petscconf/packages/base.site file directly. Yes, > its name really has changed that many times since 2.1.0.) > As an added bonus to having a cleaner Makefile namespace, this should > help streamline the linking process as well. Seems like the right sort of thing to do. Note that for petsc-2.1.5 and older, bmake/common/base already has getlinklibs and getincludedir targets, but 2.1.3 does not have these. I don't know whether LibMesh should still support 2.1.0. There is nothing corresponding to PETSC_COMPILE but I don't know what needs this. > > Could you all do me a favor and try running the following sample > Makefile on your systems (assuming you have PETSc installed)? > Just copy the attached sample Makefile and shell script into any > directory, chmod a+x the script and type make. Let me > know if there are any error messages or strange output, it should > just spit out the link line, include directories, and compiler > flags specified in $(PETSC_DIR)/bmake/common/variables. It works most of the time, but, when it is part of a recursive make, there are problems: /bin/sh: command substitution: line 0: unexpected EOF while looking for matching `'' /bin/sh: command substitution: line 1: syntax error: unexpected end of file PETSC_LIB=make[1]: Entering directory /home/karl/tmp/recursive-make' ... This can be reproduced by placing the files in a subdirectory (called recursive-make here) and running make in the parent directory on a Makefile with contents: all: make -C recursive-make I had suggested make --no-print-directory to work around this, but this is likely to cause problems for non-GNU make commands. It seems to me that these things should be worked out at configure (not make) time and so recursive makes would not be very likely. But a possible workaround is to include the following line in extract_make_var.sh before invoking make: unset MAKELEVEL HTH, Karl. |