ghdl / docker

Scripts to build and use docker images including GHDL
40 stars 10 forks source link

libgnarl-7 missing in latest docker (ghdl/ext) builds #8

Closed ishfx closed 5 years ago

ishfx commented 5 years ago

Description Latest docker (ghdl/ext) builds are not usable anymore due to missing libgnarl-7 library.

Expected behaviour If i try to run the docker image of any ghdl/ext: build : docker run -it --rm ghdl/ext:vunit ghdl

i get this error

ghdl: error while loading shared libraries: libgnarl-7.so.1: cannot open shared object file: No such file or directory

And not the the ghdl version info.

How to reproduce? Simply run : docker run -it --rm ghdl/ext:vunit ghdl

Suggested fix Add install libgnat-7 in dockerfile. apt-get install -y libgnat-7

eine commented 5 years ago

@IshFx, thanks for letting us know! I can reproduce it. I will push a fix soon.

Meanwhile, you can use ghdl/ext:ls-vunit-gtkwave. It contains VUnit too, along with GtkWave and language-server features. Moreover, ghdl/ext:ls-debian does not contain VUnit, but Python is included, so you can just pip3 install vunit_hdl.

Apart from that, just because of curiosity, how did you find these docker images? Was it through ghdl/ghdl? In vunit.github.io? Some colleague told you? As you see, we have very little feedback about who uses these docker images, so any suggestion to improve is welcome.

ishfx commented 5 years ago

@1138-4EB thanks for the quick reply! Actually i fixed it by adding libgnat-7, then commit the container (docker container commit) to a new image. It was the easiest and fastest solution.

As for your questions, i tend to use docker whenever i can, so i naturally searched for ghdl docker images rather than building it from scratch. I mainly use these images for continuous integration, and so far i'm very pleased with the results.

I think the lack of feedback comes mainly from the hardware developers not looking at the all these great innovations that came to the software world. I personally think that hardware workflow can be optimized using these docker images! So thank you for your work.

eine commented 5 years ago

Actually i fixed it by adding libgnat-7, then commit the container (docker container commit) to a new image. It was the easiest and fastest solution.

I supposed that, because of your suggested fix. I just wanted to point other alternatives, in case some other user does not want to commit/build a new image.

For your approach, you might find the following construct useful:

echo -e 'FROM ghdl/ext:vunit\nRUN apt-get install -y libgnat-7' | docker build -t myimage -

See https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#pipe-dockerfile-through-stdin. I find it handy for this kind of quick fixes.

I mainly use these images for continuous integration, and so far i'm very pleased with the results. I personally think that hardware workflow can be optimized using these docker images! So thank you for your work.

Very much appreciated. It is a pleasure to know that these resources are useful for others!

I think the lack of feedback comes mainly from the hardware developers not looking at the all these great innovations that came to the software world.

Yes, this is an airtight niche. Fortunately, thanks to GHDL, VUnit, Docker, etc. some fresh air is coming in.

tgingold commented 5 years ago

libgnarl is not expected to be used. There is something strange...

eine commented 5 years ago

libgnarl is not expected to be used. There is something strange...

What do you mean? GNAT is only a build dependency? I thought that libgnat was required for GHDL to build libgrt into the binaries it generates.

I ask it because currently we are installing gnat in all the ghdl/build images and libgnat in all the ghdl/run images. If this is not required, ghdl/run images could be smaller, and so would ghdl/ghdl images.

eine commented 5 years ago

FTR, a few days ago I removed 'buster' from https://github.com/ghdl/docker/blob/master/hrcp.sh#L15, because 'buster+mcode' is used/tested in the main repo now. However, the main repo does not push any content to hub.docker.com. Therefore, ghdl/pkg:buster-mcode is not being updated: https://hub.docker.com/r/ghdl/pkg/tags. This is used to build ghdl/ext:vunit.

The fix is to add 'buster' again to hrcp.sh. I'm with my smartphone now. Will push the fix when I'm back on my workstation.

tgingold commented 5 years ago

libgnat yes, libgnarl no!

eine commented 5 years ago

libgnat yes, libgnarl no!

How can we debug this? The package is libgnat-* and it installs both of them at once: https://packages.debian.org/stretch/amd64/libgnat-6/filelist

tgingold commented 5 years ago

Build ghdl and check with ldd what are the dependencies. If needed, link with options -v or -Map to understand why libgnarl is used.

On my local build, it is not...

eine commented 5 years ago

@IshFx, the image should be fixed now:

# docker pull ghdl/ext:vunit
vunit: Pulling from ghdl/ext
f5d23c7fed46: Already exists
db16fe4b9a03: Pulling fs layer
bdbd99309ea3: Pulling fs layer
804a8302321f: Pulling fs layer
db16fe4b9a03: Verifying Checksum
db16fe4b9a03: Download complete
db16fe4b9a03: Pull complete
804a8302321f: Download complete
bdbd99309ea3: Verifying Checksum
bdbd99309ea3: Download complete
bdbd99309ea3: Pull complete
804a8302321f: Pull complete
Digest: sha256:47742b72276b28204d086a9262cb0b86155946582c91e7ebbff263469ec8b16b
Status: Downloaded newer image for ghdl/ext:vunit

# winpty docker run --rm -it ghdl/ext:vunit bash
root@f5d70fe51262:/# ghdl --version
GHDL 0.37-dev (v0.36-438-gf1e78d74) [Dunoon edition]
 Compiled with GNAT Version: 8.3.0
 mcode code generator
Written by Tristan Gingold.

