Trying to get android toolchain setup for Crystax

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Trying to get android toolchain setup for Crystax

Robert Dailey-2
So I'm having no luck getting the Crystax NDK setup using built-in
android support in CMake 3.8.

I have the following toolchain file:

set( CMAKE_SYSTEM_NAME Android )
set( CMAKE_SYSTEM_VERSION ${ANDROID_API} )

# set( CMAKE_ANDROID_NDK $ENV{ANDROID_NDK} )
set( CMAKE_ANDROID_NDK "E:/android/crystax-ndk-10.3.2-stable" )
#set( CMAKE_ANDROID_API ${ANDROID_API} )
set( CMAKE_ANDROID_ARCH_ABI ${ANDROID_ABI} )
set( CMAKE_ANDROID_STL_TYPE ${ANDROID_STL} )
set( CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION ${ANDROID_TOOLCHAIN_VERSION} )

if( CMAKE_ANDROID_ARCH_ABI MATCHES "armeabi" )
    set( CMAKE_ANDROID_ARM_MODE ON )
    set( CMAKE_ANDROID_ARM_NEON OFF )
endif()


The logs output as follows:


-- Android: Targeting API '15' with architecture 'arm', ABI
'armeabi-v7a', and processor 'armv7-a'
-- Android: Selected GCC toolchain 'arm-linux-androideabi-4.9'
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:10 (project):
  The CMAKE_C_COMPILER:

    E:/android/crystax-ndk-10.3.2-stable/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-gcc.exe

  is not a full path to an existing compiler tool.


The problem is the path to the toolchain it is trying to find is actually:


"E:\android\crystax-ndk-10.3.2-stable\toolchains\arm-linux-androideabi-4.9\prebuilt\windows\bin\arm-linux-androideabi-gcc.exe"

The one difference is that the path has "windows" in it instead of
"windows-x86_64". I installed the 32-bit version of Crystax NDK, not
the 64 bit one (not sure if that makes a difference, but my native
android code will not build with 64-bit compiler anyway).

How can I make it properly calculate the path? I tried setting this
but it did not change the behavior:

set( CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG windows )
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Trying to get android toolchain setup for Crystax

Robert Dailey-2
Sorry I guess it would help if I showed where the ANDROID_ variables
are being defined:

cmake .. -G"Ninja" -DCMAKE_BUILD_TYPE="Release"
-DCMAKE_TOOLCHAIN_FILE="crystax.toolchain.cmake"
-DBUILD_TESTING=OFF     -DANDROID_API=15
-DANDROID_TOOLCHAIN_NAME=arm-linux-androideabi-4.9
-DANDROID_ABI=armeabi-v7a     -DANDROID_TOOLCHAIN_VERSION=4.9
-DANDROID_STL=gnustl_static

On Thu, Mar 23, 2017 at 3:03 PM, Robert Dailey <[hidden email]> wrote:

> So I'm having no luck getting the Crystax NDK setup using built-in
> android support in CMake 3.8.
>
> I have the following toolchain file:
>
> set( CMAKE_SYSTEM_NAME Android )
> set( CMAKE_SYSTEM_VERSION ${ANDROID_API} )
>
> # set( CMAKE_ANDROID_NDK $ENV{ANDROID_NDK} )
> set( CMAKE_ANDROID_NDK "E:/android/crystax-ndk-10.3.2-stable" )
> #set( CMAKE_ANDROID_API ${ANDROID_API} )
> set( CMAKE_ANDROID_ARCH_ABI ${ANDROID_ABI} )
> set( CMAKE_ANDROID_STL_TYPE ${ANDROID_STL} )
> set( CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION ${ANDROID_TOOLCHAIN_VERSION} )
>
> if( CMAKE_ANDROID_ARCH_ABI MATCHES "armeabi" )
>     set( CMAKE_ANDROID_ARM_MODE ON )
>     set( CMAKE_ANDROID_ARM_NEON OFF )
> endif()
>
>
> The logs output as follows:
>
>
> -- Android: Targeting API '15' with architecture 'arm', ABI
> 'armeabi-v7a', and processor 'armv7-a'
> -- Android: Selected GCC toolchain 'arm-linux-androideabi-4.9'
> -- The C compiler identification is unknown
> -- The CXX compiler identification is unknown
> CMake Error at CMakeLists.txt:10 (project):
>   The CMAKE_C_COMPILER:
>
>     E:/android/crystax-ndk-10.3.2-stable/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-gcc.exe
>
>   is not a full path to an existing compiler tool.
>
>
> The problem is the path to the toolchain it is trying to find is actually:
>
>
> "E:\android\crystax-ndk-10.3.2-stable\toolchains\arm-linux-androideabi-4.9\prebuilt\windows\bin\arm-linux-androideabi-gcc.exe"
>
> The one difference is that the path has "windows" in it instead of
> "windows-x86_64". I installed the 32-bit version of Crystax NDK, not
> the 64 bit one (not sure if that makes a difference, but my native
> android code will not build with 64-bit compiler anyway).
>
> How can I make it properly calculate the path? I tried setting this
> but it did not change the behavior:
>
> set( CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG windows )
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Trying to get android toolchain setup for Crystax

