Welcome new user! You can search existing questions and answers without registering, but please register to post new questions and receive answers. Note that due to large amounts of spam attempts, your first three posts will be manually moderated, so please be patient.
We have moved to a new forum at http://jevois.usc.edu, please check it out. The forum at jevois.org/qa will not allow new user registrations but is maintained alive for its useful past questions and answers.

Faster Rebuild

0 votes
Hi, Are there plans to modify the make process so that only modified files are rebuilt? Right now when I execute jevoisbase rebuild it rebuilds all modules from scratch.
asked Mar 21, 2017 in Programmer Questions by alsaibie (740 points)

1 Answer

0 votes
 
Best answer

yes, after you have run rebuild-platform.sh and rebuild-host.sh at least once, you can just cd to the proper build directory (hbuild for host, pbuild for platform) and type make (have a look at what is inside rebuild-host.sh and others to get an idea), for example:

cd hbuild

make -j 4

sudo make install

(sudo not needed for platform build)

answered Mar 21, 2017 by JeVois (46,580 points)
selected Mar 21, 2017 by alsaibie
1. Registering the module to run on the host worked just fine. There were some typos in the template videomapping.cfg (extra word at the begginning of the line) and postinstall (videomapping mispelled).

I just had to chmod postinstall and execute it.
I still can't get my own module to work on the platform. It compiled for both host and platform, it ran fine on the host with the proper mapping, I put it in a jvpkg and placed in it under /packages in the SD card. But the camera would not boot up then. The jvpkg is extracted and files are placed under modules/. If I removed the files manually, the camera will then run. I also tried to manually place the module files and edit the videomapping.cfg, I get the same problem where the camera would not boot. Any idea?

Now if I modify one of the existing modules as an interim solution, and then make changes to it. Is it enough to replace the *.so file for it to work?
hum, looks like you are getting very far along with this. I would say maybe a version or format issue with the .so, if a module is declared in videomappings.cfg but fails to load, that would abort jevois-daemon. At this point, I think you should get an FTDI or other USB-to-UART cable or adapter, as you will then be able to turn on verbose boot to the serial port of JeVois and get standard error messages when errors happen. A few pointers though:

1. the package unpacking happens in bin/jevois.sh of repo jevois, it has not been thoroughly tested yet and may have issues

2. if you get an FTDI cable or similar, then edit uEnv.txt in the BOOT partition of your SD to enable console to serial. If you touch a file called 'login' in that BOOT partition, you will drop to a shell. You can then edit /usr/bin/jevois.sh to run jevois-daemon inside gdb, etc

3. replacing the .so of an existing module is unlikely to work, as the class name must match the module .so name, this is so that we can infer the class name from the .so name when loading the .so at runtime without needing some aux file telling us the class name. Is that your case, btw, module class name an exact match of the .C file name and also of the directory where that .C file is? Can you share your modified module somewhere so we can check it out (the whole source tree, like that of samplemodule), maybe we will see something in there to help you.
1 & 2. Sounds like a plan, will test out with an FTDI adapter. Thanks for pointing out the uEnv.txt, that was going to be my next question. This should help a lot.

3. What I meant was that, after adding a module or editing an existing one and rebuilding all jevoisbase correctly, if then I only edit some parameters within "process" method and recompile that file only, is it then only sufficient to replace the specific *.so file, given that the class names already match and were compiled correctly prior to that. I'm not very familiar with the dependency of *.so files on incremental edits within the methods, includes, etc. I'm asking only to avoid having to rebuild everything every time.
yes, 3. is a great idea, just edit some module in jevoisbase, recompile the whole jevoisbase (just 'make' and 'make install' inside pbuild of jevoisbase should be fine), and then copy the modified .so and see whether that works for you. Double-check that the .so was indeed updated (look at the date, size, etc). If you do not make install I believe the recompiled .so will be somewhere deep under pbuild, you can look for it using the find command.
...