Subject: Re: [bug#28593] [PATCH] gnu: openfoam: Clean up to reduce closure.

From: [email-masked] (Ludovic Courtès)
Date: Tue, 26 Sep 2017 14:08:13 +0200

Hi Paul,

Paul Garlick <[email-masked]> skribis:

> The 'file' command also reports that the executables and shared objects
> are 'not stripped'.

That’s because we use ‘--strip-debug’ and not ‘--strip-all’ (in some
cases, the latter breaks binaries in weird ways, hence the conservative
choice.)

However, you can see in the list of ELF sections reported by “objdump
-x” that there’s no .debug* section—i.e., binaries contain the symbol
table, but not DWARF debugging info, which is far larger.

>  Does adding a debug output achieve the effect of stripping the
> binaries? 

I don’t think it makes any difference.

>> Normally the ‘strip’ phase would strip things.  I guess the problem
>> here
>> is that libraries are not in lib/, so nothing gets stripped.  This
>> would
>> be worked around by simply passing something like:
>> 
>>   #:strip-directories '("OpenFOAM-1.2.3/lib")
>
> Would that not give a 'directory not found' message?  Currently,
>
> #:strip-directories (list (string-append
>                                   "lib/OpenFOAM-" ,version
>                                   "/platforms/linux64GccDPInt32Opt/bin"
> )
>                                  (string-append
>                                   "lib/OpenFOAM-" ,version
>                                   "/platforms/linux64GccDPInt32Opt/lib"
> ))

Oh sorry, I had forgotten we already had this.  This is perfect!

>> Rather:
>> 
>>   (for-each delete-file (find-files "." "\\.o$"))
>> 
>> Paul can you confirm that this is OK?
>> 
>
> Maybe.  We need to be careful that we not delete files which are needed
> later on.  Typically, a user will copy part of the directory structure
> to a subdirectory of $HOME and compile a new solver.  The OpenFOAM
> 'wmake' utility takes care of the dependencies and re-compiles object
> files as needed.  
>
> So, object files under 'platforms/linux64GccDPInt32Opt/src' should be
> safe to delete.  However, this needs to be checked to make sure no
> dependencies are deleted that cannot easily be re-compiled.  Have you
> already checked this Dave by, for example, re-compiling a standard
> solver?

I let Dave answer on this part.

Thanks,
Ludo’.