Giter Club home page Giter Club logo

Comments (7)

apjanke avatar apjanke commented on June 15, 2024

Based on https://github.com/Homebrew/homebrew-science/issues/1275, it sounds like that error happens if gnuplot was built without Qt bindings. And indeed, in the gnuplot formula, the qt dependency is :optional, not :recommended.

Meanwhile, the GUI for my Octave.app build is not plotting anything.

>> sombrero

set term qt
         ^
line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list

WARNING: Error during initialization


gnuplot> set terminal aqua enhanced title "Figure 1" size 560 420  font "*,6.66667" dashlength 1
                      ^
         line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list

WARNING: Plotting with an 'unknown' terminal.
No output will be generated. Please select a terminal with 'set terminal'.

I'm going to try customizing the gnuplot formula to install the Qt bindings.

from octave-app.

apjanke avatar apjanke commented on June 15, 2024

That was at least part of it. Building gnuplot with Qt bindings made plotting work again, and I think I'm seeing fewer of the "unknown or ambiguous terminal type" errors in the test suite. But some of them are still there.

  publish.tst .................................................
set term qt
         ^
line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list

WARNING: Error during initialization

  ./base/gsicc_manage.c:1172: gsicc_open_search(): Could not find default_rgb.icc
| ./base/gsicc_manage.c:1838: gsicc_set_device_profile(): cannot find device profile

set term qt
         ^
line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list

WARNING: Error during initialization

  ./base/gsicc_manage.c:1172: gsicc_open_search(): Could not find default_rgb.icc
| ./base/gsicc_manage.c:1838: gsicc_set_device_profile(): cannot find device profile

set term qt
         ^
line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list

WARNING: Error during initialization

  ./base/gsicc_manage.c:1172: gsicc_open_search(): Could not find default_rgb.icc
| ./base/gsicc_manage.c:1838: gsicc_set_device_profile(): cannot find device profile
...

Made a gnuplot-octave-app formula for the customizations. Enabled Cairo while I was in there, since I had seen Schoeps do that in his formulae, I think.

Fewer failing tests; we're down to 4.

Summary:

  PASS                            14933
  FAIL                                4

from octave-app.

apjanke avatar apjanke commented on June 15, 2024

I reinstalled my main Homebrew's gnuplot --with-qt --with-cairo to see if that would make the errors in the test suite go away. Suspected maybe Octave was calling out to a default /usr/local/bin/gnuplot for some of its work.

They didn't go away. That wasn't it.

from octave-app.

apjanke avatar apjanke commented on June 15, 2024

This is one of the tests that triggered it. I determined this by doing test legend verbose.

***** testif ; any (strcmp ("gnuplot", available_graphics_toolkits ()))
 toolkit = graphics_toolkit ("gnuplot");
 h = figure ("visible", "off");
 unwind_protect
   position = get (h, "position");
   plot (rand (3));
   legend ();
   filename = sprintf ("%s.eps", tempname ());
   print (filename);
   unlink (filename);
   assert (get (h, "position"), position);
 unwind_protect_cleanup
   close (h);
   graphics_toolkit (toolkit);
 end_unwind_protect

It happens at the print step.

>> toolkit = graphics_toolkit ("gnuplot")
toolkit = qt
>> h = figure ("visible", "off");
>> position = get (h, "position");
>> plot (rand (3));
>> legend ();
>> filename = sprintf ("%s.eps", tempname ());
>> print (filename);

set term qt
         ^
line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list

WARNING: Error during initialization

>>

Stepping through print, I can observe that it happens at line 568, where __gnuplot_print__ is called.

    switch (tk)
      case "gnuplot"
        opts = __gnuplot_print__ (opts);

Stepping through scripts/plot/util/private/__gnuplot_print__.m, I can observe it happens at:

