--- OpenFOAM-v1906/wmake/scripts/have_readline.orig	2019-09-04 12:23:52.902744835 +0200
+++ OpenFOAM-v1906/wmake/scripts/have_readline	2019-09-04 13:26:28.734068398 +0200
@@ -56,7 +56,7 @@
     # warn="==> skip readline"
 
     # Expected location, include/library names
-    prefix=system
+    prefix="$EBROOTLIBREADLINE"
     incName="readline/readline.h"
     libName="libreadline"
 
--- OpenFOAM-v1906/etc/bashrc.orig	2019-09-04 12:23:52.905744717 +0200
+++ OpenFOAM-v1906/etc/bashrc	2019-09-04 13:29:45.861368397 +0200
@@ -92,7 +92,7 @@
 # = SYSTEMOPENMPI | OPENMPI | SYSTEMMPI | MPI | MPICH | MPICH-GM |
 #   HPMPI | CRAY-MPICH | FJMPI | QSMPI | SGIMPI | INTELMPI | USERMPI
 # Also possible to use INTELMPI-xyz etc and define your own wmake rule
-export WM_MPLIB=SYSTEMOPENMPI
+export WM_MPLIB=EASYBUILDMPI
 
 
 #------------------------------------------------------------------------------
--- OpenFOAM-v1906/etc/config.sh/CGAL.orig	2019-06-26 16:16:55.000000000 +0200
+++ OpenFOAM-v1906/etc/config.sh/CGAL	2019-09-04 12:23:52.906744678 +0200
@@ -43,33 +43,9 @@
 #------------------------------------------------------------------------------
 # USER EDITABLE PART: Changes made here may be lost with the next upgrade
 
-boost_version=boost_1_64_0
-cgal_version=CGAL-4.9.1
-
-export BOOST_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$boost_version
-export CGAL_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cgal_version
+##EasyBuild## settings
+export BOOST_ARCH_PATH=$EBROOTBOOST
+export CGAL_ARCH_PATH=$EBROOTCGAL
 
 # END OF (NORMAL) USER EDITABLE PART
 #------------------------------------------------------------------------------
-if [ -n "$FOAM_VERBOSE" ] && [ -n "$PS1" ]
-then
-    echo "Using boost ($boost_version)  ->  $BOOST_ARCH_PATH" 1>&2
-    echo "Using CGAL ($cgal_version)  ->  $CGAL_ARCH_PATH" 1>&2
-fi
-
-if command -v _foamAddLibAuto > /dev/null 2>&1  # Normal sourcing (not makeCGAL)
-then
-    _foamAddLibAuto $BOOST_ARCH_PATH  lib$WM_COMPILER_LIB_ARCH
-    _foamAddLibAuto $CGAL_ARCH_PATH   lib$WM_COMPILER_LIB_ARCH
-
-    # GMP/MPFR may have already been added with ThirdParty compiler, but cannot
-    # be certain so add here. Any duplicates will be removed later.
-
-    _foamAddLibAuto $GMP_ARCH_PATH   # No fallback libdir
-    _foamAddLibAuto $MPFR_ARCH_PATH  # No fallback libdir
-
-    unset boost_version cgal_version
-
-fi
-
-#------------------------------------------------------------------------------
--- OpenFOAM-v1906/etc/config.sh/FFTW.orig	2019-06-26 16:16:55.000000000 +0200
+++ OpenFOAM-v1906/etc/config.sh/FFTW	2019-09-04 12:23:52.907744639 +0200
@@ -33,23 +33,7 @@
 #------------------------------------------------------------------------------
 # USER EDITABLE PART: Changes made here may be lost with the next upgrade
 
-fftw_version=fftw-3.3.7
-export FFTW_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$fftw_version
-
-# END OF (NORMAL) USER EDITABLE PART
-#------------------------------------------------------------------------------
-if [ -n "$FOAM_VERBOSE" ] && [ -n "$PS1" ]
-then
-    echo "Using fftw ($fftw_version)  ->  $FFTW_ARCH_PATH" 1>&2
-fi
-
-if command -v _foamAddLibAuto > /dev/null 2>&1  # Normal sourcing (not makeFFTW)
-then
-
-    _foamAddLibAuto $FFTW_ARCH_PATH  lib$WM_COMPILER_LIB_ARCH
-
-    unset fftw_version
-
-fi
+##EasyBuild## settings
+export FFTW_ARCH_PATH=$EBROOTFFTW
 
 #------------------------------------------------------------------------------
