Repository: pyccel/pyccel (language: python)

Issue:
[CI] MacOS gfortran installation problem
### Describe the bug
The installation of MacOS is failing. This occurs because the file `/usr/local/bin/gfortran` does not exist, but neither does `/usr/local/bin/gfortran-*`

It is not clear if it is simply the installation directory which has changed or if the installation is missing entirely



Discussion / hints:

Fix patch:
diff --git a/.github/actions/macos_install/action.yml b/.github/actions/macos_install/action.yml
index 212c79d24c..5f166c9f4d 100644
--- a/.github/actions/macos_install/action.yml
+++ b/.github/actions/macos_install/action.yml
@@ -7,9 +7,14 @@ runs:
       run: |
         brew install open-mpi
         brew install libomp
-        if [[ ! -f "/usr/local/bin/gfortran" ]]; then
-          gfort=$(ls /usr/local/bin/gfortran-* | tail -n 1)
-          ln -s ${gfort} /usr/local/bin/gfortran
+        GFORTRAN_HOME=$(which gfortran || true)
+        echo "GFORTRAN_HOME : $GFORTRAN_HOME"
+        if [[ ! -f "$GFORTRAN_HOME" ]]; then
+          gfort=$(find ${PATH//:/\/ } -name 'gfortran-*' -exec basename {} \; | sort | tail -n 1 || true)
+          echo "Found $gfort"
+          gfort_path=$(which ${gfort})
+          folder=$(dirname ${gfort_path})
+          ln -s ${gfort_path} ${folder}/gfortran
         fi
         echo "MPI_OPTS=--oversubscribe" >> $GITHUB_ENV
       shell: bash


Test patch:
diff --git a/tests/epyccel/test_epyccel_generators.py b/tests/epyccel/test_epyccel_generators.py
index b34ecac734..b8ab776985 100644
--- a/tests/epyccel/test_epyccel_generators.py
+++ b/tests/epyccel/test_epyccel_generators.py
@@ -120,7 +120,7 @@ def f(b : 'float[:]'):
 
     f_epyc = epyccel(f, language = language)
 
-    assert f(x) == f_epyc(x)
+    assert np.isclose(f(x), f_epyc(x), rtol=1e-14, atol=1e-14)
 
 @pytest.mark.parametrize( 'language', (
         pytest.param("fortran", marks = pytest.mark.fortran),
diff --git a/tests/symbolic/test_symbolic.py b/tests/symbolic/test_symbolic.py
index c46ac94f1c..11f0b813f0 100644
--- a/tests/symbolic/test_symbolic.py
+++ b/tests/symbolic/test_symbolic.py
@@ -14,8 +14,8 @@
 from pyccel.codegen.codegen import Codegen
 from pyccel.errors.errors   import Errors
 
-RTOL = 1e-12
-ATOL = 1e-16
+RTOL = 1e-13
+ATOL = 1e-14
 
 base_dir = os.path.dirname(os.path.realpath(__file__))
 path_dir = os.path.join(base_dir, 'scripts')