Repository: google-deepmind/open_spiel (language: python)

Issue:
Problem with Julia API when installed in /usr/local
Hi @findmyway, we had to move our CI away from Travis and to Github Actions this week. The problem is that the Julia tests are now failing again, see here: https://github.com/jblespiau/open_spiel-1/runs/1595264912?check_suite_focus=true

The problem is similar to https://github.com/deepmind/open_spiel/issues/201 except the command I used before no longer works because I copied the library to the $HOME/packages/julias/julia-1.3.1. See here: https://github.com/deepmind/open_spiel/blob/32a3d303e0ce710f2ef70a3214d26640cde97bf7/open_spiel/scripts/install.sh#L197

Now the machines have Julia installed in /usr/local/julia1.5.3, and this might generally happen on the user side. So we'll probably need to do a sudo to copy the file. I think we can do this in our install script as long as we echo something like why we requiring sudo... but even if that works, it does not feel like an elegant solution. Do you have a better idea about how to fix this?




Discussion / hints:
Hi @lanctot ,

I think we don't need to copy the library with Julia (and CxxWrap) of the latest version. The required change should be minor but I need to verify it first. (My response may be slow due to the Chinese New Year 😃 )
Great. Happy Chinese New Year!

No rush on this. We have disabled the Julia API in all of our tests until we can figure it out.



Fix patch:
diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml
index fbbb57e66b..35316fff97 100644
--- a/.github/workflows/actions.yml
+++ b/.github/workflows/actions.yml
@@ -31,7 +31,7 @@ jobs:
          # shared library with linkable third party dependencies in place.
         - os: ubuntu-20.04
           DEFAULT_OPTIONAL_DEPENDENCY: "ON"
-          BUILD_WITH_JULIA: "OFF"
+          BUILD_WITH_JULIA: "ON"
           TRAVIS_USE_NOX: 0
           BUILD_SHARED_LIB: "ON"
           BUILD_WITH_ORTOOLS: "ON"
diff --git a/open_spiel/julia/Project.toml b/open_spiel/julia/Project.toml
index b0c55b1e0d..56dc33bcdb 100644
--- a/open_spiel/julia/Project.toml
+++ b/open_spiel/julia/Project.toml
@@ -7,7 +7,7 @@ version = "0.1.1"
 CxxWrap = "1f15a43c-97ca-5a2a-ae31-89f07a497df4"
 
 [compat]
-CxxWrap = "0.10.1"
+CxxWrap = "0.11.2"
 julia = "1.3"
 
 [extras]
diff --git a/open_spiel/scripts/install.sh b/open_spiel/scripts/install.sh
index d80e7bd48f..87db8e761d 100755
--- a/open_spiel/scripts/install.sh
+++ b/open_spiel/scripts/install.sh
@@ -165,13 +165,13 @@ fi
 # Install Julia if required and not present already.
 if [[ ${BUILD_WITH_JULIA:-"OFF"} == "ON" ]]; then
   # Check that Julia is in the path.
-  if [[ ! -x `which julia` ]]
+  if [[ ! -x `which julia` ]] || [ "$(julia -e 'println(VERSION >= v"1.6.0-rc1")')" == "false" ]
   then
-    echo -e "\e[33mWarning: julia not in your PATH. Trying \$HOME/.local/bin\e[0m"
-    PATH=${PATH}:${HOME}/.local/bin
+    echo -e "\e[33mWarning: julia not in your PATH or its too old. Trying \$HOME/.local/bin\e[0m"
+    PATH=${HOME}/.local/bin:${PATH}
   fi
 
-  if which julia >/dev/null; then
+  if which julia >/dev/null && [ "$(julia -e 'println(VERSION >= v"1.6.0-rc1")')" == "true" ] ; then
     JULIA_VERSION_INFO=`julia --version`
     echo -e "\e[33m$JULIA_VERSION_INFO is already installed.\e[0m"
   else
@@ -189,14 +189,9 @@ if [[ ${BUILD_WITH_JULIA:-"OFF"} == "ON" ]]; then
       curl https://raw.githubusercontent.com/abelsiqueira/jill/master/jill.sh -o jill.sh
       mv jill.sh $JULIA_INSTALLER
     fi
-    JULIA_VERSION=1.3.1 bash $JULIA_INSTALLER -y
+    JULIA_VERSION=1.6.0-rc1 bash $JULIA_INSTALLER -y
     # Should install in $HOME/.local/bin which was added to the path above
-    [[ -x `which julia` ]] || die "julia not found PATH after install."
-    # This is needed on Ubuntu 19.10 and above, see:
-    # https://github.com/deepmind/open_spiel/issues/201
-    if [[ -f /usr/lib/x86_64-linux-gnu/libstdc++.so.6 ]]; then
-      cp /usr/lib/x86_64-linux-gnu/libstdc++.so.6 $HOME/packages/julias/julia-1.3.1/lib/julia
-    fi
+    [[ -x `which julia` ]] && [ "$(julia -e 'println(VERSION >= v"1.6.0-rc1")')" == "true" ] || die "julia not found PATH after install."
   fi
 
   # Install dependencies.


Test patch:
diff --git a/open_spiel/scripts/build_and_run_tests.sh b/open_spiel/scripts/build_and_run_tests.sh
index 897fb204f7..8ae7fd914a 100755
--- a/open_spiel/scripts/build_and_run_tests.sh
+++ b/open_spiel/scripts/build_and_run_tests.sh
@@ -133,11 +133,11 @@ mkdir -p $BUILD_DIR
 # Configure Julia compilation if required.
 if [[ ${BUILD_WITH_JULIA:-"OFF"} == "ON" ]]; then
   # Check that Julia is in the path.
-  if [[ ! -x `which julia` ]]
+  if [[ ! -x `which julia` ]] || [[ "$(julia -e 'println(VERSION >= v"1.6.0-rc1")')" == "false" ]]
   then
-    echo -e "\e[33mWarning: julia not in your PATH. Trying \$HOME/.local/bin\e[0m"
-    PATH=${PATH}:${HOME}/.local/bin
-    [[ -x `which julia` ]] || die "could not find julia command. Please add it to PATH and rerun."
+    echo -e "\e[33mWarning: julia not in your PATH or it's too old. Trying \$HOME/.local/bin\e[0m"
+    PATH=${HOME}/.local/bin:${PATH}
+    [[ -x `which julia` ]] && [[ "$(julia -e 'println(VERSION >= v"1.6.0-rc1")')" == "true" ]] || die "could not find julia command. Please add it to PATH and rerun."
   fi
   LIBCXXWRAP_JULIA_DIR=`julia --project=${MYDIR}/../julia -e 'using CxxWrap; print(dirname(dirname(CxxWrap.CxxWrapCore.libcxxwrap_julia_jll.libcxxwrap_julia_path)))'`
   JULIA_VERSION_INFO=`julia --version`