openslide-bin icon indicating copy to clipboard operation
openslide-bin copied to clipboard

Emscripten build

Open aaalloc opened this issue 1 year ago • 2 comments

From https://github.com/openslide/openslide/pull/621

For building, you will need to have emscripten and wasm-ld installed

Meson setup command

meson setup builddir --cross-file machines/cross-emscripten.ini --default-library=static -Dzlib:default_library=static -Dlibffi:default_library=static -Dlibxml2:default_library=static -Dsqlite3:default_library=static -Dzstd:default_library=static -Dlibpng:default_library=static -Dlibopenjp2:default_library=static -Dglib:default_library=static -Dgdk-pixbuf:default_library=static -Dpixman:default_library=static -Dcairo:default_library=static -Duthash:default_library=static -Dlibdico:default_library=static -Dopenslide:default_library=static -Dproxy-libintl:default_library=static

meson compile -C builddir

I have changed glib.wrap because building glib with emscripten needs particular changes (https://github.com/emscripten-core/emscripten/issues/11066) but it stills fails building.

It currently stuck to glib/gdk-pixbuf compilation part image

When trying to compile pcre2 it says

pcre2| Checking for function "mkostemp" : YES

subprojects/pcre2-10.44/meson.build:73:6: ERROR: Problem encountered: Your configuration is not supported

but pcre2 wasm build are present online https://github.com/stephen-riley/pcre2-wasm/blob/master/Makefile, so it is possible but I don't know for now how to do it. (Pcre2 was needed for glib 2.80.3 (previous version of glib.wrap that I modified))

So, for a successful wasm32 build, I think a correct emscripten patch for glib would do the trick.

aaalloc avatar Jun 16 '24 09:06 aaalloc

DCO signed off :heavy_check_mark:

All commits have been signed off. You have certified to the terms of the Developer Certificate of Origin, version 1.1. In particular, you certify that this contribution has not been developed using information obtained under a non-disclosure agreement or other license terms that forbid you from contributing it under the GNU Lesser General Public License, version 2.1.

openslide-bot avatar Jun 16 '24 09:06 openslide-bot

Errors previously showed in screen are fixed by https://github.com/openslide/openslide-bin/pull/262/commits/e1f3519413fba02c8a619b2c5ffa7f54dbbed2e7, now it seem to compile with different warnings in gdk-pixbuf side and some problems objcopy step that might be easy to fix

/usr/bin/objcopy: subprojects/openslide-4.0.0/src/libopenslide.a(meson-generated_.._openslide-tables.c.o): Incapable de reconnaître le format du fichier: format de fichier non reconnu
/usr/bin/objcopy: subprojects/openslide-4.0.0/src/libopenslide.a(openslide.c.o): Incapable de reconnaître le format du fichier: format de fichier non reconnu
/usr/bin/objcopy: subprojects/openslide-4.0.0/src/libopenslide.a(openslide-cache.c.o): Incapable de reconnaître le format du fichier: format de fichier non reconnu
/usr/bin/objcopy: subprojects/openslide-4.0.0/src/libopenslide.a(openslide-decode-gdkpixbuf.c.o): Incapable de reconnaître le format du fichier: format de fichier non reconnu
/usr/bin/objcopy: subprojects/openslide-4.0.0/src/libopenslide.a(openslide-decode-jp2k.c.o): Incapable de reconnaître le format du fichier: format de fichier non reconnu
/usr/bin/objcopy: subprojects/openslide-4.0.0/src/libopenslide.a(openslide-decode-jpeg.c.o): Incapable de reconnaître le format du fichier: format de fichier non reconnu
/usr/bin/objcopy: subprojects/openslide-4.0.0/src/libopenslide.a(openslide-decode-png.c.o): Incapable de reconnaître le format du fichier: format de fichier non reconnu
/usr/bin/objcopy: subprojects/openslide-4.0.0/src/libopenslide.a(openslide-decode-sqlite.c.o): Incapable de reconnaître le format du fichier: format de fichier non reconnu
/usr/bin/objcopy: subprojects/openslide-4.0.0/src/libopenslide.a(openslide-decode-tiff.c.o): Incapable de reconnaître le format du fichier: format de fichier non reconnu
/usr/bin/objcopy: subprojects/openslide-4.0.0/src/libopenslide.a(openslide-decode-tifflike.c.o): Incapable de reconnaître le format du fichier: format de fichier non reconnu
/usr/bin/objcopy: subprojects/openslide-4.0.0/src/libopenslide.a(openslide-decode-xml.c.o): Incapable de reconnaître le format du fichier: format de fichier non reconnu
/usr/bin/objcopy: subprojects/openslide-4.0.0/src/libopenslide.a(openslide-error.c.o): Incapable de reconnaître le format du fichier: format de fichier non reconnu
/usr/bin/objcopy: subprojects/openslide-4.0.0/src/libopenslide.a(openslide-file.c.o): Incapable de reconnaître le format du fichier: format de fichier non reconnu
/usr/bin/objcopy: subprojects/openslide-4.0.0/src/libopenslide.a(openslide-grid.c.o): Incapable de reconnaître le format du fichier: format de fichier non reconnu
/usr/bin/objcopy: subprojects/openslide-4.0.0/src/libopenslide.a(openslide-hash.c.o): Incapable de reconnaître le format du fichier: format de fichier non reconnu
/usr/bin/objcopy: subprojects/openslide-4.0.0/src/libopenslide.a(openslide-jdatasrc.c.o): Incapable de reconnaître le format du fichier: format de fichier non reconnu
/usr/bin/objcopy: subprojects/openslide-4.0.0/src/libopenslide.a(openslide-util.c.o): Incapable de reconnaître le format du fichier: format de fichier non reconnu
............

I might fix it if I have some times.

aaalloc avatar Aug 11 '24 21:08 aaalloc