-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[cmake][arm64] compilation is broken #1908
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
Comments
Is this with 0.3.4, or current develop ? This looks like it could be related to what I fixed for ARMV8 in #1870 just yesterday (cmake stumbilng over alternative kernels for osx as our Makefile parser does not handle gmake conditionals - on the other hand, this may have exposed a new bug as it is now no longer the generic C kernels that "win" ). |
This is with latest develop: #ff3eb1d47401f Is there any plan to officially switch to cmake at some point? Otherwise we will maybe switch to autoconf even though cmake support is much easier to integrate into our cross platform framework. Thanks a lot! |
Too bad. Somehow the DYNAMIC_ARCH code appears to assume GEMM_UNROLL_M and _N to be 2, when provisions are only made for 4x4, 4x8 or 8x4. I do not know who could proclaim any official plans at this point, but myself I am not inclined to switch to cmake as the default anytime soon. I do wonder if it would be possible to work around this problem with a simple kludge - provide a "dgemm_kernel_2x2.S" in kernel/arm64 that has only |
BTW there appears to be nothing in the "ARM dynamic arch" PR #1829 that sets GEMM_UNROLL_M and GEMM_UNROLL_N, perhaps this is just some older fallback in the cmake files that gets triggered now. |
Quick glance found nothing in the cmake code either, and the only parameter set in param.h that includes 2x2 seems to be thunderx, which has its own KERNEL file that uses the generic c kernel for dgemm. (Unless you happen to be doing your cross-compiling on an OSX box, that is ? In that case yesterday's PR would be at fault , as I actually considered breaking that unique combination the lesser evil compared to breaking cmake/ARMV8 for everybody else. And I have no idea how to make |
I am building within a Ubuntu 16.04 docker with a Linaro toolchain: |
Hmm. That should certainly not trigger the OS_DARWIN conditional. |
Seems to leave ThunderX as the only core for which 2x2 unrolling should be defined (but as I stated above, that one should use the definitions from its own KERNEL.THUNDERX file). Can you see from the log which kernel it is trying to build at that time ? |
With dynamyc arch:
With CMAKE_SYSTEM_PROCESSOR = aarch64
|
With commit #2b355592e34b07f4d0c5f81c275c902c0578236d I got this: dynamic arch now compiles (as a static library) but I have some missing symbols at link stage of my app:
with specific arch I still have the same compilation error. |
Looks like arch.cmake is not yet ready for arm64 dynamic_arch as well. |
Sorry, I had mis-spelled "SOURcES" in the CMakeLists.txt earlier (coding on the phone I use for arm64 testing). DYNAMIC_ARCH build should work now with both fixes. |
Hello, I am sorry but this may have uncovered another bug... I have this cmake error for all architecture (ARMV8, CORTEXA53, etc):
|
This should fix it:
|
The compilation then goes on and fails at CORTEXA72:
|
Not sure I understand why TARGET_CONF_DIR would not exist... The dynamic_arch compilation passes for me so it is probably something about cross-compilation not picking suitable defaults. |
This should hopefully be fixed now - when the ARMV8 targets were rearranged a few weeks ago, the specifics of the now separate CortexA7x targets had not been added to the part of prebuild.cmake that handles cross-compilation. |
I am sorry but, while the TARGET_CONF_DIR issue is fixed, I still have the compilation error: FAILED: /opt/gcc-linaro-6.4.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc -I/home/ayounes/devel/nv3dfi/deps-base/pkg-openblas/src -Ikernel_config/CORTEXA72 -fPIC -DDYNAMIC_ARCH -DNO_LAPACK -DNO_LAPACKE -DMAX_CPU_NUMBER=64 -DMAX_PARALLEL_NUMBER=1 -DNO_AFFINITY -DVERSION=""0.3.6.dev"" -O3 -DNDEBUG -fPIC -DBUILD_KERNEL -DTABLE_NAME=gotoblas_CORTEXA72 -DTS=_CORTEXA72 -MD -MT kernel/CMakeFiles/kernel_CORTEXA72.dir/CMakeFiles/dgemm_kernel_CORTEXA72.S.o -MF kernel/CMakeFiles/kernel_CORTEXA72.dir/CMakeFiles/dgemm_kernel_CORTEXA72.S.o.d -o kernel/CMakeFiles/kernel_CORTEXA72.dir/CMakeFiles/dgemm_kernel_CORTEXA72.S.o -c kernel/CMakeFiles/dgemm_kernel_CORTEXA72.S |
Hmm. That is not supposed to happen after #1930 (CortexA72 should get DGEMM_UNROLL_M 8, DGEMM_UNROLL_N 4 so should go looking for dgemm_kernel_8x4.S). I now see that my patch as committed had a few quotes missing on target names following A73, which may have led to unexpected behaviour. Will fix this in a few minutes. |
Just tried latest commit, still the same compilation error, sorry :-( |
I must be testing something else rather than your actual problem then, sorry. Which arguments are you giving to cmake ? |
Here are my cmake options:
And here is my toolchain file:
I can also provide a docker file if you want to try that by yourself. The docker file is using this compiler: |
Could you share cmake version, cmake logs around ,and emitted Makefile, leading to failure? |
cmake-3.12.3
Here are generated files (with additional .txt so that they can be uploaded here) build.ninja.txt |
I have reproduced the problem and am working on a fix. Not sure why I did not see this earlier. |
Fixed in #1946, thanks! |
with dynamic arch
With CMAKE_SYSTEM_PROCESSOR = aarch64:
The text was updated successfully, but these errors were encountered: