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
Compile time constant lookup tables with cmake #438
Conversation
|
I was using a toolchain file when cross compiling for android, namely the official one shipped with the NDK. But cross compiling usually means that one also needs to build depending libraries, many of them using autotools as build system. This is done by setting up environment variables, which also is the recommend way to build for android. Also note that |
|
This works fine for my buildroot-based cross compiling setup. Both with and without the |
|
@carlo-bramini: Could you please test whether this works for your use-case? |
|
I just tried to cross compile mingw32 on cygwin and it worked fine. I will try also with ARM cross compiler. |
Yes please, that would be of special interest for me. |
|
Actually the generated tables have the same values of the ones generated by my branch with Python support, so in my opinion it should work in the same way. It seems ok to me. |
|
@carlo-bramini Does that mean you've successfully tested it with your
ARM toolchain? I.e. cmake found the host and target compilers and
compilation successfully completed without any manual tweaks?
|
|
Actually, not really, if I lauch the cmake as it is, it breaks because it cannot find GLIB. I did these steps:
I have to say that for doing this test I used GCC-4.1.1, which is older than the one I normally use. In function 'fluid_rvoice_buffers_mix': warning: ignoring #pragma omp simd Perhaps it is not important also on even older versions of GCC, however I signal it . |
|
Thanks for your explanations Carlo. The tweaks you described are absolutely fine, as they are specific to your environment. I agree that they should not impair the changes proposed by this PR. The warning is negligible and only occurs for old compilers that dont support openMP 4.0. Will apply the changes in the next days. |
Like #423 it automatically generates lookup tables. Neither does it require additional build dependencies, nor additional cmake flags. Unlike #423 it does not use the preprocessor. Instead it generates temporary files and includes them during compilation. Currently there is no fallback to runtime initialization.
The problem of this solution: How to force cmake to look for the host compiler? When cross compiling
$CCusually points to the target compiler.$PATHis "polluted" with libs and binaries for the target platform as well. The only solution I came up with is to unset$CCwithin cmake, which seems to work at least when cross compiling for android.Tables are only generated once. Make sure your build directory is empty (i.e. start with a clean cmake run).
Closes #423.
Closes #433.