filament icon indicating copy to clipboard operation
filament copied to clipboard

build android demo fail (libgeometry.a) on windows 10 platform

Open luoqii opened this issue 1 year ago • 9 comments

Describe the bug when build android demo on windows 10 platform, ther is a error when build libs/geometry/libgeometry.a

To Reproduce Steps to reproduce the behavior:

  1. install prerequisites on my window10 PC
  2. build according to https://github.com/google/filament/blob/main/BUILDING.md#windows
  3. build according to https://github.com/google/filament/blob/main/android/Windows.md#build
  4. when executing cd out\cmake-android-release-arm7 cmake ^ -G Ninja ^ -DCMAKE_BUILD_TYPE=Release ^ -DCMAKE_INSTALL_PREFIX=..\android-release\filament ^ -DCMAKE_TOOLCHAIN_FILE=..\..\build\toolchain-arm7-linux-android.cmake ^ ..\.., all is ok
  5. when executing ninja install there is a compile error: FAILED: libs/geometry/libgeometry.a cmd.exe /C "cd . && "D:\Program Files\CMake\bin\cmake.exe" -E rm -f libs\geometry\libgeometry.a && C:\Users\11110125\AppData\Local\Android\Sdk\ndk\25.2.9519653\toolchains\llvm\prebuilt\windows-x86_64\bin\llvm-ar.exe qc libs\geometry\libgeometry.a libs/geometry/CMakeFiles/geometry.dir/src/MikktspaceImpl.cpp.o libs/geometry/CMakeFiles/geometry.dir/src/SurfaceOrientation.cpp.o libs/geometry/CMakeFiles/geometry.dir/src/TangentSpaceMesh.cpp.o libs/geometry/CMakeFiles/geometry.dir/src/Transcoder.cpp.o && C:\Users\11110125\AppData\Local\Android\Sdk\ndk\25.2.9519653\toolchains\llvm\prebuilt\windows-x86_64\bin\llvm-ranlib.exe libs\geometry\libgeometry.a && cmd.exe /C "cd /D G:\00workbench\filament\out\cmake-android-release-arm7\libs\geometry && G:\00workbench\filament\build\linux\combine-static-libs.sh C:/Users/11110125/AppData/Local/Android/Sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/windows-x86_64/bin/llvm-ar.exe G:/00workbench/filament/out/cmake-android-release-arm7/libs/geometry/libgeometry_combined.a G:/00workbench/filament/out/cmake-android-release-arm7/libs/geometry/libgeometry.a""

Expected behavior

Screenshots If applicable, add screenshots to help explain your problem.

Logs FAILED: libs/geometry/libgeometry.a cmd.exe /C "cd . && "D:\Program Files\CMake\bin\cmake.exe" -E rm -f libs\geometry\libgeometry.a && C:\Users\11110125\AppData\Local\Android\Sdk\ndk\25.2.9519653\toolchains\llvm\prebuilt\windows-x86_64\bin\llvm-ar.exe qc libs\geometry\libgeometry.a libs/geometry/CMakeFiles/geometry.dir/src/MikktspaceImpl.cpp.o libs/geometry/CMakeFiles/geometry.dir/src/SurfaceOrientation.cpp.o libs/geometry/CMakeFiles/geometry.dir/src/TangentSpaceMesh.cpp.o libs/geometry/CMakeFiles/geometry.dir/src/Transcoder.cpp.o && C:\Users\11110125\AppData\Local\Android\Sdk\ndk\25.2.9519653\toolchains\llvm\prebuilt\windows-x86_64\bin\llvm-ranlib.exe libs\geometry\libgeometry.a && cmd.exe /C "cd /D G:\00workbench\filament\out\cmake-android-release-arm7\libs\geometry && G:\00workbench\filament\build\linux\combine-static-libs.sh C:/Users/11110125/AppData/Local/Android/Sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/windows-x86_64/bin/llvm-ar.exe G:/00workbench/filament/out/cmake-android-release-arm7/libs/geometry/libgeometry_combined.a G:/00workbench/filament/out/cmake-android-release-arm7/libs/geometry/libgeometry.a""

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • GPU: [e.g. NVIDIA GTX 1080]
  • Backend: [OpenGL/Vulkan]

Additional context Add any other context about the problem here.

luoqii avatar Jun 14 '23 06:06 luoqii

i have try this on main, tag/v1.38.0 branches. the result is same

luoqii avatar Jun 14 '23 06:06 luoqii

on branch tags/v1.37.0 tags/v1.36.0 the result is same.

luoqii avatar Jun 14 '23 07:06 luoqii

Do you have the full logs? The actual error is missing.

romainguy avatar Jun 14 '23 08:06 romainguy

@romainguy re-run & output is here.

G:\00workbench\filament\out\cmake-android-release-arm7>ninja install [0/1] Re-running CMake...-- DFG LUT size set to 64x64 CMake Deprecation Warning at third_party/meshoptimizer/tnt/CMakeLists.txt:1 (cmake_minimum_required): Compatibility with CMake < 3.5 will be removed from a future version of CMake.

Update the VERSION argument value or use a ... suffix to tell CMake that the project does not need compatibility with older versions.

CMake Deprecation Warning at third_party/spirv-tools/CMakeLists.txt:15 (cmake_minimum_required): Compatibility with CMake < 3.5 will be removed from a future version of CMake.

Update the VERSION argument value or use a ... suffix to tell CMake that the project does not need compatibility with older versions.

-- Configuring done (3.4s) -- Generating done (0.5s) -- Build files have been written to: G:/00workbench/filament/out/cmake-android-release-arm7

