Difference between revisions of "Installation/Delete intermediate files"

From OpenFOAMWiki
(OpenFOAM 1.5 to 2.4.x: done)
(OpenFOAM-extend 1.6-ext, as well as foam-extend 3.0 and newer: Added instructions, based on OF 1.7 et al)
Line 65: Line 65:
 
= OpenFOAM-extend 1.6-ext, as well as foam-extend 3.0 and newer =
 
= OpenFOAM-extend 1.6-ext, as well as foam-extend 3.0 and newer =
  
TODO
+
<ol>
 +
<li>To remove all object files ({{tt|*.o}}), run the following commands:
 +
<bash>foam
 +
rmoall src applications
 +
</bash>
 +
</li>
 +
 
 +
<li>To remove all dependency files ({{tt|*.dep}}), run the following commands:
 +
<bash>foam
 +
rmdepall
 +
</bash>
 +
</li>
 +
 
 +
<li>To remove the complete intermediate build folder for all source code folders (it removes the intermediate _make_ files that {{tt|wmake}} creates before it starts building a library or application), run the following commands:
 +
<bash>foam
 +
find src applications -name "linux*" | grep "/Make/" | xargs rm -r
 +
</bash>
 +
</li>
 +
 
 +
<li>To remove all intermediate build files, run the following commands:
 +
<bash>foam3rdParty
 +
rm -r rpmBuild/BUILD/*
 +
rm -r rpmBuild/BUILDROOT/*
 +
rm -r rpmBuild/tmp/*
 +
</bash>
 +
</li>
 +
 
 +
<li>To also remove the extra downloaded source code, the resulting RPM and tarball packages that resulted from the build process (although these packages are compressed and can be used to re-install without rebuilding), run the following commands:
 +
<bash>foam3rdParty
 +
rm -r rpmBuild/rpmDB/*
 +
rm -r rpmBuild/SOURCES/*.tar.*
 +
rm -r rpmBuild/SOURCES/*.zip
 +
rm -r rpmBuild/RPMS/*
 +
rm -r rpmBuild/TGZS/*
 +
</bash>
 +
'''Note''': This does not delete the installed software that was custom built.
 +
</li>
 +
 
 +
<li>To remove all third-party source code folders that installation instructions may tell you to download and build, which in total can add up from 500MB to 2 GB, run the following commands:
 +
<bash>foam3rdParty
 +
rm -r gcc-* gmp-* mpfr-* binutils-* boost* ParaView-* qt-*
 +
</bash>
 +
</li>
 +
 
 +
</ol>
 +
 
  
 
<br>
 
<br>

Revision as of 12:28, 28 December 2018

1 Introduction

This page explains the steps to follow for each series of OpenFOAM versions/forks/variants on which temporary folders can be deleted after building OpenFOAM from source code, which can save disk space between 2 and 10 GB. This includes:

  1. the intermediate object files that were used to build OpenFOAM, namely the files with the extensions *.o;
  2. the dependency files that were used to know which files each source file depends on, namely the files with the extensions *.dep;
  3. the intermediate files used to build the software at the ThirdParty folder.


However, please keep in mind the following limitations:

  1. Removing the *.o files will result in having to rebuild the whole library or application in OpenFOAM, if you need to do some modification to the source code of said library. In other words, it's as if you had executed the command wclean for each library or application folder.
  2. Removing the *.dep files will in practice have the same effect as removing the *.o files, given that these files are both needed in case you are only updating the build of a library/application.
  3. Removing the intermediate files at ThirdParty folder can either:
    • affect the ability to build the OpenFOAM reader libraries for ParaView, although this only happened for old versions of ParaView (~3.12.0 or older, if not mistaken);
    • having these intermediate files can allow you to do minor rebuilds, for example, to build ParaView with other build options;
    • removing the source code folders for large software packages, such as Boost and GCC, can save up a lot of disk space.


2 OpenFOAM 1.7.x to 2.4.x

  1. To remove all object files (*.o), run the following commands:
    foam
    rmoall src applications
  2. To remove all dependency files (*.dep), run the following commands:
    foam
    rmdepall
  3. To remove the complete intermediate build folder for all source code folders (it removes the intermediate _make_ files that wmake creates before it starts building a library or application), run the following commands:
    foam
    find src applications -name "linux*" | grep "/Make/" | xargs rm -r
  4. To remove all intermediate build files, run the following commands:
    foam3rdParty
    rm -r build
  5. To remove all third-party source code folders that installation instructions may tell you to download and build, which in total can add up from 500MB to 2 GB, run the following commands:
    foam3rdParty
    rm -r gcc-* gmp-* mpfr-* binutils-* boost* ParaView-* qt-*


3 OpenFOAM 3.0.0 and newer

TODO


4 OpenFOAM+ v3.0+, v1606+, v1612+, v1706 and newer

TODO


5 OpenFOAM-extend 1.6-ext, as well as foam-extend 3.0 and newer

  1. To remove all object files (*.o), run the following commands:
    foam
    rmoall src applications
  2. To remove all dependency files (*.dep), run the following commands:
    foam
    rmdepall
  3. To remove the complete intermediate build folder for all source code folders (it removes the intermediate _make_ files that wmake creates before it starts building a library or application), run the following commands:
    foam
    find src applications -name "linux*" | grep "/Make/" | xargs rm -r
  4. To remove all intermediate build files, run the following commands:
    foam3rdParty
    rm -r rpmBuild/BUILD/*
    rm -r rpmBuild/BUILDROOT/*
    rm -r rpmBuild/tmp/*
  5. To also remove the extra downloaded source code, the resulting RPM and tarball packages that resulted from the build process (although these packages are compressed and can be used to re-install without rebuilding), run the following commands:
    foam3rdParty
    rm -r rpmBuild/rpmDB/*
    rm -r rpmBuild/SOURCES/*.tar.*
    rm -r rpmBuild/SOURCES/*.zip
    rm -r rpmBuild/RPMS/*
    rm -r rpmBuild/TGZS/*

    Note: This does not delete the installed software that was custom built.

  6. To remove all third-party source code folders that installation instructions may tell you to download and build, which in total can add up from 500MB to 2 GB, run the following commands:
    foam3rdParty
    rm -r gcc-* gmp-* mpfr-* binutils-* boost* ParaView-* qt-*