deephealthproject / eddl

European Distributed Deep Learning (EDDL) library. A general-purpose library initially developed to cover deep learning needs in healthcare use cases within the DeepHealth project.
https://deephealthproject.github.io/eddl/
MIT License
34 stars 10 forks source link

Build Windows with CMake and mingw64 #196

Closed gsutra closed 3 years ago

gsutra commented 4 years ago

Hi,

I cannot build eddl using CMake on windows. Configure and Generate from CMake are successful, but build fail with errors in std.h.

EDDL version

Tag 0.6.0 (02e37c0d).

Configuration CMake

The build error

[ 67%] Building CXX object src/CMakeFiles/eddl.dir/tensor/tensor_serialization.cpp.obj
cd /d C:\Users\****\****\****\code\eddl\build\src && C:\PROGRA~1\MINGW-~1\X86_64~1.0-P\mingw64\bin\G__~1.EXE  -DOpenMP_VERSION_MAJOR=4 -DcPROTO -Deddl_EXPORTS @CMakeFiles/eddl.dir/includes_CXX.rsp -O3   -fopenmp -std=gnu++11 -o CMakeFiles\eddl.dir\tensor\tensor_serialization.cpp.obj -c C:\Users\****\****\****\code\eddl\src\tensor\tensor_serialization.cpp
In file included from C:\Users\****\****\****\code\eddl\src\tensor\tensor_serialization.cpp:34:
C:/Users/****/****/****/code/eddl/src/tensor/stb/stb.h: In function 'FILE* stb__open_temp_file(char*, char*, const char*)':
C:/Users/****/****/****/code/eddl/src/tensor/stb/stb.h:464:37: error: cannot convert 'bool' to 'const char*'
 #define stb_p_mktemp(s)  (mktemp(s) != NULL)
                          ~~~~~~~~~~~^~~~~~~~
C:/Users/****/****/****/code/eddl/src/tensor/stb/stb.h:5605:23: note: in expansion of macro 'stb_p_mktemp'
         int fd = open(stb_p_mktemp(temp_name), O_RDWR);
                       ^~~~~~~~~~~~
In file included from C:/PROGRA~1/MINGW-~1/X86_64~1.0-P/mingw64/x86_64-w64-mingw32/include/unistd.h:10,
                 from C:/Users/****/****/****/code/eddl/build/cmake/third_party/zlib/include/zconf.h:477,
                 from C:/Users/****/****/****/code/eddl/build/cmake/third_party/zlib/include/zlib.h:34,
                 from C:/Users/****/****/****/code/eddl/include/eddl/tensor/cnpy/cnpy.h:16,
                 from C:/Users/****/****/****/code/eddl/include/eddl/tensor/tensor.h:26,
                 from C:\Users\****\****\****\code\eddl\src\tensor\tensor_serialization.cpp:12:
C:/PROGRA~1/MINGW-~1/X86_64~1.0-P/mingw64/x86_64-w64-mingw32/include/io.h:338:32: note:   initializing argument 1 of 'int open(const char*, int, ...)'
   int __cdecl open(const char *_Filename,int _OpenFlag,...)  __MINGW_ATTRIB_DEPRECATED_MSVC2005;
                    ~~~~~~~~~~~~^~~~~~~~~
In file included from C:\Users\****\****\****\code\eddl\src\tensor\tensor_serialization.cpp:34:
C:/Users/****/****/****/code/eddl/src/tensor/stb/stb.h: In function 'char** readdir_raw(char*, int, char*)':
C:/Users/****/****/****/code/eddl/src/tensor/stb/stb.h:6193:38: error: 'struct dirent' has no member named 'd_type'; did you mean 'd_name'?
                 is_subdir = !!(data->d_type & DT_DIR);
                                      ^~~~~~
                                      d_name
C:/Users/****/****/****/code/eddl/src/tensor/stb/stb.h:6193:47: error: 'DT_DIR' was not declared in this scope
                 is_subdir = !!(data->d_type & DT_DIR);
                                               ^~~~~~
C:/Users/****/****/****/code/eddl/src/tensor/stb/stb.h:6193:47: note: suggested alternative: 'DIR'
                 is_subdir = !!(data->d_type & DT_DIR);
salvacarrion commented 3 years ago

@gsutra is this already fixed? It seems to pass the Windows CI in develop

gsutra commented 3 years ago

Hi @salvacarrion

I ended up building with VC (usual compiler on windows) instead of MinGW. The issue with MinGW is not solved, but it might be a problem with MinGW itself, not a problem from EDDL. By the way MinGW is not supposed to be supported in EDDL, so you can close the issue.

Thanks !