taskReproducible paper template - Tasks: task #15481, X11 libraries for Ghostscript

 
 

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

task #15481: X11 libraries for Ghostscript

Submitted by:  Mohammad Akhlaghi <makhlaghi>
Submitted on:  Tue 03 Dec 2019 04:17:15 PM UTC  
 
Should Start On:  Tue 03 Dec 2019 12:00:00 AM UTC Should be Finished on:  Tue 03 Dec 2019 12:00:00 AM UTC
Category:  Software Priority:  5 - Normal
Status:  Postponed Privacy:  Public
Percent Complete:  0% Assigned to:  None
Open/Closed:  Open Effort:  0.00

( Jump to the original submission)

Mon 13 Jan 2020 04:00:40 PM UTC, comment #14: 

Thanks a lot Raul, it has been merged into the master branch ;-).

Mohammad Akhlaghi <makhlaghi>
Project Administrator
Mon 13 Jan 2020 03:25:25 PM UTC, comment #13: 

Thanks a lot for the notice! I have done it properly, so, now you should be able to merge it with no problems. Check out it here: https://gitlab.com/infantesainz/reproduce-raulfork/commit/1d72e26d00

Raul Infante-Sainz <infantesainz>
Project Member
Sat 11 Jan 2020 07:39:26 PM UTC, comment #12: 

Just one thin, don't commit directly on the `master' branch.

Once you checkout to the `master' branch, first create a new branch over it, then make the change and commit it, something like this:

git checkout master
git pull origin master
git checkout -b x11-gs-fix
emacs reproduce/software/make/highlevel.mk
git commit
git push YOURREMOVE x11-gs-fix

Mohammad Akhlaghi <makhlaghi>
Project Administrator
Sat 11 Jan 2020 07:35:13 PM UTC, comment #11: 

Great, thanks for the check and the commit ;-)!

Just one thing: after fetching your fork, I noticed that your commit isn't on the template's `master' branch, its on your tutorial branch.

Can you make sure everything is committed, then `checkout' to the master branch, `pull' from the main repository to update it, then make the change and commit on the master branch?

Right now, the most recent commit on the `master' branch is `f92bef4' ("Corrected markdown code notations in one README.md").

Mohammad Akhlaghi <makhlaghi>
Project Administrator
Sat 11 Jan 2020 06:15:02 PM UTC, comment #10: 

That is great, now it worked! You can have a look at my fork for fixing this problem: https://gitlab.com/infantesainz/reproduce-raulfork/commit/234e75b9a Thanks a lot Mohammad! :-)

Raul Infante-Sainz <infantesainz>
Project Member
Sat 11 Jan 2020 03:20:51 PM UTC, comment #9: 

Oh yes! Sorry! `LDFLAGS' is used by the standard build systems which follow standard ways of calling the C compiler that are configured with environment variables like `LDFLAGS' or `CPPFLAGS'.

But here, we aren't using those build systems, we are manually calling the C compiler directly. So, to fix the problem, you should add the `$$LDFLAGS' to the command that calls the C compiler (`$$CC').

In short line 894 should become like this:

if $$CC $$LDFLAGS $$cprog -o$$oprog -lXt -lSM -lICE -lXext; then

Let me know how it goes ;-).

Mohammad Akhlaghi <makhlaghi>
Project Administrator
Thu 09 Jan 2020 05:53:43 PM UTC, comment #8: 

It does not work, I obtain the same error than before :-( I checked that it is being properly added by printing the `LDFLAGS' and it is, at the end of the variable. I also tried to put at the beginning but it does not work neither. Thanks!

Raul Infante-Sainz <infantesainz>
Project Member
Thu 09 Jan 2020 05:26:05 PM UTC, comment #7: 

Thanks ;-)! I think I see the problem.

From your previous post (libraries Ghostscript links to on your system), I see that the X11 libraries are under `/opt/X11/lib'. Can you try adding this line just after the `echo' commands and before the `if $$CC ...' (line 889)

export LDFLAGS="$$LDFLAGS -L/opt/X11/lib"

It should work after this. It won't be a problem on GNU/Linux systems (because the library will be found before reaching the end, and generally, this directory doesn't exist there, so it will just be ignored).

Mohammad Akhlaghi <makhlaghi>
Project Administrator
Thu 09 Jan 2020 05:14:34 PM UTC, comment #6: 

Thanks Mohammad, you are right. Find the error below, let me know anything you need ;-)

make: *** Waiting for unfinished jobs....
ld: library not found for -lXt
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Problem in building Ghostscript
-------------------------------
Some necessary X11 libraries (that we don't yet install
within the template) couldn't be found on your system, see
the 'ld' error message above. Please install them manually
so Ghostscript can be built.

For example if you use Debian-based OSs, run this command:
  sudo apt install libxext-dev libxt-dev libsm-dev libice-dev ghostscript

This notice will be removed once these packages are built
within the project (Task #15481).
-------------------------------

Raul Infante-Sainz <infantesainz>
Project Member
Thu 09 Jan 2020 04:57:56 PM UTC, comment #5: 

Thanks for the check Raul, Can you put the failing error message here?

Manual interventions for running on different systems is not acceptable (it changes the Git commit). If we don't find the cause of the problem, we can just limit this check on non-macOS systems. But first, let's see what the error was ;-).

Mohammad Akhlaghi <makhlaghi>
Project Administrator
Thu 09 Jan 2020 04:49:52 PM UTC, comment #4: 

This is a good work around for GNU/Linux systems. However, I found that the checking fails when it goes in my macOS laptop. Since I already have X11 libraries installed, there is no problem at all, so I can comment out the checking lines. But I am noticing this point here to not forget this issue in the future. Thanks!

comment #2:

