Blaze assignment causes error when compiling with msvc

Issue #268 wontfix
Thorsten Schmitz created an issue

Hi

I startet getting to know Blaze to compare it to Eigen and startet with this little test program:

#include <iostream>

#include <blaze/Blaze.h>

typedef blaze::DynamicVector<int, blaze::columnVector> bdVector;

int main(int argn, char** argc) {

    bdVector a{ 1, 2, 3 };

    std::cout << a+a << std::endl;

    return 0;
}

This runs just fine. But when I put the addition into a simple function like this

bdVector func(bdVector a, bdVector b) { return a + b; }

It still compiled, but when I startet it I got a dialog saying

The Ordinal 968 was not found in DLL "PATH/blaze-test.exe"

In Visual Studio I also got the lines

Exception thrown at 0x00007FFF329FEB78 (ntdll.dll) in blaze-test.exe: 0xC0000138: Ordinal Not Found.
The thread 0x87c has exited with code -1073741512 (0xc0000138).
The thread 0x3c80 has exited with code -1073741512 (0xc0000138).
The program '[7960] blaze-test.exe' has exited with code -1073741512 (0xc0000138) 'Ordinal Not Found'.

Changing debug/release mode or using references or pointers instead of copied values doesn’t change this. Later I found out that this line

bdVector b = a;

Also causes this error. The compiler gave me these warnings

\blaze\blaze\math\smp\openmp\Functions.h(97): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data
\blaze\blaze\util\Time.h(92): warning C4996: 'localtime': This function or variable may be unsafe. Consider using localtime_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
  C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\time.h(506): note: see declaration of 'localtime'
\blaze\blaze\util\Time.h(113): warning C4996: 'localtime': This function or variable may be unsafe. Consider using localtime_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
  C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\time.h(506): note: see declaration of 'localtime'
\blaze\blaze\util\Time.h(131): warning C4996: '_ftime64': This function or variable may be unsafe. Consider using _ftime64_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.

Hoping for some more information I tried compiling with Clang. But then the error dissapeard.

I don’t know if this is relevant, but Clang did not find OpenMP.

Comments (4)

  1. Klaus Iglberger

    Hi Thorsten!

    Thanks for taking the time to create an issue for this possible error. In this case, however, it is a configuration problem. Using your favourite search engine to find out more about The Ordinal 968 was not found in DLL may lead you to this Stackoverflow article, which provides some help to install the right components.

    We have pushed commit a33a44c to get rid of the first warning (C4267). The remaining MSVC warnings have to do with the usual attempt of Microsoft to make you use their own implementation of some functions (see C4996 and cppreference).

    Best regards,

    Klaus!

  2. Thorsten Schmitz reporter

    I found the problem. It seems as if MKL came with a lib for OpenMP. As a consequence there were two OpenMP libraries due to the find_package(OpenMP) in CMake. It worked with Clang because Clang didn’t find OpenMP.

  3. Klaus Iglberger

    I’m glad you found the underlying problem. All operations, including the assignment, are handled by OpenMP, hence the problem also occurred there.

    Best regards,

    Klaus!

  4. Log in to comment