Png terminal does not work gnuplot in OS X 10.8.4

I started using gnuplot in my macbook pro. I am using OS X 10.8.4. Whenever I install terminal in png using

set the term png

he gave an error: unknown or ambiguous terminal type; enter only "set terminal" for the list

Does anyone know this?

+4
source share
1 answer

You need to reinstall the gnuplot package and its dependent package. Maybe you need libpng, libgd.

From the manual

Install gnuplot on Mac OS X 10.6

I wanted to install gnuplot, the infamous data visualization tool, on my laptop running Mac OS X 10.6.6. I got the idea (perhaps from this page) that I should build gnuplot from its source sources. Of course, this led to half a mile of dependencies, which are also required for compilation, mainly through libgd. Fortunately, this libgd and Mac OS X document from the libgd wiki delivered me most of the way.

If you want gnuplot on Mac OS X, you can consider DarwinPorts or Fink, a package system designed to prevent the problems that I work below. I avoided packaging systems on my computers, but not for reasonable or even practical reasons.

The following is a summary of the specific steps I need to take to get gnuplot working on my machine. I am sending this to the future for seekers of this information, including, probably, me, therefore Ive included detailed error messages and supporting data to match the relevant search condition.

A few caveats: Im hardly an expert in any of these libraries, or even an expert on creating software for Mac OS X. This may not even be the easiest way to get gnuplot to work on Mac OS X. I canโ€™t promise these instructions will work for you, and I cannot promise to support them. But suggestions for improving these instructions are welcome.

Since this is a snapshot in time, and the time can be reached between the time I write it and the time you read it, we start with a list of version numbers that act as a cover for the specifics of these instructions:

Mac OS X 10.6.6, with Xcode development tools and X11 libraries installed gnuplot 4.4.2 libgd 2.0.35 zlib 1.2.5 libjpeg v8c FreeType 2.4.4. Install Xcode

If you do not already have the Xcode development tools and the X11 library, install the Mac OS X 10.6 Snow Leopard disk, run it and install it. You will not run the Xcode application, but the packages you install use the GNU development tools that are installed using Xcode to create the software.

Install PATH

In the libgd document, we recommend that you verify that / usr / local / bin is in front of your look-up PATH command. I'm not sure if this was strictly necessary for me, but it could not hurt. I put everything in my defaults to set locations, which usually means / usr / local.

export PATH=/usr/local/bin:$PATH 

Download and unpack

Using the list above, visit each software website, go to the download sections and get the latest .tar.gz source archives. I will not refer to them directly, because open source websites change frequently and you can choose a specific mirror or a new version. If you download them by clicking on them in your web browser, your browser is likely to save these files in the Downloads directory.

Unzip the archive for each file. Each of these projects uses the best practice of unpacking archives into a subdirectory with the name after the archive, so you can simply double-click these files in Finder or run the usual commands:

 cd ~/Downloads ls -1 *.gz | xargs -n 1 tar xzvf zlib 

Zlib build:

 cd ~/Downloads/zlib-1.2.5 ./configure --shared && make && sudo make install 

The sudo command will ask for the administrator password once every five minutes. You will use this for the installation phase for each of these packages.

Libpng

If you have Mac OS X 10.6, you already have libpng 1.2 installed.

Mismatch: I recommend not trying to create and install a new version of libpng. Mac OS X 10.6 includes libpng 1.2 and the introduction of libpng 1.5 in addition to this will only confuse the libgd build logic. I spent many hours trying to get 1.5 to work, but each binary file built points to the dynamic library libpng 1.2 (dylib) even when compiling with libpng 1.5 headers. This will subsequently fail, for example:

Libpng warning: the application was compiled using png.h from libpng-1.5.1 Libpng warning: the application works with png.c from libpng-1.2.44 gd-png: fatal libpng error: Incompatible version of libpng in the application and zsh library: error segmentation. / gdtest test / gdtest.png The libgd document talks about installing libpng 1.2 on a system that no longer has a libpng version. Mac OS X 10.6 already has libpng 1.2.

