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

Build fails on RPi3B+, no build-linux.rb in folder zyn-fusion-build, make setup failed #87

Open
CychoRider opened this issue Sep 4, 2021 · 14 comments

Comments

@CychoRider
Copy link

CychoRider commented Sep 4, 2021

Following the build instructions on the github wiki page (https://github.com/zynaddsubfx/zyn-fusion-build/wiki/Building-on-Linux) leads to errors when building on an RPi3B+ with 32 bit Raspbian OS installed on the SD using Imager, followed by update and upgrade prior to build.

Anybody have success building ZynAddSubFX on an RPi3B+ or any other Raspberry Pi?

Floyd Steinberg (ZYNADDSUBFX on Raspberry PI Linux - open source synthesiser) has a cool youtube video showing building on an RPi400. In the description are links to the wiki where he got the build instruction list. He shows running the build instruction list without errors, but when I run those build instructions there is no build-linux.rb in the folder zyn-fusion-build.

So I tried using build-rpi3.rb instead of build-linux.rb, but that led to a make error.

Things seemed to be going OK after I made a little substitution:

pi@raspberrypi:~/zyn-fusion-build $ ruby build-linux.rb
Traceback (most recent call last):
ruby: No such file or directory -- build-linux.rb (LoadError)
pi@raspberrypi:~/zyn-fusion-build $ ls
build-rpi3.rb docker-builders Makefile.mingw64.mk README.md
Common.mk Install-deps.mk Makefile.windows.mk z
COPYING linux-system-testers mingw64
docker Makefile.linux.mk no-net-build
pi@raspberrypi:~/zyn-fusion-build $ ruby build-rpi3.rb

Then the build quickly failed:

ruby rebuild-fcache.rb
length(IR) = 208
Total time is 2278.082733 ms
make setup
make: *** No rule to make target 'setup'. Stop.
ERROR: 'make setup' failed
pi@raspberrypi:~/zyn-fusion-build

I would not mind buying a different RPi if the RPi3B+ is not supported, but I don't really want the form factor of an RPI400.

Thanks very much if you have any tips, experiences, or links to share.

@fundamental
Copy link
Member

As mentioned on IRC, the raspberry pi build scripts haven't been updated since some build system changes occurred a few months back. It shouldn't be terribly complex to adapt the build-rpi3 scripts to work again based on the changes in the common makefile and linux makefile. e.g. 'make setup' is no longer a required build step.

I currently only own a Rasberry Pi 1, so I'm not equipped to verify all changes are made correctly to those scripts, but if they're failing because they're calling 'make setup' when that has been removed, that's a logical starting point. Zyn itself should work just fine on Rasberry Pi 1..4 and the Raspberry Pi 400, The Zyn-Fusion interface should work fine with Rasberry Pi 2..4/400 (I'd expect the Rpi1 to have too little compute power). The build system does not have a compatibility issue with those devices, it just does not have a working build-rpi3.rb script. That script is community maintained and contributions are welcome to fix it.

@CychoRider
Copy link
Author

Fundamental, appreciate you picking up the conversation here. I have many years experience in various languages but I'm new to contributing with open source. I wanted to do a diff between build-rpi2.rb and build-linux.rb but my searches for build-linux.rb were not successful.

I commented out make setup and that led to a make builddep error so I commented that out also:
def get_zest()
stage "Getting Zest"
#Clone the unreleased UI submodules
cmd "git clone --depth=1 https://github.com/mruby-zest/mruby-zest-build"
chdir "mruby-zest-build"
cmd "git submodule update --init"
cmd "ruby rebuild-fcache.rb"
#cmd "mv testing-cache.rb src/mruby-widget-lib/mrblib/fcache.rb"
#make setup no longer required
#cmd "make setup"
#make builddep no longer required?
#cmd "make builddep"
chdir ".."
end

On IRC you mentioned "I wouldn't be surprise if the OpenGL -> OpenGL ES flag is needed for the raspberry pi build." Any tips on were to turn on this flag?

It got to 100% on the build but then it threw a gl related error:
[100%] Built target WatchTest
Changing directory to ..

Building Zest in release mode

Changing directory to mruby-zest-build
make clean
cd mruby && MRUBY_CONFIG=../build_config.rb rake clean
Environment is:

rm -f /home/pi/zyn-fusion-build/mruby-zest-build/mruby/build/host/mrbgems/mruby-file-stat/config.h
Cleaned up target build folder
cd mruby && rm -rf build/w64
rm -f deps/libuv.a deps/libuv-win.a
sed -i -- 's/GL2/GLES2/g' src/mruby-widget-lib/src/gem.c
sed -i -- 's/MRUBY_NANOVG_GL2/MRUBY_NANOVG_GLES2/g' build_config.rb
sed -i '/idiot/d' deps/mruby-nanovg/src/nvg_impl.h
cp ../gl_core.3.2.* deps/mruby-nanovg/src
cp: cannot stat '../gl_core.3.2.': No such file or directory
ERROR: 'cp ../gl_core.3.2.
deps/mruby-nanovg/src' failed
pi@raspberrypi:~/zyn-fusion-build $

@CychoRider
Copy link
Author

Update, searching for location to set the OpenGL -> OpenGL ES flag.
Or, how to create ./gl_core.3.2.* to satisfy the copy command
cp ../gl_core.3.2.* deps/mruby-nanovg/src

I used this to activate GL, rebooted, and rebuilt, but no change.
sudo raspi-config
Advance Options
GL Drivers
GL (Full KMS) Desktop Drivers

I did a grep -r OpenGL in zyn-fusion-build and got about 100 instances of that string but I didn't see from that how or where to set the OpenGL -> OpenGL ES flag.

Any ideas on how to to set the OpenGL -> OpenGL ES flag.
Or, how to create ./gl_core.3.2.* to satisfy the copy command
cp ../gl_core.3.2.* deps/mruby-nanovg/src?

@fundamental
Copy link
Member

Or, how to create ./gl_core.3.2.* to satisfy the copy command

It looks like the file is in the place where the code is trying to copy it, so that statement might not be needed. If the existing one doesn't work then it would have to be the old one in this repo which got removed around 2eed727

sudo raspi-config

No configuration change on the side of your raspberry pi should be needed. My statement referred to build-rpi3.rb:67,68 where GL2 was replaced with GLES2

@CychoRider
Copy link
Author

CychoRider commented Sep 7, 2021

Update, got through ruby build-rpi3.rb by skipping (commenting out) many steps, but then
tar -jxvf zyn-fusion-linux-64bit-3.0.6-dev-release.tar.bz2
failed.

I had previously done a search on github for ruby build-linux.rb but could not find it. Maybe if I could locate that file I could compare it to ruby build-rpi3.rb to see why so many commands fail.

Does the RPi400 use a different OS that is detected such that ruby build-linux.rb installs seamlessly? Something must account for the ease of building the project Floyd Steinberg shows on an RPi400, as compared to the multitude of failures trying to build on an RPi3B+..
ZYNADDSUBFX on Raspberry PI Linux - open source synthesiser
https://www.youtube.com/watch?v=iIcKMS_lxZ8

Here is the modified build script I have added to with every failure. I had to comment out so many things to get ruby build-rpi3.rb to complete that I am not surprised the subsequent command tar -jxvf zyn-fusion-linux-64bit-3.0.6-dev-release.tar.bz2 failed (below)

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential git ruby libtool libmxml-dev automake cmake libfftw3-dev libjack-jackd2-dev liblo-dev libz-dev libasound2-dev mesa-common-dev libgl1-mesa-dev libglu1-mesa-dev libcairo2-dev libfontconfig1-dev bison libuv1 libuv1-dev
git clone https://github.com/zynaddsubfx/zyn-fusion-build
cd zyn-fusion-build
#############
#for RPi3B+ comment out the following in build-rpi3.rb
#cmd   "make setup"
#cmd   "make builddep"
#cmd   "cp ../gl_core.3.2.* deps/mruby-nanovg/src"
#cmd   "make -j2" #comment out 2 places
#cmd "unzip -o ZynAddSubFX_C_Owl_Alvarez_full_bank.zip"
#cmd "sudo mv Cris\\ Owl\\ Alvarez/ /opt/zyn-fusion/banks"
#cmd "sudo cp      ./mruby-zest-build/package/libzest.so   /opt/zyn-fusion/"
#cmd "sudo cp      ./mruby-zest-build/package/zest         /opt/zyn-fusion/zyn-fusion"

#############
#for RPi3B+ comment out the following in MakefileMod to be copied to mruby-zest-build/Makefile
#cp mruby/bin/mruby                  package/
#cp libzest.so                       package/
#cp zest                             package/
#    #############
#    #remove make file and put a corrected makefile in its place to prevent overwrite of correction
#    cmd   "rm mruby-zest-build/Makefile"
#    cmd   "cp MakefileMod mruby-zest-build/Makefile" 
#    #############
#    cmd   "make pack"

#############
#build-linux.rb not present, use build-rpi3.rb instead
#ruby build-linux.rb
ruby build-rpi3.rb
tar -jxvf zyn-fusion-linux-64bit-3.0.6-dev-release.tar.bz2
cd zyn-fusion
sudo bash ./install-linux.sh
zynaddsubfx&
qjackctl&

pi@raspberrypi:~/zyn-fusion-build $ tar -jxvf zyn-fusion-linux-64bit-3.0.6-dev-release.tar.bz2
tar (child): zyn-fusion-linux-64bit-3.0.6-dev-release.tar.bz2: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
pi@raspberrypi:~/zyn-fusion-build $ 

@fundamental
Copy link
Member

Does the RPi400 use a different OS that is detected such that ruby build-linux.rb installs seamlessly?

No. As stated before the build system has changed over time. When he built it the older scripts would have worked. build-linux.rb was replaced with the makefiles and around the same time the build-rpi3.rb script was likely broken.

@fundamental
Copy link
Member

I had previously done a search on github for ruby build-linux.rb but could not find it. Maybe if I could locate that file I could compare it to ruby build-rpi3.rb to see why so many commands fail.

If you look in this repository's history you'll see the build-linux.rb file. It was removed when it was replaced with the makefiles. I strongly recommend referring to the makefiles as they're the currently tested build system. Only minor modifications of those should be required to have a fully functional raspberry pi build.

@rtizzy
Copy link

rtizzy commented Oct 23, 2021

I'm trying to get this working on a 3b myself within patchbox OS.

Will come back with details if I manage to get it going @fundamental

@fundamental
Copy link
Member

Sounds good to me. I just got a RPi 4 for an unrelated project, so I should be able to verify what is proposed. Side note - egads does the chip shortage make it tricky to buy a RPi without going through scalpers.

@rtizzy
Copy link

rtizzy commented Oct 23, 2021

@fundamental At least for me the standard make process seems to compile just fine.

Have you tried that @CychoRider ?

@CychoRider
Copy link
Author

@rtizzy I appreciate the response. I have tried the standard build process but it failed in my setup. Lots of details are posted above with the points at which it threw errors and the items I cut out of the makefile in order to get the make to complete. Eventually I got the make to complete but by then I had cut so many things out that the result did not function.

I first had a problem with this:
#build-linux.rb not present, use build-rpi3.rb instead
#ruby build-linux.rb
ruby build-rpi3.rb

Thus, the standard build process calls for build-linux.rb to be in a folder on the Pi, but it was not present there or any other place I looked, and I searched all subfolders from the root of the Pi. However, build-rpi3.rb was present so I edited that file name into the process, but that led to a series of other calls that threw errors.

I am using an Rpi3B+, Raspbian, imager, update, and upgrade to start with a freshly imaged microSD drive. I see you are using patchbox OS, so that is at least one difference in our configurations.

@rtizzy
Copy link

rtizzy commented Oct 24, 2021 via email

@CychoRider
Copy link
Author

CychoRider commented Oct 24, 2021 via email

@rtizzy
Copy link

rtizzy commented Oct 25, 2021

I see a very minor error or two (You miss a cd after the git clone for example). Some of the folder names may be different but the commands you mentioned should get you 99-100% of the way there.

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