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

Submitted by:  Mohammad Akhlaghi <makhlaghi>
Submitted on:  Sat 07 May 2016 06:30:37 AM UTC  
 
Category: InstallationSeverity: 4 - Important
Item Group: CrashStatus: Confirmed
Privacy: PublicAssigned to: Mosè Giordano <giordano>
Open/Closed: Closed

(Jump to the original submission 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).

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

Uh,

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>
Project MemberIn charge of this item.
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>
Project 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>
Project MemberIn charge of this item.
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>
Project 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>
Project 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

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>
Project MemberIn charge of this item.
Mon 09 May 2016 09:08:02 AM UTC, comment #5:

Thanks. It has been merged into master.

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

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

Mosè Giordano <giordano>
Project MemberIn charge of this item.
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>
Project MemberIn charge of this item.
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>
Project 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>
Project MemberIn charge of this item.
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>
Project Administrator

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 09 May 2016 09:08:02 AM UTCmakhlaghiAssigned toNone=>giordano
      Open/ClosedOpen=>Closed
    Sat 07 May 2016 06:31:13 AM UTCmakhlaghiSummaryCheck Ghostscript\'s PDF creation at ./configure time=>Check Ghostscript version at ./configure time

    Back to the top


    Powered by Savane 3.1-cleanup1