sherpa-onnx icon indicating copy to clipboard operation
sherpa-onnx copied to clipboard

Problem with generation xcframework

Open make1986 opened this issue 2 years ago • 8 comments

When a buid-ios.sh trying to create headers for build/simulator/lib it encounters an error like: fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: can't open input file: build/simulator_arm64/lib/libkaldi-native-fbank-core.a (No such file or directory) This happens because there are not files (only folder "Debug"). image

make1986 avatar Nov 23 '23 08:11 make1986

Did you run

./build.sh

using the latest master?

It yes, could you post the complete logs in the terminal?

csukuangfj avatar Nov 23 '23 12:11 csukuangfj

Did you run

./build.sh

using the latest master?

It yes, could you post the complete logs in the terminal?

Yes, I did it using latest master. I have resolved this problem using

for f in libkaldi-native-fbank-core.a libsherpa-onnx-c-api.a libsherpa-onnx-core.a \
         libsherpa-onnx-fst.a libsherpa-onnx-kaldifst-core.a libkaldi-decoder-core.a libcargs.a; do
  cp build/simulator_arm64/lib/Debug/${f} build/simulator_arm64/lib/${f}
  cp build/simulator_x86_64/lib/Debug/${f} build/simulator_x86_64/lib/${f}
  cp build/os64/lib/Debug/${f} build/os64/lib/${f}
done

before call

mkdir -p "build/simulator/lib"
for f in libkaldi-native-fbank-core.a libsherpa-onnx-c-api.a libsherpa-onnx-core.a \
         libsherpa-onnx-fst.a libsherpa-onnx-kaldifst-core.a libkaldi-decoder-core.a; do
  lipo -create build/simulator_arm64/lib/${f} \
               build/simulator_x86_64/lib/${f} \
       -output build/simulator/lib/${f}
  echo "File ${f} created"
done

make1986 avatar Nov 23 '23 13:11 make1986

./build-ios.sh

is supposed to run to completion without any errors.

Did you change any code?

csukuangfj avatar Nov 23 '23 13:11 csukuangfj

It looks to me that somehow you are building a debug version of xcframework.

./build-ios.sh by default builds a Release version.

csukuangfj avatar Nov 23 '23 13:11 csukuangfj

The following screenshot shows what the directory structure looks like on my computer.

Screenshot 2023-11-23 at 21 53 21

csukuangfj avatar Nov 23 '23 13:11 csukuangfj

./build-ios.sh

is supposed to run to completion without any errors.

Did you change any code?

No, I didn't change it before I got the problem))

make1986 avatar Nov 23 '23 13:11 make1986

It looks to me that somehow you are building a debug version of xcframework.

It using Release by default

make1986 avatar Nov 23 '23 13:11 make1986

It looks to me that somehow you are building a debug version of xcframework.

It using Release by default

Do you mind posting the following output to help debug?

./build-ios.sh > log.txt 2>&1

(please post ./log.txt)

csukuangfj avatar Nov 23 '23 14:11 csukuangfj