For this response I assume that you have followed the comilation instructions from https://github.com/HoerTech-gGmbH/openM ... ILATION.md
, section on macOS:
You are interested manually compiling a new plugin that is not part of openMHA, particularly how to set the compiler search paths to compile and link a new, self-developed plugin.
I suggest that you compile the original openMHA source code following to these instructions. Compilation commands will scroll through your terminal while you do it, too many find a particular compilation task. To isolate the compilation commands for just one plugin in order to learn how we compile and link a plugin, please delete one of the compiled plugins when compilation is finished, e.g. with
then invoke make again to find just the commands needed to recompile this dc plugin. These will be (for release 4.11.0):
Code: Select all
clang++ -Wno-error=unused-command-line-argument -Wall -Wnon-virtual-dtor -Werror -std=c++14 -fPIC -O3 -msse -msse2 -mfpmath=sse -ffast-math -fomit-frame-pointer -fno-finite-math-only -I/opt/local/include -g -I/Users/mha/jenkins/workspace/openMHA_openMHA_master/external_libs/x86_64-Darwin-clang/include -I../../../external_libs/x86_64-Darwin-clang/include -I../../libmha/src -c -o x86_64-Darwin-clang/dc.o dc.cpp
clang++ -shared -o $PWD/x86_64-Darwin-clang/dc.dylib x86_64-Darwin-clang/dc.o x86_64-Darwin-clang/dc_mha_git_commit_hash.o -L/Users/mha/jenkins/workspace/openMHA_openMHA_master/external_libs/x86_64-Darwin-clang/lib -L../../libmha/x86_64-Darwin-clang -L/opt/local/lib -lopenmha
These commands are executed inside the directory mha/plugins/dc. Unfortunately I cannot go into too much detail here what each of the options mean, please refer to the compiler's (clang or gcc) manual. As a rough overview: The first command compiles source code to object code and needs to be told where to find header files with option -I. The second command links object code into a shared library and links dependencies in with -L and -l options.
You will probably need to add more of these options for the compiler to find your headers and dependencies.
If you compile your plugin in another directory, i.e. not from inside mha/plugins/yourplugin, then you will also need to adjust all relative paths.
To future readers: These command lines will be different on other platforms (linux, windows, arm) and may change for future versions of openMHA. Please find compilation commands for your platform and version by following the described procedure instead of using the compilation commands from this forum post.