diff --git a/src/binary_c_maths.h b/src/binary_c_maths.h
index 6cff7d724302e2c9909d11e17794ec207c77fc7b..2dcdcb7c10422aeb41ca2c64f529578767c20c02 100644
--- a/src/binary_c_maths.h
+++ b/src/binary_c_maths.h
@@ -22,7 +22,9 @@
  * mathematical in nature.
  */
 
+#ifndef _GNU_SOURCE
 #define _GNU_SOURCE
+#endif //_GNU_SOURCE
 #include <math.h>
 #include <float.h>
 #include <stdarg.h>
diff --git a/src/debug/backtrace-symbols.c b/src/debug/backtrace-symbols.c
index 61648e7110ab0fcf5c1d6a19b9c53cf012e8b95b..bcf9b85453a6cb4adecc3688173b6271d9c0fe46 100644
--- a/src/debug/backtrace-symbols.c
+++ b/src/debug/backtrace-symbols.c
@@ -1,6 +1,9 @@
 #define __BINARY_C_LINT_SKIP
 #define __NATIVE_ALL__
+
+#ifndef _GNU_SOURCE
 #define _GNU_SOURCE
+#endif // _GNU_SOURCE
 #include "binary_c_code_options.h"
 #include "binary_c_debug.h"
 #include "../binary_c.h"
diff --git a/ubuntu_install_binary_c.sh b/ubuntu_install_binary_c.sh
index a96f1d038663ecdb65627c387cdc9ea178b607e2..6aaf74ae4c7aa9435b8f1877c6f83be65d513fca 100755
--- a/ubuntu_install_binary_c.sh
+++ b/ubuntu_install_binary_c.sh
@@ -38,6 +38,8 @@ export CC
 export BINARY_C
 export GITROOT
 
+GITLAB="gitlab.eps.surrey.ac.uk/ri0005"
+
 echo
 echo "#########################################################"
 echo "Binary_c installation script for Ubuntu/Kubuntu 20/21+"
@@ -151,11 +153,16 @@ complete -F _binary_c binary_c
 complete -F _binary_c tbse
 complete -F _binary_c tbse.mint
 complete -F _binary_c tbse.IRAS
+
+# for binarycpython
+export GSL_DIR=`gsl-config --prefix`
+
 ' >> $BASHRC
     fi
 
     # some of the above we require now
-    export LD_LIBRARY_PATH=$HOME/lib:$BINARY_C:$BINARY_C/src
+    export LD_LIBRARY_PATH="$HOME/lib:$BINARY_C:$BINARY_C/src"
+    export LIBRARY_PATH="$LD_LIBRARY_PATH"
     export PATH=$HOME/bin:$HOME/.local/bin:$PATH
     if [ -f $HOME/perl5/perlbrew/etc/bashrc ];
     then
@@ -171,7 +178,7 @@ function install_from_surrey_git
     # download and install $PACKAGE
     mkdir -p $GITROOT
     cd $GITROOT
-    $WGET https://gitlab.eps.surrey.ac.uk/ri0005/$PACKAGE/-/archive/master/$PACKAGE-master.zip -O $PACKAGE-master.zip
+    $WGET https://$GITLAB/$PACKAGE/-/archive/master/$PACKAGE-master.zip -O $PACKAGE-master.zip
     unzip -o $PACKAGE-master.zip
     cd $PACKAGE-master/
     if [ -d builddir ];
@@ -191,7 +198,7 @@ function install_binary_c_from_zip
     exit
     fi
     cd /tmp # work from /tmp
-    $WGET https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/archive/master/binary_c-master.zip -O binary_c-master.zip
+    $WGET https://$GITLAB/binary_c/-/archive/master/binary_c-master.zip -O binary_c-master.zip
     unzip -o binary_c-master.zip
     rm binary_c-master.zip
     mv binary_c-master $BINARY_C
@@ -206,7 +213,7 @@ function install_binary_c_from_git_https
 {
     # download and install binary_c
     echo "Install to BINARY_C=$BINARY_C"
-    git clone --branch master --single-branch https://gitlab.eps.surrey.ac.uk/ri0005/binary_c.git $BINARY_C
+    git clone --branch master --single-branch https://$GITLAB/binary_c.git $BINARY_C
     rm -rf $BINARY_C/builddir 2>/dev/null
     cd $BINARY_C
     meson -Dbuildtype=release -Dvalgrind=true $BINARY_C/builddir
@@ -284,6 +291,14 @@ function install_perl
     perlbrew -f install-cpanm
 }
 
+function install_binary_c_python
+{
+    # install the binary_c Python module
+    export LIBRARY_PATH=$LD_LIBRARY_PATH
+    pip3 install -U pip setuptools
+    pip3 install git+https://$GITLAB/binary_c-python.git
+}
+
 function update_packages
 {
     # update and install a KDE desktop :)
@@ -330,6 +345,10 @@ select yn in "Yes" "No"; do
     esac
 done
 
+# now we can set GSL_DIR because GSL has been installed
+# (or at least should have been)
+export GSL_DIR=`gsl-config --prefix`
+
 # install perl from perlbrew
 echo "Install perlbrew and custom Perl?"
 select yn in "Yes" "No"; do
@@ -386,6 +405,15 @@ select yn in "Yes" "No"; do
     esac
 done
 
+echo "Install binary_c-python?"
+select yn in "Yes" "No"; do
+    case $yn in
+        Yes ) install_binary_c_python; break;;
+        No ) break;;
+    esac
+done
+
+
 # install MINT data?
 echo "Download MINT data?"
 select yn in "Yes" "No"; do
@@ -396,7 +424,7 @@ select yn in "Yes" "No"; do
 done
 
 # run test population
-echo "Run a test stellar population to make sure everything works?"
+echo "Run a test binary_grid stellar population to make sure everything works?"
 select yn in "Yes" "No"; do
     case $yn in
         Yes ) run_test_population; break;;