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

cmake error with "fopen_s" #8

Open
Jingzheng-Li opened this issue May 17, 2023 · 2 comments
Open

cmake error with "fopen_s" #8

Jingzheng-Li opened this issue May 17, 2023 · 2 comments

Comments

@Jingzheng-Li
Copy link

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

@Destranix
Copy link

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

@DrChiZhang
Copy link

#include <stdio.h>

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

Try add these lines.

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