[petsc-dev] Experimental GNU make build system

Satish Balay balay at mcs.anl.gov
Tue Jun 4 16:05:04 CDT 2013


On Tue, 4 Jun 2013, Jed Brown wrote:

> Satish Balay <balay at mcs.anl.gov> writes:
> 
> > I can use cygpath directly from gmakefile to handle this.
> >
> >         @cygpath -w $^ > ar.args
> 
> I don't understand how this works.  Doesn't it overflow the argument
> list just as surely as the other methods?  Wouldn't we need to write the
> arguments file incrementally if we're going to pass the file names on
> the command line?

As I understand it - 32k limit is for windows apps [using windows
compiler dlls?]. Cygwin binaries appear to handle long args properly.

[the previous issue we had was when using 'cmd1 && cmd1' or 'cmd1 |
cmd1' via make - which is now fixed in the updated cygwin dll]

The following updated thingy also works - but with a [false] warning
from win32fe. I must have seen this before and assumed '@file' didn't
work from win32fe

I guess I should look at fixing win32fe to handle '@file' properly

Satish

--------

balay at msnehalem2 ~/petsc.clone
$ make -f gmakefile PETSC_ARCH=arch-cmplx -j 20 V=1
/home/balay/petsc.clone/bin/win32fe/win32fe lib -a /home/balay/petsc.clone/arch-cmplx/lib/libpetsc.lib @`cygpath -w /home/balay/petsc.clone/arch-cmplx/lib/libpetsc.lib.args`
Warning: win32fe: File Not Found: @C:\cygwin\home\balay\petsc.clone\arch-cmplx\lib\libpetsc.lib.args
kspams.o : warning LNK4221: no public symbols found; archive member will be inaccessible
/usr/bin/true /home/balay/petsc.clone/arch-cmplx/lib/libpetsc.lib

balay at msnehalem2 ~/petsc.clone
$ make test
Running test examples to verify correct installation
Using PETSC_DIR=/home/balay/petsc.clone and PETSC_ARCH=arch-cmplx
C/C++ example src/snes/examples/tutorials/ex19 run successfully with 1 MPI process
Fortran example src/snes/examples/tutorials/ex5f run successfully with 1 MPI process
Completed test examples

balay at msnehalem2 ~/petsc.clone
$ git diff gmakefile
diff --git a/gmakefile b/gmakefile
index bf9ce21..83a1a54 100644
--- a/gmakefile
+++ b/gmakefile
@@ -68,9 +68,11 @@ $(libpetsc_shared) : $(srcs.o) | $$(@D)/.DIR
 $(libpetsc_static) : obj := $(srcs.o)

 %.$(AR_LIB_SUFFIX) : $$(obj) | $$(@D)/.DIR
-       @$(RM) $@
-       $(call quiet,AR) $(AR_FLAGS) $@ $^
+       @$(RM) $@ $@.args
+       @cygpath -w $^ > $@.args
+       $(call quiet,AR) $(AR_FLAGS) $@ @`cygpath -w $@.args`
        $(call quiet,RANLIB) $@
+       @$(RM) $@.args

 # with-single-library=0
 libpkg = $(foreach pkg, $1, $(LIBDIR)/libpetsc$(pkg).so)

balay at msnehalem2 ~/petsc.clone



More information about the petsc-dev mailing list