VOICEVOX / open_jtalk-rs

BSD 3-Clause "New" or "Revised" License
10 stars 12 forks source link

iOS向けのビルドを作る #10

Closed HyodaKazuaki closed 1 year ago

HyodaKazuaki commented 1 year ago

VOICEVOX CoreはOpen JTalkに依存しています。 このリポジトリでは、VOICEVOX Coreが利用するOpen JTalkのビルドとRustのバインディングを提供しています。 しかし、iOS向けのビルドは提供されていません。

そこで、open_jtalk-rsをiOSに対応したいと思います。

関連PR

9

すでにarm64向け実機arm64-apple-iosとarm64(Apple Silicon)向けシミュレータarm64-apple-ios-simのビルドが可能であることが確認されています。

問題

x86_64(Intel Mac)向けシミュレータx86_64-apple-iosのビルドができていません。 ビルドができないコミットは https://github.com/VOICEVOX/open_jtalk-rs/pull/9/commits/7b4d9e4c02d9140e97ab5e7c5bd55573380696b1 です。

エラーログ

open_jtalk-rs % cargo build --target x86_64-apple-ios -p open_jtalk-sys --features generate-bindings
   Compiling libc v0.2.140
   Compiling memchr v2.5.0
   Compiling glob v0.3.1
   Compiling autocfg v1.1.0
   Compiling cfg-if v1.0.0
   Compiling proc-macro2 v1.0.54
   Compiling cc v1.0.79
   Compiling log v0.4.17
   Compiling hashbrown v0.12.3
   Compiling indexmap v1.9.3
   Compiling unicode-ident v1.0.8
   Compiling os_str_bytes v6.5.0
   Compiling clang-sys v1.6.0
   Compiling minimal-lexical v0.2.1
   Compiling regex-syntax v0.6.29
   Compiling termcolor v1.2.0
   Compiling aho-corasick v0.7.20
   Compiling quote v1.0.26
   Compiling nom v7.1.3
   Compiling atty v0.2.14
   Compiling clap_lex v0.2.4
   Compiling libloading v0.7.4
   Compiling textwrap v0.16.0
   Compiling either v1.8.1
   Compiling humantime v2.1.0
   Compiling bitflags v1.3.2
   Compiling strsim v0.10.0
   Compiling bindgen v0.60.1
   Compiling which v4.4.0
   Compiling clap v3.2.23
   Compiling regex v1.7.3
   Compiling link-cplusplus v1.0.8
   Compiling lazy_static v1.4.0
   Compiling lazycell v1.3.0
   Compiling cexpr v0.6.0
   Compiling peeking_take_while v0.1.2
   Compiling shlex v1.1.0
   Compiling rustc-hash v1.1.0
   Compiling cmake v0.1.50
   Compiling env_logger v0.9.3
   Compiling open_jtalk-sys v0.16.111 (/Users/user/work/open_jtalk-rs/crates/open_jtalk-sys)
error: failed to run custom build command for `open_jtalk-sys v0.16.111 (/Users/user/work/open_jtalk-rs/crates/open_jtalk-sys)`

Caused by:
  process didn't exit successfully: `/Users/user/work/open_jtalk-rs/target/debug/build/open_jtalk-sys-66da37e88d79db03/build-script-build` (exit status: 101)
  --- stdout
  CMAKE_TOOLCHAIN_FILE_x86_64-apple-ios = None
  CMAKE_TOOLCHAIN_FILE_x86_64_apple_ios = None
  TARGET_CMAKE_TOOLCHAIN_FILE = None
  CMAKE_TOOLCHAIN_FILE = None
  CMAKE_GENERATOR_x86_64-apple-ios = None
  CMAKE_GENERATOR_x86_64_apple_ios = None
  TARGET_CMAKE_GENERATOR = None
  CMAKE_GENERATOR = None
  running: "xcrun" "--show-sdk-path" "--sdk" "iphonesimulator"
  exit status: 0
  running: "xcrun" "--show-sdk-path" "--sdk" "iphonesimulator"
  exit status: 0
  CMAKE_PREFIX_PATH_x86_64-apple-ios = None
  CMAKE_PREFIX_PATH_x86_64_apple_ios = None
  TARGET_CMAKE_PREFIX_PATH = None
  CMAKE_PREFIX_PATH = None
  CMAKE_x86_64-apple-ios = None
  CMAKE_x86_64_apple_ios = None
  TARGET_CMAKE = None
  CMAKE = None
  running: cd "/Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build" && CMAKE_PREFIX_PATH="" "cmake" "/Users/user/work/open_jtalk-rs/crates/open_jtalk-sys/open_jtalk" "-DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk" "-DCMAKE_SYSTEM_NAME=iOS" "-DCMAKE_SYSTEM_PROCESSOR=x86_64" "-DCMAKE_INSTALL_PREFIX=/Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out" "-DCMAKE_C_FLAGS= -fPIC --target=x86_64-apple-ios -m64 -mios-simulator-version-min=7.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk -fembed-bitcode" "-DCMAKE_C_COMPILER=/usr/bin/clang" "-DCMAKE_CXX_FLAGS= -fPIC --target=x86_64-apple-ios -m64 -mios-simulator-version-min=7.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk -fembed-bitcode" "-DCMAKE_CXX_COMPILER=/usr/bin/clang++" "-DCMAKE_ASM_FLAGS= -fPIC --target=x86_64-apple-ios -m64 -mios-simulator-version-min=7.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk -fembed-bitcode" "-DCMAKE_ASM_COMPILER=/usr/bin/clang" "-DCMAKE_BUILD_TYPE=Release"
  -- The C compiler identification is AppleClang 14.0.3.14030022
  -- The CXX compiler identification is AppleClang 14.0.3.14030022
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working C compiler: /usr/bin/clang - skipped
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Check for working CXX compiler: /usr/bin/clang++ - skipped
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  -- Looking for include file ctype.h
  -- Looking for include file ctype.h - found
  -- Looking for include file dirent.h
  -- Looking for include file dirent.h - found
  -- Looking for include file fcntl.h
  -- Looking for include file fcntl.h - found
  -- Looking for include file inttypes.h
  -- Looking for include file inttypes.h - found
  -- Looking for include file io.h
  -- Looking for include file io.h - not found
  -- Looking for include file memory.h
  -- Looking for include file memory.h - found
  -- Looking for include file setjmp.h
  -- Looking for include file setjmp.h - found
  -- Looking for include file stdint.h
  -- Looking for include file stdint.h - found
  -- Looking for include file stdlib.h
  -- Looking for include file stdlib.h - found
  -- Looking for include file strings.h
  -- Looking for include file strings.h - found
  -- Looking for include file string.h
  -- Looking for include file string.h - found
  -- Looking for include file sys/mman.h
  -- Looking for include file sys/mman.h - found
  -- Looking for include file sys/stat.h
  -- Looking for include file sys/stat.h - found
  -- Looking for include file sys/times.h
  -- Looking for include file sys/times.h - found
  -- Looking for include file sys/types.h
  -- Looking for include file sys/types.h - found
  -- Looking for include file unistd.h
  -- Looking for include file unistd.h - found
  -- Looking for include file windows.h
  -- Looking for include file windows.h - not found
  -- Looking for getenv
  -- Looking for getenv - found
  -- Looking for getpagesize
  -- Looking for getpagesize - found
  -- Looking for mmap
  -- Looking for mmap - found
  -- Looking for opendir
  -- Looking for opendir - found
  -- Looking for setjmp
  -- Looking for setjmp - found
  -- Looking for sqrt
  -- Looking for sqrt - found
  -- Looking for strstr
  -- Looking for strstr - found
  -- Looking for iconv_open in iconv
  -- Looking for iconv_open in iconv - found
  -- Looking for sqrt in m
  -- Looking for sqrt in m - found
  -- Looking for stddef.h
  -- Looking for stddef.h - found
  -- Check size of char
  -- Check size of char - done
  -- Check size of int
  -- Check size of int - done
  -- Check size of long
  -- Check size of long - done
  -- Check size of long long
  -- Check size of long long - done
  -- Check size of short
  -- Check size of short - done
  -- Check size of size_t
  -- Check size of size_t - done
  -- Configuring done (7.2s)
  -- Generating done (0.0s)
  -- Build files have been written to: /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build
  running: cd "/Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build" && MAKEFLAGS="-j --jobserver-fds=15,16 --jobserver-auth=15,16" "cmake" "--build" "." "--target" "install" "--config" "Release"
  [  2%] Building CXX object _deps/openjtalk-build/CMakeFiles/openjtalk.dir/mecab/src/context_id.cpp.o
  [  5%] Building C object _deps/openjtalk-build/CMakeFiles/openjtalk.dir/jpcommon/jpcommon_label.c.o
  [  7%] Building CXX object _deps/openjtalk-build/CMakeFiles/openjtalk.dir/mecab/src/char_property.cpp.o
  [ 10%] Building C object _deps/openjtalk-build/CMakeFiles/openjtalk.dir/jpcommon/jpcommon_node.c.o
  [ 12%] Building CXX object _deps/openjtalk-build/CMakeFiles/openjtalk.dir/mecab/src/connector.cpp.o
  [ 15%] Building CXX object _deps/openjtalk-build/CMakeFiles/openjtalk.dir/mecab/src/dictionary.cpp.o
  [ 17%] Building C object _deps/openjtalk-build/CMakeFiles/openjtalk.dir/jpcommon/jpcommon.c.o
  [ 20%] Building CXX object _deps/openjtalk-build/CMakeFiles/openjtalk.dir/mecab/src/dictionary_compiler.cpp.o
  [ 23%] Building CXX object _deps/openjtalk-build/CMakeFiles/openjtalk.dir/mecab/src/dictionary_generator.cpp.o
  [ 25%] Building CXX object _deps/openjtalk-build/CMakeFiles/openjtalk.dir/mecab/src/dictionary_rewriter.cpp.o
  [ 28%] Building CXX object _deps/openjtalk-build/CMakeFiles/openjtalk.dir/mecab/src/eval.cpp.o
  [ 30%] Building CXX object _deps/openjtalk-build/CMakeFiles/openjtalk.dir/mecab/src/feature_index.cpp.o
  [ 33%] Building CXX object _deps/openjtalk-build/CMakeFiles/openjtalk.dir/mecab/src/iconv_utils.cpp.o
  [ 35%] Building CXX object _deps/openjtalk-build/CMakeFiles/openjtalk.dir/mecab/src/lbfgs.cpp.o
  [ 38%] Building CXX object _deps/openjtalk-build/CMakeFiles/openjtalk.dir/mecab/src/learner.cpp.o
  [ 41%] Building CXX object _deps/openjtalk-build/CMakeFiles/openjtalk.dir/mecab/src/learner_tagger.cpp.o
  [ 43%] Building CXX object _deps/openjtalk-build/CMakeFiles/openjtalk.dir/mecab/src/libmecab.cpp.o
  [ 46%] Building CXX object _deps/openjtalk-build/CMakeFiles/openjtalk.dir/mecab/src/mecab-dict-index.cpp.o
  [ 48%] Building CXX object _deps/openjtalk-build/CMakeFiles/openjtalk.dir/mecab/src/mecab.cpp.o
  [ 51%] Building CXX object _deps/openjtalk-build/CMakeFiles/openjtalk.dir/mecab/src/nbest_generator.cpp.o
  [ 53%] Building CXX object _deps/openjtalk-build/CMakeFiles/openjtalk.dir/mecab/src/param.cpp.o
  [ 56%] Building CXX object _deps/openjtalk-build/CMakeFiles/openjtalk.dir/mecab/src/string_buffer.cpp.o
  [ 58%] Building CXX object _deps/openjtalk-build/CMakeFiles/openjtalk.dir/mecab/src/tokenizer.cpp.o
  [ 61%] Building CXX object _deps/openjtalk-build/CMakeFiles/openjtalk.dir/mecab/src/tagger.cpp.o
  [ 64%] Building CXX object _deps/openjtalk-build/CMakeFiles/openjtalk.dir/mecab/src/utils.cpp.o
  [ 66%] Building CXX object _deps/openjtalk-build/CMakeFiles/openjtalk.dir/mecab/src/writer.cpp.o
  [ 69%] Building CXX object _deps/openjtalk-build/CMakeFiles/openjtalk.dir/mecab/src/viterbi.cpp.o
  [ 71%] Building C object _deps/openjtalk-build/CMakeFiles/openjtalk.dir/mecab2njd/mecab2njd.c.o
  [ 74%] Building C object _deps/openjtalk-build/CMakeFiles/openjtalk.dir/njd/njd.c.o
  [ 76%] Building C object _deps/openjtalk-build/CMakeFiles/openjtalk.dir/njd/njd_node.c.o
  [ 79%] Building C object _deps/openjtalk-build/CMakeFiles/openjtalk.dir/njd2jpcommon/njd2jpcommon.c.o
  [ 82%] Building C object _deps/openjtalk-build/CMakeFiles/openjtalk.dir/njd_set_accent_phrase/njd_set_accent_phrase.c.o
  [ 84%] Building C object _deps/openjtalk-build/CMakeFiles/openjtalk.dir/njd_set_accent_type/njd_set_accent_type.c.o
  [ 87%] Building C object _deps/openjtalk-build/CMakeFiles/openjtalk.dir/njd_set_digit/njd_set_digit.c.o
  [ 89%] Building C object _deps/openjtalk-build/CMakeFiles/openjtalk.dir/njd_set_long_vowel/njd_set_long_vowel.c.o
  [ 92%] Building C object _deps/openjtalk-build/CMakeFiles/openjtalk.dir/njd_set_pronunciation/njd_set_pronunciation.c.o
  [ 94%] Building C object _deps/openjtalk-build/CMakeFiles/openjtalk.dir/njd_set_unvoiced_vowel/njd_set_unvoiced_vowel.c.o
  [ 97%] Building C object _deps/openjtalk-build/CMakeFiles/openjtalk.dir/text2mecab/text2mecab.c.o
  [100%] Linking CXX static library libopenjtalk.a
  [100%] Built target openjtalk
  Install the project...
  -- Install configuration: "Release"
  -- Installing: /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/lib/libopenjtalk.a
  -- Installing: /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/include/openjtalk/jpcommon.h
  -- Installing: /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/include/openjtalk/mecab.h
  -- Installing: /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/include/openjtalk/mecab2njd.h
  -- Installing: /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/include/openjtalk/njd.h
  -- Installing: /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/include/openjtalk/njd2jpcommon.h
  -- Installing: /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/include/openjtalk/njd_set_accent_phrase.h
  -- Installing: /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/include/openjtalk/njd_set_accent_type.h
  -- Installing: /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/include/openjtalk/njd_set_digit.h
  -- Installing: /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/include/openjtalk/njd_set_long_vowel.h
  -- Installing: /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/include/openjtalk/njd_set_pronunciation.h
  -- Installing: /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/include/openjtalk/njd_set_unvoiced_vowel.h
  -- Installing: /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/include/openjtalk/text2mecab.h
  -- Up-to-date: /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/lib/libopenjtalk.a
  -- Installing: /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/include/jpcommon.h
  -- Installing: /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/include/mecab.h
  -- Installing: /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/include/njd.h
  -- Installing: /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/include/njd2jpcommon.h
  -- Installing: /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/include/njd_set_accent_phrase.h
  -- Installing: /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/include/njd_set_accent_type.h
  -- Installing: /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/include/njd_set_digit.h
  -- Installing: /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/include/njd_set_long_vowel.h
  -- Installing: /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/include/njd_set_pronunciation.h
  -- Installing: /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/include/njd_set_unvoiced_vowel.h
  -- Installing: /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/include/text2mecab.h
  -- Installing: /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/include/mecab2njd.h
  cargo:root=/Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out
  cargo:rustc-link-search=/Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/lib
  cargo:rustc-link-lib=openjtalk
  cargo:rerun-if-changed=wrapper.hpp
  cargo:rerun-if-changed=src/generated/bindings.rs

  --- stderr
  CMake Deprecation Warning at /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/CMakeLists.txt:5 (cmake_minimum_required):
    Compatibility with CMake < 2.8.12 will be removed from a future version of
    CMake.

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

  Required HTSEngine not found
  CMake Warning:
    Manually-specified variables were not used by the project:

      CMAKE_ASM_COMPILER
      CMAKE_ASM_FLAGS

  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/context_id.cpp:9:
  /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/utils.h:47:8: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
    std::sprintf(s, "%-16f", val);
         ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
  __deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
  ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
          #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                        ^
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/dictionary.cpp:8:
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/connector.h:10:
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/mmap.h:51:
  /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/utils.h:47:8: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
    std::sprintf(s, "%-16f", val);
         ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
  __deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
  ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
          #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                        ^
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/connector.cpp:9:
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/connector.h:10:
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/mmap.h:51:
  /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/utils.h:47:8: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
    std::sprintf(s, "%-16f", val);
         ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
  __deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
  ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
          #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                        ^
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/dictionary_compiler.cpp:9:
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/char_property.h:8:
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/mmap.h:51:
  /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/utils.h:47:8: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
    std::sprintf(s, "%-16f", val);
         ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
  __deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
  ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
          #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                        ^
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/char_property.cpp:11:
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/char_property.h:8:
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/mmap.h:51:
  /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/utils.h:47:8: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
    std::sprintf(s, "%-16f", val);
         ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
  __deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
  ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
          #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                        ^
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/dictionary_rewriter.cpp:13:
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/dictionary_rewriter.h:14:
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/freelist.h:11:
  /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/utils.h:47:8: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
    std::sprintf(s, "%-16f", val);
         ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
  __deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
  ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
          #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                        ^
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/dictionary_generator.cpp:11:
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/char_property.h:8:
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/mmap.h:51:
  /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/utils.h:47:8: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
    std::sprintf(s, "%-16f", val);
         ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
  __deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
  ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
          #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                        ^
  1 warning generated.
  1 warning generated.
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/eval.cpp:55:
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/stream_wrapper.h:12:
  /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/utils.h:47:8: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
    std::sprintf(s, "%-16f", val);
         ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
  __deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
  ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
          #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                        ^
  /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/eval.cpp:118:5: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
      sprintf(buf.get(), "%4.4f(%d/%d) %4.4f(%d/%d) %4.4f\n",
      ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
  __deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
  ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
          #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                        ^
  1 warning generated.
  1 warning generated.
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/feature_index.cpp:11:
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/feature_index.h:12:
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/mmap.h:51:
  /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/utils.h:47:8: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
    std::sprintf(s, "%-16f", val);
         ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
  __deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
  ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
          #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                        ^
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/iconv_utils.cpp:53:
  /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/utils.h:47:8: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
    std::sprintf(s, "%-16f", val);
         ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
  __deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
  ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
          #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                        ^
  2 warnings generated.
  1 warning generated.
  1 warning generated.
  1 warning generated.
  1 warning generated.
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/learner.cpp:10:
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/feature_index.h:12:
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/mmap.h:51:
  /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/utils.h:47:8: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
    std::sprintf(s, "%-16f", val);
         ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
  __deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
  ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
          #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                        ^
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/learner_tagger.cpp:12:
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/learner_node.h:12:
  /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/utils.h:47:8: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
    std::sprintf(s, "%-16f", val);
         ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
  __deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
  ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
          #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                        ^
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/libmecab.cpp:52:
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/tokenizer.h:10:
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/freelist.h:11:
  /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/utils.h:47:8: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
    std::sprintf(s, "%-16f", val);
         ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
  __deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
  ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
          #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                        ^
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/nbest_generator.cpp:8:
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/nbest_generator.h:11:
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/freelist.h:11:
  /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/utils.h:47:8: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
    std::sprintf(s, "%-16f", val);
         ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
  __deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
  ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
          #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                        ^
  1 warning generated.
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/param.cpp:51:
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/string_buffer.h:52:
  /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/utils.h:47:8: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
    std::sprintf(s, "%-16f", val);
         ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
  __deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
  ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
          #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                        ^
  1 warning generated.
  1 warning generated.
  1 warning generated.
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/string_buffer.cpp:9:
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/string_buffer.h:52:
  /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/utils.h:47:8: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
    std::sprintf(s, "%-16f", val);
         ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
  __deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
  ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
          #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                        ^
  1 warning generated.
  1 warning generated.
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/tagger.cpp:10:
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/connector.h:10:
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/mmap.h:51:
  /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/utils.h:47:8: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
    std::sprintf(s, "%-16f", val);
         ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
  __deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
  ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
          #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                        ^
  1 warning generated.
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/tokenizer.cpp:7:
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/connector.h:10:
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/mmap.h:51:
  /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/utils.h:47:8: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
    std::sprintf(s, "%-16f", val);
         ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
  __deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
  ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
          #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                        ^
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/utils.cpp:85:
  /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/utils.h:47:8: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
    std::sprintf(s, "%-16f", val);
         ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
  __deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
  ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
          #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                        ^
  1 warning generated.
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/viterbi.cpp:11:
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/connector.h:10:
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/mmap.h:51:
  /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/utils.h:47:8: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
    std::sprintf(s, "%-16f", val);
         ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
  __deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
  ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
          #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                        ^
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/writer.cpp:12:
  In file included from /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/string_buffer.h:52:
  /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/utils.h:47:8: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
    std::sprintf(s, "%-16f", val);
         ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
  __deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
  ^
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
          #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                        ^
  /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/writer.cpp:253:61: warning: adding 'const char' to a string does not append to the string [-Wstring-plus-int]
              const std::string error = "unknown meta char: " + *p;
                                        ~~~~~~~~~~~~~~~~~~~~~~^~~~
  /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/build/_deps/openjtalk-src/src/mecab/src/writer.cpp:253:61: note: use array indexing to silence this warning
              const std::string error = "unknown meta char: " + *p;
                                                              ^
                                        &                     [   ]
  2 warnings generated.
  1 warning generated.
  1 warning generated.
  1 warning generated.
  warning: include path for libstdc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
  wrapper.hpp:1:19: warning: extra tokens at end of #include directive [-Wextra-tokens]
  /Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/include/mecab.h:370:10: fatal error: 'cstdio' file not found
  clang diag: warning: include path for libstdc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
  clang diag: wrapper.hpp:1:19: warning: extra tokens at end of #include directive [-Wextra-tokens]
  thread 'main' panicked at 'Unable to generate bindings: ClangDiagnostic("/Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/include/mecab.h:370:10: fatal error: 'cstdio' file not found\n")', crates/open_jtalk-sys/build.rs:82:10
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

実行環境

MacBook Air M2 2022 rustc 1.68.2 (9eb3afe9e 2023-03-27) cargo 1.68.2 (6feb7c9cf 2023-03-26) Apple clang version 14.0.3 (clang-1403.0.22.14.1) cmake version 3.26.1

PickledChair commented 1 year ago

Issue 作成ありがとうございます!

多くのメッセージが表示されていますが、ほとんどは無視できそうでした。最後の方の bindgen のエラー(以下に記載)が原因のようでした。clang が cstdio を見つけられない、というもののようです。

thread 'main' panicked at 'Unable to generate bindings: ClangDiagnostic("/Users/user/work/open_jtalk-rs/target/x86_64-apple-ios/debug/build/open_jtalk-sys-3e2c4554572bab69/out/include/mecab.h:370:10: fatal error: 'cstdio' file not found\n")', crates/open_jtalk-sys/build.rs:82:10

私の環境でも再現しました。Apple Silicon Mac でも Intel Mac でも同じところで躓くようです(Intel Mac でも aarch64-apple-ios-sim 向けには bindings.rs の生成に成功し、 x86_64-apple-ios 向けには失敗する)。

色々試したところ、M1 MacBook Air では open_jtalk-sys crate の build.rs 内の generate_bindings 関数において、clang_args を以下のように書き換えると x86_64 向けの binding.rs の生成に成功しました(C++ の標準ライブラリのインクルードパスを明示的に追加した。これはこちらの対応策を参考にしています。Intel Mac ではまだ検証していません)。

オリジナル

https://github.com/VOICEVOX/open_jtalk-rs/blob/0315051623fdea5544d121b61fb155f307f33461/crates/open_jtalk-sys/build.rs#L43

書き換え後

    let target = env::var("TARGET").unwrap();
    let mut clang_args = vec![format!("-I{}", include_dir.display())];
    if target == "x86_64-apple-ios" {
        clang_args.push(format!(
            "-I{}/usr/include/c++/v1",
            String::from_utf8_lossy(
                &Command::new("xcrun")
                    .args(["--sdk", "iphonesimulator", "--show-sdk-path"])
                    .output()
                    .expect("failed to run xcrun command")
                    .stdout
            )
            .trim()
        ));
    }
PickledChair commented 1 year ago

Intel Mac ではまだ検証していません

検証した結果、Intel Mac でもこの対応策が有効であることを確認しました。

Hiroshiba commented 1 year ago

めちゃくちゃ素人考えなのですが、x86_64-apple-iosではなくx86_64-apple-ios-simとかだったり・・・・?

PickledChair commented 1 year ago

めちゃくちゃ素人考えなのですが、x86_64-apple-iosではなくx86_64-apple-ios-simとかだったり・・・・?

Rust の Platform Support の一覧を見ていただけるとわかると思うのですが、x86_64-apple-ios-sim は存在しないんですよね……(これは私も最初に引っかかりました)。そもそも、iOS 端末のプロセッサが Intel CPU だったことはないので、x86_64-apple-ios だけでシミュレータ向けだと分かる感じのようです。

一方、aarch64 の方のシミュレータ向けに-sim がついている理由は、これがないと実機向けの aarch64-apple-ios と名前が被ってしまうので、例外的に suffix をつけていると考えられます。

HyodaKazuaki commented 1 year ago

色々試したところ、M1 MacBook Air では open_jtalk-sys crate の build.rs 内の generate_bindings 関数において、clang_args を以下のように書き換えると x86_64 向けの binding.rs の生成に成功しました(C++ の標準ライブラリのインクルードパスを明示的に追加した。これはこちらの対応策を参考にしています。Intel Mac ではまだ検証していません)。

オリジナル

https://github.com/VOICEVOX/open_jtalk-rs/blob/0315051623fdea5544d121b61fb155f307f33461/crates/open_jtalk-sys/build.rs#L43

書き換え後

    let target = env::var("TARGET").unwrap();
    let mut clang_args = vec![format!("-I{}", include_dir.display())];
    if target == "x86_64-apple-ios" {
        clang_args.push(format!(
            "-I{}/usr/include/c++/v1",
            String::from_utf8_lossy(
                &Command::new("xcrun")
                    .args(["--sdk", "iphonesimulator", "--show-sdk-path"])
                    .output()
                    .expect("failed to run xcrun command")
                    .stdout
            )
            .trim()
        ));
    }

解決策があっという間に見つかって驚きです! なるほど、iOS SDKもインクルード対象に追加しないといけないのですね。

ご提案いただいた修正方法ですが、xcrunコマンドを2度呼び出すことになるので、この処理をmain関数側で対応できると良さそうな感じがしました。 そこで、generate_bindings関数の仮引数include_dirallow_dirという名前を変えて、新たにinclude_dirsという仮引数を追加して処理することを考えました。

fn generate_bindings(
    allow_dir: impl AsRef<Path>,
    include_dirs: impl Iterator<Item = impl AsRef<Path>>,
) {
    let include_dir = allow_dir.as_ref();
    let clang_arg = &[format!("-I{}", include_dir.display())];
    let mut clang_args: Vec<String> = include_dirs
        .map(|dir| format!("-I{}", dir.as_ref().display()))
        .collect();
    clang_args.extend(clang_arg.iter().cloned);
    println!("cargo:rerun-if-changed=wrapper.hpp");
// 以下略 //

main関数側では、include_dir変数を次のように定義し、必要に応じて(今回のような場合など)追加するという形を取ります。

let mut include_dirs: Vec<PathBuf> = Vec::new();

以上の点はコミットしてありますので、よければ実際にcloneしてお試しいただけると幸いです。 https://github.com/VOICEVOX/open_jtalk-rs/pull/9/commits/6e2f8935bdf5b22e1e0b9e306fdd6b08ebe24f7c

PickledChair commented 1 year ago

ご提案いただいた修正方法ですが、xcrunコマンドを2度呼び出すことになるので、この処理をmain関数側で対応できると良さそうな感じがしました。 そこで、generate_bindings関数の仮引数include_dirallow_dirという名前を変えて、新たにinclude_dirsという仮引数を追加して処理することを考えました。

より良い実装方針だと思いました……! 後で確認してみます。続きのやり取りは #9 で行いたいと思います

HyodaKazuaki commented 1 year ago

9 で対応されたのでCloseします。