guitarix
guitarix copied to clipboard
Unknown ld options on Mac OS X
I have gotten further in my journey to compile Guitarix on OS X, taking detailed notes along the way of course.
One hurdle is that the version of ld
on OS X does not support some of the options that exist throughout the codebase in various Makefiles, wscript files, tools/ampsim/DK/dk_templates.py
and waftools/lv2.py
. These are:
-
-b binary
-
-z relro
-
-z noexecstack
-
--exclude-libs ALL
I have tried removing these options, and I end up with different ld
errors, like:
[1121/1606] Linking build/src/LV2/gx_amp.lv2/gx_amp_gui.so
21:47:47 runner ['g++', '-L/opt/X11/lib', '-lX11', '-lpthread', '-Qunused-arguments', '-L/opt/X11/lib', '-lX11', '-lpthread', '-fvisibility=hidden', '-dynamiclib', 'src/LV2/gx_amp.lv2/gxamp_ui.cpp.3.o', '-o/private/tmp/guitarix/trunk/build/src/LV2/gx_amp.lv2/gx_amp_gui.so', '-Lsrc/LV2/xputty', '-lxcairo', '-L/usr/local/Cellar/cairo/1.16.0_3/lib', '-lX11', '-lcairo', '-L/opt/X11/lib', '-lX11', '-lpthread', '-Qunused-arguments', '-L/opt/X11/lib', '-lX11', '-lpthread']
Undefined symbols for architecture x86_64:
"__section$__DATA__guitarix_orange_png", referenced from:
instantiate(LV2UI_Descriptor const*, char const*, char const*, void (*)(void*, unsigned int, unsigned int, unsigned int, void const*), void*, void**, LV2_Feature const* const*) in gxamp_ui.cpp.3.o
"__section$__DATA__screw_png", referenced from:
instantiate(LV2UI_Descriptor const*, char const*, char const*, void (*)(void*, unsigned int, unsigned int, unsigned int, void const*), void*, void**, LV2_Feature const* const*) in gxamp_ui.cpp.3.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
So my main question is whether those ld
options are necessary. Am I breaking something by removing them?
And any clues for how to get past this latest error?
Nice. First that means you've already successful build guitarix for OS X. When you use the configure flag --no-lv2 you could skip the build of the lv2 plugs and finish the build for guitarix. Then you could check if it runs on OS X.
To the error. We use ld to generate object files from images (png's) which we then link into the binary's. Here is a article which explain the process we use. https://gareus.org/wiki/embedding_resources_in_executables There is as well shown a process which work for OS X. If you wish to go past of this error you need to rewrite the wscript in /trunk/src/LV2/xputty/resources to use a method supported by OS X.
@JonathanCooper , I would love to build the latest Guitarix on OSX. Do you have your notes on this available online somewhere?
Thanks, Ted
So first an update: Guitarix did build! But it isn't really working, the window does not seem to draw properly and clicking around does not work as expected. I haven't had any time lately to debug.
@Rippert here are my notes for building:
- download ladspa.h, place in
/usr/local/include
-
brew install gtk+ gtkmm3 glib libsigc++@2 zita-convolver libsndfile jack boost sassc lrdf lilv faust eigen cairo g++
- Install zita-resamspler:
curl https://kokkinizita.linuxaudio.org/linuxaudio/downloads/zita-resampler-1.6.0.tar.bz2 -O
tar xvjf zita-resampler-1.6.0.tar.bz2
cd zita-resampler-1.6.0/libs/
make -f Makefile-osx
make -f Makefile-osx install
- install Roboto Condensed via Google fonts
- clone guitarix repo
- replace line 22 of
waftools/compile-extra.py
with:self.ldflags.append('-Wl,-map,%s' % mapfile.bldpath())
-
cd trunk
-
CXX=g++ ./waf configure --no-avahi --ldflags="-Qunused-arguments -L/opt/X11/lib -lX11 -lpthread" --cxxflags="-I/opt/X11/include -I/opt/X11/include/cairo" --no-lv2
-
./waf build
It is fairly likely I have left something out that I did but failed to note; if you run into any issues please post here and tag me and I'll take a look!
* download [ladspa.h](https://www.ladspa.org/ladspa_sdk/ladspa.h.txt), place in `/usr/local/include`
This shouldn't be needed, as, when guitarix didn't find ladspa.h during configure, it will use it's own included one, which is exactly the same.
The very same is true for zita-convolver and zita-resampler, when you use the flags --includeresampler --includeconvolver
guitarix will use it's included versions.
So first an update: Guitarix did build! But it isn't really working, the window does not seem to draw properly and clicking around does not work as expected. I haven't had any time lately to debug.
Patches to fixing this issues would be very welcome.
I believe you can also avoid the Roboto Condensed install by using the flag --install-roboto-font
to use the included version of the font. Not sure if that works on OSX the way it does on linux though.
@JonathanCooper - I'll install homebrew and try your instructions in a couple days and see if I can get as far as you did. Thanks again.