Robert Dailey-2
Update:

Using the x86_64 version of the Crystax NDK worked. Meaning, the
directory name aligned with what CMake was expecting. However, the
question now is: Why didn't changing
CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG work?

On Thu, Mar 23, 2017 at 3:14 PM, Robert Dailey <[hidden email]> wrote:

> Sorry I guess it would help if I showed where the ANDROID_ variables
> are being defined:
>
> cmake .. -G"Ninja" -DCMAKE_BUILD_TYPE="Release"
> -DCMAKE_TOOLCHAIN_FILE="crystax.toolchain.cmake"
> -DBUILD_TESTING=OFF     -DANDROID_API=15
> -DANDROID_TOOLCHAIN_NAME=arm-linux-androideabi-4.9
> -DANDROID_ABI=armeabi-v7a     -DANDROID_TOOLCHAIN_VERSION=4.9
> -DANDROID_STL=gnustl_static
>
> On Thu, Mar 23, 2017 at 3:03 PM, Robert Dailey <[hidden email]> wrote:
>> So I'm having no luck getting the Crystax NDK setup using built-in
>> android support in CMake 3.8.
>>
>> I have the following toolchain file:
>>
>> set( CMAKE_SYSTEM_NAME Android )
>> set( CMAKE_SYSTEM_VERSION ${ANDROID_API} )
>>
>> # set( CMAKE_ANDROID_NDK $ENV{ANDROID_NDK} )
>> set( CMAKE_ANDROID_NDK "E:/android/crystax-ndk-10.3.2-stable" )
>> #set( CMAKE_ANDROID_API ${ANDROID_API} )
>> set( CMAKE_ANDROID_ARCH_ABI ${ANDROID_ABI} )
>> set( CMAKE_ANDROID_STL_TYPE ${ANDROID_STL} )
>> set( CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION ${ANDROID_TOOLCHAIN_VERSION} )
>>
>> if( CMAKE_ANDROID_ARCH_ABI MATCHES "armeabi" )
>>     set( CMAKE_ANDROID_ARM_MODE ON )
>>     set( CMAKE_ANDROID_ARM_NEON OFF )
>> endif()
>>
>>
>> The logs output as follows:
>>
>>
>> -- Android: Targeting API '15' with architecture 'arm', ABI
>> 'armeabi-v7a', and processor 'armv7-a'
>> -- Android: Selected GCC toolchain 'arm-linux-androideabi-4.9'
>> -- The C compiler identification is unknown
>> -- The CXX compiler identification is unknown
>> CMake Error at CMakeLists.txt:10 (project):
>>   The CMAKE_C_COMPILER:
>>
>>     E:/android/crystax-ndk-10.3.2-stable/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-gcc.exe
>>
>>   is not a full path to an existing compiler tool.
>>
>>
>> The problem is the path to the toolchain it is trying to find is actually:
>>
>>
>> "E:\android\crystax-ndk-10.3.2-stable\toolchains\arm-linux-androideabi-4.9\prebuilt\windows\bin\arm-linux-androideabi-gcc.exe"
>>
>> The one difference is that the path has "windows" in it instead of
>> "windows-x86_64". I installed the 32-bit version of Crystax NDK, not
>> the 64 bit one (not sure if that makes a difference, but my native
>> android code will not build with 64-bit compiler anyway).
>>
>> How can I make it properly calculate the path? I tried setting this
>> but it did not change the behavior:
>>
>> set( CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG windows )
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Trying to get android toolchain setup for Crystax

Robert Dailey-2
Sorry last email:

Assuming I get past the host tag issue, the next one is that the test
program is unable to compile because:

error: cannot find -lcrystax

Somehow, somewhere the linker is expecting this library. I do not see
it in the output from CMake when the build fails. I do know the file
is located here:

${CMAKE_ANDROID_NDK}/sources/crystax/libs/${ANDROID_ABI}

Is there a way I can add this to the linker search path from the
toolchain file? Or is there a better way?

On Thu, Mar 23, 2017 at 3:22 PM, Robert Dailey <[hidden email]> wrote:

> Update:
>
> Using the x86_64 version of the Crystax NDK worked. Meaning, the
> directory name aligned with what CMake was expecting. However, the
> question now is: Why didn't changing
> CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG work?
>
> On Thu, Mar 23, 2017 at 3:14 PM, Robert Dailey <[hidden email]> wrote:
>> Sorry I guess it would help if I showed where the ANDROID_ variables
>> are being defined:
>>
>> cmake .. -G"Ninja" -DCMAKE_BUILD_TYPE="Release"
>> -DCMAKE_TOOLCHAIN_FILE="crystax.toolchain.cmake"
>> -DBUILD_TESTING=OFF     -DANDROID_API=15
>> -DANDROID_TOOLCHAIN_NAME=arm-linux-androideabi-4.9
>> -DANDROID_ABI=armeabi-v7a     -DANDROID_TOOLCHAIN_VERSION=4.9
>> -DANDROID_STL=gnustl_static
>>
>> On Thu, Mar 23, 2017 at 3:03 PM, Robert Dailey <[hidden email]> wrote:
>>> So I'm having no luck getting the Crystax NDK setup using built-in
>>> android support in CMake 3.8.
>>>
>>> I have the following toolchain file:
>>>
>>> set( CMAKE_SYSTEM_NAME Android )
>>> set( CMAKE_SYSTEM_VERSION ${ANDROID_API} )
>>>
>>> # set( CMAKE_ANDROID_NDK $ENV{ANDROID_NDK} )
>>> set( CMAKE_ANDROID_NDK "E:/android/crystax-ndk-10.3.2-stable" )
>>> #set( CMAKE_ANDROID_API ${ANDROID_API} )
>>> set( CMAKE_ANDROID_ARCH_ABI ${ANDROID_ABI} )
>>> set( CMAKE_ANDROID_STL_TYPE ${ANDROID_STL} )
>>> set( CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION ${ANDROID_TOOLCHAIN_VERSION} )
>>>
>>> if( CMAKE_ANDROID_ARCH_ABI MATCHES "armeabi" )
>>>     set( CMAKE_ANDROID_ARM_MODE ON )
>>>     set( CMAKE_ANDROID_ARM_NEON OFF )
>>> endif()
>>>
>>>
>>> The logs output as follows:
>>>
>>>
>>> -- Android: Targeting API '15' with architecture 'arm', ABI
>>> 'armeabi-v7a', and processor 'armv7-a'
>>> -- Android: Selected GCC toolchain 'arm-linux-androideabi-4.9'
>>> -- The C compiler identification is unknown
>>> -- The CXX compiler identification is unknown
>>> CMake Error at CMakeLists.txt:10 (project):
>>>   The CMAKE_C_COMPILER:
>>>
>>>     E:/android/crystax-ndk-10.3.2-stable/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-gcc.exe
>>>
>>>   is not a full path to an existing compiler tool.
>>>
>>>
>>> The problem is the path to the toolchain it is trying to find is actually:
>>>
>>>
>>> "E:\android\crystax-ndk-10.3.2-stable\toolchains\arm-linux-androideabi-4.9\prebuilt\windows\bin\arm-linux-androideabi-gcc.exe"
>>>
>>> The one difference is that the path has "windows" in it instead of
>>> "windows-x86_64". I installed the 32-bit version of Crystax NDK, not
>>> the 64 bit one (not sure if that makes a difference, but my native
>>> android code will not build with 64-bit compiler anyway).
>>>
>>> How can I make it properly calculate the path? I tried setting this
>>> but it did not change the behavior:
>>>
>>> set( CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG windows )
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Loading...