bsansouci / reprocessing-example

79 stars 29 forks source link

Ubuntu 16.04 x86_64 failure #2

Closed raould closed 6 years ago

raould commented 6 years ago

after the npm install etc. trying to do

$ npm run build
...
FAILED: indexhot.byte 
/home/superman/Dev/rml/Test/reprocessing-example/node_modules/bs-platform/lib/bsb_helper.exe  -add-ocaml-dependency bigarray -add-ocaml-dependency dynlink -add-ocaml-dependency nums -add-ocaml-dependency str -add-ocaml-dependency threads -add-ocaml-dependency unix -w -30-40+6+7+27+32..39+44+45+101  -bs-main IndexHot -bs-super-errors -add-clib -ccopt -add-clib -lasound -add-clib -ccopt -add-clib -lm -add-clib -ccopt -add-clib -ldl -add-clib -ccopt -add-clib -lpulse-simple -add-clib -ccopt -add-clib -lpulse -add-clib -ccopt -add-clib -lpthread -add-clib -ccopt -add-clib -lrt -add-clib /home/superman/Dev/rml/Test/reprocessing-example/node_modules/Reasongl/lib/reasongl.o -add-clib /home/superman/Dev/rml/Test/reprocessing-example/node_modules/Tgls/lib/glad.o -add-clib /home/superman/Dev/rml/Test/reprocessing-example/node_modules/Tgls/lib/image_helper.o -add-clib /home/superman/Dev/rml/Test/reprocessing-example/node_modules/Tgls/lib/stb_image_aug.o -add-clib /home/superman/Dev/rml/Test/reprocessing-example/node_modules/Tgls/lib/image_DXT.o -add-clib /home/superman/Dev/rml/Test/reprocessing-example/node_modules/Tgls/lib/SOIL.o -add-clib /home/superman/Dev/rml/Test/reprocessing-example/node_modules/Tgls/lib/soil_wrapper.o -add-clib /home/superman/Dev/rml/Test/reprocessing-example/node_modules/Tgls/lib/tgls_new.o -add-clib /home/superman/Dev/rml/Test/reprocessing-example/node_modules/Tsdl/lib/tsdl_new.o -add-clib /home/superman/Dev/rml/Test/reprocessing-example/node_modules/sdl2/libSDL2.a  -I /home/superman/Dev/rml/Test/reprocessing-example/node_modules/sdl2/lib/ocaml/bytecode -I /home/superman/Dev/rml/Test/reprocessing-example/node_modules/Tsdl/lib/ocaml/bytecode -I /home/superman/Dev/rml/Test/reprocessing-example/node_modules/Tgls/lib/ocaml/bytecode -I /home/superman/Dev/rml/Test/reprocessing-example/node_modules/Reasongl/lib/ocaml/bytecode -I /home/superman/Dev/rml/Test/reprocessing-example/node_modules/reprocessing/lib/ocaml/bytecode src/IndexHot.mlast src/index.mlast -link-bytecode indexhot.byte
/usr/bin/ld: cannot find -lpulse-simple
/usr/bin/ld: cannot find -lpulse
collect2: error: ld returned 1 exit status

so then i installed libpulse-dev, which helped. but then:

FAILED: indexhot.byte 
/home/superman/Dev/rml/Test/reprocessing-example/node_modules/bs-platform/lib/bsb_helper.exe  -add-ocaml-dependency bigarray -add-ocaml-dependency dynlink -add-ocaml-dependency nums -add-ocaml-dependency str -add-ocaml-dependency threads -add-ocaml-dependency unix -w -30-40+6+7+27+32..39+44+45+101  -bs-main IndexHot -bs-super-errors -add-clib -ccopt -add-clib -lasound -add-clib -ccopt -add-clib -lm -add-clib -ccopt -add-clib -ldl -add-clib -ccopt -add-clib -lpulse-simple -add-clib -ccopt -add-clib -lpulse -add-clib -ccopt -add-clib -lpthread -add-clib -ccopt -add-clib -lrt -add-clib /home/superman/Dev/rml/Test/reprocessing-example/node_modules/Reasongl/lib/reasongl.o -add-clib /home/superman/Dev/rml/Test/reprocessing-example/node_modules/Tgls/lib/glad.o -add-clib /home/superman/Dev/rml/Test/reprocessing-example/node_modules/Tgls/lib/image_helper.o -add-clib /home/superman/Dev/rml/Test/reprocessing-example/node_modules/Tgls/lib/stb_image_aug.o -add-clib /home/superman/Dev/rml/Test/reprocessing-example/node_modules/Tgls/lib/image_DXT.o -add-clib /home/superman/Dev/rml/Test/reprocessing-example/node_modules/Tgls/lib/SOIL.o -add-clib /home/superman/Dev/rml/Test/reprocessing-example/node_modules/Tgls/lib/soil_wrapper.o -add-clib /home/superman/Dev/rml/Test/reprocessing-example/node_modules/Tgls/lib/tgls_new.o -add-clib /home/superman/Dev/rml/Test/reprocessing-example/node_modules/Tsdl/lib/tsdl_new.o -add-clib /home/superman/Dev/rml/Test/reprocessing-example/node_modules/sdl2/libSDL2.a  -I /home/superman/Dev/rml/Test/reprocessing-example/node_modules/sdl2/lib/ocaml/bytecode -I /home/superman/Dev/rml/Test/reprocessing-example/node_modules/Tsdl/lib/ocaml/bytecode -I /home/superman/Dev/rml/Test/reprocessing-example/node_modules/Tgls/lib/ocaml/bytecode -I /home/superman/Dev/rml/Test/reprocessing-example/node_modules/Reasongl/lib/ocaml/bytecode -I /home/superman/Dev/rml/Test/reprocessing-example/node_modules/reprocessing/lib/ocaml/bytecode src/IndexHot.mlast src/index.mlast -link-bytecode indexhot.byte
/home/superman/Dev/rml/Test/reprocessing-example/node_modules/sdl2/libSDL2.a(SDL_mirvideo.o): In function `MIR_InitDisplayFromOutput':
/home/superman/Dev/rml/Test/reprocessing-example/node_modules/sdl2/src/video/mir/SDL_mirvideo.c:258: undefined reference to `mir_output_get_current_mode'
collect2: error: ld returned 1 exit status
Schmavery commented 6 years ago

Mhhhh, I believe this is as a result of our linux support for sdl2 being still a tad hacky. We generate a bsconfig with the "correct" (hardcoded) linux linking flags here: https://github.com/bsansouci/SDL-mirror/blob/fast/postinstall.js#L135

But since on linux we run the configure script and build from scratch, these link flags might end up being wrong for some platforms (seems like yours is one of them). We need to instead pull the right static linking flags from the generated pc files (https://github.com/bsansouci/SDL-mirror/blob/SDL12/sdl.pc.in#L14)

@bsansouci

Schmavery commented 6 years ago

@raould can you paste the contents of node_modules/sdl2/sdl2.pc?

mciparelli commented 6 years ago

In my case I get a bunch of these

can not be used when making a shared object; recompile with -fPIC

Any idea how to workaround this?

Schmavery commented 6 years ago

@mciparelli unless sdl is mentioned explicitly in the error message, that unfortunately looks like another occurrence of https://github.com/bsansouci/bsb-native/issues/35 (and likely isn't related to this issue).

bsansouci commented 6 years ago

@mciparelli Could you paste the contents of node_modules/sdl2/sdl2.pc so we can figure out if you have different generated linker flags on your machine?

mciparelli commented 6 years ago

yeah it looks like this

# sdl pkg-config source file

prefix=/home/tincho/local/reprocessing-example/node_modules/sdl2
exec_prefix=${prefix}
libdir=/home/tincho/local/reprocessing-example/node_modules/sdl2
includedir=${prefix}/include

Name: sdl2
Description: Simple DirectMedia Layer is a cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D video framebuffer.
Version: 2.0.5
Requires:
Conflicts:
Libs: -L${libdir} -Wl,-rpath,${libdir} -Wl,--enable-new-dtags -lSDL2 
Libs.private: -lSDL2   -Wl,--no-undefined -lm -ldl -lpthread -lrt
Cflags: -I${includedir}/SDL2   -D_REENTRANT
Schmavery commented 6 years ago

@raould the dependency on libpulse-dev should be removed for cases where your distro doesn't use pulseaudio. Please reopen or otherwise let us know if you're still having issues, and if the error looks like this, please include the contents of node_modules/sdl2/sdl2.pc just so we can check what sdl2 wants us to link :)