--- OpenFOAM-v1906/etc/config.sh/gperftools.orig	2019-06-26 16:16:55.000000000 +0200
+++ OpenFOAM-v1906/etc/config.sh/gperftools	2019-09-04 12:23:52.910744522 +0200
@@ -37,32 +37,7 @@
 #------------------------------------------------------------------------------
 # USER EDITABLE PART: Changes made here may be lost with the next upgrade
 
-gperftools_version=gperftools-2.5
-GPERFTOOLS_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$gperftools_version
-
-# END OF (NORMAL) USER EDITABLE PART
-#------------------------------------------------------------------------------
-if [ -n "$FOAM_VERBOSE" ] && [ -n "$PS1" ]
-then
-    echo "Using gperftools ($gperftools_version)  ->  $GPERFTOOLS_ARCH_PATH" 1>&2
-fi
-
-if command -v _foamAddLib > /dev/null 2>&1      # Normal sourcing
-then
-
-    # If GPERFTOOLS_ARCH_PATH does not end with '-system' or '-none',
-    # it is located within ThirdParty, or a central installation
-    # outside of ThirdParty and must be added to the lib-path.
-
-    ending="${GPERFTOOLS_ARCH_PATH##*-}"
-    if [ "$ending" != none ] && [ "$ending" != system ]
-    then
-        _foamAddLib     $GPERFTOOLS_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH
-        _foamAddPath    $GPERFTOOLS_ARCH_PATH/bin
-    fi
-
-    unset gperftools_version ending
-
-fi
+##EasyBuild## settings
+GPERFTOOLS_ARCH_PATH=$EBROOTGPERFTOOLS
 
 #------------------------------------------------------------------------------
--- OpenFOAM-v1906/etc/config.sh/metis.orig	2019-09-04 12:23:52.912744444 +0200
+++ OpenFOAM-v1906/etc/config.sh/metis	2019-09-04 13:34:37.724933897 +0200
@@ -33,8 +33,8 @@
 #------------------------------------------------------------------------------
 # USER EDITABLE PART: Changes made here may be lost with the next upgrade
 
-METIS_VERSION=metis-5.1.0
-export METIS_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION/$METIS_VERSION
+METIS_VERSION=metis-$EBVERSIONMETIS
+[ -d "$METIS_ARCH_PATH" ] || METIS_ARCH_PATH=$METIS_ROOT
 
 # END OF (NORMAL) USER EDITABLE PART
 #------------------------------------------------------------------------------
--- OpenFOAM-v1906/etc/config.sh/mpi.orig	2019-06-26 16:16:55.000000000 +0200
+++ OpenFOAM-v1906/etc/config.sh/mpi	2019-09-04 12:23:52.918744210 +0200
@@ -95,6 +95,10 @@
     _foamEtc -config  mpi-user                  # <- Adjustments (optional)
     ;;
 
+EASYBUILDMPI)
+    export FOAM_MPI=mpi
+    ;;
+
 SYSTEMMPI)
     export FOAM_MPI=mpi-system
     _foamEtc -config  mpi-system                # <- Adjustments (optional)
--- OpenFOAM-v1906/etc/config.sh/paraview.orig	2019-06-26 16:16:55.000000000 +0200
+++ OpenFOAM-v1906/etc/config.sh/paraview	2019-09-04 13:37:50.725336434 +0200
@@ -53,7 +53,8 @@
 #------------------------------------------------------------------------------
 # USER EDITABLE PART: Changes made here may be lost with the next upgrade
 
-ParaView_VERSION=5.6.0
+##Easybuild## settings
+ParaView_VERSION=$EBVERSIONPARAVIEW
 ParaView_QT=qt-system
 cmake_version=cmake-system
 
@@ -84,14 +85,6 @@
     esac
 done
 
-# ThirdParty cmake
-cmake="$archDir/$cmake_version"
-if [ -r "$cmake/bin/cmake" ]
-then
-    # _foamAddPath not available when foamPV function is used
-    PATH="$cmake/bin:$PATH"
-fi
-
 case "$ParaView_VERSION" in
 ('')
     # empty - do nothing
@@ -147,7 +140,8 @@
         ;;
     esac
 
