Compilation fails with undeclared identifier 'yyrhs'

You're new to the LinuxSampler world? You don't know where to start and nothing works? Here's the place to ask for help.
Post Reply
delvento
Newbie
Posts: 9
Joined: Sat Nov 20, 2021 2:48 am

Compilation fails with undeclared identifier 'yyrhs'

Post by delvento » Sat Nov 20, 2021 5:16 am

I'm trying to compile linuxsampler v2.2.0 (and dependencies) in Ubuntu 18.04.6 LTS following the instructions in http://linuxsampler.org/downloads.html (note *)

I've checked that my distro did not have apt installed any of those packages, but did have the ones that were obviously needed, such as intltool, libgtk2.0-dev, gtkmm-2.4 and many, many others.

I've successfully compiled and installed libgig v4.3.0 with gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04). Now I am trying to install linuxsampler.

The configure gives a WARNING about the non-trivial designated initializers not supported, specifying that "You will be able to compile LinuxSampler, but you will not  be able to compile the test cases", but the compilation fails with non-trivial designated initializers not supported nevertheless. Probably that configure warning should be changed into an ERROR? But that's secondary.

Switching to clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final) fails with:

lscp.y:1386:18: error: use of undeclared identifier 'yyprhs'
    for (int i = yyprhs[rule]; yyrhs[i] != -1; ++i)
                 ^
lscp.y:1386:32: error: use of undeclared identifier 'yyrhs'
    for (int i = yyprhs[rule]; yyrhs[i] != -1; ++i)
                               ^
lscp.y:1387:13: error: use of undeclared identifier 'yyrhs'
        if (yyrhs[i] >= YYNTOKENS) return false;
            ^

Just in case that's an issue related to compiling code with clang against a library compiled with with gcc (rare, but...) I uninstall libgig, recompile it with clang and reinstall it. I guess I should do the same with all the dependencies, but those are too many to enter that rabbit hole. Anyway, after recompiling the libgig the error persists.
According to viewtopic.php?t=3355 the problem should be solved by installing liblscp first (despite from the dependency graph that does not seem to be the case). But I do it anyway, and the problem is still there. Since that thread explicitly mention liblscp-0.5.8.tar.bz2 I download that version and use ag to look for the yyrhs identifier in case that has been moved or renamed in subsequent releases, and the old version is laying around in build machines hiding this issue -- but nope, that's not there, so I am not even sure how it could have been fixed in the first place. I notice there is a liblscp-0.9.4.tar.gz in http://download.linuxsampler.org/packages/ so I try that (after uninstalling v0.9.3). Its README suggests to use cmake (rather than autoconf like for earlier versions), but since the autoconf infrastructure is still there, I use that since I've always had problems with cmake. No change. And here is where I'm stuck. I guess I can win my resistance to cmake and try that too, but I at this point I seriously doubt it'd make any difference.

Any suggestions on what I may be doing wrong will be greatly appreciated.

Thanks

* note: By the way, in addition to the dependency graph, an ordered list of what to compile first will make it much easier for people to understand what to do, for example from the plot it is not clear that LS needs to be installed before gigedit for the latter to work correctly... that is only said in an obscure message in the configure output which users may overlook

delvento
Newbie
Posts: 9
Joined: Sat Nov 20, 2021 2:48 am

Re: Compilation fails with undeclared identifier 'yyrhs'

Post by delvento » Sun Nov 21, 2021 6:35 pm

Just for completeness, here is the list of packages I manually installed, in case it could be relevant to know this detail for debugging the issue:

clang g++ intltool libasound2-dev libaudiofile-dev libgtk2.0-dev libgtkmm-2.4-dev libjack-jackd2-dev libsndfile1-dev libsqlite3-dev lv2-dev uuid-dev

of course that depends on what else I had installed before.

delvento
Newbie
Posts: 9
Joined: Sat Nov 20, 2021 2:48 am

Re: Compilation fails with undeclared identifier 'yyrhs'

Post by delvento » Sun Nov 21, 2021 8:09 pm

Ok, so I'm glad that I did that digging about the installed packages. That led me to figure out that the reason for failure was the lack of the bison package!

Installing bison with

sudo apt install bison

Solved the issue. Another clue was also that searching for that identifier in the whole project, it was not defined anywhere so it MUST have been from an external dependencies, and some sleuthing brought me to bison.

To me, that's a bug,in LinuxSampler because all the needed package should be checked (and fail if missing) during configure, not at compile time. I wanted to submit a bug, but bugzilla is not letting me in :? so if anybody could submit that in my stead I'll appreciate it. I think in the other conversation the issue got "accidentally" fixed by a bison install and so it appeared to be a switch of version problem instead. I'll reply there too in case others land there with Google.

User avatar
cuse
Developer
Posts: 366
Joined: Wed Jan 23, 2008 10:07 pm
Location: Germany

Re: Compilation fails with undeclared identifier 'yyrhs'

Post by cuse » Mon Nov 22, 2021 9:21 pm

The LS release tarballs always come with pregenerated parser .cpp/.h files, so Flex and Bison are usually only required for the developer version of LS from Subversion. However there was indeed a preprocessor statement bug in src/network/lscp.y which falsely caused some compatibility code for ancient Bison 2.x to be enabled if Bison was not installed, which actually caused the compiler error you got. That's fixed now in SVN, so it should work again with the next LS release tarball.

For bug reports: as the bug report front page sais, either contact Christian or Andreas by email for an account. We had to switch to manual registration due to daily spam bot attacks.

Post Reply