compilation takes long time

Submitted by vinaym on Mon, 10/26/2015 - 13:55

Hello all,

Since this is the developer forum, I assume many people here need to compile the implementation 'often'. And this could be annoying, if it takes really long time to compile.

I have observed that LIGGGHTS compilation is stuck for a long time at the following place in the os_specific.h file:

../os_specific.h: In function ‘T* aligned_malloc(size_t) [with T = LIGGGHTS::ContactModels::ForceData; size_t = long unsigned int]’:
../os_specific.h:82:3: warning: ignoring return value of ‘int posix_memalign(void**, size_t, size_t)’, declared with attribute warn_unused_result [-Wunused-result]

This is also the case when I compile the latest 'fresh' version LIGGGHTS 3.3.0. Anyone else observes similar thing?

Thanks.

Kind regards,
Vinay

Daniel Queteschiner | Tue, 10/27/2015 - 12:15

Long compile times in LIGGGHTS (>= 3.0) are mainly due to template instantiation. If you're not already doing so, you may use the -j option to tell make to compile in parallel, e.g.
make -j 4 fedora

aaigner's picture

aaigner | Thu, 10/29/2015 - 11:10

Hi Vinay,

if you are developing a new contact model, you can speed up the compilation by compiling only the required instance. Therefore, you can use a whitelist.

sh Make.sh models
cp style_contact_model.h style_contact_model.whitelist
gedit style_contact_model.whitelist

The first line updates the file style_contact_model.h. Then copy and modify it. Keep only the entries you need!
Then recompile, e.g.

make clean-all
make -j 4 fedora

But don't wonder, if you try to use a not compiled contact model (combination), you will get an 'unknown contact model' error!

Bests
Andreas

PS: Before version 3.3.0 there were blacklists and not whitelists!