Installation/Delete intermediate files

From OpenFOAMWiki
< Installation
Revision as of 14:21, 28 December 2018 by Wyldckat (Talk | contribs)

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:
    rmoall src applications
  2. To remove all dependency files (*.dep), run the following commands:
  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:
    find src applications -name "linux*" | grep "/Make/" | xargs rm -r
  4. To remove all intermediate build files, run the following commands:
    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:
    rm -r gcc-* gmp-* mpfr-* binutils-* boost* ParaView-* qt-*

3 OpenFOAM 3.0.0 and newer


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


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