It was interesting to learn about dynamic libraries and Mac OS X (and related operating systems). Unix relies heavily on the search for dynamic libraries at run time based on the search path in the environment (LD_LIBRARY_PATH), and Unix software allows you to create absolute paths for the library in binary files. Mac OS X uses the opposite philosophy: absolute paths to dynamic libraries are embedded in binary files, and the possible and relative paths of libraries and the search environment variable (DYLD_LIBRARY_PATH) is possible, but not recommended for security reasons. Setting DYLD_LIBRARY_PATH may confuse other libraries and packages. You can see the binary paths of the library using this command: otool -l path / in / binary

If you know how to create and install libpng 1.5 on Mac OS X and get other build applications with both headers and the dylib channel, let me know.

Update, November 2012: here is the solution for connecting libpng 1.5 with the reader. Thanks!

libjpeg

Go to the libjpeg directory:

 cd ~/Downloads/jpeg-8c 

The libgd document states that you must set the MACOSX_DEPLOYMENT_TARGET environment variable. I accepted the value will be in my case 10.6:

 export MACOSX_DEPLOYMENT_TARGET=10.6 

Assembly and installation:

 ./configure --enable-shared && make && sudo make install 

I have not encountered the problem "ltconfig: can not guess host type", but if you do, see the libgd document.

Freetype

Go to the FreeType directory and create and install it:

 cd ~/Downloads/freetype-2.4.4 ./configure && make && sudo make install 

The libgd document states that you need to edit to include /freetype/config/ftoption.h and uncomment the line that defines TT_CONFIG_OPTION_BYTECODE_INTERPRETER, but I found that this line was already uncommented in 2.4.4. I do not know the history of the patent problem under the prompt TrueType.

 libgd 

Now it's time to install libgd, the subject of the doc Im cribbing doc. This document offers several steps for setting up links to libraries and tools for creating libgd. Run the following commands:

 cd ~/Downloads/gd-2.0.35 sudo ln -s /usr/X11R6/include/fontconfig /usr/local/include ln -s `which glibtool` ./libtool ./configure --with-png=/usr/X11 --x-includes=/usr/X11/include --x-libraries=/usr/X11/lib 

Note. These arguments for configuring the cause of gd must be built using the version of libpng included with Mac OS X 10.6. Without these arguments, the build will not find png.h, and the make (next) step will fail.

Make sure you find PNG, JPEG, Freetype, Fontconfig Libraries, Xpm, and pthreads, the output of which looks like this:

 ** Configuration summary for gd 2.0.34: Support for PNG library: yes Support for JPEG library: yes Support for Freetype 2.x library: yes Support for Fontconfig library: yes Support for Xpm library: yes Support for pthreads: yes 

Assembly and installation:

 make && sudo make install 

Test:

 ./gdtest test/gdtest.png gnuplot cd ~/Downloads/gnuplot-4.4.2 ./configure 

Look for ** Configuration summary for gnuplot 4.4.2: end the output and check that it reports happy things regarding JPEG, GIF, and PNG support. (Theres libpdf is probably worth building and installing up to this point to enable PDF output from gnuplot. I will assume it is libpdf, but I have not tried it yet.)

Mismatch: gnuplot includes an extension for Emacs, the infamous text and file environment called gnuplot-mode. However, it seems that its build process expects files that are present in Emacs 22 but not in Emacs 23. If you have not explicitly installed Emacs 23, youre fine: Mac OS X 10.6 comes with Emacs 22. If you have Emacs 23 installed and trying to run make at this point, you get this message:

 Making all in lisp emacs -batch -q -no-site-file -l ./dot.el -f batch-byte-compile gnuplot.el Cannot open load file: subst-ksc make[2]: *** [gnuplot.elc] Error 255 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2 

I still do not understand how to get gnuplot mode to work with Emacs 23 (copying in old lisp / international / subst files - *. El isnt enough; hints are welcome). So I just turned off the Lisp compilation step in the gnuplot build:

 ./configure --without-lisp-files 

You are now ready to install and install gnuplot:

 make && sudo make install 

Check out gnuplot by running an interactive prompt:

 gnuplot 

At the gnuplot> prompt, type:

 plot sin(x) 

X11 starts up (which takes a second or two), and the window opens using a sine curve graph. Enter the quit command to return to the shell.

-1
source

Source: https://habr.com/ru/post/1487673/


All Articles