From f1424eec0d9a86297443827f56a10e621218744e Mon Sep 17 00:00:00 2001
From: Incardona Pietro <incardon@mpi-cbg.de>
Date: Thu, 25 Nov 2021 14:12:09 +0100
Subject: [PATCH] Fixing CMake for openfpm_devices

---
 configure             | 3 ++-
 install               | 4 +++-
 openfpm_devices       | 2 +-
 script/solve_clangomp | 2 +-
 4 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/configure b/configure
index 89b52e494..e72ddba21 100755
--- a/configure
+++ b/configure
@@ -583,7 +583,8 @@ cd build
 
 ## remove enerything
 echo "Calling cmake ../. $conf_options"
-printf "cmake ../. $conf_options" > cmake_build_options 
+printf "cmake ../. $conf_options" > cmake_build_options
+rm ../openfpm_devices/error_code
 rm ../error_code
 DYLD_LIBRARY_PATH=$ld_lib_pathopt cmake ../. $conf_options
 if [ $? != 0 ]; then
diff --git a/install b/install
index 6b7fc8730..58360efd4 100755
--- a/install
+++ b/install
@@ -318,6 +318,7 @@ HDF5_installed=0
 HDF5_System_prv=1
 LIBHILBERT_installed=0
 VCDEVEL_installed=0
+CLANGOMP_installed=0
 conf_err=1
 
 
@@ -402,7 +403,7 @@ else
             configure_options=" $configure_options --with-vcdevel=$i_dir/VCDEVEL "
             VCDEVEL_installed=1
         elif [ $conf_err -eq 220 ]; then
-	    if [ x"$platform" == x"OSX" ]; then
+	    if [ x"$platform" == x"osx" ]; then
             	echo "OpenMP has not been found for your compiler"
             	if [ $CLANGOMP_installed -eq 1 ]; then
                 	echo "Error the installation of openmp for clang failed"
@@ -411,6 +412,7 @@ else
             	solve_clangomp $platform
             	CLANGOMP_installed=1
 	    else
+		echo "We do not know how to install OpenMP for your compiler"
 	        exit 1
 	    fi
         elif [ $conf_err -ne 0 ]; then
diff --git a/openfpm_devices b/openfpm_devices
index 00da05888..50bea04ad 160000
--- a/openfpm_devices
+++ b/openfpm_devices
@@ -1 +1 @@
-Subproject commit 00da0588866ba06ebf971b45645eabcaeabb4b35
+Subproject commit 50bea04ad0d2ea9ce9310f2ad515128e12ead1a0
diff --git a/script/solve_clangomp b/script/solve_clangomp
index 08048c06d..83e20afa7 100755
--- a/script/solve_clangomp
+++ b/script/solve_clangomp
@@ -12,7 +12,7 @@ if [ x"$pcman" = x"" ]; then
 fi
 
 if [ x"$1" = x"osx" ]; then 
-        commands[0]="$pcman install clang-omp"
+        commands[0]="$pcman install libomp"
         possible_solutions "${commands[@]}"
 fi 
 }
-- 
GitLab