diff inst/import_ufl_Problem.m @ 269:897e312cb440

Ensure the mkoctfile installed with running octave is used * inst/import_*.m: find the right mkoctfile and pass it through the environment * inst/private/generate_*.m: get mkoctfile from the environment
author Eugenio Gianniti <eugenio.gianniti@mail.polimi.it>
date Thu, 14 Aug 2014 17:10:29 +0200
parents 61830a4f9ab9
children
line wrap: on
line diff
--- a/inst/import_ufl_Problem.m	Thu Aug 14 12:26:55 2014 +0200
+++ b/inst/import_ufl_Problem.m	Thu Aug 14 17:10:29 2014 +0200
@@ -43,10 +43,17 @@
       output += generate_rhs (var_prob);
       output += generate_lhs (var_prob);
       output += generate_makefile (var_prob, private);
+
+      # Find correct mkoctfile for this version of Octave
+      bindir = octave_config_info ("bindir");
+      ext = octave_config_info ("EXEEXT");
+      shell_script = fullfile (bindir, sprintf ("mkoctfile-%s%s", OCTAVE_VERSION, ext));
+
       if (output != 0)
         error ("Compilation failed");
       else
-        [output, textfile] = system (sprintf ("make -f Makefile_%s all", var_prob));
+        [output, textfile] = system ...
+          (sprintf ("MKOCTFILE=%s make -f Makefile_%s all", shell_script, var_prob));
         if (output != 0)
           display (text);
           error ("Compilation failed");