From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45615) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dwoEd-0001uL-Fa for guix-patches@gnu.org; Tue, 26 Sep 2017 07:41:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dwoEZ-0001HC-CK for guix-patches@gnu.org; Tue, 26 Sep 2017 07:41:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:51106) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dwoEZ-0001Gi-7q for guix-patches@gnu.org; Tue, 26 Sep 2017 07:41:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dwoEY-0002xE-9k for guix-patches@gnu.org; Tue, 26 Sep 2017 07:41:02 -0400 Subject: [bug#28593] [PATCH] gnu: openfoam: Clean up to reduce closure. Resent-Message-ID: Message-ID: <1506426036.2423.32.camel@tourbillion-technology.com> From: Paul Garlick Date: Tue, 26 Sep 2017 12:40:36 +0100 In-Reply-To: <87fubbj5yr.fsf@gnu.org> References: <20170925104459.17798-1-fx@gnu.org> <87fubbj5yr.fsf@gnu.org> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Dave Love Cc: 28593@debbugs.gnu.org Hi Dave and Ludo, Thank you Dave for your helpful suggestions on the OpenFOAM package definition. Firstly, on the question of adding a debug output, I have checked the effect of the current '#:strip-directories' keyword definition.  In the build log: stripping binaries in "/gnu/store/4zqn4w0wlq0irdwh3dhrdbsr7i3f1dag- openfoam-4.1/lib/OpenFOAM-4.1/platforms/linux64GccDPInt32Opt/bin" with "strip" and flags ("--strip-debug" "--enable-deterministic-archives") stripping binaries in "/gnu/store/4zqn4w0wlq0irdwh3dhrdbsr7i3f1dag- openfoam-4.1/lib/OpenFOAM-4.1/platforms/linux64GccDPInt32Opt/lib" with "strip" and flags ("--strip-debug" "--enable-deterministic-archives") This suggests that the binaries in .../bin and .../lib are being stripped.  However, if I check a randomly-selected executable in the bin directory: $ objdump --syms /home/paul/.guix-profile/lib/OpenFOAM- 4.1/platforms/linux64GccDPInt32Opt/bin/blockMesh | grep debug 0000000000000000       O *UND* 0000000000000000              _ZN 4Foam8fileName5debugE 0000000000000000       O *UND* 0000000000000000              _ZN 4Foam4word5debugE The 'file' command also reports that the executables and shared objects are 'not stripped'.  Does adding a debug output achieve the effect of stripping the binaries?  > > 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" )) > > > > +                  (add-after 'build 'cleanup > > +                    ;; Avoid lots of junk installed > > +                    (lambda _ > > +                      (delete-file-recursively > > +                       "platforms/linux64GccDPInt32Opt/src") > > +                      (delete-file-recursively > > +                       "platforms/linux64GccDPInt32OptSYSTEMOPENMP > > I/src") > > +                      (zero? > > +                       (system* "find" "-name" "*.o" "-delete")))) > 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? Paul.