acids-ircam / nn_tilde

Other
321 stars 36 forks source link

Add nn~ build script for Linux #51

Closed devstermarts closed 1 year ago

devstermarts commented 1 year ago

raspberrypi.sh runs into errors with Torch (e.g. searching for Torch cmake configuration files). This script uses libtorch in a temp folder to build nn~ for Linux.

maurice-jo commented 3 months ago

Hi there,

I've been following the instructions for the linux build as the raspberrypi.sh was giving me errors. It seems like I'm close but now I'm getting the following error.

-- Build files have been written to: /home/sonicagent1/nn_tilde/build [ 20%] Building CXX object backend/CMakeFiles/backend.dir/parsing_utils.cpp.o [ 40%] Building CXX object backend/CMakeFiles/backend.dir/backend.cpp.o [ 60%] Linking CXX static library libbackend.a [ 60%] Built target backend [ 80%] Building CXX object frontend/puredata/nn_tilde/CMakeFiles/nn.dir/nn_tilde.cpp.o [100%] Linking CXX shared library "nn~.pd_linux" /usr/bin/ld: /home/sonicagent1/nn_tilde/lib/libtorch/lib/libtorch.so: error adding symbols: file in wrong format collect2: error: ld returned 1 exit status make[2]: [frontend/puredata/nn_tilde/CMakeFiles/nn.dir/build.make:102: frontend/puredata/nn_tilde/nn~.pd_linux] Error 1 make[1]: [CMakeFiles/Makefile2:142: frontend/puredata/nn_tilde/CMakeFiles/nn.dir/all] Error 2 make: *** [Makefile:91: all] Error 2 cp: cannot stat 'frontend/puredata/nn_tilde/nn~.pd_linux': No such file or directory

Any advice on how to fix this as it seems connected to the libtorch.so?

I'm running a Pi 5 with bookworm.

hongyue-howard-wang commented 3 months ago

/home/sonicagent1/nn_tilde/lib/libtorch/lib/libtorch.so: error adding symbols: file in wrong f

Hi, I also met this issue this morning, do you know how to slove it?

jbabr@vibeplate:~/nn_tilde/build $ make [ 60%] Built target backend [ 80%] Linking CXX shared library "nn~.pd_linux" /home/jbabr/nn_tilde/lib/libtorch/lib/libtorch.so: file not recognized: file format not recognized collect2: error: ld returned 1 exit status make[2]: *** [frontend/puredata/nn_tilde/CMakeFiles/nn.dir/build.make:108: frontend/puredata/nn_tilde/nn~.pd_linux] Error 1 make[1]: *** [CMakeFiles/Makefile2:161: frontend/puredata/nn_tilde/CMakeFiles/nn.dir/all] Error 2 make: *** [Makefile:103: all] Error 2 I am running a Pi 4.

caillonantoine commented 3 months ago

The install script uses a hardcoded path to the lib, can you make sure there is a file there ?

maurice-jo commented 3 months ago

There's not and for some reason I can't install Python3.9 + torch site-packages there....

maurice-jo commented 3 months ago

So digging further. It seems to be an issue with Raspberry Pi 5 and 64-bit Bookworm OS. Bookworm comes with Python 3.11 and it does not let me downgrade to Python 3.9 systemwide, which is why the script cannot access the path (/.local/lib/python3.9/site-packages/torch/) as it does not exist.

I've been trying to compile it using a venv but failed thus far. Is there a possibility to upgrade the nn~ compiler to python3.9?


On another note, I bought a Pi4 and ran it with legacy raspbian bullseye. I was able to compile the file but whenever I create the object in PureData the program crashes....