digego / extempore

A cyber-physical programming environment
1.41k stars 127 forks source link

Build error: Error copying libsndfile.so #367

Closed dgrisham closed 5 years ago

dgrisham commented 5 years ago

I recently posted a build issue that seems to have been resolved by https://github.com/digego/extempore/pull/366. I'm getting another build error now, still involving sndfile. I'm using gcc to build this time (as per the extempore-git package on the AUR), here's the gcc and system info:

$ uname -a
Linux archlinux 5.3.7-arch1-1-ARCH #1 SMP PREEMPT Fri Oct 18 00:17:03 UTC 2019 x86_64 GNU/Linux

$ gcc --version
gcc (GCC) 9.2.0
Copyright (C) 2019 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.

Based on the error below, I tried searching for libsndfile.so (I'm not 100% certain if that makes sense to do) in the top level directory of the build with find . -name 'libsndfile.so' and it didn't find anything.

[ 68% ] Performing install step for 'sndfile'
[ 95% ] Built target sndfile
[100%] Built target sndfile-regtest
Install the project...
-- Install configuration: "Release"
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/lib/libsndfile.a
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/include/sndfile.hh
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/include/sndfile.h
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/share/man/man1/sndfile-info.1
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/share/man/man1/sndfile-play.1
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/share/man/man1/sndfile-convert.1
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/share/man/man1/sndfile-cmp.1
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/share/man/man1/sndfile-metadata-get.1
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/share/man/man1/sndfile-concat.1
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/share/man/man1/sndfile-interleave.1
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/share/man/man1/sndfile-salvage.1
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/share/doc/libsndfile/index.html
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/share/doc/libsndfile/libsndfile.jpg
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/share/doc/libsndfile/libsndfile.css
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/share/doc/libsndfile/print.css
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/share/doc/libsndfile/api.html
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/share/doc/libsndfile/command.html
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/share/doc/libsndfile/bugs.html
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/share/doc/libsndfile/sndfile_info.html
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/share/doc/libsndfile/new_file_type.HOWTO
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/share/doc/libsndfile/win32.html
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/share/doc/libsndfile/FAQ.html
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/share/doc/libsndfile/lists.html
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/share/doc/libsndfile/embedded_files.html
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/share/doc/libsndfile/octave.html
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/share/doc/libsndfile/tutorial.html
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/lib/pkgconfig/sndfile.pc
[ 69% ] Completed 'sndfile'
[ 69% ] Built target sndfile
Scanning dependencies of target external_shlibs_audio
[ 70% ] moving shared libs into /home/grish/src/pkgbuild/extempore-git/src/extempore/libs/platform-shlibs
Error copying file "libsndfile.so" to "/home/grish/src/pkgbuild/extempore-git/src/extempore/libs/platform-shlibs".
make[2]: *** [CMakeFiles/external_shlibs_audio.dir/build.make:62: CMakeFiles/external_shlibs_audio] Error 1
make[1]: *** [CMakeFiles/Makefile2:1219: CMakeFiles/external_shlibs_audio.dir/all] Error 2
make: *** [Makefile:163: all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...[ 68%] Performing install step for 'sndfile'
[ 95%] Built target sndfile
[100%] Built target sndfile-regtest
Install the project...
-- Install configuration: "Release"
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/lib/libsndfile.a
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/include/sndfile.hh
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/include/sndfile.h
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/share/man/man1/sndfile-info.1
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/share/man/man1/sndfile-play.1
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/share/man/man1/sndfile-convert.1
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/share/man/man1/sndfile-cmp.1
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/share/man/man1/sndfile-metadata-get.1
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/share/man/man1/sndfile-concat.1
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/share/man/man1/sndfile-interleave.1
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/share/man/man1/sndfile-salvage.1
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/share/doc/libsndfile/index.html
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/share/doc/libsndfile/libsndfile.jpg
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/share/doc/libsndfile/libsndfile.css
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/share/doc/libsndfile/print.css
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/share/doc/libsndfile/api.html
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/share/doc/libsndfile/command.html
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/share/doc/libsndfile/bugs.html
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/share/doc/libsndfile/sndfile_info.html
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/share/doc/libsndfile/new_file_type.HOWTO
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/share/doc/libsndfile/win32.html
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/share/doc/libsndfile/FAQ.html
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/share/doc/libsndfile/lists.html
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/share/doc/libsndfile/embedded_files.html
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/share/doc/libsndfile/octave.html
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/share/doc/libsndfile/tutorial.html
-- Installing: /home/grish/src/pkgbuild/extempore-git/src/build/deps-install/lib/pkgconfig/sndfile.pc
[ 69%] Completed 'sndfile'
[ 69%] Built target sndfile
Scanning dependencies of target external_shlibs_audio
[ 70%] moving shared libs into /home/grish/src/pkgbuild/extempore-git/src/extempore/libs/platform-shlibs
Error copying file "libsndfile.so" to "/home/grish/src/pkgbuild/extempore-git/src/extempore/libs/platform-shlibs".
make[2]: *** [CMakeFiles/external_shlibs_audio.dir/build.make:62: CMakeFiles/external_shlibs_audio] Error 1
make[1]: *** [CMakeFiles/Makefile2:1219: CMakeFiles/external_shlibs_audio.dir/all] Error 2
make: *** [Makefile:163: all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...
benswift commented 5 years ago

Hey Dave

Sorry about the issues - I don't have access to an Arch machine so the debugging will be a bit of a back-and-forward I suspect.

Yep, Extempore builds its own libsndfile (because reasons) and copies it into place "manually" (you can see the relevant command in CMakeLists.txt:715).

Can you tell me if there's anything sndfile-looking in <build-dir>/deps-install/lib? Or, failing that, there should be a <build-dir>/libsndfile/src/sndfile-build directory---are there any *.so files in there?

dgrisham commented 5 years ago

No worries, I appreciate the help!

I do see libsndfile.a in both directories, but no .so files for libsndfile.

deps-install/lib:

$ ll
total 11M
drwxr-xr-x 3 grish grish 4.0K Oct 19 08:00 cmake
drwxr-xr-x 2 grish grish 4.0K Oct 19 08:00 pkgconfig
lrwxrwxrwx 1 grish grish   14 Oct 19 08:00 libassimp.so -> libassimp.so.3
lrwxrwxrwx 1 grish grish   18 Oct 19 08:00 libassimp.so.3 -> libassimp.so.3.2.0
-rwxr-xr-x 1 grish grish 8.6M Oct 19 08:00 libassimp.so.3.2.0
-rwxr-xr-x 1 grish grish  37K Oct 19 08:00 libkiss_fft.so
-rwxr-xr-x 1 grish grish 304K Oct 19 07:55 libnanovg.so
-rwxr-xr-x 1 grish grish  48K Oct 19 07:20 libportmidi.so
lrwxrwxrwx 1 grish grish   14 Oct 19 07:19 librtmidi.so -> librtmidi.so.5
lrwxrwxrwx 1 grish grish   18 Oct 19 07:19 librtmidi.so.5 -> librtmidi.so.5.0.0
-rwxr-xr-x 1 grish grish 136K Oct 19 07:19 librtmidi.so.5.0.0
-rw-r--r-- 1 grish grish 1.1M Oct 19 08:00 libsndfile.a

libsndfile/src/sndfile-build:

$ ll
total 1.9M
drwxr-xr-x 7 grish grish 4.0K Oct 19 08:00 CMakeFiles
drwxr-xr-x 2 grish grish 4.0K Oct 19 08:00 doc
drwxr-xr-x 2 grish grish 4.0K Oct 19 08:00 src
-rw-r--r-- 1 grish grish  35K Oct 19 08:00 CMakeCache.txt
-rw-r--r-- 1 grish grish 4.9K Oct 19 08:00 cmake_install.cmake
-rw-r--r-- 1 grish grish 2.3K Oct 19 08:00 install_manifest.txt
-rw-r--r-- 1 grish grish 1.1M Oct 19 08:00 libsndfile.a
-rw-r--r-- 1 grish grish  76K Oct 19 08:00 Makefile
-rw-r--r-- 1 grish grish  303 Oct 19 08:00 sndfile.pc
-rwxr-xr-x 1 grish grish 682K Oct 19 08:00 sndfile-regtest
benswift commented 5 years ago

That's weird - it should build the .so, I'm not sure why it's only building the static library (.a) version.

All the CMake build process is doing is trying to clone & build this project using CMake, with the following definitions:

    -DBUILD_PROGRAMS=OFF
    -DBUILD_EXAMPLES=OFF
    -DBUILD_TESTING=OFF
    -DENABLE_CPACK=OFF
    -DENABLE_PACKAGE_CONFIG=OFF

as per Extempore's CMakeLists.txt.

Perhaps can you try building the sndfile project separately (using CMake) and see if it builds a shared lib .so file? If not, is there any magic combination of the build-time defines that will make it work?

CastixGitHub commented 5 years ago

I installed extempore with the same AUR package, but after receiving that error I think I copied libsndfile.so from my installation, wich is wrong (because reasons, and you should use the extempore's patched/compiled version). then i commented line 62 of src/build/CMakeFiles/external_shlibs_audio.dir/build.make or I copied it directly in src/build/deps-install/lib/ without commenting, I don't remember.

I think I upgraded the system after because now I have a new version installed

$ extempore-git  file /usr/lib/libsndfile.so
/usr/lib/libsndfile.so: symbolic link to libsndfile.so.1.0.28
$ extempore-git  ls -al src/build/deps-install/lib/
total 11300
drwxr-xr-x 4 castix wheel    4096 Oct 18 21:02 .
drwxr-xr-x 6 castix wheel    4096 May 31 09:31 ..
drwxr-xr-x 4 castix wheel    4096 May 31 09:41 cmake
lrwxrwxrwx 1 castix wheel      14 May 31 09:41 libassimp.so -> libassimp.so.3
lrwxrwxrwx 1 castix wheel      18 May 31 09:41 libassimp.so.3 -> libassimp.so.3.2.0
-rwxr-xr-x 1 castix wheel 8920792 Oct 18 21:01 libassimp.so.3.2.0
lrwxrwxrwx 1 castix wheel      12 May 31 09:37 libglfw.so -> libglfw.so.3
lrwxrwxrwx 1 castix wheel      14 May 31 09:37 libglfw.so.3 -> libglfw.so.3.2
-rwxr-xr-x 1 castix wheel  149416 Oct 18 21:02 libglfw.so.3.2
-rwxr-xr-x 1 castix wheel   37544 Oct 18 21:01 libkiss_fft.so
-rwxr-xr-x 1 castix wheel  308664 Oct 18 20:58 libnanovg.so
-rwxr-xr-x 1 castix wheel   47928 Oct 18 20:26 libportmidi.so
lrwxrwxrwx 1 castix wheel      14 Oct 18 20:26 librtmidi.so -> librtmidi.so.5
lrwxrwxrwx 1 castix wheel      18 Oct 18 20:26 librtmidi.so.5 -> librtmidi.so.5.0.0
-rwxr-xr-x 1 castix wheel  136584 Oct 18 20:26 librtmidi.so.5.0.0
-rw-r--r-- 1 castix wheel 1088730 Oct 18 21:02 libsndfile.a
-rwxr-xr-x 1 castix wheel    1009 May 31 09:31 libsndfile.la
lrwxrwxrwx 1 castix wheel      20 May 31 09:31 libsndfile.so -> libsndfile.so.1.0.26
lrwxrwxrwx 1 castix wheel      20 May 31 09:31 libsndfile.so.1 -> libsndfile.so.1.0.26
-rwxr-xr-x 1 castix wheel  644216 May 31 09:31 libsndfile.so.1.0.26
-rwxr-xr-x 1 castix wheel  200432 Oct 18 21:02 libstb_image.so
drwxr-xr-x 2 castix wheel    4096 Oct 18 21:02 pkgconfig

I did't try to write the result audio, but reading them works. Anyway this isn't a fix.

dgrisham commented 5 years ago

See the libsndfile issue I reference above -- seems like adding -DBUILD_SHARED_LIBS=ON fixes the issue, but that should be on by default for libsndfile .

However, I may be getting a segfault later in the build now. Reset extempore to a fresh state and am trying the build again, will post back after (or possibly start another issue for that).

dgrisham commented 5 years ago

Looks like -DBUILD_SHARED_LIBS=ON should be explicitly specified now -- https://github.com/erikd/libsndfile/commit/97a361afc24202b16489d8c06910277c06b18b53.

benswift commented 5 years ago

should be fixed in 0bffd5ae7dcca686216c48f7913ca4095186d0f0