bennetthardwick / darknet.js

A NodeJS wrapper of pjreddie's darknet / yolo.
65 stars 27 forks source link

Unable to install v3 on mac #32

Open pedroslopez opened 4 years ago

pedroslopez commented 4 years ago

Trying to install the latest version (v3) on macOS Mojave results in an error:

ld: library not found for -l:libdarknet.so
clang: fatal error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [uselib] Error 1
Could not compile darknet
npm WARN darknet2@1.0.0 No description
npm WARN darknet2@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! darknet@3.0.0 install: `./install-script.sh && node-gyp rebuild`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the darknet@3.0.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Installing the previous version (v2.0.17) works just fine.

bennetthardwick commented 4 years ago

Interesting. Can you tell me what ls node_modules/dkarnet/ | grep libdarknet says? Does the libdarknet.so file exist?

pedroslopez commented 4 years ago

Well, the error is in the installation step, so node_modules/darknet does not exist 😛

bennetthardwick commented 4 years ago

Lol, can you clone the repo and run npm install and see if you get the same thing

zaoldyeck commented 3 years ago

Hi @bennetthardwick

I have cloned this repo and run $npm install. It shows ld: library not found for -l:libdarknet.so. Could you help me please? My OS is Big Sur version 11.1, and device is Macbook Air6,2(x64).

bennetthardwick commented 3 years ago

Hey @zaoldyeck after building it should have created a libdarknet file, can you tell me what extension this has (maybe libdarknet.a)? I don't have a Mac so I can't check unfortunately.

owocowyy commented 3 years ago

Hi @bennetthardwick I got the same problem on my Mac. After cloning the repo and running npm install the console shows ld: library not found for -l:libdarknet.so. In the lib folder I see a darknet.ts file.

macOS BigSur 11.2.3 (Intel)

bennetthardwick commented 3 years ago

Hey @owocowyy! Can you see anything that says libdarknet like libdarknet.so or libdarknet.a in the root directory

I think the issue is that Mac generates a different kind of libdarknet than on Linux.

owocowyy commented 3 years ago

Sorry for my late response @bennetthardwick

The only file with libdarknet name in it is libdarknet.so in darknet folder.

README.md       darknet         lib         package.json
binding.gyp     examples        node_modules        spec
cppsrc          install-script.sh   package-lock.json   tsconfig.json

Those are files in the root folder of the repo.

3rdparty        backup          darknet.py      json_mjpeg_streams.sh   src
CMakeLists.txt      build           darknet_images.py   libdarknet.so       vcpkg.json
DarknetConfig.cmake.in  build.ps1       darknet_video.py    net_cam_v3.sh       video_yolov3.sh
LICENSE         build.sh        data            net_cam_v4.sh       video_yolov4.sh
Makefile        cfg         image_yolov3.sh     obj
Makefile-e      cmake           image_yolov4.sh     results
README.md       darknet         include         scripts

Those are the files in the darknet folder

bennetthardwick commented 3 years ago

Hmm, that's a bit weird - no clue why it's not working. I tried to fix it with darknet@3.1.6 - can you give it a go? :pray:

owocowyy commented 3 years ago

I got error like this:

ld: library not found for -l:libdarknet.so
clang: fatal error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [uselib] Error 1
Could not compile darknet

This is the debug log

