diff --git a/tools/build_macosx.sh b/tools/build_macosx.sh
index 80cd0d87979a437bb1b861b39a2f2ca56ee87768..8787225e02e833a40f306c4c060ed1e91bbe5ab1 100755
--- a/tools/build_macosx.sh
+++ b/tools/build_macosx.sh
@@ -1,6 +1,7 @@
 #!/bin/bash
 
-export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/Cellar/openblas/0.3.13/lib/pkgconfig/:${PKG_CONFIG_PATH}
+# setup openblas
+. ~/.bash_profile
 
 cd build-starpu
 cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/../install -DCHAMELEON_PREC_D=OFF -DCHAMELEON_PREC_C=OFF -DCHAMELEON_PREC_Z=OFF -DBLA_PREFER_PKGCONFIG=ON -DBUILD_SHARED_LIBS=ON