> I just added a check before building Ghostscript so we can suggest a solution to the user, until this task is complete.
>
> As described in the commit message, if those libraries aren't found, it the problem is explained to the user and a possible solution (if they have root access) is suggested.

Raul Infante-Sainz <infantesainz>
Project Member
Sat 14 Dec 2019 04:01:48 AM UTC, comment #3: 

Linux From Scratch has a nice guide on installing the X.org libraries (there are many!).

Besides Ghostscript, they are also necessary for other contexts. After we include an installation of the GNU C Library (task #15390), we can build all of these (and ofcourse their dependencies).

Mohammad Akhlaghi <makhlaghi>
Project Administrator
Wed 04 Dec 2019 01:39:18 PM UTC, comment #2: 

I just added a check before building Ghostscript so we can suggest a solution to the user, until this task is complete.

As described in the commit message, if those libraries aren't found, it the problem is explained to the user and a possible solution (if they have root access) is suggested.

Mohammad Akhlaghi <makhlaghi>
Project Administrator
Wed 04 Dec 2019 01:07:57 PM UTC, comment #1: 

Just as a reference, here are the libraries Ghostscript needs on macOS systems (thanks to Raul for providing this):

$ otool -L .local/bin/gs
.local/bin/gs:
    /opt/X11/lib/libXt.6.dylib (compatibility version 7.0.0, current version 7.0.0)
    /opt/X11/lib/libSM.6.dylib (compatibility version 7.0.0, current version 7.1.0)
    /opt/X11/lib/libICE.6.dylib (compatibility version 10.0.0, current version 10.0.0)
    /opt/X11/lib/libXext.6.dylib (compatibility version 11.0.0, current version 11.0.0)
    /opt/X11/lib/libX11.6.dylib (compatibility version 10.0.0, current version 10.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.50.4)
    /PROJECT/BUILD/DIRECTORY/hipercam-pipeline/software/installed/lib/libiconv.2.dylib (compatibility version 9.0.0, current version 9.1.0)
    /opt/X11/lib/libfontconfig.1.dylib (compatibility version 11.0.0, current version 11.2.0)

Mohammad Akhlaghi <makhlaghi>
Project Administrator
Tue 03 Dec 2019 04:17:15 PM UTC, original submission:  

Currently the installed Ghostscript in the template uses the host's X11 libraries. For example in [1] you can see the full list of libraries that the template's Ghostscript depends on.

This can cause problems on some systems, for example on one Ubuntu 18.04.3 LTS, `libXext' (X11 miscellaneous extensions library) wasn't present during the build of Ghostscript, and it complained with `ld: cannot find -lXext'.

We should add native builds of the necessary (and possible!) X11 libraries also. Until then, we should put a check so when its necessary, the user knows what is missing before starting to compile Ghostscript.

[1] List of the libraries linked with the template's Ghoscript:

$ ldd .local/bin/gs
        linux-vdso.so.1 (0x00007ffd3c125000)
        libXt.so.6 => /usr/lib/libXt.so.6 (0x00007efdbf8cf000)
        libSM.so.6 => /usr/lib/libSM.so.6 (0x00007efdbf8c4000)
        libICE.so.6 => /usr/lib/libICE.so.6 (0x00007efdbf8a7000)
        libXext.so.6 => /usr/lib/libXext.so.6 (0x00007efdbf892000)
        libX11.so.6 => /usr/lib/libX11.so.6 (0x00007efdbf752000)
        libm.so.6 => /usr/lib/libm.so.6 (0x00007efdbf60c000)
        libdl.so.2 => /PROJECT/BUILD/DIRECTORY/software/installed/lib/libdl.so.2 (0x00007efdbf605000)
        libidn.so.12 => /usr/lib/libidn.so.12 (0x00007efdbf5d0000)
        libpaper.so.1 => /usr/lib/libpaper.so.1 (0x00007efdbf5ca000)
        libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x00007efdbf582000)
        libpthread.so.0 => /PROJECT/BUILD/DIRECTORY/software/installed/lib/libpthread.so.0 (0x00007efdbf560000)
        libc.so.6 => /usr/lib/libc.so.6 (0x00007efdbf399000)
        libuuid.so.1 => /usr/lib/libuuid.so.1 (0x00007efdbf38e000)
        libxcb.so.1 => /usr/lib/libxcb.so.1 (0x00007efdbf364000)
        /lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2 (0x00007efdc1091000)
        libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x00007efdbf296000)
        libexpat.so.1 => /usr/lib/libexpat.so.1 (0x00007efdbf269000)
        libXau.so.6 => /usr/lib/libXau.so.6 (0x00007efdbf264000)
        libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x00007efdbf25a000)
        libbz2.so.1.0 => /PROJECT/BUILD/DIRECTORY/software/installed/lib/libbz2.so.1.0 (0x00007efdbf247000)
        libpng16.so.16 => /usr/lib/libpng16.so.16 (0x00007efdbf20f000)
        libz.so.1 => /PROJECT/BUILD/DIRECTORY/software/installed/lib/libz.so.1 (0x00007efdbf1f2000)
        libharfbuzz.so.0 => /usr/lib/libharfbuzz.so.0 (0x00007efdbf0ee000)
        libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0x00007efdbefc7000)
        libgraphite2.so.3 => /usr/lib/libgraphite2.so.3 (0x00007efdbefa2000)
        libpcre.so.1 => /usr/lib/libpcre.so.1 (0x00007efdbef2f000)

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
  • -email is unavailable- added by infantesainz (Posted a comment)
  • -email is unavailable- added by makhlaghi (Submitted the item)
  •  

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

    Only logged-in users can vote.

     

     

     

    No changes have been made to this item

    Back to the top


    Powered by Savane 3.5