78:         eps_drawnow (opts, opts.name, gp_opts);
218:     local_drawnow (["postscript eps " gp_opts], epsfile, opts);
230:    drawnow (term, file);
__gnuplot_draw_now__.m: 39:       plot_stream = __gnuplot_open_stream__ (2, h);
__gnuplot_open_stream: 32:     [plot_stream(1), plot_stream(2), pid] = popen2 (prog, args{:});

debug> prog
prog = gnuplot
debug> args
args = {}(0x0)
debug> system('which gnuplot')
/Applications/Octave-4.4.0.app/Contents/Resources/usr/bin//gnuplot
debug> dbstack
stopped in:

  -->         __gnuplot_open_stream__ at line 32 [/Applications/Octave-4.4.0.app/Contents/Resources/usr/Cellar/octave_4.4.0/4.4.0/share/octave/4.4.0/m/plot/util/private/__gnuplot_open_stream__.m]
                  __gnuplot_drawnow__ at line 39 [/Applications/Octave-4.4.0.app/Contents/Resources/usr/Cellar/octave_4.4.0/4.4.0/share/octave/4.4.0/m/plot/util/__gnuplot_drawnow__.m]
      __gnuplot_print__>local_drawnow at line 230 [/Applications/Octave-4.4.0.app/Contents/Resources/usr/Cellar/octave_4.4.0/4.4.0/share/octave/4.4.0/m/plot/util/private/__gnuplot_print__.m]
        __gnuplot_print__>eps_drawnow at line 218 [/Applications/Octave-4.4.0.app/Contents/Resources/usr/Cellar/octave_4.4.0/4.4.0/share/octave/4.4.0/m/plot/util/private/__gnuplot_print__.m]
                    __gnuplot_print__ at line 78 [/Applications/Octave-4.4.0.app/Contents/Resources/usr/Cellar/octave_4.4.0/4.4.0/share/octave/4.4.0/m/plot/util/private/__gnuplot_print__.m]
                                print at line 568 [/Applications/Octave-4.4.0.app/Contents/Resources/usr/Cellar/octave_4.4.0/4.4.0/share/octave/4.4.0/m/plot/util/print.m]

Maybe print using the plain "gnuplot" graphics toolkit is an issue?

It's calling out to plain gnuplot, which in that environment resolves to the bundled gnuplot.

Hmm. I get the same error when calling that bundled gnuplot from the command line.

$ GNUTERM=qt /Applications/Octave-4.4.0.app/Contents/Resources/usr/bin//gnuplot

	G N U P L O T
	Version 5.2 patchlevel 4    last modified 2018-06-01
...
Terminal type is now 'unknown'

set term qt
         ^
unknown or ambiguous terminal type; type just 'set terminal' for a list

WARNING: Error during initialization

Maybe it was built wrong, or has trouble linking to Qt libs at the non-default location? I did an otool -L on it, and it's not showing any Qt libraries. My /usr/local/bin/gnuplot does.

from octave-app.

apjanke avatar apjanke commented on June 15, 2024

Aha, that was the problem: a bad gnuplot-octave-app build. When I changed the dependency from qt to qt-octave-app, the implicit --with-qt option went away, and I needed to add in an explicit option --without-qt to make the build.with?("qt") tests work right. (Since I'm still just calling the option "qt" instead of renaming the tests and option.)

Fixed in octave-app/homebrew-octave-app-bases@9d8616f.

Rebuilt Octave.app with a fixed gnuplot-octave-app, and those errors went away.

from octave-app.

apjanke avatar apjanke commented on June 15, 2024

This problem came back in the 4.4.1 RC1 build. We switched to using an un-hacked qt formula, and that had the side effect of restoring the --with-qt option and making it non-default. So its newly-grabbed gnuplot formula was building without Qt.

I modified our gnuplot_5.2.6 formula to build with Qt in octave-app/homebrew-octave-app@fcbbd59

from octave-app.

apjanke avatar apjanke commented on June 15, 2024

That fixed it.

from octave-app.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.