Re-compiling LIGGGHTS after making changes to source code (SOLVED)

Nucleophobe's picture
Submitted by Nucleophobe on Fri, 03/11/2016 - 17:48

Hi everyone,

Maybe this is a naive question, but is there a way to speed-up the compilation of LIGGGHTS when you only make changes to one fix (e.g., fix_cfd_couple_forces)?

For example, when compiling OpenFOAM, executing 'wmake' will only recompile libraries whose source code changed since the last build.

However, when I execute 'cfdemCompLIG,' the build is first cleaned, and then all of LIGGGHTS is rebuild, which takes 5-10 minutes. I've tried running 'make fedora_fpic,' but this doesn't seem to rebuild any of the source code - it just re-packages all of the compiled libraries to make the 'lmp_fedora_fpic' executable.

Do I need to create a custom makefile, or is there another way to recompile a single fix?

EDIT: I looked at the function.sh file and figured out the proper sequence:

make fedora_fpic
make makelib
make -f Makefile.lib fedora_fpic

This works for me.

Thanks,
-Nuc

ckloss's picture

ckloss | Mon, 04/25/2016 - 21:33

Hi Nuc,

yes - as you wrote you can do it like that!

Best wishes
Christoph

nasser225 | Tue, 11/01/2016 - 16:11

Hi guys,

I have now managed to get Liggghts to compile successfully but the new contact model is not recognised. I get the error:
pair_style gran model CUSTOMMOD #custom model to show powder compaction
ERROR: unknown contact model or model not in whitelist. Possible root causes:
(1) it's a typo. Check the documentation of the contact model you are using.
(2) the contact model is not available in your installation. Check if a documentation for this.
contact model is available at all in your version.
(3) the model is part of a package which was not installed. Check the documentation for details.
(4) the model is available, but was not in the whitelist during compilation. Check if a file
src/style_contact_model.whitelist exists. If yes, modify it and re-compile.
(../pair_gran_proxy.cpp:74)

Please let me know what I need to do to get this to work...

Thanks,

jtvanlew | Tue, 11/01/2016 - 21:06

hi nasser,

can you upload the .h file of your new contact model (deleting any sensitive equations if you want)? i am not a pro but i've been working pretty intensely on these normal models for the last couple weeks so i might be able to pour through your file and figure out what's going wrong. i didn't modify a single other file in order to make lammps recognize the new contact model, but during compilation it added my new normal model into the style_contact_model.h list and style_normal_model.h list too.

jon