Skip to content
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

Support building debug version on Windows #583

Merged
merged 4 commits into from
Feb 18, 2024

Conversation

csukuangfj
Copy link
Collaborator

@csukuangfj csukuangfj commented Feb 17, 2024

Many users want to debug sherpa-onnx on Windows. However, they would have the following issues before this PR when they try to build a debug version of sherpa-onnx on windows:

onnxruntime.lib(simplify.obj) : error LNK2038: 
mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' 
doesn't match value 'MTd_StaticDebug' in
 online-websocket-server-impl.obj 
[D:\a\sherpa-onnx\sherpa-onnx\build\sherpa-onnx\csrc\sherpa-onnx-online-websocket-server.vcxproj]

This PR enables users to build a debug version of sherpa-onnx on Windows.

You can use the following commands to build a debug version of sherpa-onnx on windows:

win64

git clone https://github.com/k2-fsa/sherpa-onnx
cd sherpa-onnx
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Debug ..
cmake --build . --config Debug

win32

git clone https://github.com/k2-fsa/sherpa-onnx
cd sherpa-onnx
mkdir build
cd build

# Please select one toolset among VS 2015, 2017, 2019, and 2022 below
# We use VS 2022 as an example.

# For Visual Studio 2015
# cmake -T v140,host=x64 -A Win32 -D CMAKE_BUILD_TYPE=Debug ..

# For Visual Studio 2017
# cmake -T v141,host=x64 -A Win32 -D CMAKE_BUILD_TYPE=Debug ..

# For Visual Studio 2019
# cmake -T v142,host=x64 -A Win32 -D CMAKE_BUILD_TYPE=Debug ..

# For Visual Studio 2022
cmake -T v143,host=x64 -A Win32 -D CMAKE_BUILD_TYPE=Debug ..

cmake --build . --config Debug

@csukuangfj csukuangfj merged commit 64007a6 into k2-fsa:master Feb 18, 2024
171 of 180 checks passed
@csukuangfj csukuangfj deleted the win-debug branch February 18, 2024 02:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant