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

Mismatch '_ITERATOR_DEBUG_LEVEL' #64

Closed
goodle06 opened this issue Aug 5, 2020 · 4 comments
Closed

Mismatch '_ITERATOR_DEBUG_LEVEL' #64

goodle06 opened this issue Aug 5, 2020 · 4 comments

Comments

@goodle06
Copy link

goodle06 commented Aug 5, 2020

Have a bunch mkl related linker errors when compiling NeoMathEngine. Could someone help me and tell what is this all about, since I can't look inside mkl dll? Neo ML was build with FineObjects option turned off (if it makes any difference).

Severity Code Description Project File Line Suppression State
Error LNK2038 mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in common.obj NeoMathEngine K:\NeoML\build\NeoMathEngine\src\mkl_core.lib(_avx512_jit_destroy.obj) 1
Severity Code Description Project File Line Suppression State
Error LNK2038 mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MDd_DynamicDebug' in common.obj NeoMathEngine K:\NeoML\build\NeoMathEngine\src\mkl_core.lib(_avx512_jit_destroy.obj) 1
Error LNK2038 mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in common.obj NeoMathEngine K:\NeoML\build\NeoMathEngine\src\mkl_core.lib(_avx2_jit_destroy.obj) 1
Error LNK2038 mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MDd_DynamicDebug' in common.obj NeoMathEngine K:\NeoML\build\NeoMathEngine\src\mkl_core.lib(_avx2_jit_destroy.obj) 1
Error LNK2038 mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in common.obj NeoMathEngine K:\NeoML\build\NeoMathEngine\src\mkl_core.lib(_avx_jit_destroy.obj) 1
Error LNK2038 mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MDd_DynamicDebug' in common.obj NeoMathEngine K:\NeoML\build\NeoMathEngine\src\mkl_core.lib(_avx_jit_destroy.obj) 1

@Columbiysky
Copy link

Columbiysky commented Aug 5, 2020

@goodle06, Hello, next steps helped me:

  1. Install MKL 2018 Update4, what written in Sources.txt
  2. Install VS 2015, MKL 2018 doesn't support VS2019, only 2013, 2015, 2017
  3. Configure project in CMAKE as "Visual Studio 14 2015", architecture is win32, additional parameter is -DCMAKE_PREFIX_PATH=/path/to/protobuf
  4. Generate projects (if u are using cmake GUI)
  5. Open project in VS 2015 ONLY(!), build that as Release (!)
    after these steps i got NeoML.dll, NeoMathEngine.dll и NeoOnnx.dll.

I don't know why official instruction is so bad, i hope it will be fixed soon....

@goodle06
Copy link
Author

goodle06 commented Aug 6, 2020

@Columbiysky, hello! Thanks for help, I changed to MKL 2018U4 and VS2017 and it got me past those errors, but no I encountered new ones:

K:\NeoML\build\NeoOnnx\src\onnx.pb.h(12): fatal error C1189: #error:  This file was generated by a newer version of protoc which is (компилируется исходный файл K:\NeoML\src\NeoOnnx\src\Nodes\ReluNode.cpp) [K:\NeoML\build\NeoOnnx\src\Ne
oOnnx.vcxproj]

There are plenty of them, but all state the same - some problem with protoc version and I don't know what to do.
Btw, I'm building via cmd\cmake if it matters.

It might be useful to someone, here is actual commands:

cmake -G "Visual Studio 15 2017" -A x64 K:\NeoML\src\NeoML -DCMAKE_INSTALL_PREFIX=K:\NeoML\build64 -DCMAKE_PREFIX_PATH=C:\Users\vcpkg\installed\x64-windows

cmake --build . --target install --config Debug

prefix_path points to protobuf.

@Columbiysky
Copy link

Columbiysky commented Aug 6, 2020

@goodle06 Это из-за того что protobuf установлен через vcpkg, удалите его, и пересоберите по этой инструкции:
https://github.com/protocolbuffers/protobuf/blob/master/cmake/README.md
после всего в папке, где вы делали git clone появится папка install (я компилировал только release), -DCMAKE_PREFIX_PATH должен указывать внутрь папки install.

@goodle06
Copy link
Author

goodle06 commented Aug 6, 2020

@Columbiysky Спасибо большое! Оказалось, что проблема не с vcpkg, а с моими кривыми руками. Я поставил два protobuf'а, один через vcpkg, один вручную. Второй указал в path, а первый - при билде. Снес оба, снова поставил через vcpkg, все собралось. Еще не тестировал, но по крайней мере скомпилировалось, получил заветные dll'ки.

Итоговая конфигурация:
CUDA 11
Visual Studio 2017
MKL 2018 update 4

@goodle06 goodle06 closed this as completed Aug 7, 2020
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

No branches or pull requests

2 participants