pshriwise / openmc

OpenMC Monte Carlo Code
http://openmc.readthedocs.io/
Other
5 stars 2 forks source link

Infer libmesh build type in FindLIBMESH.cmake #4

Open RonRahaman opened 4 years ago

RonRahaman commented 4 years ago

I noticed that FindLIBMESH.cmake always tries to find the "opt" configuration of libmesh . Could you infer this from the user?

In many places, the libmesh and MOOSE stack use the environment variable "METHOD", which is either "opt", "oprof", or "dbg"

find_path(LIBMESH_PC NAMES libmesh-opt.pc
          HINTS ${LIBMESH_DIR} $ENV{LIBMESH_ROOT}
          PATHS ENV LD_LIBRARY_PATH
          PATH_SUFFIXES lib/pkgconfig pkgconfig
          NO_DEFAULT_PATH)
pshriwise commented 4 years ago

Hiya! I take it you’re looking one of the libmesh branches here?

Given that OpenMC could be built with libmesh independently of MOOSE, we probably want to have some default option here but yeah we could certainly look into that. Hard-coding libmesh-opt.pc was a temporary measure while I sorted out some issues with the libmesh pkgconfig files (https://github.com/libMesh/libmesh/pull/2682). Now that these are incorporated in the latest libmesh release I can revisit how to approach this.

pshriwise commented 4 years ago

It's good timing that you brought this up, really, I was just starting to clean up some of libMesh related stuff in the libmesh_umesh2 branch yesterday. Right now I just rely on the libmesh.pc, which after that PR above should always be valid.

https://github.com/pshriwise/openmc/commit/8566e2e818f22f8f9689b95d1515f8313f91d4eb