From b52611945830990849245c7d5e04256a8511a979 Mon Sep 17 00:00:00 2001
From: Pietro Incardona <incardon@mpi-cbg.de>
Date: Sat, 2 Jan 2021 10:50:25 +0100
Subject: [PATCH] Reinstalling BOOST

---
 CMakeLists.txt   |  2 +-
 build.sh         |  1 +
 install_BOOST.sh | 23 +++++++++++++++++++----
 3 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index f263c79..adaef6a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -42,7 +42,7 @@ elseif ( CUDA_VERSION_MAJOR EQUAL 11 AND CUDA_VERSION_MINOR EQUAL 0 )
 
 endif()
 
-find_package(Boost 1.66.0 REQUIRED COMPONENTS unit_test_framework iostreams program_options OPTIONAL_COMPONENTS fiber context)
+find_package(Boost 1.72.0 REQUIRED COMPONENTS unit_test_framework iostreams program_options OPTIONAL_COMPONENTS fiber context)
 find_package(MPI REQUIRED)
 find_package(PETSc)
 
diff --git a/build.sh b/build.sh
index a535f70..9cb965e 100755
--- a/build.sh
+++ b/build.sh
@@ -43,6 +43,7 @@ fi
 #	kill 73440 87662 87661 73439 51687 51686
 #fi
 
+rm -rf $HOME/openfpm_dependencies/openfpm_vcluster/BOOST
 
 if [ ! -d $HOME/openfpm_dependencies/openfpm_vcluster/BOOST ]; then
         if [ x"$hostname" == x"cifarm-mac-node" ]; then
diff --git a/install_BOOST.sh b/install_BOOST.sh
index c4a1f6a..723da2c 100755
--- a/install_BOOST.sh
+++ b/install_BOOST.sh
@@ -7,11 +7,26 @@ if [ -d "$1/BOOST" ]; then
   exit 0
 fi
 
-wget http://ppmcore.mpi-cbg.de/upload/boost_1_68_0.tar.bz2
-tar -xvf boost_1_68_0.tar.bz2
-cd boost_1_68_0
+wget http://ppmcore.mpi-cbg.de/upload/boost_1_72_0.tar.bz2
+tar -xvf boost_1_72_0.tar.bz2
+cd boost_1_72_0
+if [ x"$4" != x"" ]; then
+	if [ -f $HOME/user-config.jam ]; then
+		mv $HOME/user-config.jam $HOME/user-config.jam_bck
+	fi
+	if [ x"$5" != x"" ]; then
+		echo "using gcc : $5.$6 : $4 ; " > $HOME/user-config.jam
+	else
+		echo "using gcc : : $4 ; " > $HOME/user-config.jam
+	fi
+fi
 ./bootstrap.sh --with-toolset=$3
 mkdir $1/BOOST
 ./b2 -j $2 install --prefix=$1/BOOST
-rm -rf boost_1_68_0
+rm -rf boost_1_72_0
+
+if [ -f $HOME/user-config.jam_bck ]; then
+	mv $HOME/user-config.jam_bck $HOME/user-config.jam
+fi
+rm -rf boost_1_72_0.tar.bz2
 
-- 
GitLab