JKU-ICG / AOS

Airborne Optical Sectioning
Other
73 stars 21 forks source link

setup_Unix.py in LFR not working #10

Open ahartlba opened 10 months ago

ahartlba commented 10 months ago

Description

The setup_Unix.py (AOS for Own Projects/LFR/python/setup_Unix.py) script is not working properly (linker-error for glfw and assimp libraries.

I was able to make it work by changing

ext_modules = [Extension(...
                          libraries=["glfw3", "assimp"], ....

to

ext_modules = [Extension(...
                          libraries=["glfw", "assimp"], ....

so this would be my proposal for a bugfix.

Environment

ubuntu22.04 base-docker image + necessary python packages

codecalypse commented 10 months ago

Thank you for confirmation, I also figured out that this works indeed for building. Very helpful. However, did you also encountered the issue with:

import pyaos as LFR ImportError: libglfw.so.3: cannot open shared object file: No such file or directory

even I can confirm that the file libglfw.so.3 is located in the /usr/lib directory? I am currently not sure why this is happening.

I will try now to build the libglfw once more. (x11 for manjaro linux)

codecalypse commented 10 months ago

Ok, I tried to install also the 32-bit versions of the library and point the linker to that files (usr/lib32). sadly he writes out, to skip them and ends up with the 64-bit versions again (usr/lib).

Here are the last few lines of the output of setup_Unix:

g++ -pthread -B /home/nidhoeggr/miniconda3/envs/cv2023/compiler_compat -Wl,--sysroot=/ -pthread -shared -B /home/nidhoeggr/miniconda3/envs/cv2023/compiler_compat -L/home/nidhoeggr/miniconda3/envs/cv2023/lib -Wl,-rpath=/home/nidhoeggr/miniconda3/envs/cv2023/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-cpython-37/../src/AOS.o build/temp.linux-x86_64-cpython-37/../src/gl_utils.o build/temp.linux-x86_64-cpython-37/../src/glad.o build/temp.linux-x86_64-cpython-37/../src/image.o build/temp.linux-x86_64-cpython-37/../src/utils.o build/temp.linux-x86_64-cpython-37/pyaos.o -L/usr/lib32 -lglfw -lassimp -o "/home/nidhoeggr/JKU/UE_CV/AOS/AOS for Drone Swarms/LFR/python/pyaos.cpython-37m-x86_64-linux-gnu.so" /usr/bin/ld: skipping incompatible /usr/lib32/libglfw.so when searching for -lglfw /usr/bin/ld: skipping incompatible /usr/lib32/libassimp.so when searching for -lassimp /usr/bin/ld: skipping incompatible /usr/lib32/libm.so when searching for -lm /usr/bin/ld: skipping incompatible /usr/lib32/libm.a when searching for -lm /usr/bin/ld: skipping incompatible /usr/lib32/libc.so when searching for -lc /usr/bin/ld: skipping incompatible /usr/lib32/libc.a when searching for -lc

with the directory pointing directly to /usr/lib, g++ command is the only thing I get in the end of the script. Nothing changes, the ImportError remains. Any suggestion is highly appreciated.

codecalypse commented 10 months ago

Update: I did copy the .so-files into the LFR/lib folder. added runtime_library_dirs=["../lib"] in the setup_unix file installd dependancy of assimp:

conda install -c conda-forge gcc=12.1.0

not it works. Maybe i was wrong adding the libs on the host /usr/lib directory. But now it works. Maybe this can proof useful to someone else.