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

building for native M1 #9

Open
davephillips opened this issue Dec 30, 2022 · 4 comments
Open

building for native M1 #9

davephillips opened this issue Dec 30, 2022 · 4 comments

Comments

@davephillips
Copy link

Greetings ! I'm attempting a build of dbRackCsound for my ARM-based Mac Mini M1. I've compiled the appropriate static lib for Csound but I'm having a rough time building a working libsndfile.a (it's a persistent error regarding unresolved FLAC symbols even though the library is compiled with FLAC support). Before proceeding I thought I'd check to see if you're already working on an ARM version and/or if you have any advice regarding the libsndfile/FLAC issue.

Thanks again for the great plugins, all the db stuff is 1st-class music software.

Best regards,

dp

@docb
Copy link
Owner

docb commented Dec 30, 2022

hi,
as far as i recall i have compiled libsndfile for mac with all external stuff disabled (FLAC, OGG, Opus) as i assumed that those are not needed for the plugin. May be this works on your side too.
I did not making anything for ARM as i don't have an M1.

The VCV plugins are normally built on linux with a cross compiler rack-plugin-toochain. At the end the goal should be that the whole plugin should be built inside this tool chain processes. That means that csound and libsoundfile should be compiled using the osx cross compiler.(also for ARM).

So the current build is a kind of a hack, as i take my old max book pro to compile it. But i think i will not have the time to realize this soonish. So it would be great if you could provide the ARM build of csound and libsoundfile, then i could check in libs and make an ARM build for the plugin using the cross compiler.
best regards,
christian

@davephillips
Copy link
Author

@docb Thanks for the information, I'll keep hacking here. I think I've got past the static libs themselves, now the plugin fails to load with this error:

[1.301 info src/plugin.cpp:137 loadPlugin] Loading plugin from /Users/davephillips/src/Rack-2.2-native/plugins/dbRackCsound
[1.389 warn src/plugin.cpp:203 loadPlugin] Could not load plugin /Users/davephillips/src/Rack-2.2-native/plugins/dbRackCsound: Failed to load library /Users/davephillips/src/Rack-2.2-native/plugins/dbRackCsound/plugin-arm64.dylib: dlopen(/Users/davephillips/src/Rack-2.2-native/plugins/dbRackCsound/plugin-arm64.dylib, 0x0006): symbol not found in flat namespace '_init_static_modules'

Looking further:

% nm plugin-arm64.dylib |grep static
                 U _init_static_modules
00000000003d77d0 s _staticmodules

Compare to the x86_64 build:

% nm plugin.dylib |grep static
0000000000327c10 t _init_static_modules
00000000004a8290 s _staticmodules

Is something not linking ? Any suggestions where I should be looking and/or what I should be looking for ?

@docb
Copy link
Owner

docb commented Dec 31, 2022

i guess this is because you have to compile csound differently -- in CMakeLists.txt of csound:

+option(BUILD_STATIC_LIBRARY "Also build a static version of the csound library" ON)
+option(INIT_STATIC_MODULES "Also build opcodes in a static version of the csound library" ON)

and you should take the csound source on the master branch after Nov 2 e.g. the current one (it should include this commit):
csound/csound@33f4d91
see also here: csound/csound#1648

@davephillips
Copy link
Author

davephillips commented Dec 31, 2022

Thank you ! I now have a working arm64 version of the dbRackCsound plugin, though I am only at the initial testing stage.

I added the changes you advised for CMakeLists but the plugin then failed to load because of a missing symbol (_libntl_gettext). I turned off the option for gettext in the Csound build, recompiled, and the plugin loads successfully now. Question: Is gettext needed anywhere by the dbRackCsound plugin ?

My only test so far has been to run the default vco2 instrument. I've edited it for dual VCOs, it works as expected. Next tests will work with the processing module. I'm starting with mono instruments and effects.

Edit: I made a simple processor with two instances of nreverb. It works fine. :)

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

2 participants