Copyright (C) 2003 - 2019 Tristan Gingold.
GHDL is free software, covered by the GNU General Public License.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@tgingold, this is on Debian (Buster mcode):

root@f5d70fe51262:/# ldd $(which ghdl)
        linux-vdso.so.1 (0x00007ffcdf1fe000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f141088b000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f1410708000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f14104ea000)
        libgnarl-8.so.1 => /usr/lib/x86_64-linux-gnu/libgnarl-8.so.1 (0x00007f141049d000)
        libgnat-8.so.1 => /usr/lib/x86_64-linux-gnu/libgnat-8.so.1 (0x00007f141013e000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f141011d000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f1410111000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f14100f7000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f140ff36000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f1410c72000)

And, on Fedora (29 mcode):

[root@c97ef447a513 /]# ldd $(which ghdl)
        linux-vdso.so.1 (0x00007ffe89b58000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007f0198ebc000)
        libm.so.6 => /lib64/libm.so.6 (0x00007f0198d38000)
        libz.so.1 => /lib64/libz.so.1 (0x00007f0198d1e000)
        libgnarl-8.so => /lib64/libgnarl-8.so (0x00007f0198cd8000)
        libgnat-8.so => /lib64/libgnat-8.so (0x00007f0198982000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f0198960000)
        librt.so.1 => /lib64/librt.so.1 (0x00007f0198954000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f019878e000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f0198ec8000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f0198773000)

Shall I just add LDFLAGS+=-v to the https://github.com/ghdl/ghdl/blob/master/Makefile.in?

EDIT

ldd -v $(which ghdl)
        linux-vdso.so.1 (0x00007fffdd1ab000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f9c324e9000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f9c32366000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f9c32148000)
        libgnarl-7.so.1 => /usr/lib/x86_64-linux-gnu/libgnarl-7.so.1 (0x00007f9c320fb000)
        libgnat-7.so.1 => /usr/lib/x86_64-linux-gnu/libgnat-7.so.1 (0x00007f9c31d76000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f9c31d55000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f9c31d49000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f9c31d2f000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f9c31b6e000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f9c328cd000)

        Version information:
        /usr/local/bin/ghdl:
                libgcc_s.so.1 (GCC_3.0) => /lib/x86_64-linux-gnu/libgcc_s.so.1
                libz.so.1 (ZLIB_1.2.0) => /lib/x86_64-linux-gnu/libz.so.1
                libdl.so.2 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libdl.so.2
                libpthread.so.0 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libpthread.so.0
                libm.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libm.so.6
                libc.so.6 (GLIBC_2.14) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6
        /lib/x86_64-linux-gnu/libdl.so.2:
                ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2
                libc.so.6 (GLIBC_PRIVATE) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.4) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6
        /lib/x86_64-linux-gnu/libm.so.6:
                ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2
                libc.so.6 (GLIBC_2.4) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_PRIVATE) => /lib/x86_64-linux-gnu/libc.so.6
        /lib/x86_64-linux-gnu/libz.so.1:
                libc.so.6 (GLIBC_2.14) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.4) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.3.4) => /lib/x86_64-linux-gnu/libc.so.6
        /usr/lib/x86_64-linux-gnu/libgnarl-7.so.1:
                libgcc_s.so.1 (GCC_3.0) => /lib/x86_64-linux-gnu/libgcc_s.so.1
                librt.so.1 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/librt.so.1
                ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x86-64.so.2
                libc.so.6 (GLIBC_2.14) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6
                libpthread.so.0 (GLIBC_2.3.4) => /lib/x86_64-linux-gnu/libpthread.so.0
                libpthread.so.0 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libpthread.so.0
                libpthread.so.0 (GLIBC_2.3.2) => /lib/x86_64-linux-gnu/libpthread.so.0
        /usr/lib/x86_64-linux-gnu/libgnat-7.so.1:
                libgcc_s.so.1 (GCC_4.2.0) => /lib/x86_64-linux-gnu/libgcc_s.so.1
                libgcc_s.so.1 (GCC_3.3) => /lib/x86_64-linux-gnu/libgcc_s.so.1
                libgcc_s.so.1 (GCC_3.0) => /lib/x86_64-linux-gnu/libgcc_s.so.1
                libc.so.6 (GLIBC_2.14) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.7) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.28) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.3) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6
        /lib/x86_64-linux-gnu/libpthread.so.0:
                ld-linux-x86-64.so.2 (GLIBC_2.2.5) => /lib64/ld-linux-x86-64.so.2
                ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2
                libc.so.6 (GLIBC_2.14) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.3.2) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.4) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_PRIVATE) => /lib/x86_64-linux-gnu/libc.so.6
        /lib/x86_64-linux-gnu/librt.so.1:
                libpthread.so.0 (GLIBC_2.3.2) => /lib/x86_64-linux-gnu/libpthread.so.0
                libpthread.so.0 (GLIBC_PRIVATE) => /lib/x86_64-linux-gnu/libpthread.so.0
                libpthread.so.0 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libpthread.so.0
                libc.so.6 (GLIBC_2.14) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.3.2) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.4) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_PRIVATE) => /lib/x86_64-linux-gnu/libc.so.6
        /lib/x86_64-linux-gnu/libgcc_s.so.1:
                libc.so.6 (GLIBC_2.14) => /lib/x86_64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6
        /lib/x86_64-linux-gnu/libc.so.6:
                ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x86-64.so.2
                ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2
ishfx commented 5 years ago

@1138-4EB Indeed ! Thank you very much for your responsiveness 😄