changeset 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 f4d6ae912a08
files inst/import_meshfunction_type.m inst/import_ufl_BilinearForm.m inst/import_ufl_FunctionSpace.m inst/import_ufl_Functional.m inst/import_ufl_LinearForm.m inst/import_ufl_Problem.m inst/private/generate_makefile.m inst/private/generate_mf_makefile.m
diffstat 8 files changed, 52 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/inst/import_meshfunction_type.m	Thu Aug 14 12:26:55 2014 +0200
+++ b/inst/import_meshfunction_type.m	Thu Aug 14 17:10:29 2014 +0200
@@ -42,10 +42,17 @@
       output += generate_mf_constructor (label);
       output += generate_mf_save (typename, label);
       output += generate_mf_makefile (label, 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 (["make -f Makefile_", label, " all"]);
+        [output, textfile] = ...
+          system (["MKOCTFILE=", shell_script, " make -f Makefile_", label, " all"]);
         if (output != 0)
           display (text);
           error ("compilation failed");
--- a/inst/import_ufl_BilinearForm.m	Thu Aug 14 12:26:55 2014 +0200
+++ b/inst/import_ufl_BilinearForm.m	Thu Aug 14 17:10:29 2014 +0200
@@ -44,10 +44,17 @@
       private = fullfile (path, "include/");
       output = generate_rhs (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 rhs", var_prob));
+        [output, textfile] = system ...
+          (sprintf ("MKOCTFILE=%s make -f Makefile_%s rhs", shell_script, var_prob));
         if (output != 0)
           display (text);
           error ("Compilation failed");
--- a/inst/import_ufl_FunctionSpace.m	Thu Aug 14 12:26:55 2014 +0200
+++ b/inst/import_ufl_FunctionSpace.m	Thu Aug 14 17:10:29 2014 +0200
@@ -42,10 +42,17 @@
       private = fullfile (path, "include/");
       output = generate_fs (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 fs", var_prob));
+        [output, textfile] = system ...
+          (sprintf ("MKOCTFILE=%s make -f Makefile_%s fs", shell_script, var_prob));
         if (output != 0)
           display (text);
           error ("Compilation failed");
--- a/inst/import_ufl_Functional.m	Thu Aug 14 12:26:55 2014 +0200
+++ b/inst/import_ufl_Functional.m	Thu Aug 14 17:10:29 2014 +0200
@@ -42,10 +42,17 @@
       private = fullfile (path, "include/");
       output = generate_fun (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 fun", var_prob));
+        [output, textfile] = system ...
+          (sprintf ("MKOCTFILE=%s make -f Makefile_%s fun", shell_script, var_prob));
         if (output != 0)
           display (text);
           error ("Compilation failed");
--- a/inst/import_ufl_LinearForm.m	Thu Aug 14 12:26:55 2014 +0200
+++ b/inst/import_ufl_LinearForm.m	Thu Aug 14 17:10:29 2014 +0200
@@ -43,10 +43,17 @@
 
       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 lhs", var_prob));
+        [output, textfile] = system ...
+          (sprintf ("MKOCTFILE=%s make -f Makefile_%s lhs", shell_script, var_prob));
         if (output != 0)
           display (text);
           error ("Compilation failed");
--- 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");
--- a/inst/private/generate_makefile.m	Thu Aug 14 12:26:55 2014 +0200
+++ b/inst/private/generate_makefile.m	Thu Aug 14 17:10:29 2014 +0200
@@ -24,8 +24,8 @@
 DIR = @@PATH@@\n\
 CPPFLAGS+=@@FF_CPPFLAGS@@ -g\n\
 LIBS+=@@FF_LIBS@@\n\
-MKOCTFILE = mkoctfile\n\
-FFC = ffc\n\
+MKOCTFILE ?= mkoctfile\n\
+FFC ?= ffc\n\
 \n\
 OCTFILES = @@UFL_NAME@@_FunctionSpace.oct @@UFL_NAME@@_BilinearForm.oct @@UFL_NAME@@_LinearForm.oct\n\
 \n\
--- a/inst/private/generate_mf_makefile.m	Thu Aug 14 12:26:55 2014 +0200
+++ b/inst/private/generate_mf_makefile.m	Thu Aug 14 17:10:29 2014 +0200
@@ -24,8 +24,8 @@
 DIR = @@PATH@@\n\
 CPPFLAGS+=@@FF_CPPFLAGS@@ -g\n\
 LIBS+=@@FF_LIBS@@\n\
-MKOCTFILE = mkoctfile\n\
-FFC = ffc\n\
+MKOCTFILE ?= mkoctfile\n\
+FFC ?= ffc\n\
 \n\
 OCTFILES = MeshFunction_@@LABEL@@.oct save_@@LABEL@@.oct\n\
 \n\