Skip to content

strip symbol when linking #3234

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

Closed
wants to merge 1 commit into from
Closed

Conversation

cccclai
Copy link
Contributor

@cccclai cccclai commented Apr 23, 2024

Summary:
Refer to https://sourceware.org/binutils/docs/binutils/strip.html
command to build for android

rm -rf cmake-android-out && mkdir cmake-android-out

cmake -DBUCK2="$BUCK" \
    -DCMAKE_INSTALL_PREFIX=cmake-android-out \
    -DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK}/build/cmake/android.toolchain.cmake" \
    -DANDROID_ABI="arm64-v8a" \
    -DANDROID_PLATFORM=android-29 \
    -DCMAKE_BUILD_TYPE=Release \
    -DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
    -DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
    -DEXECUTORCH_BUILD_CUSTOM=ON \
    -DEXECUTORCH_BUILD_OPTIMIZED=ON \
    -DEXECUTORCH_BUILD_QUANTIZED=ON \
    -DEXECUTORCH_BUILD_XNNPACK=ON \
    -DEXECUTORCH_ENABLE_LOGGING=ON \
    -Bcmake-android-out .

cmake --build cmake-android-out -j16 --target install --config Release

cmake -DBUCK2="$BUCK" \
    -DCMAKE_INSTALL_PREFIX=cmake-android-out \
    -DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK}/build/cmake/android.toolchain.cmake" \
    -DANDROID_ABI="arm64-v8a" \
    -DANDROID_PLATFORM=android-23 \
    -DCMAKE_BUILD_TYPE=Release \
    -DEXECUTORCH_BUILD_CUSTOM=ON \
    -DEXECUTORCH_BUILD_OPTIMIZED=ON \
    -DEXECUTORCH_BUILD_XNNPACK=ON \
    -DEXECUTORCH_ENABLE_LOGGING=ON \
    -DEXECUTORCH_USE_TIKTOKEN=ON \
    -Bcmake-android-out/${dir} \
    ${dir}

cmake --build cmake-android-out/${dir} -j16 --config Release

