|
From: Thomas M. <mat...@ph...> - 2016-03-03 20:56:53
|
Hi The goal is to make it easy for a non-computer-science student to install gnuplot on a reasonably modern Mac. While it's free and not even very hard to install a compiler and package-manager on a Mac, I'm trying to avoid asking students to do that. Instead, I want to build gnuplot on one Mac, and "clone" the installation on other Macs that don't have compiler and package manager. As I learned yesterday, the existing gnuplot makefile supports "make DESTDIR=/tmp/gnuplot install" That makes a tree starting at /tmp/gnuplot/usr I copied that tree to a flash drive as gnuplot64/usr I made a short script file to the gnuplot64 directory: #!/bin/sh echo "This script must be run from an account with administrative privileges" echo "You must enter the administrative user's password" sudo rsync -arv usr/* /usr The "sudo rsync" command copies everything to the place that "sudo make install" would have. (The script using "cp" that I mentioned yesterday doesn't work because "cp" on a Mac doesn't create the required directory structure, while "rsync" does.) I have tested this by building on a 10.6.8 Intel Core 2 Duo machine, and porting to a 10.10.5 Intel Core i7 machine via a flash drive. It worked at the level of "plot sin(x)" (I didn't do extensive regression testing). So the OS version doesn't have to match exactly. (Porting to a 10.6.8 Intel Core Duo machine doesn't work, giving an error "Bad CPU type in executable" presumably because the destination is 32 bits and the binary is 64 bits. I haven't yet tried to do the build on a 32 bit machine to port to other 32 bit machines, but presumably that would work.) The build-machine had XQuartz (but not Aquaterm, at build time). The destination-machine didn't have XQuartz before the "rsync". I ran the native Terminal.app, and typed "gnuplot" It complained that X11 wasn't available, but I could still "set term dumb" and see something. When I installed XQuartz on the destination, I could type "gnuplot" into Terminal.app, and when I typed "plot sin(x)" it launched XQuartz and showed the plot. I could also start XQuartz first, which brings up an xterm window, and type "gnuplot" into that. Then I installed Aquaterm on the destination. Aquaterm is much smaller than XQuartz, and I believe has native support for saving screen graphics as pdf files (gnuplot can of course do that too, but it requires several steps that students often get wrong). But the gnuplot installation would not accept "set term aqua" I then installed Aquaterm on the build-machine and ran ./configure --with-aquaterm (also --with-readline=builtin in both cases). Doing "make" and "make install" then gave Aquaterm support on the build machine. (I haven't yet tested on the destination machine, I presume it will work). So the lesson is that Aquaterm needs to be on the build machine before the build. I want to make an even more capable version of gnuplot, so I'm following instructions from http://www.physics.buffalo.edu/phy410-505/tools/install/ They say to install zlib, libpng, freetype, libgd, then build gnuplot. I expected that this would give access to the png, jpeg, and gif terminal types. The gnuplot ./configure step seemed to have a problem with libgd: aqua terminal (OSX): yes libgd-based png, jpeg, and gif terminals: no (see config.log) The gnuplot build gave an error: c++ -g -O2 -framework Foundation -framework AquaTerm -L/usr/X11/lib -o gnuplot alloc.o axis.o breaders.o boundary.o color.o command.o contour.o datablock.o datafile.o dynarray.o eval.o external.o fit.o gadgets.o getcolor.o graph3d.o graphics.o help.o hidden3d.o history.o internal.o interpol.o libcerf.o matrix.o misc.o mouse.o multiplot.o parse.o plot.o plot2d.o plot3d.o pm3d.o readline.o save.o scanner.o set.o show.o specfun.o standard.o stats.o stdfn.o tables.o tabulate.o term.o time.o unset.o util.o util3d.o variable.o version.o -lz -lgd -lgd -lz -liconv -liconv Undefined symbols: "_gdImagePng", referenced from: _PNG_text in term.o ld: symbol(s) not found collect2: ld returned 1 exit status make[4]: *** [gnuplot] Error 1 make[3]: *** [all-recursive] Error 1 make[2]: *** [all] Error 2 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2 If I delete /user/local/bin/gnuplot then run "make install", it doesn't put an executable back. I'm building gnuplot 5.0.3 with zlib 1.2.8, libpng 1.6.21, freetype 2.4.10 and libgd 2.1.1 in place on Mac OS X 10.6.8 on Intel Core 2 Duo Mac Mini. Looking back at the libgd ./configure step, there seem to be some issues: checking for LIBPNG... no checking for LIBFREETYPE... no checking for LIBFONTCONFIG... no checking for jpeg_set_defaults in -ljpeg... no checking for LIBXPM... no checking for LIBVPX... no checking for LIBVPX... no checking for LIBTIFF... no checking for simple visibility declarations... yes checking whether pthreads work with -pthread... yes checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE checking if more special flags are required for pthreads... -D_THREAD_SAFE checking for PTHREAD_PRIO_INHERIT... yes checking whether we are building for a Win32 host... no ** Configuration summary for libgd 2.1.1: Support for Zlib: yes Support for PNG library: no Support for JPEG library: no Support for VPX library: no Support for TIFF library: no Support for Freetype 2.x library: no Support for Fontconfig library: no Support for Xpm library: no Support for pthreads: yes There weren't any obvious actual build errors, but it looks like it won't do png or jpeg. I tried using gd 2.0.33 as stated on the http://www.physics.buffalo.edu/phy410-505/tools/install/ link, rather than the more up to date libgd 2.1.1. That gives a more promising .configure stage: ** Configuration summary for gd 2.0.33: 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 But, the "make" gives compile errors gcc -DHAVE_CONFIG_H -I. -I. -I. -I/Users/mattison/anaconda/include/freetype2 -g -O2 -MT gd_jpeg.lo -MD -MP -MF .deps/gd_jpeg.Tpo -c gd_jpeg.c -fno-common -DPIC -o .libs/gd_jpeg.lo gd_jpeg.c:47:21: error: jpeglib.h: No such file or directory gd_jpeg.c:48:20: error: jerror.h: No such file or directory gd_jpeg.c:60: error: expected ')' before 'cinfo' gd_jpeg.c:112: error: expected ')' before 'cinfo' gd_jpeg.c: In function 'gdImageJpegCtx': gd_jpeg.c:116: error: storage size of 'cinfo' isn't known gd_jpeg.c:117: error: storage size of 'jerr' isn't known gd_jpeg.c:120: error: nested functions are disabled, use -fnested-functions to re-enable gd_jpeg.c:120: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'row' gd_jpeg.c:120: error: 'row' undeclared (first use in this function) gd_jpeg.c:120: error: (Each undeclared identifier is reported only once gd_jpeg.c:120: error: for each function it appears in.) gd_jpeg.c:121: error: 'JSAMPROW' undeclared (first use in this function) gd_jpeg.c:121: error: expected ';' before 'rowptr' gd_jpeg.c:123: error: 'JDIMENSION' undeclared (first use in this function) gd_jpeg.c:123: error: expected ';' before 'nlines' gd_jpeg.c:154: error: 'fatal_jpeg_error' undeclared (first use in this function) gd_jpeg.c:161: error: 'JCS_RGB' undeclared (first use in this function) gd_jpeg.c:164: error: 'TRUE' undeclared (first use in this function) gd_jpeg.c:178: error: expected ';' before 'gdCalloc' gd_jpeg.c:188: error: 'rowptr' undeclared (first use in this function) gd_jpeg.c:192: error: 'JPEG_LIB_VERSION' undeclared (first use in this function) gd_jpeg.c:198: error: 'JPEG_COM' undeclared (first use in this function) gd_jpeg.c:222: error: 'nlines' undeclared (first use in this function) gd_jpeg.c:250:2: error: #error IJG JPEG library BITS_IN_JSAMPLE value must be 8 or 12 gd_jpeg.c: At top level: gd_jpeg.c:283: error: expected ')' before 'cinfo' gd_jpeg.c: In function 'gdImageCreateFromJpegCtx': gd_jpeg.c:293: error: storage size of 'cinfo' isn't known gd_jpeg.c:294: error: storage size of 'jerr' isn't known gd_jpeg.c:297: error: nested functions are disabled, use -fnested-functions to re-enable gd_jpeg.c:297: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'row' gd_jpeg.c:297: error: 'row' undeclared (first use in this function) gd_jpeg.c:299: error: 'JSAMPROW' undeclared (first use in this function) gd_jpeg.c:299: error: expected ';' before 'rowptr' gd_jpeg.c:301: error: 'JDIMENSION' undeclared (first use in this function) gd_jpeg.c:301: error: expected ';' before 'nrows' gd_jpeg.c:325: error: 'fatal_jpeg_error' undeclared (first use in this function) gd_jpeg.c:333: error: 'JPEG_APP0' undeclared (first use in this function) gd_jpeg.c:335: error: 'TRUE' undeclared (first use in this function) gd_jpeg.c:336: error: 'JPEG_HEADER_OK' undeclared (first use in this function) gd_jpeg.c:360: error: 'JCS_CMYK' undeclared (first use in this function) gd_jpeg.c:361: error: 'JCS_YCCK' undeclared (first use in this function) gd_jpeg.c:367: error: 'JCS_RGB' undeclared (first use in this function) gd_jpeg.c:444: error: 'jpeg_saved_marker_ptr' undeclared (first use in this function) gd_jpeg.c:444: error: expected ';' before 'marker' gd_jpeg.c:453: error: 'marker' undeclared (first use in this function) gd_jpeg.c:481: error: 'JSAMPLE' undeclared (first use in this function) gd_jpeg.c:488: error: 'rowptr' undeclared (first use in this function) gd_jpeg.c:493: error: nested functions are disabled, use -fnested-functions to re-enable gd_jpeg.c:493: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'currow' gd_jpeg.c:493: error: 'currow' undeclared (first use in this function) gd_jpeg.c:495: error: 'nrows' undeclared (first use in this function) gd_jpeg.c:514: error: nested functions are disabled, use -fnested-functions to re-enable gd_jpeg.c:514: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'currow' gd_jpeg.c: At top level: gd_jpeg.c:634: error: field 'pub' has incomplete type gd_jpeg.c:653: error: expected ')' before 'cinfo' gd_jpeg.c:700: error: expected ')' before 'cinfo' gd_jpeg.c:768: error: expected ')' before 'cinfo' gd_jpeg.c:810: error: expected ')' before 'cinfo' gd_jpeg.c:828: error: expected ')' before 'cinfo' gd_jpeg.c:866: error: field 'pub' has incomplete type gd_jpeg.c:882: error: expected ')' before 'cinfo' gd_jpeg.c:920: error: expected ')' before 'cinfo' gd_jpeg.c:945: error: expected ')' before 'cinfo' gd_jpeg.c:966: error: expected ')' before 'cinfo' make[2]: *** [gd_jpeg.lo] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2 Any idea what is going on, or advice? Cheers Prof. Thomas Mattison Hennings 276 University of British Columbia Dept. of Physics and Astronomy 6224 Agricultural Road Vancouver BC V6T 1Z1 CANADA mat...@ph... phone: 604-822-9690 fax:604-822-5324 |