cuda_memtest icon indicating copy to clipboard operation
cuda_memtest copied to clipboard

code does not compile in Visual Studio 2019

Open gfernval opened this issue 1 year ago • 5 comments

There is missing pthreads.h, sys\time.h, unistd.h in Visual Studio 2019, would like to have cuda_memtest running in Windows

gfernval avatar Jan 27 '24 19:01 gfernval

Thanks for reporting. Could you please provide a fix or point to the file where the include is missing? I checked cuda_memtest.h and cpp and both contain #include <pthread.h>

IMO the problem is that by default pthreads does not existis in Widows. You need to compile it your self or download a pre-compiled library. If we would refactore the code and use c++ threads the issue would be solved.

I do not have a Windows machine to test it.

psychocoderHPC avatar Jan 29 '24 16:01 psychocoderHPC

Currently, I do not have time to work on it. I will see if I find someone working on it.

psychocoderHPC avatar Jan 29 '24 16:01 psychocoderHPC

Thanks, besides pthread.h there are other issues like sys/time.h that does not exists in Windows, cmake generates sucessfully a makefile for Visual Studio 2019 (after installing Cuda libraries), but when build inside Visual Studio 2019 complains about pthread.h, sys/time.h,.. Could be such lines removed in order to make a command line utility runnable under Windows 7 64 bit? Don´t know enough about making such task. cuda-memtest compiles successfully without problems under Ubuntu Linux 20.04, I have checked it.

gfernval avatar Jan 29 '24 19:01 gfernval

Gould to known that sys/time.h is in the code too. If we would switch to C++17 both can be solved with C++ std::.

psychocoderHPC avatar Feb 01 '24 10:02 psychocoderHPC

I don´t know enough programming to remove all POSIX stuff from the source code, but the code as is depicted generates a valid makefile from cmake of Visual Studio 2019, problem is that when compiling under Visual Studio 2019 complais about pthreads.h, time.h, ...

gfernval avatar Feb 02 '24 08:02 gfernval