0 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'install' ]
1 info using npm@7.7.6
2 info using node@v14.15.0
3 timing npm:load:whichnode Completed in 2ms
4 timing config:load:defaults Completed in 1ms
5 timing config:load:file:/usr/local/lib/node_modules/npm/npmrc Completed in 1ms
6 timing config:load:builtin Completed in 1ms
7 timing config:load:cli Completed in 1ms
8 timing config:load:env Completed in 1ms
9 timing config:load:file:/Users/Dawid/Desktop/darknet/.npmrc Completed in 0ms
10 timing config:load:project Completed in 0ms
11 timing config:load:file:/Users/Dawid/.npmrc Completed in 0ms
12 timing config:load:user Completed in 0ms
13 timing config:load:file:/usr/local/etc/npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:validate Completed in 1ms
16 timing config:load:setEnvs Completed in 0ms
17 timing config:load Completed in 5ms
18 timing npm:load:configload Completed in 5ms
19 timing npm:load:setTitle Completed in 0ms
20 timing npm:load:setupLog Completed in 1ms
21 timing npm:load:cleanupLog Completed in 2ms
22 timing npm:load:configScope Completed in 0ms
23 timing npm:load:projectScope Completed in 1ms
24 timing npm:load Completed in 11ms
25 timing config:load:flatten Completed in 2ms
26 timing arborist:ctor Completed in 1ms
27 timing idealTree:init Completed in 132ms
28 timing idealTree:userRequests Completed in 0ms
29 silly idealTree buildDeps
30 timing idealTree:#root Completed in 0ms
31 timing idealTree:buildDeps Completed in 2ms
32 timing idealTree:fixDepFlags Completed in 0ms
33 timing idealTree Completed in 135ms
34 timing reify:loadTrees Completed in 145ms
35 timing reify:diffTrees Completed in 4ms
36 silly reify moves {}
37 timing reify:retireShallow Completed in 0ms
38 timing reify:createSparse Completed in 30ms
39 timing reify:loadBundles Completed in 0ms
40 http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/advisories/bulk 769ms
41 timing auditReport:getReport Completed in 770ms
42 timing auditReport:init Completed in 0ms
43 timing reify:audit Completed in 771ms
44 timing reifyNode:node_modules/static-extend Completed in 782ms
45 timing reifyNode:node_modules/object-copy Completed in 781ms
46 timing reifyNode:node_modules/osenv Completed in 783ms
47 timing reifyNode:node_modules/get-value Completed in 782ms
48 timing reifyNode:node_modules/copy-descriptor Completed in 783ms
49 timing reifyNode:node_modules/wrappy Completed in 795ms
50 timing reifyNode:node_modules/wide-align Completed in 795ms
51 timing reifyNode:node_modules/unset-value/node_modules/has-values Completed in 795ms
52 timing reifyNode:node_modules/use Completed in 796ms
53 timing reifyNode:node_modules/unset-value Completed in 796ms
54 timing reifyNode:node_modules/unset-value/node_modules/has-value/node_modules/isobject Completed in 795ms
55 timing reifyNode:node_modules/unset-value/node_modules/has-value Completed in 796ms
56 timing reifyNode:node_modules/to-regex-range Completed in 796ms
57 timing reifyNode:node_modules/union-value Completed in 796ms
58 timing reifyNode:node_modules/to-object-path/node_modules/kind-of Completed in 796ms
59 timing reifyNode:node_modules/to-regex Completed in 796ms
60 timing reifyNode:node_modules/to-object-path Completed in 797ms
61 timing reifyNode:node_modules/strip-ansi Completed in 796ms
62 timing reifyNode:node_modules/strip-json-comments Completed in 797ms
63 timing reifyNode:node_modules/string-width Completed in 797ms
64 timing reifyNode:node_modules/snapdragon-util/node_modules/kind-of Completed in 797ms
65 timing reifyNode:node_modules/static-extend/node_modules/define-property Completed in 798ms
66 timing reifyNode:node_modules/snapdragon-node/node_modules/define-property Completed in 797ms
67 timing reifyNode:node_modules/snapdragon-node/node_modules/is-descriptor Completed in 799ms
68 timing reifyNode:node_modules/snapdragon/node_modules/define-property Completed in 798ms
69 timing reifyNode:node_modules/snapdragon/node_modules/extend-shallow Completed in 798ms
70 timing reifyNode:node_modules/set-value/node_modules/extend-shallow Completed in 798ms
71 timing reifyNode:node_modules/snapdragon-node/node_modules/is-data-descriptor Completed in 799ms
72 timing reifyNode:node_modules/simple-get Completed in 799ms
73 timing reifyNode:node_modules/set-value Completed in 799ms
74 timing reifyNode:node_modules/snapdragon-node/node_modules/is-accessor-descriptor Completed in 799ms
75 timing reifyNode:node_modules/repeat-string Completed in 799ms
76 timing reifyNode:node_modules/repeat-element Completed in 799ms
77 timing reifyNode:node_modules/regex-not Completed in 799ms
78 timing reifyNode:node_modules/posix-character-classes Completed in 799ms
79 timing reifyNode:node_modules/process-nextick-args Completed in 800ms
80 timing reifyNode:node_modules/pascalcase Completed in 800ms
81 timing reifyNode:node_modules/path-is-absolute Completed in 800ms
82 timing reifyNode:node_modules/once Completed in 799ms
83 timing reifyNode:node_modules/os-tmpdir Completed in 800ms
84 timing reifyNode:node_modules/path-dirname Completed in 800ms
85 timing reifyNode:node_modules/object-copy/node_modules/kind-of Completed in 799ms
86 timing reifyNode:node_modules/object-copy/node_modules/define-property Completed in 799ms
87 timing reifyNode:node_modules/os-homedir Completed in 801ms
88 timing reifyNode:node_modules/object-visit Completed in 800ms
89 timing reifyNode:node_modules/object.pick Completed in 800ms
90 timing reifyNode:node_modules/number-is-nan Completed in 800ms
91 timing reifyNode:node_modules/oauth-sign Completed in 800ms
92 timing reifyNode:node_modules/npm-packlist Completed in 800ms
93 timing reifyNode:node_modules/object-assign Completed in 800ms
94 timing reifyNode:node_modules/npm-bundled Completed in 800ms
95 timing reifyNode:node_modules/ms Completed in 799ms
96 timing reifyNode:node_modules/needle/node_modules/ms Completed in 800ms
97 timing reifyNode:node_modules/mixin-deep Completed in 800ms
98 timing reifyNode:node_modules/map-visit Completed in 800ms
99 timing reifyNode:node_modules/map-cache Completed in 800ms
100 timing reifyNode:node_modules/merge2 Completed in 801ms
101 timing reifyNode:node_modules/is-number/node_modules/kind-of Completed in 800ms
102 timing reifyNode:node_modules/is-number Completed in 800ms
103 timing reifyNode:node_modules/is-descriptor Completed in 800ms
104 timing reifyNode:node_modules/is-extglob Completed in 800ms
105 timing reifyNode:node_modules/is-fullwidth-code-point Completed in 801ms
106 timing reifyNode:node_modules/is-glob Completed in 801ms
107 timing reifyNode:node_modules/is-windows Completed in 801ms
108 timing reifyNode:node_modules/is-data-descriptor Completed in 801ms
109 timing reifyNode:node_modules/is-accessor-descriptor/node_modules/kind-of Completed in 801ms
110 timing reifyNode:node_modules/is-extendable Completed in 801ms
111 timing reifyNode:node_modules/is-data-descriptor/node_modules/kind-of Completed in 801ms
112 timing reifyNode:node_modules/is-accessor-descriptor Completed in 801ms
113 timing reifyNode:node_modules/inflight Completed in 801ms
114 timing reifyNode:node_modules/has-values/node_modules/kind-of Completed in 801ms
115 timing reifyNode:node_modules/has-value Completed in 801ms
116 timing reifyNode:node_modules/ignore-walk Completed in 801ms
117 timing reifyNode:node_modules/has-values Completed in 801ms
118 timing reifyNode:node_modules/has-unicode Completed in 801ms
119 timing reifyNode:node_modules/glob-parent/node_modules/is-glob Completed in 801ms
120 timing reifyNode:node_modules/ini Completed in 801ms
121 timing reifyNode:node_modules/glob-parent Completed in 801ms
122 timing reifyNode:node_modules/fragment-cache Completed in 802ms
123 timing reifyNode:node_modules/fill-range/node_modules/extend-shallow Completed in 802ms
124 timing reifyNode:node_modules/extglob/node_modules/is-descriptor Completed in 801ms
125 timing reifyNode:node_modules/for-in Completed in 802ms
126 timing reifyNode:node_modules/extglob/node_modules/is-data-descriptor Completed in 801ms
127 timing reifyNode:node_modules/fs-minipass Completed in 802ms
128 timing reifyNode:node_modules/extglob/node_modules/define-property Completed in 801ms
129 timing reifyNode:node_modules/extglob/node_modules/is-accessor-descriptor Completed in 801ms
130 timing reifyNode:node_modules/extglob/node_modules/extend-shallow Completed in 801ms
131 timing reifyNode:node_modules/extend-shallow Completed in 801ms
132 timing reifyNode:node_modules/expand-brackets/node_modules/define-property Completed in 802ms
133 timing reifyNode:node_modules/expand-brackets/node_modules/extend-shallow Completed in 802ms
134 timing reifyNode:node_modules/define-property/node_modules/is-descriptor Completed in 802ms
135 timing reifyNode:node_modules/define-property/node_modules/is-data-descriptor Completed in 802ms
136 timing reifyNode:node_modules/define-property/node_modules/is-accessor-descriptor Completed in 802ms
137 timing reifyNode:node_modules/decode-uri-component Completed in 802ms
138 timing reifyNode:node_modules/collection-visit Completed in 803ms
139 timing reifyNode:node_modules/chownr Completed in 803ms
140 timing reifyNode:node_modules/class-utils/node_modules/define-property Completed in 803ms
141 timing reifyNode:node_modules/code-point-at Completed in 803ms
142 timing reifyNode:node_modules/base/node_modules/is-descriptor Completed in 803ms
143 timing reifyNode:node_modules/braces/node_modules/extend-shallow Completed in 803ms
144 timing reifyNode:node_modules/base/node_modules/define-property Completed in 802ms
145 timing reifyNode:node_modules/base/node_modules/is-accessor-descriptor Completed in 803ms
146 timing reifyNode:node_modules/brace-expansion Completed in 803ms
147 timing reifyNode:node_modules/base/node_modules/is-data-descriptor Completed in 804ms
148 timing reifyNode:node_modules/array-unique Completed in 803ms
149 timing reifyNode:node_modules/assign-symbols Completed in 803ms
150 timing reifyNode:node_modules/arr-union Completed in 803ms
151 timing reifyNode:node_modules/abbrev Completed in 803ms
152 timing reifyNode:node_modules/ansi-regex Completed in 803ms
153 timing reifyNode:node_modules/arr-diff Completed in 804ms
154 timing reifyNode:node_modules/aproba Completed in 805ms
155 timing reifyNode:node_modules/arr-flatten Completed in 805ms
156 timing reifyNode:node_modules/tunnel-agent Completed in 814ms
157 timing reifyNode:node_modules/split-string Completed in 814ms
158 timing reifyNode:node_modules/set-blocking Completed in 814ms
159 timing reifyNode:node_modules/mixin-deep/node_modules/is-extendable Completed in 812ms
160 timing reifyNode:node_modules/minizlib Completed in 813ms
161 timing reifyNode:node_modules/minipass Completed in 813ms
162 timing reifyNode:node_modules/mime-types Completed in 813ms
163 timing reifyNode:node_modules/mimic-response Completed in 813ms
164 timing reifyNode:node_modules/isobject Completed in 814ms
165 timing reifyNode:node_modules/is-typedarray Completed in 814ms
166 timing reifyNode:node_modules/is-plain-object Completed in 814ms
167 timing reifyNode:node_modules/is-descriptor/node_modules/kind-of Completed in 814ms
168 timing reifyNode:node_modules/inherits Completed in 814ms
169 timing reifyNode:node_modules/forever-agent Completed in 814ms
170 timing reifyNode:node_modules/fill-range Completed in 815ms
171 timing reifyNode:node_modules/extend-shallow/node_modules/is-extendable Completed in 814ms
172 timing reifyNode:node_modules/define-property Completed in 815ms
173 timing reifyNode:node_modules/env-paths Completed in 815ms
174 timing reifyNode:node_modules/decompress-response Completed in 816ms
175 timing reifyNode:node_modules/console-control-strings Completed in 816ms
176 timing reifyNode:node_modules/caseless Completed in 816ms
177 timing reifyNode:node_modules/component-emitter Completed in 817ms
178 timing reifyNode:node_modules/cache-base Completed in 817ms
179 timing reifyNode:node_modules/balanced-match Completed in 816ms
180 timing reifyNode:node_modules/class-utils Completed in 817ms
181 timing reifyNode:node_modules/aws-sign2 Completed in 816ms
182 timing reifyNode:node_modules/assert-plus Completed in 816ms
183 timing reifyNode:node_modules/base Completed in 818ms
184 timing reifyNode:node_modules/util-deprecate Completed in 827ms
185 timing reifyNode:node_modules/yallist Completed in 829ms
186 timing reifyNode:node_modules/snapdragon-node Completed in 827ms
187 timing reifyNode:node_modules/signal-exit Completed in 826ms
188 timing reifyNode:node_modules/rimraf Completed in 827ms
189 timing reifyNode:node_modules/minimatch Completed in 826ms
190 timing reifyNode:node_modules/kind-of Completed in 827ms
191 timing reifyNode:node_modules/is-buffer Completed in 827ms
192 timing reifyNode:node_modules/fs.realpath Completed in 826ms
193 timing reifyNode:node_modules/combined-stream Completed in 829ms
194 timing reifyNode:node_modules/which Completed in 839ms
195 timing reifyNode:node_modules/urix Completed in 840ms
196 timing reifyNode:node_modules/string_decoder Completed in 839ms
197 timing reifyNode:node_modules/simple-concat Completed in 839ms
198 timing reifyNode:node_modules/safe-buffer Completed in 839ms
199 timing reifyNode:node_modules/npmlog Completed in 838ms
200 timing reifyNode:node_modules/mkdirp Completed in 838ms
201 timing reifyNode:node_modules/har-validator Completed in 837ms
202 timing reifyNode:node_modules/glob-to-regexp Completed in 837ms
203 timing reifyNode:node_modules/graceful-fs Completed in 837ms
204 timing reifyNode:node_modules/getpass Completed in 838ms
205 timing reifyNode:node_modules/delayed-stream Completed in 838ms
206 timing reifyNode:node_modules/deep-extend Completed in 838ms
207 timing reifyNode:node_modules/snapdragon-util Completed in 847ms
208 timing reifyNode:node_modules/sax Completed in 846ms
209 timing reifyNode:node_modules/punycode Completed in 846ms
210 timing reifyNode:node_modules/jsprim Completed in 845ms
211 timing reifyNode:node_modules/isarray Completed in 845ms
212 timing reifyNode:node_modules/bcrypt-pbkdf Completed in 845ms
213 timing reifyNode:node_modules/safe-regex Completed in 852ms
214 timing reifyNode:node_modules/ret Completed in 852ms
215 timing reifyNode:node_modules/delegates Completed in 849ms
216 timing reifyNode:node_modules/core-util-is Completed in 849ms
217 timing reifyNode:node_modules/concat-map Completed in 849ms
218 timing reifyNode:node_modules/call-me-maybe Completed in 849ms
219 timing reifyNode:node_modules/safer-buffer Completed in 857ms
220 timing reifyNode:node_modules/resolve-url Completed in 857ms
221 timing reifyNode:node_modules/nopt Completed in 856ms
222 timing reifyNode:node_modules/isstream Completed in 855ms
223 timing reifyNode:node_modules/isexe Completed in 856ms
224 timing reifyNode:node_modules/extend Completed in 854ms
225 timing reifyNode:node_modules/detect-libc Completed in 855ms
226 timing reifyNode:node_modules/aws4 Completed in 854ms
227 timing reifyNode:node_modules/verror Completed in 865ms
228 timing reifyNode:node_modules/semver Completed in 863ms
229 timing reifyNode:node_modules/jsbn Completed in 862ms
230 timing reifyNode:node_modules/expand-brackets Completed in 860ms
231 timing reifyNode:node_modules/braces Completed in 861ms
232 timing reifyNode:node_modules/are-we-there-yet Completed in 860ms
233 timing reifyNode:node_modules/source-map-resolve Completed in 869ms
234 timing reifyNode:node_modules/json-stringify-safe Completed in 867ms
235 timing reifyNode:node_modules/glob Completed in 866ms
236 timing reifyNode:node_modules/extsprintf Completed in 866ms
237 timing reifyNode:node_modules/ecc-jsbn Completed in 866ms
238 timing reifyNode:node_modules/source-map-url Completed in 877ms
239 timing reifyNode:node_modules/snapdragon Completed in 877ms
240 timing reifyNode:node_modules/json-schema-traverse Completed in 875ms
241 timing reifyNode:node_modules/asn1 Completed in 873ms
242 timing reifyNode:node_modules/fast-deep-equal Completed in 879ms
243 timing reifyNode:node_modules/atob Completed in 877ms
244 timing reifyNode:node_modules/extglob Completed in 882ms
245 timing reifyNode:node_modules/dashdash Completed in 882ms
246 timing reifyNode:node_modules/rc Completed in 888ms
247 timing reifyNode:node_modules/needle/node_modules/debug Completed in 888ms
248 timing reifyNode:node_modules/nanomatch Completed in 887ms
249 timing reifyNode:node_modules/micromatch Completed in 888ms
250 timing reifyNode:node_modules/@nodelib/fs.stat Completed in 887ms
251 timing reifyNode:node_modules/tough-cookie Completed in 896ms
252 timing reifyNode:node_modules/http-signature Completed in 895ms
253 timing reifyNode:node_modules/form-data Completed in 896ms
254 timing reifyNode:node_modules/mime-db Completed in 899ms
255 timing reifyNode:node_modules/performance-now Completed in 902ms
256 timing reifyNode:node_modules/npm-normalize-package-bin Completed in 902ms
257 timing reifyNode:node_modules/asynckit Completed in 899ms
258 timing reifyNode:node_modules/fast-json-stable-stringify Completed in 902ms
259 timing reifyNode:node_modules/debug Completed in 901ms
260 timing reifyNode:node_modules/uuid Completed in 912ms
261 timing reifyNode:node_modules/tweetnacl Completed in 913ms
262 timing reifyNode:node_modules/minimist Completed in 911ms
263 timing reifyNode:node_modules/har-schema Completed in 909ms
264 timing reifyNode:node_modules/gauge Completed in 910ms
265 timing reifyNode:node_modules/jasmine Completed in 914ms
266 timing reifyNode:node_modules/@mrmlnc/readdir-enhanced Completed in 912ms
267 timing reifyNode:node_modules/qs Completed in 923ms
268 timing reifyNode:node_modules/request Completed in 925ms
269 timing reifyNode:node_modules/readable-stream Completed in 928ms
270 timing reifyNode:node_modules/psl Completed in 930ms
271 timing reifyNode:node_modules/tar Completed in 937ms
272 timing reifyNode:node_modules/iconv-lite Completed in 938ms
273 timing reifyNode:node_modules/node-pre-gyp Completed in 944ms
274 timing reifyNode:node_modules/json-schema Completed in 949ms
275 timing reifyNode:node_modules/needle Completed in 966ms
276 timing reifyNode:node_modules/sshpk Completed in 971ms
277 timing reifyNode:node_modules/source-map Completed in 974ms
278 timing reifyNode:node_modules/nan Completed in 991ms
279 timing reifyNode:node_modules/canvas Completed in 989ms
280 timing reifyNode:node_modules/jasmine-core Completed in 995ms
281 timing reifyNode:node_modules/uri-js Completed in 1013ms
282 timing reifyNode:node_modules/@types/node Completed in 1006ms
283 timing reifyNode:node_modules/fast-glob Completed in 1010ms
284 timing reifyNode:node_modules/node-addon-api Completed in 1016ms
285 timing reifyNode:node_modules/ajv Completed in 1019ms
286 timing reifyNode:node_modules/node-gyp Completed in 1049ms
287 timing reifyNode:node_modules/typescript Completed in 1369ms
288 timing reify:unpack Completed in 1371ms
289 timing reify:unretire Completed in 1ms
290 timing build:queue Completed in 23ms
291 timing build:link:node_modules/atob Completed in 6ms
292 timing build:link:node_modules/detect-libc Completed in 7ms
293 timing build:link:node_modules/needle Completed in 6ms
294 timing build:link:node_modules/node-gyp Completed in 6ms
295 timing build:link:node_modules/rimraf Completed in 6ms
296 timing build:link:node_modules/jasmine Completed in 6ms
297 timing build:link:node_modules/mkdirp Completed in 6ms
298 timing build:link:node_modules/nopt Completed in 6ms
299 timing build:link:node_modules/rc Completed in 6ms
300 timing build:link:node_modules/uuid Completed in 6ms
301 timing build:link:node_modules/semver Completed in 6ms
302 timing build:link:node_modules/node-pre-gyp Completed in 6ms
303 timing build:link:node_modules/typescript Completed in 6ms
304 timing build:link:node_modules/which Completed in 6ms
305 timing build:link Completed in 7ms
306 info run canvas@2.6.1 install node_modules/canvas node-pre-gyp install --fallback-to-build
307 info run canvas@2.6.1 install { code: 0, signal: null }
308 timing build:run:install:node_modules/canvas Completed in 6904ms
309 timing build:run:install Completed in 6904ms
310 timing build:deps Completed in 6936ms
311 timing build Completed in 6936ms
312 timing reify:build Completed in 6937ms
313 timing reify:trash Completed in 0ms
314 timing reify:save Completed in 135ms
315 timing reify Completed in 8650ms
316 timing command:install Completed in 39914ms
317 verbose stack Error: command failed
317 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/index.js:64:27)
317 verbose stack     at ChildProcess.emit (events.js:315:20)
317 verbose stack     at maybeClose (internal/child_process.js:1048:16)
317 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
318 verbose pkgid darknet@3.1.6
319 verbose cwd /Users/Dawid/Desktop/darknet
320 verbose Darwin 20.3.0
321 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
322 verbose node v14.15.0
323 verbose npm  v7.7.6
324 error code 2
325 error path /Users/Dawid/Desktop/darknet
326 error command failed
327 error command sh -c ./install-script.sh && node-gyp rebuild
328 verbose exit 2
bennetthardwick commented 3 years ago