(executorch) chenlai@chenlai-mbp executorch % du -sh cmake-android-out/examples/models/llama2/*
 44K	cmake-android-out/examples/models/llama2/CMakeCache.txt
2.2M	cmake-android-out/examples/models/llama2/CMakeFiles
 76K	cmake-android-out/examples/models/llama2/Makefile
4.0K	cmake-android-out/examples/models/llama2/cmake_install.cmake
4.0K	cmake-android-out/examples/models/llama2/compile_commands.json
4.9M	cmake-android-out/examples/models/llama2/custom_ops
736K	cmake-android-out/examples/models/llama2/lib
 54M	cmake-android-out/examples/models/llama2/llama_main
 16K	cmake-android-out/examples/models/llama2/options-pinned.h
 11M	cmake-android-out/examples/models/llama2/runner
151M	cmake-android-out/examples/models/llama2/third-party

Reviewed By: lucylq

Differential Revision: D56450794

Summary:
Refer to https://sourceware.org/binutils/docs/binutils/strip.html
command to build for android
```
rm -rf cmake-android-out && mkdir cmake-android-out

cmake -DBUCK2="$BUCK" \
    -DCMAKE_INSTALL_PREFIX=cmake-android-out \
    -DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK}/build/cmake/android.toolchain.cmake" \
    -DANDROID_ABI="arm64-v8a" \
    -DANDROID_PLATFORM=android-29 \
    -DCMAKE_BUILD_TYPE=Release \
    -DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
    -DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
    -DEXECUTORCH_BUILD_CUSTOM=ON \
    -DEXECUTORCH_BUILD_OPTIMIZED=ON \
    -DEXECUTORCH_BUILD_QUANTIZED=ON \
    -DEXECUTORCH_BUILD_XNNPACK=ON \
    -DEXECUTORCH_ENABLE_LOGGING=ON \
    -Bcmake-android-out .

cmake --build cmake-android-out -j16 --target install --config Release

cmake -DBUCK2="$BUCK" \
    -DCMAKE_INSTALL_PREFIX=cmake-android-out \
    -DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK}/build/cmake/android.toolchain.cmake" \
    -DANDROID_ABI="arm64-v8a" \
    -DANDROID_PLATFORM=android-23 \
    -DCMAKE_BUILD_TYPE=Release \
    -DEXECUTORCH_BUILD_CUSTOM=ON \
    -DEXECUTORCH_BUILD_OPTIMIZED=ON \
    -DEXECUTORCH_BUILD_XNNPACK=ON \
    -DEXECUTORCH_ENABLE_LOGGING=ON \
    -DEXECUTORCH_USE_TIKTOKEN=ON \
    -Bcmake-android-out/${dir} \
    ${dir}

cmake --build cmake-android-out/${dir} -j16 --config Release

```

```
(executorch) chenlai@chenlai-mbp executorch % du -sh cmake-android-out/examples/models/llama2/*
 44K	cmake-android-out/examples/models/llama2/CMakeCache.txt
2.2M	cmake-android-out/examples/models/llama2/CMakeFiles
 76K	cmake-android-out/examples/models/llama2/Makefile
4.0K	cmake-android-out/examples/models/llama2/cmake_install.cmake
4.0K	cmake-android-out/examples/models/llama2/compile_commands.json
4.9M	cmake-android-out/examples/models/llama2/custom_ops
736K	cmake-android-out/examples/models/llama2/lib
 54M	cmake-android-out/examples/models/llama2/llama_main
 16K	cmake-android-out/examples/models/llama2/options-pinned.h
 11M	cmake-android-out/examples/models/llama2/runner
151M	cmake-android-out/examples/models/llama2/third-party
```

Reviewed By: lucylq

Differential Revision: D56450794
Copy link

pytorch-bot bot commented Apr 23, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/3234

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 96ddaa2 with merge base aec2549 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 23, 2024
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D56450794

cccclai added a commit to cccclai/executorch-1 that referenced this pull request Apr 23, 2024
Summary:

Refer to https://sourceware.org/binutils/docs/binutils/strip.html
command to build for android
```
rm -rf cmake-android-out && mkdir cmake-android-out

cmake -DBUCK2="$BUCK" \
    -DCMAKE_INSTALL_PREFIX=cmake-android-out \
    -DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK}/build/cmake/android.toolchain.cmake" \
    -DANDROID_ABI="arm64-v8a" \
    -DANDROID_PLATFORM=android-29 \
    -DCMAKE_BUILD_TYPE=Release \
    -DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
    -DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
    -DEXECUTORCH_BUILD_CUSTOM=ON \
    -DEXECUTORCH_BUILD_OPTIMIZED=ON \
    -DEXECUTORCH_BUILD_QUANTIZED=ON \
    -DEXECUTORCH_BUILD_XNNPACK=ON \
    -DEXECUTORCH_ENABLE_LOGGING=ON \
    -Bcmake-android-out .

cmake --build cmake-android-out -j16 --target install --config Release

cmake -DBUCK2="$BUCK" \
    -DCMAKE_INSTALL_PREFIX=cmake-android-out \
    -DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK}/build/cmake/android.toolchain.cmake" \
    -DANDROID_ABI="arm64-v8a" \
    -DANDROID_PLATFORM=android-23 \
    -DCMAKE_BUILD_TYPE=Release \
    -DEXECUTORCH_BUILD_CUSTOM=ON \
    -DEXECUTORCH_BUILD_OPTIMIZED=ON \
    -DEXECUTORCH_BUILD_XNNPACK=ON \
    -DEXECUTORCH_ENABLE_LOGGING=ON \
    -DEXECUTORCH_USE_TIKTOKEN=ON \
    -Bcmake-android-out/${dir} \
    ${dir}

cmake --build cmake-android-out/${dir} -j16 --config Release

```

```
(executorch) chenlai@chenlai-mbp executorch % du -sh cmake-android-out/examples/models/llama2/*
 44K	cmake-android-out/examples/models/llama2/CMakeCache.txt
2.2M	cmake-android-out/examples/models/llama2/CMakeFiles
 76K	cmake-android-out/examples/models/llama2/Makefile
4.0K	cmake-android-out/examples/models/llama2/cmake_install.cmake
4.0K	cmake-android-out/examples/models/llama2/compile_commands.json
4.9M	cmake-android-out/examples/models/llama2/custom_ops
736K	cmake-android-out/examples/models/llama2/lib
 54M	cmake-android-out/examples/models/llama2/llama_main
 16K	cmake-android-out/examples/models/llama2/options-pinned.h
 11M	cmake-android-out/examples/models/llama2/runner
151M	cmake-android-out/examples/models/llama2/third-party
```

Reviewed By: lucylq, kirklandsign

Differential Revision: D56450794
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in d8e94b0.

@cccclai
Copy link
Contributor Author

cccclai commented Apr 24, 2024

@pytorchbot cherry-pick --onto release/0.2 -c regression

pytorchbot pushed a commit that referenced this pull request Apr 24, 2024
Summary:
Pull Request resolved: #3234

Refer to https://sourceware.org/binutils/docs/binutils/strip.html
command to build for android
```
rm -rf cmake-android-out && mkdir cmake-android-out

cmake -DBUCK2="$BUCK" \
    -DCMAKE_INSTALL_PREFIX=cmake-android-out \
    -DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK}/build/cmake/android.toolchain.cmake" \
    -DANDROID_ABI="arm64-v8a" \
    -DANDROID_PLATFORM=android-29 \
    -DCMAKE_BUILD_TYPE=Release \
    -DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
    -DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
    -DEXECUTORCH_BUILD_CUSTOM=ON \
    -DEXECUTORCH_BUILD_OPTIMIZED=ON \
    -DEXECUTORCH_BUILD_QUANTIZED=ON \
    -DEXECUTORCH_BUILD_XNNPACK=ON \
    -DEXECUTORCH_ENABLE_LOGGING=ON \
    -Bcmake-android-out .

cmake --build cmake-android-out -j16 --target install --config Release

cmake -DBUCK2="$BUCK" \
    -DCMAKE_INSTALL_PREFIX=cmake-android-out \
    -DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK}/build/cmake/android.toolchain.cmake" \
    -DANDROID_ABI="arm64-v8a" \
    -DANDROID_PLATFORM=android-23 \
    -DCMAKE_BUILD_TYPE=Release \
    -DEXECUTORCH_BUILD_CUSTOM=ON \
    -DEXECUTORCH_BUILD_OPTIMIZED=ON \
    -DEXECUTORCH_BUILD_XNNPACK=ON \
    -DEXECUTORCH_ENABLE_LOGGING=ON \
    -DEXECUTORCH_USE_TIKTOKEN=ON \
    -Bcmake-android-out/${dir} \
    ${dir}

cmake --build cmake-android-out/${dir} -j16 --config Release

```

```
(executorch) chenlai@chenlai-mbp executorch % du -sh cmake-android-out/examples/models/llama2/*
 44K	cmake-android-out/examples/models/llama2/CMakeCache.txt
2.2M	cmake-android-out/examples/models/llama2/CMakeFiles
 76K	cmake-android-out/examples/models/llama2/Makefile
4.0K	cmake-android-out/examples/models/llama2/cmake_install.cmake
4.0K	cmake-android-out/examples/models/llama2/compile_commands.json
4.9M	cmake-android-out/examples/models/llama2/custom_ops
736K	cmake-android-out/examples/models/llama2/lib
 54M	cmake-android-out/examples/models/llama2/llama_main
 16K	cmake-android-out/examples/models/llama2/options-pinned.h
 11M	cmake-android-out/examples/models/llama2/runner
151M	cmake-android-out/examples/models/llama2/third-party
```

Reviewed By: lucylq, kirklandsign

Differential Revision: D56450794

fbshipit-source-id: 79e77732713708f3ced3801d11e30a9141075a76
(cherry picked from commit d8e94b0)
@pytorchbot
Copy link
Collaborator

Cherry picking #3234

The cherry pick PR is at #3269 and it is recommended to link a regression cherry pick PR with an issue

Details for Dev Infra team Raised by workflow job

@mergennachin mergennachin mentioned this pull request Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants