taskManeage - Tasks: task #15481, Xorg libraries for Ghostscript

 
 

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

task #15481: Xorg libraries for Ghostscript

Submitter:  Mohammad Akhlaghi <makhlaghi>
Submitted:  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:  Done Privacy:  Public
Assigned to:  makhlaghi Percent Complete:  100%
Open/Closed:  Closed Effort:  0.00

Jump to the original submission

Tue 30 Jun 2020 02:26:07 AM UTC, comment #20: 

With Raul's help, this task is now completed and merged into Maneage as Commit 9ddff8b5c. So I am closing it :-D.

This was a major milestone and I am happy we were able to complete it.

Mohammad Akhlaghi <makhlaghi>
Group administrator
Mon 29 Jun 2020 09:12:50 AM UTC, comment #19: 

Great! So thd one I was most worried about ('util-linux') was built :-).

I just had a fast search and found this: https://gitlab.freedesktop.org/xorg/lib/pthread-stubs

It looks like the missing package and belongs to Xorg/Freedesktop ;-)! Can you add it as a build dependency of libxcb in 'xorg.mk'?

You just have to set automake as its dependency, and probably we can't use 'gbuild', because before calling './configure', we will have to run './autogen.sh'. But its easy to write tghe necesary commands (like ghostscript itself).

Let me know if you like me to add it ;-).

I can also add it if yo

Mohammad Akhlaghi <makhlaghi>
Group administrator
Mon 29 Jun 2020 08:20:27 AM UTC, comment #18: 

In my previous post I wrote in a bad way the text, here it is. Sorry!


[...]
checking whether make supports nested variables... (cached) yes
checking whether to build developer documentation... yes
configure: WARNING: dot not found - doxygen targets will be skipped
checking for CHECK... no
checking for XCBPROTO... yes
checking for NEEDED... no
configure: error: Package requirements (xau >= 0.99.2 pthread-stubs) were not
met:

No package 'pthread-stubs' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables NEEDED_CFLAGS
and NEEDED_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
make: *** [reproduce/software/make/xorg.mk:105:
BDIR/software/installed/version-info/proglib/libxcb-1.14] Error 1
make: Target 'all' not remade because of errors.


I am trying to solve it, but if you know the problem let me know. I think it
should not be very difficult to solve ;-)

Raul Infante-Sainz <infantesainz>
Group Member
Mon 29 Jun 2020 08:16:44 AM UTC, comment #17: 

That is great Mohammad!! I tested and most of them (flex-2.6.4-91-ga631f5d, xcb-proto-1.14, gperf-3.1, util-macros-1.19.2, xorgproto-2020.1, libxau-1.0.9, util-linux-2.35, libxdmcp-1.1.3, libidn-1.35, fontconfig-2.13.1) were installed  without any problem. It crashed when installing libxcb-1.14 showing this suggestions in the last lines:


[...]
checking whether make supports nested variables... (cached) yes
checking whether to build developer documentation... yes
configure: WARNING: dot not found - doxygen targets will be skipped
checking for CHECK... no
checking for XCBPROTO... yes
checking for NEEDED... no
configure: error: Package requirements (xau >= 0.99.2 pthread-stubs) were not met:

No package 'pthread-stubs' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables NEEDED_CFLAGS
and NEEDED_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
make: *** [reproduce/software/make/xorg.mk:105: BDIR/software/installed/version-info/proglib/libxcb-1.14] Error 1
make: Target 'all' not remade because of errors.
-verbatim+

I am trying to solve it, but if you know the problem let me know. I think it should not be very difficult to solve ;-)

Raul Infante-Sainz <infantesainz>
Group Member
Mon 29 Jun 2020 03:32:13 AM UTC, comment #16: 

I am happy to say that the necessary Xorg libraries are now built (in the xorg branch). As a beautiful demo, see Ghostscript's linked libraries at the end of this message. The only libraries that aren't within Maneage (not starting with 'BDIR') are the GNU C Library components :-D.

Raul, when you have the chance, can you please try this branch on your macOS and send us the result?

For non-macOS users, it would be great if you could also try it and let me know how it went ;-).

You don't need any special options to test this feature! A default build is enough because Ghostscript is currently built by default.

In macOS, I am just a little worried about 'util-linux' (a dependency of fontconfig). Apparently it does build on macOS because it is on Homebrew. If you do encounter a problem in a specific program of util-linux, you can easily disable it (as you can already see from its build rule in 'high-level.mk'). The most important component is that 'fontconfig', needs to link with 'libuuid'.

This makes the default Maneage branch really nicely independent of almost all features of the OS! With this branch, in a "slim" Debian docker image, we just need the 'gcc' and 'g++' compilers! NOTHING ELSE :-D!!!!

It is also a big step towards building TeXLive from source (because it depends on Ghostscript and its library and these core Xorg libraries).


ldd .local/bin/gs
        linux-vdso.so.1 (0x00007ffdbb926000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f19092b8000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f1908274000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f1907f5f000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f190826f000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f1908120000)
        libtiff.so.5 => BDIR/software/installed/lib/libtiff.so.5 (0x00007f19083fa000)
        libidn.so.12 => BDIR/software/installed/lib/libidn.so.12 (0x00007f190823a000)
        libpaper.so.1 => BDIR/software/installed/lib/libpaper.so.1 (0x00007f1908234000)
        libfontconfig.so.1 => BDIR/software/installed/lib/libfontconfig.so.1 (0x00007f19081ed000)
        libfreetype.so.6 => BDIR/software/installed/lib/libfreetype.so.6 (0x00007f1908141000)
        liblzma.so.5 => BDIR/software/installed/lib/liblzma.so.5 (0x00007f1907f37000)
        libjpeg.so.9 => BDIR/software/installed/lib/libjpeg.so.9 (0x00007f1907efa000)
        libz.so.1 => BDIR/software/installed/lib/libz.so.1 (0x00007f1907edd000)
        libiconv.so.2 => BDIR/software/installed/lib/libiconv.so.2 (0x00007f1907df5000)
        libbz2.so.1.0 => BDIR/software/installed/lib/libbz2.so.1.0 (0x00007f1907de2000)
        libpng16.so.16 => BDIR/software/installed/lib/libpng16.so.16 (0x00007f1907dac000)
        libexpat.so.1 => BDIR/software/installed/lib/libexpat.so.1 (0x00007f1907d7f000)
        libuuid.so.1 => BDIR/software/installed/lib/libuuid.so.1 (0x00007f1907d76000)


Mohammad Akhlaghi <makhlaghi>
Group administrator
Mon 27 Apr 2020 10:07:09 PM UTC, comment #15: 

Based on my testing on a system I'm using, this task should remain open.

It's OK as a "task", because on reading my log file carefully
enough, I see:


/scratch/boud/tmp/tmp_build_maneage_project/software/installed/bin/ld: cannot find -lXt
collect2: error: ld returned 1 exit status

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).
-------------------------------


which brought me directly to this Task. :)

Trying the Debian recommendation, I only had to install one package:


The following NEW packages will be installed:
  libxt-dev


After this, I no longer get the warning message.

Boud Roukema <boud>
Group Member
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>
Group 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>
Group 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>
Group 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>
Group 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>
Group 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>
Group 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>
Group 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>
Group 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>
Group 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>
Group 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>
Group 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>
Group 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>
Group 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>
Group 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>
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 boud (Posted a comment)
  • -email is unavailable- added by infantesainz (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 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-06-30 makhlaghi StatusReady For Test Done
        Percent Complete90% 100%
        Open/ClosedOpen Closed
    2020-06-29 makhlaghi StatusPostponed Ready For Test
        Percent Complete0% 90%
        Assigned toNone makhlaghi
        SummaryX11 libraries for Ghostscript Xorg libraries for Ghostscript

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code