Skip to content
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

python configure.py build fails #3

Open
MNS26 opened this issue Jul 28, 2022 · 72 comments
Open

python configure.py build fails #3

MNS26 opened this issue Jul 28, 2022 · 72 comments

Comments

@MNS26
Copy link

MNS26 commented Jul 28, 2022

following the example process when running python configure.py build this is the following output

❯ python configure.py build
Consolidate compiler generated dependencies of target phx
[  1%] Linking CXX shared library ../../bin/libphx64r.so
/usr/bin/ld: /home/noah/Desktop/Github/ltheory/libphx/ext/lib/linux64/libfmod.so: .dynsym local symbol at index 2 (>= sh_info of 2)
/usr/bin/ld: /home/noah/Desktop/Github/ltheory/libphx/ext/lib/linux64/libfmod.so: .dynsym local symbol at index 3 (>= sh_info of 2)
/usr/bin/ld: /home/noah/Desktop/Github/ltheory/libphx/ext/lib/linux64/libfmod.so: .dynsym local symbol at index 4 (>= sh_info of 2)
/usr/bin/ld: /home/noah/Desktop/Github/ltheory/libphx/ext/lib/linux64/libfmodstudio.so: .dynsym local symbol at index 2 (>= sh_info of 2)
/usr/bin/ld: /home/noah/Desktop/Github/ltheory/libphx/ext/lib/linux64/libfmodstudio.so: .dynsym local symbol at index 3 (>= sh_info of 2)
/usr/bin/ld: /home/noah/Desktop/Github/ltheory/libphx/ext/lib/linux64/libfmodstudio.so: .dynsym local symbol at index 4 (>= sh_info of 2)
/usr/bin/ld: cannot find -lBulletCollision: No such file or directory
/usr/bin/ld: cannot find -lBulletDynamics: No such file or directory
collect2: error: ld returned 1 exit status
make[2]: *** [libphx/CMakeFiles/phx.dir/build.make:1857: ../bin/libphx64r.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:126: libphx/CMakeFiles/phx.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
░▒▓  │   ~/De/G/ltheory │    master ?4 ▓▒░                                                                         ░▒▓ ✔ │ 11:45:40   ▓▒░
@neonrust
Copy link

neonrust commented Jul 30, 2022

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)

@insta256
Copy link

insta256 commented Jul 31, 2022

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.

@neonrust
Copy link

Ok, so then you succeeded in linking libphx64r.so (that this issue is about). Care to enlighten us?

@insta256
Copy link

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 ()

@neonrust
Copy link

neonrust commented Jul 31, 2022

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)

@insta256
Copy link

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?

@insta256
Copy link

insta256 commented Jul 31, 2022

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?

@neonrust
Copy link

neonrust commented Aug 1, 2022

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.

@neonrust
Copy link

neonrust commented Aug 1, 2022

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. :(

@imbev
Copy link

imbev commented Aug 1, 2022

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)

@MNS26
Copy link
Author

MNS26 commented Aug 1, 2022

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?

mind writing the steps/commands you took to get passed it? i dont quite follow what you did

@neonrust
Copy link

neonrust commented Aug 1, 2022

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 ?

@imbev
Copy link

imbev commented Aug 1, 2022

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?

@insta256
Copy link

insta256 commented Aug 1, 2022

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.

@FormalMoss
Copy link

As noted here:
#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?

@insta256
Copy link

insta256 commented Aug 9, 2022

I have cmake version 3.23. the CmakeLists.txt specifies version 3.0.2 as the minimum. So, any reasonably recent version should work.

@dw0xaa55
Copy link

dw0xaa55 commented Sep 11, 2022

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.

@tatsujb
Copy link

tatsujb commented Nov 6, 2022

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.

@neonrust
Copy link

neonrust commented Nov 6, 2022

No such file or directory: 'cmake'
Seems simple enough: you need to install cmake.

@neonrust
Copy link

neonrust commented Nov 6, 2022

wtf... can't edit my message? :( the second row isn't supposed to be a quote...

@tatsujb
Copy link

tatsujb commented Nov 9, 2022

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.

@neonrust
Copy link

neonrust commented Nov 9, 2022

