ComputationalRadiationPhysics / cuda_memtest

Fork of CUDA GPU memtest :eyeglasses:
http://sourceforge.net/projects/cudagpumemtest
114 stars 32 forks source link

code does not compile in Visual Studio 2019 #47

Open gfernval opened 10 months ago

gfernval commented 10 months ago

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

psychocoderHPC commented 10 months ago

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 commented 10 months ago

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

gfernval commented 10 months ago

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.

psychocoderHPC commented 10 months ago

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::.

gfernval commented 10 months ago

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, ...