-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
linux builds #1
Comments
great, thnx for makefile! but when i tried it inside godot (i opened example from godot-audiostream) i got these errors: after make i got pdstream.o file inside src dir and when i do command " nm pdstream" i got: but when i proceed "nm libpdstream.so" i got only: so my guess there must be something wrong in linking? |
Hello, sorry - I deleted the previous Makefile, as it was clearly wrong. I'm getting closer, I guess. Here's my latest one:
But there are still linking issues. Inside Godot:
|
Here's
|
More information: I'm using more recent versions of libpd and puredata:
And
|
yep i can just confirm that error concerning loading libpd :-o:
ERROR: Can't open dynamic library: /home/tao/godot/godot_pd/addons/audiostreampd/lib/linux/libpdstream.so. Error: libpd.so: cannot open shared object file: No such file or directory
at: open_dynamic_library (drivers/unix/os_unix.cpp:418)
ERROR: No valid library handle, can't get symbol from GDNative object
at: get_symbol (modules/gdnative/gdnative.cpp:510)
ERROR: No nativescript_init in "res://addons/audiostreampd/lib/linux/libpdstream.so" found
at: init_library (modules/gdnative/nativescript/nativescript.cpp:1503)
ERROR: No valid library handle, can't get symbol from GDNative object
at: get_symbol (modules/gdnative/gdnative.cpp:510)
ERROR: No valid library handle, can't terminate GDNative object
at: terminate (modules/gdnative/gdnative.cpp:417)
ERROR: Can't open dynamic library: /home/tao/godot/godot_pd/addons/audiostreampd/lib/linux/libpdstream.so. Error: libpd.so: cannot open shared object file: No such file or directory
at: open_dynamic_library (drivers/unix/os_unix.cpp:418)
huh thats strange :/ |
Wait, before I go down a rabbit hole... It's linked properly:
I'll try this |
OK, no more errors from Godot, but running GUI.tscn just exits the scene 🤔 Here's the latest Makefile: SOLIB_PREFIX = lib
SOLIB_EXT = dylib
else
- SOLIB_PREFIX =
- SOLIB_EXT = dll
- LDFLAGS += -Wl,--export-all-symbols \
- -static-libgcc
+ ifeq ($(OS), Windows_NT) # Windows, use Mingw
+ SOLIB_PREFIX =
+ SOLIB_EXT = dll
+ LDFLAGS += -Wl,--export-all-symbols \
+ -static-libgcc
+ else # assume Linux
+ SOLIB_PREFIX = lib
+ SOLIB_EXT = so
+ endif
endif
LDFLAGS += -shared\
$(LIBS)
+ifeq ($(shell uname),Linux)
+ CFLAGS += -fPIC
+ LDFLAGS += '-Wl,-rpath,addons/audiostreampd/lib/linux'
+endif
+
PDSTREAM = $(OUT)/$(SOLIB_PREFIX)pdstream.$(SOLIB_EXT)
LIBPD_DIR = libpd
@@ -36,7 +46,7 @@ ifeq ($(OS),Windows_NT)
endif
$(PDSTREAM): ${SRC:.c=.o} $(LIBPD_LOCAL)
- $(CC) -o $@ ${SRC:.c=.o} $(LDFLAGS)
+ $(CC) -o $@ $(CFLAGS) ${SRC:.c=.o} $(LDFLAGS)
$(LIBPD_LOCAL): Makefile.patch $(OUT)
ifeq ($(OS),Windows_NT) |
OK, I got it to work when I remove the error handler, i.e. // error(pd_init(), __func__, __LINE__);
pd_init(); // just call this I'm trying to figure out if anything broke when going to tag It seems as through this repo points to a libpd from 2021-11-19, but:
So it's somewhere in-between these two stable tags. Looking at the changelog now... |
Thank you all so much for your work. I apologise that a Linux build wasn't included to begin with; I lost access to a Linux machine last year and never got around to testing anything on Linux after moving to a Mac. My guess would have been, having dealt with build issues when creating the Windows and Mac Makefiles, that either the library or some of its dependencies are not being located correctly or are a mismatched architecture. From the looks of things, though, @opyate has a working Make recipe. I don't believe libpd has introduced any breaking API changes, as I used libpd in some other projects with similar code to this repo. @opyate, if you could confirm your fix and submit a pull request with your Makefile and submodule changes, I'll merge it in. Again, thank you all for your work and sorry for the radio silence. |
@magogware no worries :) Found the reason why the TSCN (the game) just exits. The error handler is clashing with some other function called
I'll open a PR for this. |
Brilliant sleuthing! Out of curiosity, any indication what function is clashing? I took a brief look through |
When I rename this https://github.com/magogware/godot-pdstream/blob/master/src/pdstream.c#L12 EDIT: ok, it just occurs to me that you're asking about what function not written by yourself might be clashing :) No idea - all I know is that the rename fixes things, so I just presume there's an |
slowly getting there but something strange is also happening... :/ make went just fine producing libpd.so and libpdstream.so. i created new project in godot 3.5.1 copied addons dir from godot-audiostream into it, also copied compiled libpd.so and libpdstream.so into ../lib/linux dir and set paths in PdStream.tres . saved that project and when i try to open and run it from godot editor it spills warnings (which are not essential i guess): it even creates window without those four buttons and spills errors like: in Pdstream.gdns is just this:
on line 15 in AudioStreamPd.gd is maybe i am doing some stupid error but have no idea what i am doing wrong :/. ev. will be thankful for advice. |
I see this error too, but can make it go away if I set a breakpoint on
Then I just step over the next to lines manually.
It looks like a race condition. I'm looking at a way to slow the initialisation down. As for the second error:
I'm also seeing this, and working on it now. |
I got it to work. Perhaps crucially because I renamed There was an Screencast: https://youtu.be/fIjNBv-tS5Q (HD should be ready 30 minutes from time of writing this)
PS I just stumbled upon this solution thanks to |
(yep it looks like progress, thnx! :) can confirm that with breakpoints it works, but without them nope...) |
hallo, any chance to merge opyate tribute, or to make it work under godot4? as we have stable version already... |
hello,
in Makefile there is no option for build linux version - i guess this shlould not be problem. I tried to fiddle with Makefile but I ended at error like this:
make -C libpd MULTI=true make[1]: Entering directory '/home/tao/source/godot-pdstream/libpd' make[1]: Nothing to be done for 'libpd'. make[1]: Leaving directory '/home/tao/source/godot-pdstream/libpd' cp libpd/libs/libpd.so bin/libpd.so cc -o bin/libpdstream.so ./src/pdstream.o ./src/instance.o -fPIC -shared -L./libpd/libs -lpd /usr/bin/ld: ./src/pdstream.o: warning: relocation against `res_prefix' in read-only section `.text' /usr/bin/ld: ./src/pdstream.o: relocation R_X86_64_PC32 against symbol `core_api' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: bad value collect2: error: ld returned 1 exit status make: *** [Makefile:38: bin/libpdstream.so] Error 1
and git submodule update --init --recursive
dont work, so i add libpd and pd sources manually
it would be really great to have pdlib api accessible in godot. good work :)
The text was updated successfully, but these errors were encountered: