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

failing build on rtmidi #417

Closed
dromer opened this issue Nov 10, 2020 · 10 comments
Closed

failing build on rtmidi #417

dromer opened this issue Nov 10, 2020 · 10 comments

Comments

@dromer
Copy link

dromer commented Nov 10, 2020

Environment

  • OS: Linux Debian Buster
  • Giada version: latest master

Describe the bug
In the configure I see:

checking rtmidi/RtMidi.h usability... yes
checking rtmidi/RtMidi.h presence... yes
checking for rtmidi/RtMidi.h... yes

However the compile fails with:

src/core/kernelMidi.cpp:28:10: fatal error: RtMidi.h: No such file or directory
 #include <RtMidi.h>
          ^~~~~~~~~~
compilation terminated.

To Reproduce
Steps to reproduce the behavior:

  • Install all dependencies
  • git clone
  • git submodule init
  • git submodule update
  • ./autogen.sh
  • ./configure --target=linux
  • make

Expected behavior
Build giada.

@tomek-szczesny
Copy link
Collaborator

Hi!
Yes, this is to be expected, as "master" branch HEAD is not stable, tags are. The reason it fails to compile is that the build environment has been changed in the meantime.
Follow the tips from this forum post to resolve your issues.

Let us know if you need more help!

@dromer
Copy link
Author

dromer commented Nov 10, 2020

Check. Was already considering to checkout a release tag instead ;)

I'm maybe also too used to git-flow, where master always tracks the latest release.

@dromer
Copy link
Author

dromer commented Nov 10, 2020

Ok, can confirm that with
git clone --depth 1 --branch v0.16.4 git://github.com/monocasual/giada.git
, and then the same steps as mentioned before, giada builds and runs.

@dromer dromer closed this as completed Nov 10, 2020
@dvzrv
Copy link
Contributor

dvzrv commented Nov 20, 2020

This problem is still present on 0.17.0 and breaks the build for packaging on Arch Linux:

g++ -DPACKAGE_NAME=\"giada\" -DPACKAGE_TARNAME=\"giada\" -DPACKAGE_VERSION=\"0.16\" -DPACKAGE_STRING=\"giada\ 0.16\" -DPACKAGE_BUGREPORT=\"giadaloopmachine@gmail.com\" -DPACKAGE_URL=\"\" -DPACKAGE=\"giada\" -DVERSION=\"0.16\" -DWITH_SYSTEM_CATCH=1 -DNDEBUG=1 -DHAVE_LIBPTHREAD=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -D
HAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -I.  -I./src    -D__LINUX_ALSA__ -D__LINUX_PULSE__ -D__UNIX_JACK__   -D_FORTIFY_SOURCE=2 -std=c++17 -Wall  -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -MT src/core/giad
a-waveManager.o -MD -MP -MF src/core/.deps/giada-waveManager.Tpo -c -o src/core/giada-waveManager.o `test -f 'src/core/waveManager.cpp' || echo './'`src/core/waveManager.cpp
mv -f src/core/plugins/.deps/giada-pluginHost.Tpo src/core/plugins/.deps/giada-pluginHost.Po
mv -f src/core/plugins/.deps/giada-plugin.Tpo src/core/plugins/.deps/giada-plugin.Po
src/core/kernelMidi.cpp:28:10: fatal error: RtMidi.h: No such file or directory
   28 | #include <RtMidi.h>
      |          ^~~~~~~~~~
compilation terminated.
mv -f src/core/plugins/.deps/giada-pluginManager.Tpo src/core/plugins/.deps/giada-pluginManager.Po
mv -f src/core/plugins/.deps/giada-pluginState.Tpo src/core/plugins/.deps/giada-pluginState.Po
make: *** [Makefile:3956: src/core/giada-kernelMidi.o] Error 1

I have to manually add rtmidi's cflags to CPPFLAGS:

CPPFLAGS+="$(pkgconf --cflags rtmidi)"

Please reopen!

@dvzrv
Copy link
Contributor

dvzrv commented Nov 20, 2020

A more clean solution to this problem is:

diff -ruN a/Makefile.am b/Makefile.am
--- a/Makefile.am	2020-11-15 21:26:40.000000000 +0100
+++ b/Makefile.am	2020-11-20 18:53:06.031868664 +0100
@@ -402,7 +402,7 @@
 if LINUX
 
 # Add preprocessor flags to enable ALSA, Pulse and JACK in RtAudio.
-cppFlags += -D__LINUX_ALSA__ -D__LINUX_PULSE__ -D__UNIX_JACK__
+cppFlags += -D__LINUX_ALSA__ -D__LINUX_PULSE__ -D__UNIX_JACK__ $(RTMIDI_CFLAGS)
 
 ldAdd += -lsndfile -lfltk -lXext -lX11 -lXft -lXpm -lm -ljack -lasound \
 	-lpthread -ldl -lpulse-simple -lpulse -lsamplerate -lrtmidi \
diff -ruN a/configure.ac b/configure.ac
--- a/configure.ac	2020-11-15 21:26:40.000000000 +0100
+++ b/configure.ac	2020-11-20 18:52:11.715602516 +0100
@@ -138,6 +138,7 @@
 		[],
 		[AC_MSG_ERROR([library 'rtMidi' not found!])]
 	)
+	PKG_CHECK_MODULES([RTMIDI], [rtmidi])
 	AC_LANG_POP
 fi

@dromer
Copy link
Author

dromer commented Feb 11, 2021

On 0.17.1 this problem is also back for me.

The solution that @dvzrv proposes results in:

/usr/include/c++/8/bits/fs_path.h:184: undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
collect2: error: ld returned 1 exit status
make: *** [Makefile:2860: giada] Error 1

@tomek-szczesny
Copy link
Collaborator

This looks like an unrelated problem. I googled this error message and it seems that upgrading gcc to version 9 might help. Check this out: CLIUtils/CLI11#445

@dromer
Copy link
Author

dromer commented Feb 12, 2021

Hmm, I'm not exactly in a position where I feel comfortable to change the gcc version on my system at the moment :#

@dvzrv
Copy link
Contributor

dvzrv commented Apr 24, 2021

With the cmake setup in 0.17.2 rtmidi is picked up properly.

@dromer
Copy link
Author

dromer commented Apr 24, 2021

The build succeeds, however now I run in to: #457

I should try what plain alsa config does on top of pipewire.

I guess this ticket can be closed (again), we get to an executable now :)

@dromer dromer closed this as completed Apr 24, 2021
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

3 participants