0

I cannot compile the iotivity-node source on Raspbian OS in Raspberry pi 3 developed board. But, I'm able to compile the same source successfully in in my laptop under Ubuntu 16.04 LTS OS.

I met the following error message on screen. Does anyone know how to fix this issue? thanks. (Please refer the totally log in my gist. iotivity-node fail log

> COPY Release/nothing.node  
  CXX(target) Release/obj.target/iotivity/generated/constants.o  
virtual memory exhausted: Cannot allocate memory  
iotivity.target.mk:131: recipe for target 
 elease/obj.target/iotivity/generated/constants.o' failed  
make: *** [Release/obj.target/iotivity/generated/constants.o] Error 1  
make: Leaving directory '/home/pi/workspace/iotivity-node/build'  
gyp ERR! build error  
gyp ERR! stack Error: `make` failed with exit code: 2  
gyp ERR! stack     at ChildProcess.onExit 
 (/home/pi/.nvm/versions/node/v9.5.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)  
gyp ERR! stack     at ChildProcess.emit (events.js:160:13)  
gyp ERR! stack     at Process.ChildProcess._handle.onexit  
(internal/child_process.js:209:12)  
gyp ERR! System Linux 4.9.59-v7+
gyp ERR! command "/home/pi/.nvm/versions/node/v9.5.0/bin/node" 
 "/home/pi/.nvm/versions/node/v9.5.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"  
gyp ERR! cwd /home/pi/workspace/iotivity-node  
gyp ERR! node -v v9.5.0  
gyp ERR! node-gyp -v v3.6.2  
gyp ERR! not ok  
npm ERR! code ELIFECYCLE  
npm ERR! errno 1  
npm ERR! iotivity-node@1.3.1-0 install: `node-gyp rebuild`  
npm ERR! Exit status 1  
npm ERR!  
npm ERR! Failed at the iotivity-node@1.3.1-0 install script.  
npm ERR! This is probably not a problem with npm. There is likely additional  logging output above.  
jdonald
  • 670
  • 7
  • 15
cchhsu
  • 13
  • 6
  • Maybe it worth to create deb package, eventually add more memory like explained at : – RzR Feb 06 '18 at 11:50

1 Answers1

0

I guess you need to add more memory to your Pi:

Check this post about building iotivity on ARM:

https://blogs.s-osg.org/building-iotivity-arm-artik-devices/

Should be easy to adapt for debian based distro,

Over NFS for instance

file="$mnt/swap.tmp" dd if=/dev/zero of=$file bs=1k count=2097152 # 2GB losetup /dev/loop0 "$file" mkswap /dev/loop0 swapon /dev/loop0

RzR
  • 3,068
  • 29
  • 26