bugGNU Astronomy Utilities - Bugs: bug #47868, Check Ghostscript version at...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #47868: Check Ghostscript version at ./configure time

Submitter:  Mohammad Akhlaghi <makhlaghi>
Submitted:  Sat 07 May 2016 06:30:37 AM UTC
   
 
Category:  Installation Severity:  4 - Important
Item Group:  Crash Status:  Confirmed
Privacy:  Public Assigned to:  giordano
Open/Closed:  Closed

Jump to the original submission

Mon 30 May 2016 08:49:03 AM UTC, comment #12: 

Putting this in a `test.sh' script and running it on the shell does give "before 9.10" on my system too. I am not sure why, but in the configure script, it would not work.

This is part of the `./configure' output for version 0.0.162-d6f0 that my friend sent to me. I had added the "checking Ghostscript version..." report to make sure why the tests FAILs on his system. You see that while the version is "9.05", but ultimately there is no warning for Ghostscript (showing how the test had failed).


checking for jpeg_stdio_dest in -ljpeg... no
checking for gs... yes
checking Ghostscript version... 9.05
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating doc/Makefile
config.status: creating lib/Makefile
config.status: creating tests/Makefile
config.status: creating src/mkprof/Makefile
config.status: creating src/header/Makefile
config.status: creating src/mknoise/Makefile
config.status: creating src/imgcrop/Makefile
config.status: creating src/imgstat/Makefile
config.status: creating src/imgwarp/Makefile
config.status: creating src/convertt/Makefile
config.status: creating src/convolve/Makefile
config.status: creating src/cosmiccal/Makefile
config.status: creating src/mkcatalog/Makefile
config.status: creating src/arithmetic/Makefile
config.status: creating src/noisechisel/Makefile
config.status: creating src/subtractsky/Makefile
config.status: creating bootstrapped/lib/Makefile
config.status: creating bootstrapped/tests/Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands

===================================================================
===================================================================
GNU Astronomy Utilities (gnuastro) 0.0.162-d6f0, is configured.

Warnings:
  - libjpeg, could not be linked with in your library search path.
      If JPEG outputs are desired from ConvertType, it will warn
      you and abort with an error.
  All checks related to the above warnings will be skipped.

Please run the following commands to build, test
and install gnuastro 0.0.162-d6f0 on your machine.
    make
    make check
    make install
===================================================================
===================================================================


Mohammad Akhlaghi <makhlaghi>
Group administrator
Mon 30 May 2016 08:38:24 AM UTC, comment #11: 

Uh,


case "9.05" in
    [1-8].* | 9.0[0-9]) echo "before 9.10";;
    *) echo "9.10 or later";;
esac


echos "before 9.10" as expected with dash, bash, and zsh for me.  I don't really see it shouldn't work just for 9.05.  Which shell do you use?

Mosè Giordano <giordano>
Group Member
Mon 30 May 2016 01:53:01 AM UTC, comment #10: 

Ghostscript 9.05 does return "9.05". The initial script was tested on my own GNU/Linux system and a friend also tested it on a Mac OS X. In both cases the initial script would not recognize that "9.05" is smaller than "9.10" and would thus assume that Ghostscript can be used, which would result in a FAILed test result.

Mohammad Akhlaghi <makhlaghi>
Group administrator
Sun 29 May 2016 05:14:13 PM UTC, comment #9: 

Nice solution, but I don't understand why it was needed.  Doesn't Ghostscript 9.05 return "9.05" when querying the version?

Mosè Giordano <giordano>
Group Member
Fri 13 May 2016 10:50:58 AM UTC, comment #8: 

When the version of Ghostscript is 9.05, the version test we had initially implemented wasn't successful (so `make check' would give a FAILed result for the `convertt/fitstopdf.sh' test).

Since GNU Autoconf Archives already had a very thoroughly tested version checking tool (as explained below), its ax_compare_version.m4 is now used to check Ghostscript's version. It works nicely and is able to tell that 9.05 is less than 9.10 and so `make check' will SKIP that test. This .m4 file was also included in bootstrap.conf so it will be automatically prepared upon bootstrapping.

