← Back to team overview

yade-users team mailing list archive

[Question #245682]: optional compilation of LBM engine

 

New question #245682 on Yade:
https://answers.launchpad.net/yade/+question/245682

Hi,
 A LBM engine (to compute interstitial fluid flow with the lattice Boltzmann method) was implemented in Yade some years ago, but have not been submitted to git so far. Now I want to submit this engine, and I want to make its compilation optionnal, with this option disable by default.

Consequently I added in CMakeLists.txt the following lines:

OPTION(ENABLE_LBMFLOW "Enable LBM engine (very experimental)" OFF)

and

IF(ENABLE_LBMFLOW)
   SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DLBM_ENGINE")
   SET(CONFIGURED_FEATS "${CONFIGURED_FEATS} LBMFLOW")
   MESSAGE("LBMFLOW is still experimental, building and running LBM engine are at your own risk!")
ELSE(ENABLE_LBMFLOW)
   SET(DISABLED_FEATS "${DISABLED_FEATS} LBMFLOW")
 ENDIF(ENABLE_LBMFLOW)

In addition all .ccp and .hpp files related to the LBM engine begin with:
#ifdef LBM_ENGINE
and finish with
#endif

When I choose the option:
cmake -DENABLE_LBMFLOW=ON
the message:
"LBMFLOW is still experimental, building and running LBM engine are at your own risk!"
is printed in the console, thus ENABLE_LBMFLOW is turned to ON as requested, but that's all and the compilation of the LBM engine is not performed. It is as if the results of the condition:
#ifdef LBM_ENGINE
is still false. Indeed, if I remove the condition #ifdef LBM_ENGINE, then the LBM engine is compiled.

I think I missed a point somewhere in the definition of the variable LBM_ENGINE, but which one? Have you got an idea?

Best,
Luc

-- 
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.


Follow ups