prabindh / darknet

Convolutional Neural Networks
http://pjreddie.com/darknet/
Other
122 stars 46 forks source link

Fix macOS compile issues #49

Closed inokii closed 7 years ago

inokii commented 7 years ago

Builds on macOS Sierra (10.12) failed for me with the following error message. My changes resolve the build issue and enhance the arapaho Makefile.

./src/data.c:12:1: fatal error: unknown type name 'pthread_mutex_t'; did you
      mean 'pthread_attr_t'?
pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
^~~~~~~~~~~~~~~
pthread_attr_t
/usr/include/sys/_pthread/_pthread_attr_t.h:30:33: note: 'pthread_attr_t'
      declared here
typedef __darwin_pthread_attr_t pthread_attr_t;
                                ^
1 error generated.
make: *** [obj-cpp/data.o] Error 1
prabindh commented 7 years ago

Thanks. Could you please indicate - Which Mac OS version, toolchain, and CUDA version this has been tested with ?

inokii commented 7 years ago

The changes were tested on macOS 10.12.6 and have not been tested with CUDA on macOS as I don't have the appropriate hardware. The code changes have been successfully tested on Linux with CUDA v8.0.61 (deviceQuery reports CUDA Driver Version = 9.0, CUDA Runtime Version = 8.0).

$ g++ --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.0.0 (clang-900.0.37)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
inokii commented 7 years ago

@prabindh Do you need anything else to help get this PR merged?

prabindh commented 7 years ago

No, I just need to check the build on linux/windows before merging. Thanks for the patience.

prabindh commented 7 years ago

Merged, tagged as v5.3. Thanks !

prabindh commented 7 years ago

https://github.com/prabindh/darknet/tree/v5.3