Page 1 of 1

Compilation option for mpicc

Posted: Thu Feb 11, 2021 5:28 pm
by Cbarnaud
Hello,
I'm working on CS 6.0.0 ans I would like to add options/flags to mpicc command just like -g or -O3 (I know they're already there, it's just an example).
My goal is to do something like : mpicc test.c -ltensorflow ...
Is there a way to add it in a 'clean' way ?
I tried to modify cflags_default and cxxflags_defaut as a 'crash test' in ..config/cs_auto_flags.sh but it's not super effective...

Thank you all.
Best regards,
CB

Re: Compilation option for mpicc

Posted: Thu Feb 11, 2021 6:01 pm
by Yvan Fournier
Hello,

If you want to do this in a full installation, use the LDGFLAGS and LIBS variables at configure time.
For example ../../configure --prefix=<my_prefix> CC=mpicc CXX=mpicxx LIBS=-ltensorflow.

If you want to do this only for a given test case, you can use the cs_user_scripts.py (in DATA) user script hooks to define domain.compile_cflags, domain.compile_cxxflags, and domain.compile_libs to add options for this specific case.

Best regards,

Yvan