[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...

@tatsujb
Copy link

tatsujb commented Nov 10, 2022

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.

@neonrust
Copy link

Not sure why you think you need 32bit libs? The native architecture is 64bit, for sure?

@tatsujb
Copy link

tatsujb commented Nov 10, 2022

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

@neonrust
Copy link

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.

@tatsujb
Copy link

tatsujb commented Nov 10, 2022

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?

@neonrust
Copy link

You didn't find liblz4-dev or liblua5.2-dev ?

@tatsujb
Copy link

tatsujb commented Nov 10, 2022

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?

@tatsujb
Copy link

tatsujb commented Nov 10, 2022

as for configure, I'm still getting the same error :
#3 (comment)

it wants me to have a CMakeLists.txt file ?
and the rest of the errors, I don't understand

@tatsujb
Copy link

tatsujb commented Nov 10, 2022

so now someone just needs to go in an redo the source entirely to not use FMOD but SDL_audio instead
JoshParnell/libphx#1 (comment)
"just"

what about if I had a license to FMOD?

@neonrust
Copy link

Not really familiar with the fmod license, but yeah, something else would be preferable.

@neonrust
Copy link

Don't think you need a license per se just to run applications using it, though.

@tatsujb
Copy link

tatsujb commented Nov 10, 2022

Don't think you need a license per se just to run applications using it, though.

?

do you have an example?

@neonrust
Copy link

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.

@dw0xaa55
Copy link

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.

@neonrust
Copy link

Hm... I don't have an "ext" directory, in the redux fork at least.

@dw0xaa55
Copy link

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.

@neonrust
Copy link

Yeah, I did... now I can run it, but instead apparently have mixed SDL versions :(

@dw0xaa55
Copy link

dw0xaa55 commented Nov 10, 2022

Try copying the SDL.h from your system (located in /usr/include/SDL2/SDL.h) into libphx/include for the redux version.
For the original it is libphx/ext/include/sdl/
Edit:
Oh right, and you have to rebuild ltheory, obviously

@tatsujb
Copy link

tatsujb commented Nov 10, 2022

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.

Try copying the SDL.h from your system (located in /usr/include/SDL2/SDL.h) into libphx/include for the redux version.
For the original it is libphx/ext/include/sdl/
Edit:
Oh right, and you have to rebuild ltheory, obviously

I did all of that, with all three steps, configure, configure build and configure run and yet still :

t@tsu:~/Documents/ltheory$ python3 configure.py run
bin/lt64r: error while loading shared libraries: libfmod.so.10: cannot open shared object file: No such file or directory

should I empty out all the cache ?

@dw0xaa55
Copy link

did you copy the libfmod*.so.10 back into the bin/ folder after the rebuild?
python configure.py clean seems to delete everything in the folder, also your manually copied files.

@tatsujb
Copy link

tatsujb commented Nov 10, 2022

did you copy the libfmod*.so.10 back into the bin/ folder after the rebuild? python configure.py clean seems to delete everything in the folder, also your manually copied files.

no but the file wasn't there to begin with (and it was still there after build) so I would've assumed it wasn't touched.

I copied them back over (and renamed them) again, no change.

@neonrust
Copy link

I had to run with LD_LIBRARY_PATH=$(pwd)/bin python ..., otherwise it didn't find the fmod lib.

@tatsujb
Copy link

tatsujb commented Nov 10, 2022

LD_LIBRARY_PATH=$(pwd)/bin python ...

what's the full path on that (so that I can adapt to what's mine)

what i've been doing this entire time is

export LD_LIBRARY_PATH=/home/t/Documents/ltheory/libphx/ext/lib/linux64

but I imagine you can only have one exported value on that so mine isn't correct?
EDIT: (and now I realise that this was moot with the redux dirrectory since that one didn't have an ext dir ....

BTW @dw0xaa55 on ubuntu the SDL.h I already had was working. replacing it made a new build fail.

@dw0xaa55
Copy link

dw0xaa55 commented Nov 10, 2022

Interesting, @tatsujb, I didn't expect other distros to handle the copied SDL versions so differently, since you are just copying the system's SDL version, against which you compile so the build and system use the same one.

@tatsujb
Copy link

tatsujb commented Nov 10, 2022

well they're very very different in size for one...
image

@dw0xaa55
Copy link

oh wow, that's a big difference. I did not know that.

@tatsujb
Copy link

tatsujb commented Nov 10, 2022

so yeah. for me the 95 bytes one (original) results in a successful compile.
whereas it's 8.1 kB counterpart results in :

python3 configure.py build
[  1%] Building CXX object libphx/CMakeFiles/phx.dir/src/Audio.cpp.o
[  2%] Building CXX object libphx/CMakeFiles/phx.dir/src/BSP.cpp.o
[  3%] Building CXX object libphx/CMakeFiles/phx.dir/src/Bit.cpp.o
[  4%] Building CXX object libphx/CMakeFiles/phx.dir/src/BlendMode.cpp.o
[  5%] Building CXX object libphx/CMakeFiles/phx.dir/src/BoxMesh.cpp.o
[  6%] Building CXX object libphx/CMakeFiles/phx.dir/src/BoxTree.cpp.o
[  6%] Building CXX object libphx/CMakeFiles/phx.dir/src/Button.cpp.o
In file included from /home/t/Documents/ltheory/libphx/include/Button.h:5,
                 from /home/t/Documents/ltheory/libphx/src/Button.cpp:2:
/home/t/Documents/ltheory/libphx/include/SDL.h:32:10: fatal error: SDL_main.h: No such file or directory
   32 | #include "SDL_main.h"
      |          ^~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [libphx/CMakeFiles/phx.dir/build.make:160: libphx/CMakeFiles/phx.dir/src/Button.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:126: libphx/CMakeFiles/phx.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2

@dw0xaa55
Copy link

dw0xaa55 commented Nov 10, 2022

oh, that's just the error, that it also wants SDL_main.h.
I didn't run into this one, maybe because I was lazy and copied the whole folder (/usr/include/sdl2/*) over.

Otherwise, if it works for you, just leave it the way it is :D

@tatsujb
Copy link

tatsujb commented Nov 10, 2022

ok but the problem still is bin/lt64r: error while loading shared libraries: libfmod.so.10: cannot open shared object file: No such file or directory 😅

@dw0xaa55
Copy link

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.

or use LD_LIBRARY_PATH=path/to/original/ltheory/shared/object/files
but either way they have to be called .so.10

@tatsujb
Copy link

tatsujb commented Nov 10, 2022

alright so I tried with the whole folder copied over
and
export LD_LIBRARY_PATH=$(pwd)/bin python3
and got:

t@tsu:~/Documents/ltheory$ python3 configure.py run
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:

which is a new error!

@dw0xaa55
Copy link

yeah, that*s the problem with which I am stuck, too. I guess from here on out we need someone, who understands lua. :D

@tatsujb
Copy link

tatsujb commented Nov 10, 2022

I made a condensed little guide of how to get here in bash/shell format :

#install dependencies (these might be named different on your linux there's a good chance if your linux is arch-based that you can simply remove all the "lib" in front of the package names and do "sudo pacman -Syu" instead of "sudo apt install" and it'll work)
sudo apt install git git-lfs build-essential cmake libfreetype-dev libluajit-5.1-dev libglew-dev libsdl2-dev libsdl2-dev liblz4-dev liblua5.1-dev -y
cd Documents/
git clone [email protected]:JoshParnell/libphx.git
git clone --recurse-submodules -j8 [email protected]:Limit-Theory-Redux/ltheory.git
mkdir -p ltheory/bin
cp libphx/ext/lib/linux64/libfmod.so libfmodstudio.so
cd ltheory/
mv bin/libfmod.so bin/libfmod.so.10
mv bin/libfmodstudio.so bin/libfmodstudio.so.10       #make fmod libs available
cp /usr/include/SDL2/* libphx/include/                #copy over all your locally installed SDL into your ltheory/libphx/include/ folder
sed -i '274d' libphx/src/Physics.cpp                  #this line crashes the linux compiler so I remove it
sed -i 's/lt64.exe/lf64r/g' configure.py              #I'm making sure the generated binary is lt64r instead of lt64.exe
export LD_LIBRARY_PATH=$(pwd)/bin python3
python3 configure.py                                  #on non-ubuntu this command will simply be "python configure.py"
python3 configure.py build                            #same it's only "python3" on ubuntu

could be useful to those who follow in our wake.

@tatsujb
Copy link

tatsujb commented Nov 10, 2022

actually should I break this into a new issue?

The title of this issue is "build fails" maybe we need an issue titled "./script/env/ext/IOEx.lua:14: attempt to index global 'lfs'"

or is it better to just keep everything grouped for now? I do have a "discussion" over on the redux : Limit-Theory-Redux/ltheory#7

@dw0xaa55
Copy link

I would open this under a new issue here and in addition over at the redux and link it, because it happens to be the exact same error in the original ltheory build. At least for me.

@tatsujb
Copy link

tatsujb commented Nov 10, 2022

@dw0xaa55 there's no "issue" tab in redux. I opened a "discussion" there because that's all I could find

@tatsujb
Copy link

tatsujb commented Nov 10, 2022

here's the new issue at least : #8

@dgavedissian
Copy link

dgavedissian commented Dec 6, 2022

We've just merged official Ubuntu support in Redux, and updated the README with instructions to get the right development libraries installed: https://github.com/Limit-Theory-Redux/ltheory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants