Ctranslate2 client did not work in windows

i built the ctranslate2 with vs2019 and cmake(from makelists.txt to .sln) to release x64 bin files.
i use default options intel mkl,openmp, download and setup it. openmp is default ‘intel’
git submodule update --init --recursive to clone third_party is also ok.

As a result i get 6 released files:
ctranslate2.dll,ctranslate2.exp,ctranslate2.lib cpu_features.lib utils.lib translate.exe
and i copy libiomp5md.dll from oneapi

but i can’t use translate.exe to get any outputs.
i can only use translate.exe -h to show me the help
the command
.\translate.exe --model .\ct2_model3\ --device cpu --src .\javal.txt – out .\result.txt

it didn’t work,there is not any outputs. i use the model int 8,and it’s inputs and outputs should be utf-8. it works very well with linux python.

maybe i need more dependencies ?or something happend with pagecode?
i’m not sure, beacause i am not good at c++ and cmake .I never compile any c++ programs before.

Can you be more specific? Are you getting an error? Or does the command succeed but the file result.txt is empty?

I have got roughly as far as you and when I try to run “translate.exe” from the “install” fiolder I get the error message “The code execution cannot proceed because libiomp5md.dll was not found. Reinstalling the program may fix this problem.” I have tried copying that dll into various likely places to no avail. Could the development team perhaps please indicate where the program is looking for that file?

Can you check the CMakeCache.txt file and see to which openmp library it links (IOMP5_LIBRARY)?

Ah, it’s linking to IOMP5_LIBRARY:FILEPATH=C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/compiler/lib/intel64_win/libiomp5md.lib
BUT there’s no *.dll in the sub-directory and that’s what the program seems to be looking for. Should it go in this sub-directory? I’m not a C++ guy :frowning:

OK, so it links correctly. Now find and grab the libiomp5md.dll from oneAPI’s directory, dnnl.dll (if you compiled with WITH_DNNL=ON, and the ctranslate2’s dll and put them all in the exe’s directory. I think these are all the dependencies the client needs to run.

Thanks - I’ll try this tomorrow :slight_smile:

oh my god ,i’m so sad.i just took a fool mistake.
I compiled it with intel mkl ,but my cpu is amd r7 4800h, just beause i never used AMD before and fogot it.
when i used dnnl,it worked very well(but cpu mode is not fast as i thought)
and i found a mkl-dnnl liberary, as you are using now,i’ll try it if using openmp and mkl-dnnl is faster.

i think all .dll files can be found in the folder of oneapi, but i didn’t found mkl-dnnl.dll ,maybe it’s not necessary or must compile it.

I am now getting the message from translator.exe that “cpu_features.dll” is not found. I cannot find this dll anywhere. I am getting the idea from the documentation that I need to build this file. Is this the case, I wonder? I’m assuming you are gearing your code to a GPU and did not need cpu_features.

Actually I have yet to include support for GPU, so my experience so far is with CPU only. Did your compilation completed without any complains? There is now a separate library for the CPU features, so you should have this subdirectory in the source code you cloned: third_party/cpu_features. You need to git clone --recursive in order to get all the subdirectories.

Yes, I did clone --recursive and I do have third_party/cpu_features and have examined it closely :-). Do I need to specify this subdirectory with add_subdirectory()? Using VS my compiling completed error-free and installed. Do you know where VS would put cpu_features.dll if it created this file?

I’m not using Visual Studio extensively, but it should be inside a Release or Debug directory inside the build directory.

Yes, I found it tucked away in the Debug directory inside the Build directory and have copied into the same directory as the translate.exe file with the other dependencies. The only exception thrown now is because I have not yet given it a model.bin file and source text.

Using OneApi/dnnl, translate.exe (which compiled error-free) asks for sycl.dll which seems to require the DPC++ runtime. Did you install this to get round this problem?

it didn’t need it ,mybe because i used the cpu_vcomp to compile it