claymore icon indicating copy to clipboard operation
claymore copied to clipboard

cmake error with "fopen_s"

Open Jingzheng-Li opened this issue 1 year ago • 2 comments

Hi there, I have recently encountered a cmake error that: "error: identifier 'fopen_s' is undefined" in the process of compiling gmpm. I didn't quite understand the cause of the error. How can I solve this problem? Thank you so much in advance

And my system info should be as: gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0, nvidia driver Version: 515.65.01, CUDA Version: 11.7

Jingzheng-Li avatar May 17 '23 09:05 Jingzheng-Li

Might be just an include issue. Try including stdio.h in gmpm.cu. (But you are lucky if that's the only issue, newest version is not tested agains gcc.)

Destranix avatar May 22 '23 14:05 Destranix

#include <stdio.h>

#ifdef __unix #define fopen_s(pFile,filename,mode) ((*(pFile))=fopen((filename),(mode)))==NULL #endif

Try add these lines.

DrChiZhang avatar Feb 20 '24 13:02 DrChiZhang