diff -uNr a/src/configure.ac b/src/configure.ac
--- a/src/configure.ac	2020-01-04 12:49:06.000000000 -0500
+++ b/src/configure.ac	2020-08-25 13:47:59.000000000 -0400
@@ -252,5 +252,30 @@
   AC_DEFINE([HAVE_OCTAVE_BASE_VALUE_PRINT_CONST],[1],[Define if octave_base_value::print is const-qualified])
 fi
 
+AC_CACHE_CHECK([whether first catop function argument is const-qualified],
+  [comm_cv_octave_first_catop_fcn_arg_const_qualified],
+  [comm_save_CPPFLAGS=$CPPFLAGS
+   comm_save_CXXFLAGS=$CXXFLAGS
+   CPPFLAGS="$CPPFLAGS $HDF5_CFLAGS"
+   CXXFLAGS="$CXXFLAGS $comm_CXXFLAGS"
+   AC_LANG_PUSH(C++)
+   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+       #include <octave/oct.h>
+       #include <octave/ov-typeinfo.h>
+       ]], [[
+       octave_value foobar_fcn (const octave_base_value&,
+                                const octave_base_value&,
+                                const Array<octave_idx_type>& ra_idx);
+       octave::type_info::cat_op_fcn fcn = foobar_fcn;
+       ]])],
+     [comm_cv_octave_first_catop_fcn_arg_const_qualified=yes],
+     [comm_cv_octave_first_catop_fcn_arg_const_qualified=no])
+   AC_LANG_POP(C++)
+   CPPFLAGS=$comm_save_CPPFLAGS
+   CXXFLAGS=$comm_save_CXXFLAGS])
+if test $comm_cv_octave_first_catop_fcn_arg_const_qualified = yes; then
+  AC_DEFINE([HAVE_OCTAVE_FIRST_CATOP_ARG_CONST],[1],[Define if first catop function argument is const-qualified])
+fi
+
 AC_CONFIG_FILES([Makefile])
 AC_OUTPUT
diff -uNr a/src/galois-ops.h b/src/galois-ops.h
--- a/src/galois-ops.h	2020-01-04 12:49:06.000000000 -0500
+++ b/src/galois-ops.h	2020-08-25 14:00:18.000000000 -0400
@@ -40,11 +40,19 @@
 #endif
 
 #if ! defined (CATOPDECL)
-#  define CATOPDECL(name, a1, a2)                                       \
+#  if defined (HAVE_OCTAVE_FIRST_CATOP_ARG_CONST)
+#    define CATOPDECL(name, a1, a2)                                     \
+  static octave_value                                                   \
+  CONCAT2(oct_catop_, name) (const octave_base_value& a1,               \
+                             const octave_base_value& a2,               \
+                             const Array<octave_idx_type>& ra_idx)
+#  else
+#    define CATOPDECL(name, a1, a2)                                     \
   static octave_value                                                   \
   CONCAT2(oct_catop_, name) (octave_base_value& a1,                     \
                              const octave_base_value& a2,               \
                              const Array<octave_idx_type>& ra_idx)
+#  endif
 #endif
 
 // Override the operator and function definition defines from Octave
@@ -124,7 +132,24 @@
     return new octave_galois (f (v1.t1 ## _value (), v2.matrix_value ())); \
   }
 
-#define DEFCATOP_G_FN(name, t1, t2, f) \
+#if defined (HAVE_OCTAVE_FIRST_CATOP_ARG_CONST)
+#  define DEFCATOP_G_FN(name, t1, t2, f) \
+  CATOPDECL (name, a1, a2) \
+  { \
+    CAST_BINOP_ARGS (const octave_ ## t1&, const octave_ ## t2&); \
+    return new octave_galois (f (v1.t1 ## _value (), v2.t2 ## _value (), \
+                                 ra_idx)); \
+  }
+
+#define DEFCATOP_G_METHOD(name, t1, t2, f) \
+  CATOPDECL (name, a1, a2) \
+  { \
+    CAST_BINOP_ARGS (const octave_ ## t1&, const octave_ ## t2&); \
+    return new octave_galois (v1.t1 ## _value (). f (v2.t2 ## _value (), \
+                                                     ra_idx)); \
+  }
+#else
+#  define DEFCATOP_G_FN(name, t1, t2, f) \
   CATOPDECL (name, a1, a2) \
   { \
     CAST_BINOP_ARGS (octave_ ## t1&, const octave_ ## t2&); \
@@ -139,6 +164,7 @@
     return new octave_galois (v1.t1 ## _value (). f (v2.t2 ## _value (), \
                                                      ra_idx)); \
   }
+#endif
 
 #define INSTALL_G_CATOP(t1, t2, f) INSTALL_CATOP (t1, t2, f)
 
diff -uNr a/src/op-gm-s.cc b/src/op-gm-s.cc
--- a/src/op-gm-s.cc	2020-01-04 12:49:06.000000000 -0500
+++ b/src/op-gm-s.cc	2020-08-25 13:50:19.000000000 -0400
@@ -68,7 +68,11 @@
 
 DEFCATOP (gm_s, galois, scalar)
 {
+#if defined (HAVE_OCTAVE_FIRST_CATOP_ARG_CONST)
+  CAST_BINOP_ARGS (const octave_galois&, const octave_scalar&);
+#else
   CAST_BINOP_ARGS (octave_galois&, const octave_scalar&);
+#endif
   return new octave_galois (v1.galois_value (). concat (v2.matrix_value (),
                                                         ra_idx));
 }
diff -uNr a/src/op-s-gm.cc b/src/op-s-gm.cc
--- a/src/op-s-gm.cc	2020-01-04 12:49:06.000000000 -0500
+++ b/src/op-s-gm.cc	2020-08-25 14:51:01.000000000 -0400
@@ -81,7 +81,11 @@
 
 DEFCATOP (s_gm, scalar, galois)
 {
+#if defined (HAVE_OCTAVE_FIRST_CATOP_ARG_CONST)
+  CAST_BINOP_ARGS (const octave_scalar&, const octave_galois&);
+#else
   CAST_BINOP_ARGS (octave_scalar&, const octave_galois&);
+#endif
   return new octave_galois (concat (v1.matrix_value (), v2.galois_value (),
                                     ra_idx));
 }
