Skip to content

Commit b148675

Browse files
committed
Fixed Installation of Google's protobuf. Included links to library in bindings
1 parent 99779a4 commit b148675

2 files changed

Lines changed: 24 additions & 7 deletions

File tree

binding.gyp

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22
'targets': [{
33
'target_name': 'node-tensorflow',
44
'sources': ['src/api.cc'],
5-
"include_dirs" : [
5+
6+
'libraries' : [
7+
"<!@(pkg-config --libs protobuf)"
8+
],
9+
10+
'include_dirs' : [
611
# All c++ dependencies goes here
712
"src/includes",
813

@@ -13,19 +18,26 @@
1318
# Include NAN
1419
"<!(node -e \"require('nan')\")"
1520
],
21+
1622
"conditions": [
1723
[ "OS==\"mac\"", {
1824
"xcode_settings": {
1925
"OTHER_CFLAGS": [
2026
"-mmacosx-version-min=10.7",
2127
"-std=c++11",
22-
"-stdlib=libc++"
28+
"-stdlib=libc++",
29+
"<!@(pkg-config --cflags opencv)",
2330
],
2431
"GCC_ENABLE_CPP_RTTI": "YES",
2532
"GCC_ENABLE_CPP_EXCEPTIONS": "YES"
2633
}
2734
}]
2835
],
29-
"cflags!" : [ "-fno-exceptions"]
36+
'cflags': [
37+
"<!@(pkg-config --cflags protobuf)"
38+
],
39+
'cflags!': [
40+
"-fno-exceptions"
41+
]
3042
}]
3143
}

tools/install.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,15 @@ bazel build //tensorflow/core
258258
# Compile photobuf
259259
cd "google/protobuf"
260260
echo ""
261-
echo "= Compiling Google's protobuf"
262-
./autogen.sh
263-
make
264-
bazel build
261+
echo "= Installing Google's protobuf"
262+
if ! pkg-config protobuf --exists; then
263+
./autogen.sh
264+
make
265+
make check
266+
make install
267+
else
268+
echo "== Skipped. Already installed."
269+
fi
265270

266271
#
267272
# Copy essential files to ./src/includes

0 commit comments

Comments
 (0)