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

Visual Studio runtime libraries are linked dynamically #59

Closed
gpu opened this issue May 13, 2016 · 6 comments
Closed

Visual Studio runtime libraries are linked dynamically #59

gpu opened this issue May 13, 2016 · 6 comments

Comments

@gpu
Copy link
Contributor

gpu commented May 13, 2016

This may be considered as a non-issue for you, but the Visual Studio runtime libraries are currently linked dynamically. This basically means that someone who wants to use the compiled CLBlast DLL may encounter an error message saying that "MSVCP140.DLL" can not be found.

I'm also not so familiar with the details, but I encountered the same problem in JCuda. A bit of websearching led to https://cmake.org/Wiki/CMake_FAQ#How_can_I_build_my_MSVC_application_with_a_static_runtime.3F . It boils down to some odd linker flag in the end, and I eventually fixed it by defining this file https://github.com/jcuda/jcuda-common/blob/master/JCudaCommon_CMake_flags.txt (which refers to https://github.com/jcuda/jcuda-common/blob/master/CMake_c_flag_overrides.cmake and https://github.com/jcuda/jcuda-common/blob/master/CMake_cxx_flag_overrides.cmake ), and including it before any project definition (this is important). For example, as in https://github.com/jcuda/jcufft/blob/master/JCufftJNI/CMakeLists.txt

Sorry, I know that things like this are somewhat annoying (i.e. distressingly non-academic), but I wanted to point it out.

@blueberry
Copy link

@CNugteren do you have any estimate on this? I am about to release Neanderthal, and would prefer to wait for this to be solved so that @gpu can release 0.7.1 of JOCLBlast, but if it is not in the near plans, it is better to know, to go with 0.7.0 anyway...

@CNugteren
Copy link
Owner

CNugteren commented May 18, 2016

Actually, the 0.7.1 release was just made. It includes the fix suggested in this issue. I haven't tested it on a system without Visual Studio installed, but the compiled DLLs are a little bit bigger, so hopefully they now include the necessary runtime library functions.

Could you test if this is resolved or not?

@blueberry
Copy link

That is fantastic! Thanks!

@blueberry
Copy link

Unfortunately, I cannot test it because I do not have any Windows machine. I hope @gpu will test that soon.

@gpu
Copy link
Contributor Author

gpu commented May 19, 2016

I'm not sure whether I can test it today, but hopefully tomorrow. Still, I have to figure out how to test it appropriately. At home, I have installed VS2015, so the MSVCP140.DLL is lingering around somewhere on my system. (I could probably try to find and rename it, to provoke an error with the current version, and then see if the error still appears with the new version - or I can try it in my office, but have to see whether I can schedule this before the weekend)

@gpu
Copy link
Contributor Author

gpu commented May 20, 2016

I can confirm that 0.7.1 builds out-of-the-box with VS2015, and the resulting DLL does no longer have a dependency to MSVCP140.DLL according to "Dependency Walker", and I re-checked that when (temporarily) removing the MSVCP140.DLL, the sgemm sample in 0.7.0 caused an error message, but works properly in 0.7.1.
Thanks for your efforts, I'll close this one now.

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

3 participants