This change has been merged with master.

Mohammad Akhlaghi <makhlaghi>
Group administrator
Thu 12 May 2016 06:27:54 AM UTC, comment #7: 

Thank you for the interesting solution. Apparently Gnulib is rarely tested on Native Windows and has a low priority for them (Gnuastro heavily relies on Gnulib).

https://www.gnu.org/software/gnulib/manual/html_node/Target-Platforms.html

I have also personally never developed in Windows. But if the package name test can be done easily, I see no harm in adding the tests, just in case some time in the future other things get solved and people want to use it on Windows.

I just pushed a commit to master, letting the user know what configure is doing (checking the Ghostscript version number) and also the result of that check.

Mohammad Akhlaghi <makhlaghi>
Group administrator
Mon 09 May 2016 10:33:15 PM UTC, comment #6: 

AC_CHECK_PROGS or AC_PATH_PROGS can be used to test different names of a program.  In AUCTeX there is this instruction


AC_CHECK_PROGS(GS, gs GSWIN32C.EXE, NONE)


In Elisp part of the package also other names are tested, i.e., "rungs" and "mgs", the former is a Lua wrapper around "gs" "GSWIN32C.EXE" that comes with TeX Live, the latter should be the ghostscript embedded in MiKTeX.  Summing up, if Windows support isn't on the map, probably "gs" suffices.

Mosè Giordano <giordano>
Group Member
Mon 09 May 2016 09:08:02 AM UTC, comment #5: 

Thanks. It has been merged into master.

Mohammad Akhlaghi <makhlaghi>
Group administrator
Sat 07 May 2016 01:36:12 PM UTC, comment #4: 

I pushed a fix to my "gs-version" branch.

Mosè Giordano <giordano>
Group Member
Sat 07 May 2016 01:05:13 PM UTC, comment #3: 

In AUCTeX we support "rungs", "mgs", "GSWIN32C.EXE", and "gs", see http://git.savannah.gnu.org/gitweb/?p=auctex.git;a=blob;f=preview.el.in;h=8a5810493827c0de6fe7e84e4efe8e57f62c4f55;hb=HEAD#l349

For the time being I'm writing the fix with a hard-coded "gs", then we'll see how to look for the executable name.

Mosè Giordano <giordano>
Group Member
Sat 07 May 2016 01:00:31 PM UTC, comment #2: 

That is correct, the only time Ghostscript is used is in that line you found with a hard-coded `gs'. It would be great if the program name could be found at configure time along with the version. Just out of curiosity, are there other executable names for Ghostscript?

In the Autoconf archives I found the ax_compare_version which is a generic version checker (to see if the version is more of less than a specific value).

https://www.gnu.org/software/autoconf-archive/ax_compare_version.html

Maybe this can be useful in writing up this configure test.

Mohammad Akhlaghi <makhlaghi>
Group administrator
Sat 07 May 2016 12:53:19 PM UTC, comment #1: 

I think I can fix it, but I need the name of the program.  Is it recorded in a variable during configuration or a hard-coded "gs" is used?  The only occurrence of "-dPDFFitPage" I found is in src/convertt/eps.c, and hard-coded "gs" is used there.

Mosè Giordano <giordano>
Group Member
Sat 07 May 2016 06:30:37 AM UTC, original submission:  

Currently ./configure only checks if Ghostscript exists with `AC_CHECK_PROG'. However, in converting an EPS file to a PDF, ConvertType uses the `-dPDFFitPage' option which was introduced in Ghostscript in version 9.10.

So after checking the existence of Ghostscript in `configure.ac', we have to make sure its version is above 9.10 (the current version is 9.19).

Mohammad Akhlaghi <makhlaghi>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by giordano (Posted a comment)
  • -email is unavailable- added by makhlaghi (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-05-09 makhlaghi Assigned toNone giordano
        Open/ClosedOpen Closed
    2016-05-07 makhlaghi SummaryCheck Ghostscript\'s PDF creation at ./configure time Check Ghostscript version at ./configure time

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code