Recommended NDK Directory?

6675 views
Skip to first unread message

Jeffrey Walton

unread,
Jun 17, 2013, 5:20:27 PM6/17/13
to Android NDK List
Hi All,

I'm working on a script that uses the NDK. I want to try and locate
the NDK in case its not specified by the user.

Does AOSP have a recommendation for the installation directory?

I usually install the NDK at /opt. Where are folks putting it in practice?

Jeff

David Turner

unread,
Jun 18, 2013, 4:47:43 AM6/18/13
to andro...@googlegroups.com
You should use the ANDROID_NDK_ROOT environment variable to indicate where the NDK is located. That's what most NDK-related scripts use (inside the NDK, and outside of it). There is little point in mandating a specific installation directory.



--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at http://groups.google.com/group/android-ndk.
For more options, visit https://groups.google.com/groups/opt_out.



Eric Wing

unread,
Jun 18, 2013, 5:54:58 PM6/18/13
to andro...@googlegroups.com
On 6/18/13, David Turner <di...@android.com> wrote:
> You should use the ANDROID_NDK_ROOT environment variable to indicate where
> the NDK is located. That's what most NDK-related scripts use (inside the
> NDK, and outside of it). There is little point in mandating a specific
> installation directory.
>

Is there a corresponding one you recommend for the SDK? Is there an
official document that suggests these environmental variable names
that I can point people to? (I'm seeing all kinds of variations which
makes writing portable build scripts really difficult.)


Thanks,
Eric
--
Beginning iPhone Games Development
http://playcontrol.net/iphonegamebook/

David Turner

unread,
Jun 19, 2013, 12:03:30 PM6/19/13
to andro...@googlegroups.com
On Tue, Jun 18, 2013 at 11:54 PM, Eric Wing <ewma...@gmail.com> wrote:
On 6/18/13, David Turner <di...@android.com> wrote:
> You should use the ANDROID_NDK_ROOT environment variable to indicate where
> the NDK is located. That's what most NDK-related scripts use (inside the
> NDK, and outside of it). There is little point in mandating a specific
> installation directory.
>

Is there a corresponding one you recommend for the SDK?

Yes, it's ANDROID_SDK_ROOT. This one is used by the Android emulator to find the DDMS ping program, so unlikely to change.

Is there an
official document that suggests these environmental variable names
that I can point people to? (I'm seeing all kinds of variations which
makes writing portable build scripts really difficult.)

Not that I'm aware of :-/
 

Thanks,
Eric
--
Beginning iPhone Games Development
http://playcontrol.net/iphonegamebook/

Eric Wing

unread,
Jun 19, 2013, 6:17:33 PM6/19/13
to andro...@googlegroups.com
On 6/19/13, David Turner <di...@android.com> wrote:
> On Tue, Jun 18, 2013 at 11:54 PM, Eric Wing <ewma...@gmail.com> wrote:
>
>> On 6/18/13, David Turner <di...@android.com> wrote:
>> > You should use the ANDROID_NDK_ROOT environment variable to indicate
>> where
>> > the NDK is located. That's what most NDK-related scripts use (inside
>> > the
>> > NDK, and outside of it). There is little point in mandating a specific
>> > installation directory.
>> >
>>
>> Is there a corresponding one you recommend for the SDK?
>
>
> Yes, it's ANDROID_SDK_ROOT. This one is used by the Android emulator to
> find the DDMS ping program, so unlikely to change.
>

Just to be sure, it is not ANDROID_SDK_HOME (which I know is
inconsistent with ANDROID_NDK_ROOT)? But I see this variant a lot.

I also see ANDROID_SDK and ANDROID_NDK a lot.


> Is there an
>> official document that suggests these environmental variable names
>> that I can point people to? (I'm seeing all kinds of variations which
>> makes writing portable build scripts really difficult.)
>>
>> Not that I'm aware of :-/

If the Android team could bless some conventions in official
documentation, that would be a big help.

Jeffrey Walton

unread,
Jun 19, 2013, 6:25:44 PM6/19/13
to andro...@googlegroups.com
On Wed, Jun 19, 2013 at 6:17 PM, Eric Wing <ewma...@gmail.com> wrote:
> On 6/19/13, David Turner <di...@android.com> wrote:
>> On Tue, Jun 18, 2013 at 11:54 PM, Eric Wing <ewma...@gmail.com> wrote:
>>
>>> On 6/18/13, David Turner <di...@android.com> wrote:
>>> > You should use the ANDROID_NDK_ROOT environment variable to indicate
>>> where
>>> > the NDK is located. That's what most NDK-related scripts use (inside
>>> > the
>>> > NDK, and outside of it). There is little point in mandating a specific
>>> > installation directory.
>>>
>>> Is there a corresponding one you recommend for the SDK?
>> Yes, it's ANDROID_SDK_ROOT. This one is used by the Android emulator to
>> find the DDMS ping program, so unlikely to change.
>
> Just to be sure, it is not ANDROID_SDK_HOME (which I know is
> inconsistent with ANDROID_NDK_ROOT)? But I see this variant a lot.
>
> I also see ANDROID_SDK and ANDROID_NDK a lot.
>
>
>>> official document that suggests these environmental variable names
>>> that I can point people to? (I'm seeing all kinds of variations which
>>> makes writing portable build scripts really difficult.)
>>>
>>> Not that I'm aware of :-/
>
> If the Android team could bless some conventions in official
> documentation, that would be a big help.
+1. It can be confusing at times, and it would help others who are not
aware. (Thanks David, now I have a solid reference).

Jeff

David Turner

unread,
Jun 20, 2013, 12:26:43 PM6/20/13
to andro...@googlegroups.com
On Thu, Jun 20, 2013 at 12:17 AM, Eric Wing <ewma...@gmail.com> wrote:
On 6/19/13, David Turner <di...@android.com> wrote:
> On Tue, Jun 18, 2013 at 11:54 PM, Eric Wing <ewma...@gmail.com> wrote:
>
>> On 6/18/13, David Turner <di...@android.com> wrote:
>> > You should use the ANDROID_NDK_ROOT environment variable to indicate
>> where
>> > the NDK is located. That's what most NDK-related scripts use (inside
>> > the
>> > NDK, and outside of it). There is little point in mandating a specific
>> > installation directory.
>> >
>>
>> Is there a corresponding one you recommend for the SDK?
>
>
> Yes, it's ANDROID_SDK_ROOT. This one is used by the Android emulator to
> find the DDMS ping program, so unlikely to change.
>

Just to be sure, it is not ANDROID_SDK_HOME (which I know is
inconsistent with ANDROID_NDK_ROOT)? But I see this variant a lot.


ANDROID_NDK_ROOT -> installation dir of NDK
ANDROID_SDK_ROOT -> installation dir of SDK
ANDROID_SDK_HOME -> location of SDK-related user files, defaults to ~/.android/ on Unix.

These variables are essentially used by the platform and SDK tools themselves, so are your best bet.

There is no ANDROID_NDK_HOME.

They are also used by the Chromium build for Android. 

I also see ANDROID_SDK and ANDROID_NDK a lot.

I don't think they're really standard, I recommend sticking to the variables above.
 

> Is there an
>> official document that suggests these environmental variable names
>> that I can point people to? (I'm seeing all kinds of variations which
>> makes writing portable build scripts really difficult.)
>>
>> Not that I'm aware of :-/

If the Android team could bless some conventions in official
documentation, that would be a big help.


Thanks,
Eric
--
Beginning iPhone Games Development
http://playcontrol.net/iphonegamebook/

Reply all
Reply to author
Forward
0 new messages