tensorflow: Failure to build on OS/X
I have the following error when building on OS/X:
./tensorflow/core/platform/default/mutex.h:25:10: fatal error: 'nsync_cv.h' file not found
#include "nsync_cv.h"
^
1 error generated.
Earlier on I get the following warning:
WARNING: /Users/davidn/workspace/tensorflowview/tensorflow/tensorflow/core/BUILD:1632:1: in includes attribute of cc_library rule //tensorflow/core:framework_headers_lib: '../../external/nsync/public' resolves to 'external/nsync/public' not below the relative path of its package 'tensorflow/core'. This will be an error in the future. Since this rule was created by the macro 'cc_header_only_library', the error might have been caused by the macro implementation in /Users/davidn/workspace/tensorflowview/tensorflow/tensorflow/core/BUILD:1632:1.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 19 (3 by maintainers)
Commits related to this issue
- to suppress the [tf-1.4 issue](https://github.com/tensorflow/tensorflow/issues/12482) — committed to stoneyang/Sparse-Winograd-CNN by stoneyang 6 years ago
copying
nsync*.hfromdist-packages/external/nsync/public(orhttps://github.com/google/nsync/tree/master/public) to/usr/includealso does the trick without modifying tensorflow files.Hi, I came up with a solution. Taking into account that I was able to compile everything from source on different machines, I just changed the file mutex.h for the following code:
Can you edit your post and show specs of machine, tensorflow version & bazel. Thanks (Just to detect where can be the mistake).
I changed the file
tensorflow/core/platform/default/mutex.hby adding the relative path as prefix ofnsync_cv.handnsync_mu.hto fix the issue, as follows:I feel as though this issue should be re-opened, because a fresh clone of master (as of b20ec5c461031f9375274cf026a7dfff0f903acc) results in the Aforementioned NSync compilation bug when trying to integrate libtensorflow into other apps - the only working solution was to use @alc1218 's variant of mutex.h - which is a breaking change to the codebase.
Thank you.
Had the same issue: search for nsync_cv.h file using:
sudo find / -name nsync_cv.hthen add it in the filemutex.h#include "tensorflow/contrib/makefile/downloads/nsync/public/nsync_cv.h"#include "tensorflow/contrib/makefile/downloads/nsync/public/nsync_mu.h"If you get linker error after above step try this: https://github.com/tensorflow/tensorflow/issues/12904#issuecomment-328234880