There is a bug with linking to
vtkpng after compiling for arm64-v8a with Android NDK 18b. I’m linking against vtk-8.2.0 arm64-v8a with another project that uses NEON and has flags specifying that. The linking error is:
undefined reference to `png_init_filter_functions_neon'
I suggest looking at how OpenCV is handling their 3rd party lib png: requirements:
if(ENABLE_NEON) list(APPEND lib_srcs arm/arm_init.c arm/filter_neon.S arm/filter_neon_intrinsics.c) add_definitions(-DPNG_ARM_NEON_OPT=2) elseif(AARCH64) add_definitions(-DPNG_ARM_NEON_OPT=0) # NEON assembler is not supported endif()
Not sure the VTK way to go about changing
vtkpng to adopt some of these Android specific NEON changes. @ken-martin thoughts?
Just to get my problems sorted out I put
add_definitions(-DPNG_ARM_NEON_OPT=0) at the top
vtkpng/CMakeLists.txt. After doing that and recompiling VTK my linker error with the other project goes away.