Hey sorry for the late reply but I have no clue what's going on :shrug: I think I'll just have to drop support for Mac for now until someone with a Mac can figure out what's going wrong.

owocowyy commented 3 years ago

Ok! If I find some free time I may look onto this issue :)

namnguyenn17 commented 3 years ago

I have the similar problem like you but I don't know how to fix it.

chmod +x *.sh g++ -std=c++11 -std=c++11 -Iinclude/ -I3rdparty/stb/include -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -ffp-contract=fast -mavx -mavx2 -msse3 -msse4.1 -msse4.2 -msse4a -Ofast -Xpreprocessor -fopenmp -fPIC obj/image_opencv.o obj/http_stream.o obj/gemm.o obj/utils.o obj/dark_cuda.o obj/convolutional_layer.o obj/list.o obj/image.o obj/activations.o obj/im2col.o obj/col2im.o obj/blas.o obj/crop_layer.o obj/dropout_layer.o obj/maxpool_layer.o obj/softmax_layer.o obj/data.o obj/matrix.o obj/network.o obj/connected_layer.o obj/cost_layer.o obj/parser.o obj/option_list.o obj/darknet.o obj/detection_layer.o obj/captcha.o obj/route_layer.o obj/writing.o obj/box.o obj/nightmare.o obj/normalization_layer.o obj/avgpool_layer.o obj/coco.o obj/dice.o obj/yolo.o obj/detector.o obj/layer.o obj/compare.o obj/classifier.o obj/local_layer.o obj/swag.o obj/shortcut_layer.o obj/activation_layer.o obj/rnn_layer.o obj/gru_layer.o obj/rnn.o obj/rnn_vid.o obj/crnn_layer.o obj/demo.o obj/tag.o obj/cifar.o obj/go.o obj/batchnorm_layer.o obj/art.o obj/region_layer.o obj/reorg_layer.o obj/reorg_old_layer.o obj/super.o obj/voxel.o obj/tree.o obj/yolo_layer.o obj/gaussian_yolo_layer.o obj/upsample_layer.o obj/lstm_layer.o obj/conv_lstm_layer.o obj/scale_channels_layer.o obj/sam_layer.o -o darknet -lm -pthread -lgomp`

ld: library not found for -lgomp clang: fatal error: linker command failed with exit code 1 (use -v to see invocation) make: *** [darknet] Error 1

bennetthardwick commented 3 years ago

Looks like you don't have OpenMP installed - were you installing with the DARKNET_BUILD_WITH_OPENMP=1 flag?

namnguyenn17 commented 3 years ago

Looks like you don't have OpenMP installed - were you installing with the DARKNET_BUILD_WITH_OPENMP=1 flag?

I fixed it but still have the error ld: library not found for -l:libdarknet.so

but in the folder "darknet", I see it has already generated.

bennetthardwick commented 3 years ago

Hmm seems like the same error. I haven't been able to solve it unfortunately - you might be able to fix it by messing with the binding.gyp file.

snakamura commented 2 years ago

I ran into the same issue on my M1 mac, and found that changing -l:$(LIBNAMESO) in Makefile to -ldarknet worked. The generated uselib was linked to libdarknet.so properly.

$ otool -L darknet/uselib 
darknet/uselib:
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.100.3)
    libdarknet.so (compatibility version 0.0.0, current version 0.0.0)
    /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.23.0)

I'm not sure if this change works on other platforms though.

Here is a patch for install-script.sh for reference.

diff --git a/install-script.sh b/install-script.sh
index f99aa08..d0a7b13 100755
--- a/install-script.sh
+++ b/install-script.sh
@@ -56,6 +56,7 @@ sed -i -e "s/OPENCV=[01]/OPENCV=${OPENCV}/g" ./Makefile
 sed -i -e "s/OPENMP=[01]/OPENMP=${OPENMP}/g" ./Makefile
 sed -i -e "s/CUDNN_HALF=[01]/CUDNN_HALF=${CUDNN_HALF}/g" ./Makefile
 sed -i -e "s/LIBSO=[01]/LIBSO=1/g" ./Makefile
+sed -i -e "s/-l:\$(LIBNAMESO)/-ldarknet/g" ./Makefile

 DEFAULT_ARCH=" -gencode arch=compute_35,code=sm_35 \
 -gencode arch=compute_50,code=[sm_50,compute_50] \

ld version

$ ld -v
@(#)PROGRAM:ld  PROJECT:ld64-762
BUILD 12:49:08 Mar 30 2022
configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em
LTO support using: LLVM version 13.1.6, (clang-1316.0.21.2.3) (static support for 28, runtime is 28)
TAPI support using: Apple TAPI version 13.1.6 (tapi-1316.0.7.3)