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

Silo build error on windows F_OK and R_OK undeclared #383

Open
cyrush opened this issue Jul 26, 2024 · 4 comments
Open

Silo build error on windows F_OK and R_OK undeclared #383

cyrush opened this issue Jul 26, 2024 · 4 comments
Assignees

Comments

@cyrush
Copy link
Member

cyrush commented Jul 26, 2024

4.11.1 using CMake Build System:

"C:\Users\cyrus\Documents\GitHub\ascent\scripts\build_ascent\tpls_silo\build\silo-4.11.1\ALL_BUILD.vcxproj" (default target) (1) ->
"C:\Users\cyrus\Documents\GitHub\ascent\scripts\build_ascent\tpls_silo\build\silo-4.11.1\copy_deps.vcxproj" (default target) (3) ->
"C:\Users\cyrus\Documents\GitHub\ascent\scripts\build_ascent\tpls_silo\build\silo-4.11.1\silo.vcxproj" (default target) (4) ->
(ClCompile target) ->
  C:\Users\cyrus\Documents\GitHub\ascent\scripts\build_ascent\tpls_silo\source\Silo-4.11.1\src\netcdf\silo_netcdf.c(213,10): error C2065: 'F_OK': undeclared iden
tifier [C:\Users\cyrus\Documents\GitHub\ascent\scripts\build_ascent\tpls_silo\build\silo-4.11.1\silo.vcxproj]
  C:\Users\cyrus\Documents\GitHub\ascent\scripts\build_ascent\tpls_silo\source\Silo-4.11.1\src\netcdf\silo_netcdf.c(217,15): error C2065: 'R_OK': undeclared iden
tifier [C:\Users\cyrus\Documents\GitHub\ascent\scripts\build_ascent\tpls_silo\build\silo-4.11.1\silo.vcxproj]
  C:\Users\cyrus\Documents\GitHub\ascent\scripts\build_ascent\tpls_silo\source\Silo-4.11.1\src\pdb_drv\silo_pdb.c(2106,10): error C2065: 'F_OK': undeclared ident
ifier [C:\Users\cyrus\Documents\GitHub\ascent\scripts\build_ascent\tpls_silo\build\silo-4.11.1\silo.vcxproj]
  C:\Users\cyrus\Documents\GitHub\ascent\scripts\build_ascent\tpls_silo\source\Silo-4.11.1\src\pdb_drv\silo_pdb.c(2110,17): error C2065: 'R_OK': undeclared ident
ifier [C:\Users\cyrus\Documents\GitHub\ascent\scripts\build_ascent\tpls_silo\build\silo-4.11.1\silo.vcxproj]
  C:\Users\cyrus\Documents\GitHub\ascent\scripts\build_ascent\tpls_silo\source\Silo-4.11.1\src\taurus\silo_taurus.c(240,10): error C2065: 'F_OK': undeclared iden
tifier [C:\Users\cyrus\Documents\GitHub\ascent\scripts\build_ascent\tpls_silo\build\silo-4.11.1\silo.vcxproj]
  C:\Users\cyrus\Documents\GitHub\ascent\scripts\build_ascent\tpls_silo\source\Silo-4.11.1\src\taurus\silo_taurus.c(244,15): error C2065: 'R_OK': undeclared iden
tifier [C:\Users\cyrus\Documents\GitHub\ascent\scripts\build_ascent\tpls_silo\build\silo-4.11.1\silo.vcxproj]

    0 Warning(s)
    6 Error(s)
@cyrush
Copy link
Member Author

cyrush commented Jul 26, 2024

seems like we need windows specific case to include
silo_win32_compatibility.h

In silo_netcff silo_taurus.
It does seem included by some pdb logic will explore more.

@cyrush
Copy link
Member Author

cyrush commented Jul 26, 2024

I am puzzled, silo_win32_compatibility.h should be included and solve this issue.
I tried to include it again in silo_taurus, but that didn't help.

Directly defining did help:

#ifdef _WIN32
/* Define modes for the call to _access if they are not already defined. */
#ifndef F_OK
#define F_OK   0
#endif

#ifndef W_OK
#define W_OK   2
#endif

#ifndef R_OK
#define R_OK   4
#endif

#endif

But I hit more issues later in the build.

@biagas
Copy link
Collaborator

biagas commented Jul 29, 2024

silo_win32_compatibility.h needs a patch:

--- C:\Users\biagas2\AppData\Local\Temp\TortoiseGit\silo_win32_compatibility-c9f584c5.000.h	2024-07-29 12:25:23.000000000 -0700
+++ C:\B_Silo\Silo\src\silo\silo_win32_compatibility.h	2024-07-29 12:25:39.000000000 -0700
@@ -1,7 +1,7 @@
-#ifdef WIN32
+#ifdef _WIN32
 #ifndef SILO_WIN32_COMPATIBILITY
 #define SILO_WIN32_COMPATIBILITY
 #include <io.h>  /* Include Windows IO */
 #include <errno.h>
 #include <sys\types.h>
 #include <sys\stat.h>

@cyrush
Copy link
Member Author

cyrush commented Jul 29, 2024

thanks @biagas!
This also solved some other compile issues w/ browser that weren't immediately obvious they were related to the same windows def.

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

2 participants