diff --git a/install b/install
index 9c2dd00716616dd1a672b65eaa415c8dc73c3c7e..da5082a404954aff0400d8e243d583feb2e48d6f 100755
--- a/install
+++ b/install
@@ -511,6 +511,10 @@ bash_library="$bash_library\""
 echo "$bash_path" > $HOME/openfpm_vars
 echo "$bash_library" >> $HOME/openfpm_vars
 
+if [ x"$platform" = x"osx" ]; then
+    echo "TMPDIR=/tmp/" >> $HOME/openfpm_vars
+fi
+
 echo -e "$installation_report"
 echo ""
 echo ""