-    export ParaView_DIR="$archDir/ParaView-$ParaView_VERSION"
+    ##Easybuild## settings
+    export ParaView_DIR=$EBROOTPARAVIEW
 
     # Set paths if binaries are present
     if [ -r "$ParaView_DIR" ]
@@ -166,26 +160,6 @@
         #OBSOLETE?    export PYTHONPATH=$PYTHONPATH:${PYTHONPATH:+:}$pvPython:$pvLibDir
         #OBSOLETE? fi
 
-        # QT libraries as required, and Qt5_DIR for the root directory.
-        # Another possibility: "qtpaths --qt-version"
-        qtDir="$archDir/$ParaView_QT"
-        if [ -d "$qtDir" ]
-        then
-            case "$ParaView_QT" in
-            (*-5*)
-                export Qt5_DIR="$qtDir"
-                ;;
-            esac
-            for qtLibDir in "$qtDir/lib$WM_COMPILER_LIB_ARCH" "$qtDir/lib"
-            do
-                if [ -d "$qtLibDir" ]
-                then
-                    export LD_LIBRARY_PATH="$qtLibDir:$LD_LIBRARY_PATH"
-                    break
-                fi
-            done
-        fi
-
         # ParaView libraries
         # - 5.4 and earlier: lib/paraview-X.X
         # - 5.5 and later:   lib/
--- OpenFOAM-v1906/etc/config.sh/vtk.orig	2019-09-04 12:23:52.923744015 +0200
+++ OpenFOAM-v1906/etc/config.sh/vtk	2019-09-04 13:42:37.408080163 +0200
@@ -31,46 +31,11 @@
 #------------------------------------------------------------------------------
 # USER EDITABLE PART: Changes made here may be lost with the next upgrade
 
-vtk_version=VTK-8.2.0
-mesa_version=mesa-17.1.1
 mesa_llvm=none
 
-export VTK_DIR="$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$vtk_version"
-export MESA_ARCH_PATH="$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$mesa_version"
+export VTK_DIR=$EBROOTVTK
+export MESA_ARCH_PATH=$EBROOTMESA
 export LLVM_ARCH_PATH="$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH/$mesa_llvm"
 
 # END OF (NORMAL) USER EDITABLE PART
 #------------------------------------------------------------------------------
-if [ -n "$FOAM_VERBOSE" ] && [ -n "$PS1" ]
-then
-    echo "Using vtk" 1>&2
-    echo "    vtk  ($vtk_version) $VTK_DIR" 1>&2
-    echo "    mesa ($mesa_version) $MESA_ARCH_PATH" 1>&2
-    echo "    llvm ($mesa_llvm) $LLVM_ARCH_PATH" 1>&2
-fi
-
-if command -v _foamAddLib > /dev/null 2>&1  # normal sourcing
-then
-
-    # Set paths if binaries are present
-    if [ -d "$VTK_DIR" ]
-    then
-        # Uses lib/ and not lib64/
-        _foamAddLib "$VTK_DIR/lib"
-    else
-        unset VTK_DIR
-    fi
-
-    if [ -d "$MESA_ARCH_PATH" ]
-    then
-        _foamAddLibAuto "$LLVM_ARCH_PATH"
-        _foamAddLibAuto "$MESA_ARCH_PATH"
-    else
-        unset LLVM_ARCH_PATH
-        unset MESA_ARCH_PATH
-    fi
-
-    unset vtk_version mesa_version mesa_llvm
-fi
-
-#------------------------------------------------------------------------------
--- OpenFOAM-v1906/etc/config.sh/scotch.orig	2019-06-26 16:16:55.000000000 +0200
+++ OpenFOAM-v1906/etc/config.sh/scotch	2019-09-04 12:23:52.922744054 +0200
@@ -33,8 +33,10 @@
 #------------------------------------------------------------------------------
 # USER EDITABLE PART: Changes made here may be lost with the next upgrade
 
-SCOTCH_VERSION=scotch_6.0.6
-export SCOTCH_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION/$SCOTCH_VERSION
+##Easybuild## settings
+export SCOTCH_VERSION=scotch_$EBVERSIONSCOTCH
+export SCOTCH_ARCH_PATH=$EBROOTSCOTCH
+[ -d "$SCOTCH_ARCH_PATH" ] || SCOTCH_ARCH_PATH=$SCOTCH_ROOT
 
 # END OF (NORMAL) USER EDITABLE PART
 #------------------------------------------------------------------------------
