Open MNS26 opened 2 years ago
Same here. Not sure, but it might be because libBulletDynamics.so.2.87 and libBulletCollision.so.2.87 depend on libLinearMath.so.2.87 (also a part of Bullet), but it isn't included. Haven't gotten further than this yet... :|
⯈ldd libphx/ext/lib/linux64/libBulletCollision.so.2.87
linux-vdso.so.1 (0x00007ffd9bf65000)
libLinearMath.so.2.87 => not found
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f2cba59f000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f2cba4b8000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f2cba498000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f2cba270000)
/lib64/ld-linux-x86-64.so.2 (0x00007f2cba8f1000)
For me it's going ballistic while wiring in libphx64r.so. I'm also on Linux btw...
[100%] Linking CXX executable ../bin/lt64r
/usr/bin/ld: /home/robert/code/ltheory/ltheory/libphx/ext/lib/linux64/libfmod.so: .dynsym local symbol at index 2 (>= sh_info of 2)
/usr/bin/ld: /home/robert/code/ltheory/ltheory/libphx/ext/lib/linux64/libfmod.so: .dynsym local symbol at index 3 (>= sh_info of 2)
/usr/bin/ld: /home/robert/code/ltheory/ltheory/libphx/ext/lib/linux64/libfmod.so: .dynsym local symbol at index 4 (>= sh_info of 2)
/usr/bin/ld: /home/robert/code/ltheory/ltheory/libphx/ext/lib/linux64/libfmodstudio.so: .dynsym local symbol at index 2 (>= sh_info of 2)
/usr/bin/ld: /home/robert/code/ltheory/ltheory/libphx/ext/lib/linux64/libfmodstudio.so: .dynsym local symbol at index 3 (>= sh_info of 2)
/usr/bin/ld: /home/robert/code/ltheory/ltheory/libphx/ext/lib/linux64/libfmodstudio.so: .dynsym local symbol at index 4 (>= sh_info of 2)
/usr/bin/ld: ../bin/libphx64r.so: undefined reference to 'CProfileManager::dumpAll()'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/lt.dir/build.make:98: ../bin/lt64r] Error 1
make[1]: *** [CMakeFiles/Makefile2:100: CMakeFiles/lt.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
Edit: The offending line is in src/Physics.cpp on line 274. I commented it out and now configure.py build
completes.
Ok, so then you succeeded in linking libphx64r.so (that this issue is about). Care to enlighten us?
Well, I simply followed the build instructions, i.e.
git lfs install
git clone --recursive https://github.com/JoshParnell/ltheory.git ltheory
cd ltheory
python configure.py
python configure.py build
python configure.py run
I commented out line 274 in ltheory/libphx/src/Physics.cpp
.
Also, the executable name needs to be changed in configure.py. It should be bin/lt64r
.
Having done this ./configure.py run quits with
bin/lt64r: error while loading shared libraries: libfmod.so.10: cannot open shared object file: No such file or directory
Linking still didn't go as smoothly after all...
Maybe relatedly I noticed, CMakeList.txt of libphx is missing the part where it's supposed to pull in external libraries for Linux.
if (WINDOWS)
*snip pulling in glew, lz4, lua51, and sdl2 for Windows platforms*
elseif (LINUX)
# TODO
endif ()
Strange that it works for you but not for others...
Regarding the run-time error (cannot open shared...), that could be worked around by setting LD_LIBRARY_PATH
before running. That is, adding a path where it searches for libraries during run-time.
e.g. export LD_LIBRARY_PATH=libphx/ext/lib/linux64
(probably better to use absolute path, though)
I ended up emulating what the cmake script does on Windows: copy the libraries from ltheory/libphx/ext/lib/linux64/
to ltheory/bin/
. Of course, setting LD_LIBRARY_PATH would also work.
libfmod.so
and libfmodstudio.so
are actually expected as libfmod.so.10
and libfmodstudio.so.10
, so I renamed them as well.
Finally sdl2 is missing in ltheory/libphx/ext/lib/linux64/
and simply copying or linking my native version of libsdl2.so
didn't work.
I ended up copying the contents of /usr/include/SDL2/
to ltheory/libphx/ext/include/sdl/
(leaving the cmake files in there).
With that, compiling and linking finally worked.
Now I can run ./configure.py run
to be greeted with some Lua error:
./script/env/ext/IOEx.lua:14: attempt to index global 'lfs' (a nil value)
lfs
seems to be the LuaFileSystem package. It isn't imported in IOEx.lua
(and couldn't be because it seems to be missing altogether).
Anybody knows how to install and load Lua packages?
Regarding your Bulletphysics problems: The only possible difference that I can think of is, that I have bulletphysics installed as a distro package. Maybe that provides libLinearMath.so.2.87
?
-> I just checked I have libLinearMath.so.3.24
installed. Of course also available as symlink libLinearMath.so
.
Maybe installing bulletphysics via your distro will help you as well?
Ah, I see. Yes having a globally-installed libLinearMath
would indeed help. If it would run correctly is another story ;) (considering it is a different version)
I did try (before) downloading the deb for 2.87 and putting that in the same libphx/ext/lib/linux64
but that didn't help either.
Btw, you can run ldd
on the resulting libphx64r.so, to see which libLinearMath it picked up.
No idea on the lua stuff, I'm completely useless in that area. :(
I eventually managed to get to the following upon running lt64r
Engine_Init: Detected SDL version mismatch:
Version (Compiled) : 2.0.14
Version (Linked) : 2.0.8
Engine_Init: Terminating.
Signal_Handler: Caught Abort
Aborted (core dumped)
I ended up emulating what the cmake script does on Windows: copy the libraries from
ltheory/libphx/ext/lib/linux64/
toltheory/bin/
. Of course, setting LD_LIBRARY_PATH would also work.libfmod.so
andlibfmodstudio.so
are actually expected aslibfmod.so.10
andlibfmodstudio.so.10
, so I renamed them as well. Finally sdl2 is missing inltheory/libphx/ext/lib/linux64/
and simply copying or linking my native version oflibsdl2.so
didn't work. I ended up copying the contents of/usr/include/SDL2/
toltheory/libphx/ext/include/sdl/
(leaving the cmake files in there). With that, compiling and linking finally worked. Now I can run./configure.py run
to be greeted with some Lua error:./script/env/ext/IOEx.lua:14: attempt to index global 'lfs' (a nil value)
lfs
seems to be the LuaFileSystem package. It isn't imported inIOEx.lua
(and couldn't be because it seems to be missing altogether). Anybody knows how to install and load Lua packages?
mind writing the steps/commands you took to get passed it? i dont quite follow what you did
Engine_Init: Detected SDL version mismatch: Version (Compiled) : 2.0.14 Version (Linked) : 2.0.8
That's "simply" include files and lib from different versions.
You mentioned you needed to copy from system to LT directory, so, it didn't find the system-installed SDL ?
It was not using system-installed SDL. I manually copied libSDL2-2.0.14
to bin/libSDL2-2.0.so.0
and libphx/ext/lib/linux64/libSDL2-2.0.so.0
.
Now the error is
./bin/lt64r: symbol lookup error: /home/isaac/Downloads/ltheory/libphx/ext/lib/linux64/libSDL2-2.0.so.0: undefined symbol: strlcpy, version GLIBC_2.2.5
Could this be because I obtained libSDL2 from https://altlinux.pkgs.org/p9/classic-x86_64/libSDL2-2.0.14-alt4.x86_64.rpm.html despite my distro being openSUSE Leap 15.4?
I eventually managed to get to the following upon running lt64r
Engine_Init: Detected SDL version mismatch: Version (Compiled) : 2.0.14 Version (Linked) : 2.0.8 Engine_Init: Terminating. Signal_Handler: Caught Abort Aborted (core dumped)
I also got this error, because lt ships with headers for sdl 2.0.14 but is missing the actual libsdl2.so
. Thus it's trying to link against the system installed sdl (2.0.22 in my case). I fixed this by copying the system sdl2 headers from /usr/include/SDL2/
to ltheory/libphx/ext/include/sdl/
. After ./configure.py clean
and repeating the build commands the error is gone.
I have to agree, though, replacing libLinearMath.so with the system version isn't going to work...
The proper way to go, would be to fix up the CmakeList.txt to use the system libraries and headers. Half of the necessary libraries seem to be missing anyway.
As noted here: https://github.com/JoshParnell/ltheory/discussions/5
Which highlights how much of a noob I am, I ran a-ground when attempting the previous step to you, i.e. python configure.py
Can you advise which version of Cmake you used to get to the next hurdle?
I have cmake version 3.23. the CmakeLists.txt
specifies version 3.0.2 as the minimum. So, any reasonably recent version should work.
Has anyone solved this lua error in IOEx.lua on line 14 yet?
Lua_PCall: Lua returned error message: ./script/env/ext/IOEx.lua:14: attempt to index global 'lfs' (a nil value) Signal_Handler: Caught Abort Lua Backtrace: [1] 1228801 IOT instruction (core dumped) bin/./lt64r
I have installed the luafilesystem package via the package manager of my gnu/linux distro, which did nothing to fix the error. I also tried installing the package via luarocks with the same effect.
When commenting out line 14, it obviously throws the next error, that it cannot check if the directory env/ext/ exists. Maybe someone else has more experience with lua than me and can help.
Well, I simply followed the build instructions, i.e.
git lfs install git clone --recursive https://github.com/JoshParnell/ltheory.git ltheory cd ltheory python configure.py python configure.py build python configure.py run
On ubuntu 2022 I can't get python configure.py
to run, it sptits out
Command 'python' not found, did you mean:
command 'python3' from deb python3
command 'python' from deb python-is-python3
so I do python3 configure.py
but then I get :
Traceback (most recent call last):
File "/home/t/Documents/ltheory/configure.py", line 21, in <module>
subprocess.call(['cmake', '-S', './', '-B', './build'])
File "/usr/lib/python3.10/subprocess.py", line 345, in call
with Popen(*popenargs, **kwargs) as p:
File "/usr/lib/python3.10/subprocess.py", line 969, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib/python3.10/subprocess.py", line 1845, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'cmake'
not sure what the issue is.
No such file or directory: 'cmake' Seems simple enough: you need to install
cmake
.
wtf... can't edit my message? :( the second row isn't supposed to be a quote...
ah yeah. I though cmake would come with build essentials. my bad.
I did what @insta256 did and removed ".exe" in the configure.py
I also ran :
~sudo apt install glew lz4 lua51 sdl2
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package glew
E: Unable to locate package lua51
E: Unable to locate package sdl2
but it seems most of these dependencies aren't available as-is on linux.
now when I try configure :
python3 configure.py
-- The C compiler identification is GNU 11.3.0
-- The CXX compiler identification is GNU 11.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:4 (include):
include could not find requested file:
libphx/script/build/Shared.cmake
CMake Error at CMakeLists.txt:6 (add_subdirectory):
The source directory
/home/t/Documents/ltheory/libphx
does not contain a CMakeLists.txt file.
CMake Error at CMakeLists.txt:9 (phx_configure_output_dir):
Unknown CMake command "phx_configure_output_dir".
-- Configuring incomplete, errors occurred!
See also "/home/t/Documents/ltheory/build/CMakeFiles/CMakeOutput.log".
didn't find anything interesting in the log.
[I guess you're using a debian-derived distro] Most (if not all) of those dependencies are named with lib
prefix, e.g. libglew
Also, when installing a dependency to build something, the developer package, usually with -dev
suffix, is the one you want.
Try e.g. apt search glew
to find the correct one...
I'm using ubuntu, I'm just fairly green when it comes to compiling source. thanks
I'm assuming I should prioritize 32 bit libs? (ubuntu doesn't install those unless you kinda force it to) for example on lz4 both the 32 and 64 bit library exists but I can actually only install one or the other. I'm going to try 32 bit first.
here's the maximum I was able to install :
sudo apt install libglew-dev libsdl2-dev libsdl2-dev:i386 lz4:i386 lua5.1:i386
(those that are not in this list as their 64 bit version it's because they were incompatible with the 32 bit version, and those that aren't present as their 32 bit version, it's because the 32 bit version didn't exist and those that aren't present in this list as -dev it's because they didn't have a -dev)
please tell me if I should revert this and use only 64 bit versions instead.
Not sure why you think you need 32bit libs? The native architecture is 64bit, for sure?
it is yeah. it's just I heard with a lot of dev projects like games (and in this case a 11 year old game and a windows one in particular) that they use 32 bit dependencies profusely and that for whatever reason the 64bit counterparts are incompatible.
If my assumption is wrong, all the better, i'll delete the 32bit libs and put the default instead
Yeah, if it involves wine it is sometimes 32bit (especially for older games)..But here you're compiling from source, so I don't see a reason for not using the native arch.
awesome thanks! so yeah the final set is :
sudo apt install libglew-dev libsdl2-dev libsdl2-dev lz4 lua5.1
and with this I think I have all the dependencies I will need?
You didn't find liblz4-dev
or liblua5.2-dev
?
oh my bad. I didn't test with both lib in front and -dev at the back at the same time. that worked.
sudo apt install libglew-dev libsdl2-dev libsdl2-dev liblz4-dev liblua5.1-dev
should I uninstall the non -dev version or will the compiler know which to pick?
as for configure, I'm still getting the same error : https://github.com/JoshParnell/ltheory/issues/3#issuecomment-1308761738
it wants me to have a CMakeLists.txt file ? and the rest of the errors, I don't understand
Strange, the CMakeLists.txt should already be there. It defines the building process for that sub-directory.
I realized the libphx folder is a sub-gitrepo (something I'm new to) and that my git clone command did not clone this repo
I imagine there's a command to clone all of a repo including all subrepos?
EDIT : seems this is it: https://stackoverflow.com/a/4438292/4770754
also we're supposed to add libBulletDynamics.so.2.87 libBulletCollision.so.2.87 libLinearMath.so.2.87
as dependencies?
and I didn't understand this https://github.com/JoshParnell/ltheory/issues/3#issuecomment-1200494668
configure finally went through for me :
t@tsu:~/Documents/ltheory$ python3 configure.py
-- Configuring done
-- Generating done
-- Build files have been written to: /home/t/Documents/ltheory/build
t@tsu:~/Documents/ltheory$
and here's my output for build :
I found online that the two errors I got :
/usr/bin/ld: cannot find -lBulletCollision: No such file or directory
/usr/bin/ld: cannot find -lBulletDynamics: No such file or directory
might be due to missing g++ but that's not my case.
t@tsu:~/Documents/ltheory$ g++ --version
g++ (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
what am I supposed to do?
or maybe this is the issue : https://stackoverflow.com/a/21391673/4770754
FYI, I just tried this fork: https://github.com/Limit-Theory-Redux/ltheory
Building it worked out of the box, after installing libbullet-dev
.
Haven't tried running it yet, though... ;)
ooh ! thanks! let's try that! (do I also have to remove ".exe" and the other changes required for a linux build? seems I do)
EDIT : well running build for me finished on another error :
[ 99%] Linking CXX shared library ../../bin/libphx64r.so
/usr/bin/ld: cannot find -lfreetype: No such file or directory
/usr/bin/ld: cannot find -lluajit-5.1: No such file or directory
/usr/bin/ld: /home/t/Documents/ltheory/build/_deps/ext-src/lib/linux64/libfmod.so: .dynsym local symbol at index 2 (>= sh_info of 2)
/usr/bin/ld: /home/t/Documents/ltheory/build/_deps/ext-src/lib/linux64/libfmod.so: .dynsym local symbol at index 3 (>= sh_info of 2)
/usr/bin/ld: /home/t/Documents/ltheory/build/_deps/ext-src/lib/linux64/libfmod.so: .dynsym local symbol at index 4 (>= sh_info of 2)
/usr/bin/ld: /home/t/Documents/ltheory/build/_deps/ext-src/lib/linux64/libfmodstudio.so: .dynsym local symbol at index 2 (>= sh_info of 2)
/usr/bin/ld: /home/t/Documents/ltheory/build/_deps/ext-src/lib/linux64/libfmodstudio.so: .dynsym local symbol at index 3 (>= sh_info of 2)
/usr/bin/ld: /home/t/Documents/ltheory/build/_deps/ext-src/lib/linux64/libfmodstudio.so: .dynsym local symbol at index 4 (>= sh_info of 2)
collect2: error: ld returned 1 exit status
gmake[2]: *** [libphx/CMakeFiles/phx.dir/build.make:1857: ../bin/libphx64r.so] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:126: libphx/CMakeFiles/phx.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2
I'll go post in that repo's issues too
EDIT : bizarrely they don't have issues, they only have discussions. I posted there.
EDIT2 :
I ran
sudo apt install libfreetype-dev libluajit-5.1-dev
maybe that'll do it?
oh yeah forgot about line 274 in ltheory/libphx/src/Physics.cpp
Haven't been able to run it because of missing libfmod.so.10
... not sure how it was able to build though...
build did work for me but...
python3 configure.py run
Traceback (most recent call last):
File "/home/t/Documents/ltheory/configure.py", line 19, in <module>
subprocess.call(['bin/lt64'] + sys.argv[2:])
File "/usr/lib/python3.10/subprocess.py", line 345, in call
with Popen(*popenargs, **kwargs) as p:
File "/usr/lib/python3.10/subprocess.py", line 969, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib/python3.10/subprocess.py", line 1845, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'bin/lt64'
run does not.
FileNotFoundError: [Errno 2] No such file or directory: 'bin/lt64'
Missing an r
? (in configure.py, I mean)
dammit
EDIT:
ok haha all caught up with you guys 😅
python3 configure.py run
bin/lt64r: error while loading shared libraries: libfmod.so.10: cannot open shared object file: No such file or directory
so now someone just needs to go in an redo the source entirely to not use FMOD but SDL_audio instead https://github.com/JoshParnell/libphx/issues/1#issue-1319792038 "just"
what about if I had a license to FMOD?
Not really familiar with the fmod license, but yeah, something else would be preferable.
Don't think you need a license per se just to run applications using it, though.
Don't think you need a license per se just to run applications using it, though.
?
do you have an example?
Example of an application? No, not at the moment.
From their license faq:
When do I need a license? A license must be obtained before commercial release of a game (including soft releases like early access if it is paid access). A license is not required at the start of development.
you could just copy the fmod library files from libphx/ext/lib/linux64/ into your bin/ folder. but note, that you have to rename libfmod.so to libfmod.so.10 and libfmodstudio.so to libfmodstudio.so.10.
Hm... I don't have an "ext" directory, in the redux fork at least.
Oh yeah right, it seems, that the redux version doesn't have an ext dir. You could try copying the required shared object files over from the original ltheory.
following the example process when running
python configure.py build
this is the following output