momentarylapse / tsunami

A simple but powerful audio editor
GNU General Public License v3.0
76 stars 4 forks source link

Build failure on aarch64 #9

Closed ycollet closed 1 month ago

ycollet commented 1 year ago

The build on F37 / 36 went fine for x86_64 but fail for aarch64 on F37:

[ 25%] Building CXX object CMakeFiles/tsunami.dir/src/lib/base/pointer.cpp.o
/usr/bin/g++ -DHAS_LIB_ALSA=1 -DHAS_LIB_DL=1 -DHAS_LIB_FFTW3=1 -DHAS_LIB_FLAC=1 -DHAS_LIB_GL=1 -DHAS_LIB_GTK4=1 -DHAS_LIB_OGG=1 -DHAS_LIB_PORTAUDIO=1 -DHAS_LIB_PULSEAUDIO=1 -DHAS_LIB_UNWIND=1 -DHAS_LIB_ZLIB=1 -DINSTALL_PREFIX=\"/usr\" -D_REENTRANT -I/usr/include/gtk-4.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-4 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/libxml2 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/graphene-1.0 -I/usr/lib64/graphene-1.0/include -I/usr/include/gio-unix-2.0 -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -mbranch-protection=standard -fasynchronous-unwind-tables -fstack-clash-protection -g   -pthread -pthread -std=gnu++17 -MD -MT CMakeFiles/tsunami.dir/src/lib/base/pointer.cpp.o -MF CMakeFiles/tsunami.dir/src/lib/base/pointer.cpp.o.d -o CMakeFiles/tsunami.dir/src/lib/base/pointer.cpp.o -c /builddir/build/BUILD/tsunami-57999be98a2bc707bb8db83914f20215afee185e/src/lib/base/pointer.cpp
/builddir/build/BUILD/tsunami-57999be98a2bc707bb8db83914f20215afee185e/src/lib/base/array.cpp: In member function 'int DynamicArray::simple_index(const void*) const':
/builddir/build/BUILD/tsunami-57999be98a2bc707bb8db83914f20215afee185e/src/lib/base/array.cpp:232:17: error: cast from 'const void*' to 'int_p' {aka 'int'} loses precision [-fpermissive]
  232 |         return ((int_p)p - (int_p)data) / element_size;
      |                 ^~~~~~~~
/builddir/build/BUILD/tsunami-57999be98a2bc707bb8db83914f20215afee185e/src/lib/base/array.cpp:232:28: error: cast from 'void*' to 'int_p' {aka 'int'} loses precision [-fpermissive]
  232 |         return ((int_p)p - (int_p)data) / element_size;
      |                            ^~~~~~~~~~~
momentarylapse commented 1 year ago

I'm afraid, aarch64 is not supported, right now. Sorry :(

The problem shown in your log might be easily fixable. I'll try in a couple of days. And very basic GUI and editing/playback functionality should work, then.

But any audio effects or synthesizers and other cooler features depend critically on my integrated JIT compiler for plugins. Currently, this can only produce x86_64/32 machine code. Some years ago, I started adding a compiler backend for ARM processors (32 bit). It's not complete and I never worked on aarch64.

Since I always wanted raspberry pi support, I might look into it again. But no promises, right now.

ycollet commented 1 year ago

Ah, OK, thanks for this news. I will disable the aarch64 build then :)

momentarylapse commented 1 month ago

It actually happened. Tsunami now has proper support for aarch64. The basic c++ program builds AND also the plugin JIT compiler now has an aarch64 backend.

Successfully tested on an M1 MacBook, and Raspberry Pi 3 (64bit) - although I would not call it usable on the Raspberry Pi.