[38/689] Linking CXX static library libs\geometry\libgeometry.a FAILED: libs/geometry/libgeometry.a cmd.exe /C "cd . && "D:\Program Files\CMake\bin\cmake.exe" -E rm -f libs\geometry\libgeometry.a && C:\Users\11110125\AppData\Local\Android\Sdk\ndk\25.2.9519653\toolchains\llvm\prebuilt\windows-x86_64\bin\llvm-ar.exe qc libs\geometry\libgeometry.a libs/geometry/CMakeFiles/geometry.dir/src/MikktspaceImpl.cpp.o libs/geometry/CMakeFiles/geometry.dir/src/SurfaceOrientation.cpp.o libs/geometry/CMakeFiles/geometry.dir/src/TangentSpaceMesh.cpp.o libs/geometry/CMakeFiles/geometry.dir/src/Transcoder.cpp.o && C:\Users\11110125\AppData\Local\Android\Sdk\ndk\25.2.9519653\toolchains\llvm\prebuilt\windows-x86_64\bin\llvm-ranlib.exe libs\geometry\libgeometry.a && cmd.exe /C "cd /D G:\00workbench\filament\out\cmake-android-release-arm7\libs\geometry && G:\00workbench\filament\build\linux\combine-static-libs.sh C:/Users/11110125/AppData/Local/Android/Sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/windows-x86_64/bin/llvm-ar.exe G:/00workbench/filament/out/cmake-android-release-arm7/libs/geometry/libgeometry_combined.a G:/00workbench/filament/out/cmake-android-release-arm7/libs/geometry/libgeometry.a"" [45/689] Building CXX object filament/backend/CMakeFiles/backend.dir/src/opengl/OpenGLDriver.cpp.o ninja: build stopped: subcommand failed.

G:\00workbench\filament\out\cmake-android-release-arm7>

luoqii avatar Jun 14 '23 09:06 luoqii

my DEV env: G:\00workbench\filament\out\cmake-android-release-arm7>ninja --version 1.11.1

G:\00workbench\filament\out\cmake-android-release-arm7>python --version Python 3.7.0

G:\00workbench\filament\out\cmake-android-release-arm7>cmake --version cmake version 3.27.0-rc2

CMake suite maintained and supported by Kitware (kitware.com/cmake).

luoqii avatar Jun 14 '23 09:06 luoqii

@pixelflinger @joetoth @ansman @romainguy

in WINDOWs there is a bash script in build.ninja at ${FILAMENT_SOURCE_DIR}\out\cmake-android-release-aarch64.

after i remove the sh script and add parameter "-q“ to llvm-ar.exe, like:

  POST_BUILD = cmd.exe /C "cd /D G:\00workbench\filament\out\cmake-android-release-aarch64\libs\geometry && C:/Users/11110125/AppData/Local/Android/Sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/windows-x86_64/bin/llvm-ar.exe -q G:/00workbench/filament/out/cmake-android-release-aarch64/libs/geometry/libgeometry_combined.a G:/00workbench/filament/out/cmake-android-release-aarch64/libs/geometry/libgeometry.a"

niija install success.

but when i compile android sample in AS, there is another error: ld: error: G:/00workbench/filament/out/android-release/filament/lib/arm64-v8a/libgeometry.a: archive member 'libgeometry.a' is neither ET_REL nor LLVM bitcode

other abi has same compile error

snippt in build.ninja

build libs/geometry/libgeometry.a: CXX_STATIC_LIBRARY_LINKER__geometry_Release libs/geometry/CMakeFiles/geometry.dir/src/MikktspaceImpl.cpp.o libs/geometry/CMakeFiles/geometry.dir/src/SurfaceOrientation.cpp.o libs/geometry/CMakeFiles/geometry.dir/src/TangentSpaceMesh.cpp.o libs/geometry/CMakeFiles/geometry.dir/src/Transcoder.cpp.o || libs/math/libmath.a libs/utils/libutils.a third_party/meshoptimizer/tnt/libmeshoptimizer.a third_party/mikktspace/libmikktspace.a
  LANGUAGE_COMPILE_FLAGS = -fPIE -mcpu=cortex-a57 -std=c++17 -fstrict-aliasing -Wno-unknown-pragmas -Wno-unused-function -Wno-deprecated-declarations -fPIC -Werror=unguarded-availability -fcolor-diagnostics -fvisibility=hidden -O3 -DNDEBUG -fomit-frame-pointer -ffunction-sections -fdata-sections -fno-exceptions -fno-rtti -fno-unwind-tables -fno-asynchronous-unwind-tables
  OBJECT_DIR = libs\geometry\CMakeFiles\geometry.dir
  POST_BUILD = cmd.exe /C "cd /D G:\00workbench\filament\out\cmake-android-release-aarch64\libs\geometry && **G:\00workbench\filament\build\linux\combine-static-libs.sh** C:/Users/11110125/AppData/Local/Android/Sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/windows-x86_64/bin/llvm-ar.exe G:/00workbench/filament/out/cmake-android-release-aarch64/libs/geometry/libgeometry_combined.a G:/00workbench/filament/out/cmake-android-release-aarch64/libs/geometry/libgeometry.a"
  PRE_LINK = cd .
  TARGET_COMPILE_PDB = libs\geometry\CMakeFiles\geometry.dir\geometry.pdb
  TARGET_FILE = libs\geometry\libgeometry.a
  TARGET_PDB = libs\geometry\libgeometry.pdb

luoqii avatar Jun 21 '23 09:06 luoqii

@bejado @z3moon could one of you just try to repro this on a windows machine?

pixelflinger avatar Jan 26 '24 19:01 pixelflinger

@bejado @z3moon could one of you just try to repro this on a windows machine?

I can try this week

bejado avatar Jan 29 '24 18:01 bejado

@bejado @z3moon could one of you just try to repro this on a windows machine?

I got the same error

yzqhao avatar Jun 12 '24 02:06 yzqhao