docker (missing libpng)

14 posts / 0 new
Last post
jabirulo
jabirulo's picture
Offline
Last seen: 1 month 2 weeks ago
Joined: 2013-05-30 00:53
docker (missing libpng)

Hi, I'm using walkero dockers

walkero/amigagccondocker os4-gcc11-afxgroup 0fa2e72d58b1 10 months ago 4.61GB
walkero/amigagccondocker os4-gcc11-adtools 214178218446 10 months ago 3.36GB

when trying to crosscomìile vba emulator I get:

  1. root@3c985447511a:/work/amiga/VisualBoyAdvance-1.8.0-SDL2# ./configure --host=ppc-amigaos --target=ppc-amigaos
  2. checking build system type... x86_64-unknown-linux-gnu
  3. checking host system type... powerpc-unknown-amigaos
  4. checking target system type... powerpc-unknown-amigaos
  5. checking for a BSD-compatible install... /usr/bin/install -c
  6. checking whether build environment is sane... yes
  7. checking for gawk... no
  8. checking for mawk... mawk
  9. checking whether make sets $(MAKE)... yes
  10. checking for ppc-amigaos-strip... ppc-amigaos-strip
  11. checking for ppc-amigaos-gcc... /opt/ppc-amigaos/bin/ppc-amigaos-gcc
  12. checking whether the C compiler works... yes
  13. checking for C compiler default output file name... a.out
  14. checking for suffix of executables...
  15. checking whether we are cross compiling... yes
  16. checking for suffix of object files... o
  17. checking whether we are using the GNU C compiler... yes
  18. checking whether /opt/ppc-amigaos/bin/ppc-amigaos-gcc accepts -g... yes
  19. checking for /opt/ppc-amigaos/bin/ppc-amigaos-gcc option to accept ISO C89... none needed
  20. checking for style of include used by make... GNU
  21. checking dependency style of /opt/ppc-amigaos/bin/ppc-amigaos-gcc... gcc3
  22. ./configure: line 3839: AM_PROG_CC_C_O: command not found
  23. checking for bison... bison -y
  24. checking for flex... flex
  25. checking lex output file root... lex.yy
  26. checking lex library... none needed
  27. checking whether yytext is a pointer... no
  28. checking whether we are using the GNU C++ compiler... yes
  29. checking whether /opt/ppc-amigaos/bin/ppc-amigaos-g++ accepts -g... yes
  30. checking dependency style of /opt/ppc-amigaos/bin/ppc-amigaos-g++... gcc3
  31. checking for ppc-amigaos-ranlib... /opt/ppc-amigaos/bin/ppc-amigaos-ranlib
  32. checking for nasm... no
  33. checking for gzopen in -lz... yes
  34. checking for pthread_yield in -lpthread... no
  35. checking for pkg-config... /usr/bin/pkg-config
  36. checking for libpng... Package libpng was not found in the pkg-config search path. Perhaps you should add the directory containing 'libpng.pc' to the PKG_CONFIG_PATH environment variable No package 'libpng' found
  37. configure: error: Library requirements (libpng) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.

alas I just know minimal usage of dockers:
How can I "install" libpng?
Or do I need add extra parameters to ./configure to search through my "own" directory with such (missing) dependencies?

TiA

walkero
walkero's picture
Offline
Last seen: 4 months 3 weeks ago
Joined: 2009-05-03 16:54
Re: docker (missing libpng)

The docker containers are like linux installations in any computer. To install that library you have to get into the container and go to the SDK path /local/newlib and add the files you need.

The way to do it depends on how you run the docker containers. If you tell me how you execute them, I could help you do that installation.

Another way would be to extend the docker image with your changes by creating your own images.

jabirulo
jabirulo's picture
Offline
Last seen: 1 month 2 weeks ago
Joined: 2013-05-30 00:53
Re: docker (missing libpng)

ok, here is how I launch your image:

sudo docker run -it --rm --name gcc11-ppc -v ${PWD}:/work -w /work walkero/amigagccondocker:os4-gcc11-adtools /bin/bash

  1. #amigassh usuario@ubuntu-cc
  2. usuario@ubuntu-cc password:
  3. Welcome to Ubuntu 20.04.6 LTS (GNU/Linux 5.4.0-182-generic x86_64)
  4.  
  5. * Documentation: https://help.ubuntu.com
  6. * Management: https://landscape.canonical.com
  7. * Support: https://ubuntu.com/pro
  8. New release '22.04.3 LTS' available.
  9. Run 'do-release-upgrade' to upgrade to it.
  10.  
  11. Last login: Mon Jul 1 15:37:37 2024 from 192.168.1.204
  12. usuario@ubuntu-cc:~$ ls
  13. amiga code Downloads
  14. usuario@ubuntu-cc:~$ cd amiga/
  15. usuario@ubuntu-cc:~/amiga$ sudo docker run -it --rm --name gcc11-ppc -v ${PWD}:/work -w /work walkero/amigagccondocker:os4-gcc11-adtools /bin/bash

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P

walkero
walkero's picture
Offline
Last seen: 4 months 3 weeks ago
Joined: 2009-05-03 16:54
Re: docker (missing libpng)

So, based on the way you run it, you create the docker container and get inside it, by running bash. If you do a
printenv
there should be an ENV variable named SDK_PATH or something like that, pointing to the SDK in the disk. You need to go in there and under local/newlib the library you want.
There is curl, wget to download it inside the container and also you have mc to do file manipulation.

Have in mind though, that when you exit the container, this is destroyed, which means you need to install that library every time you want to use it. To avoid that remove the --rm from the command you use when you run the docker container.

jabirulo
jabirulo's picture
Offline
Last seen: 1 month 2 weeks ago
Joined: 2013-05-30 00:53
Re: docker (missing libpng)

ok thx so will remove --rm option.

BTW when linking with existing libpng16 on such dokcer, then in amigaos4 I get:
#VisualBoyAdvance --help
assertion "PNG16Base != NULL" failed: file "static/autoinit_png16_base.c", line 48

Building/linking with the one I have/use in my amigaos4 SDK then no problem:
#VisualBoyAdvance --help
VisualBoyAdvance [option ...] file

Options:
-1, --video-1x 1x
-2, --video-2x 2x
-3, --video-3x 3x
...

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P

jabirulo
jabirulo's picture
Offline
Last seen: 1 month 2 weeks ago
Joined: 2013-05-30 00:53
Re: docker (missing libpng)

libpng16 from docker image/container os4-gcc11-exp

  1. root@9d4400a5db3d:/work/VisualBoyAdvance-1.8.0-SDL2# ls -laF $SDK_PATH/local/newlib/lib/libpng16*
  2. -rw-r--r-- 1 amidev amidev 191856 Mar 4 18:43 /opt/ppc-amigaos/ppc-amigaos/SDK/local/newlib/lib/libpng16.a
  3. -rw-r--r-- 1 amidev amidev 879 Mar 4 18:43 /opt/ppc-amigaos/ppc-amigaos/SDK/local/newlib/lib/libpng16.la
  4. ...

/* png.h - header file for PNG reference library
*
* libpng version 1.6.38 - September 14, 2022
*

And the one I have/use:

  1. -rwxr--r-- 1 amidev amidev 1275458 Jul 4 13:36 libpng16.a
  2. -rwxr--r-- 1 amidev amidev 920 Jul 4 13:36 libpng16.la
  3. ...

/* png.h - header file for PNG reference library
*
* libpng version 1.6.43

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P

Hans
Hans's picture
Offline
Last seen: 4 months 3 weeks ago
Joined: 2010-12-09 22:04
Re: docker (missing libpng)

You don't actually need to have the library installed into the SDK. You could have your own third-party subdirectory, and use GCC's -I and -L command line options to tell GCC where to find the header and library files.

I've done this with ZitaFTP server, so that it compiles out-of-the-box, without needing to install dependency files into the SDK on every machine.

Join the Kea Campus - upgrade your skills; support my work; enjoy the Amiga corner.
https://keasigmadelta.com/ - see more of my work

walkero
walkero's picture
Offline
Last seen: 4 months 3 weeks ago
Joined: 2009-05-03 16:54
Re: docker (missing libpng)

@jabirulo
Today I uploaded a new version of my docker containers with gcc11. From now on, they will have their own versions, starting from 2.0.0, so that people can use the version that works better for them.

These new docker image includes ppc-amigaos-gcc-11, which supports newlib, clib2 and clib4, with plenty of libraries already installed, including the libpng16

You can try it by pulling the image
walkero/amigagccondocker:os4-gcc11-2.0.0
or
walkero/amigagccondocker:os4-gcc11
which will be used as the latest image

If you try it, please let me know how it works with your projects. Have in mind that it worked fine with a few of my projects, but it is not extensively tested yet.

jabirulo
jabirulo's picture
Offline
Last seen: 1 month 2 weeks ago
Joined: 2013-05-30 00:53
Re: docker (missing libpng)

using your latest docker image above.
Still getting same issue when building ¿:-/
Just changing/copying libpng16.a from my aos4 system solves it:

  1. ...
  2. -rwxr--r-- 1 amidev amidev 1275458 Jul 9 11:52 /opt/ppc-amigaos/ppc-amigaos/SDK
  3. /local/newlib/lib/libpng16.a*
  4. -rw-r--r-- 1 amidev amidev 191856 Jul 11 22:19 /opt/ppc-amigaos/ppc-amigaos/SDK
  5. /local/newlib/lib/libpng16.a.BAK
  6. -rw-r--r-- 1 amidev amidev 879 Jul 11 22:19 /opt/ppc-amigaos/ppc-amigaos/SDK
  7. /local/newlib/lib/libpng16.la
  8. lrwxrwxrwx 1 amidev amidev 60 Jul 11 22:19 /opt/ppc-amigaos/ppc-amigaos/SDK
  9. /local/newlib/lib/libpng.a -> /opt/ppc-amigaos/ppc-amigaos/SDK/local/newlib/lib/
  10. libpng16.a*
  11. ...

The original (.BAK) is 191 856 bytes while the one I have/use 1 275 458
When using/building with .BAK I get on amigaos4 shell/CLI:
#VisualBoyAdvance
assertion "PNG16Base != NULL" failed: file "static/autoinit_png16_base.c", line 48

With the 1.2MB png16.a it works fine.

EDIT1: trying to build another tiny game that uses png and nop problem ¿:-/
no idea then what VBA makefile does (or does not) that executable fails with above issue.

EDIT2; I just change/use the latest libpng (http://www.os4depot.net/?function=showfile&file=development/library/graphics/libpng.lha) instead the one from the docker image (os4-gcc11) has.

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P

jabirulo
jabirulo's picture
Offline
Last seen: 1 month 2 weeks ago
Joined: 2013-05-30 00:53
Re: docker (missing libpng)

The build(link stage is:

  1. Entering directory '/work/VisualBoyAdvance-1.8.0-SDL2/src/sdl'
  2.  
  3. /opt/ppc-amigaos/bin/ppc-amigaos-g++ -fno-exceptions -gstabs -O2 -DBKPT_SUPPORT -DC_CORE -fpermissive -o VisualBoyAdvance SDL.o amigaos.o debugger.o 2xSaI.o Cheats.o EEprom.o Flash.o GBA.o Gfx.o Globals.o Mode0.o Mode1.o Mode2.o Mode3.o Mode4.o Mode5.o RTC.o Sound.o Sram.o Text.o Util.o admame.o agbprint.o armdis.o bilinear.o bios.o elf.o expr-lex.o expr.o exprNode.o getopt.o getopt1.o hq2x.o interframe.o memgzio.o motionblur.o pixel.o remote.o scanline.o simple2x.o unzip.o -L/opt/ppc-amigaos/ppc-amigaos/SDK/local/newlib/lib -lz -lpng16 -lSDL2 ../gb/libgb.a

and it's from https://github.com/smarkusg/VisualBoyAdvance-1.8.0-SDL2

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P

admin
admin's picture
Offline
Last seen: 3 weeks 4 days ago
Joined: 2009-03-27 15:07
Re: docker (missing libpng)

@jabirulo
Thank you so much for testing it. The libpng16 I use is from
https://github.com/salass00/png16_lib

If you had issues with it, as you described here, it would make sense to file an issue at that repo.

Meanwhile, I will change the docker image to take the latest from the OS4Depot as you did.

jabirulo
jabirulo's picture
Offline
Last seen: 1 month 2 weeks ago
Joined: 2013-05-30 00:53
Re: docker (missing libpng)

thx, done.
https://github.com/salass00/png16_lib/issues/2

EDIT: and seems I forgot that I needed to install the png16.library in LIBS: on my AmigaOS4 system.

EDIT2: build again VBA with docker image (and its libpng16.a 1.6.38) and now with png16.library on my aos4 LIBS: no problems, THX

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P

walkero
walkero's picture
Offline
Last seen: 4 months 3 weeks ago
Joined: 2009-05-03 16:54
Re: docker (missing libpng)

So the library from salass is working fine, right?
If yes, I will leave the docker image as it is, and if someone want to use a different version, they can override.

jabirulo
jabirulo's picture
Offline
Last seen: 1 month 2 weeks ago
Joined: 2013-05-30 00:53
Re: docker (missing libpng)

yes works ok, but it needs png16.library, so you need to include it somewhere so it can be "installed" in amigaos4.
Like is for clib4.library (...SDK/clib4)

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P

Log in or register to post comments