Skip to content

Conversation

bobpaw
Copy link
Collaborator

@bobpaw bobpaw commented Sep 11, 2025

Rename CMake options and C macros to use PUMI_ prefix

I prefixed lots of options with PUMI_ and renamed variables/options with the SCOREC_ prefix which are not created by bob.cmake. In general I set the default value for options like PUMI_ENABLE_SIMMETRIX to ${ENABLE_SIMMETRIX} which allows us to remain somewhat backward compatible and also inherit the selection from parent projects by default.

To find things that needed to be changed, I used the following searches:

git grep '\WENABLE' :^Doxyfile.in :^Doxyfile_internal.in
git grep '\WHAS' :^Doxyfile.in :^Doxyfile_internal.in
git grep '\WHAVE' :^Doxyfile.in :^Doxyfile_internal.in
git grep '\WUSE' :^Doxyfile.in :^Doxyfile_internal.in

I removed the private compile definition -DHAVE_SIMADVMESHING from phasta/CMakeLists.txt and some test exes and replaced it with the PUMI_HAS_SIMADVMESHING macro in apf_sim/apf_simConfig.h. There are some options which are left, specifically Simmetrix things like SIM_PARASOLID, SIM_ACIS, etc that I wasn't sure how we wanted to deal with yet.

An exception that I did not remove is ENABLE_VIZ in test/CMakeLists.txt:

core/test/CMakeLists.txt

Lines 63 to 65 in debc743

if(ENABLE_VIZ)
test_exe_func(viz_test viz.cc)
endif()

I think test/viz.cc can be removed, but Dan forgot to in 0c607cf.

I did not yet change the project name to SCOREC because I wanted to make sure all of these changes work.

Leaving in draft mode for now because there are a few things (Phasta HAVE_CLOCK_/USE_PCU_TIME, LION_COMPRESS, etc) left that I did not get to or am not sure if need to be updated.

Closes #337. Closes #477.

bobpaw added 12 commits July 3, 2025 22:59
- CMakeLists.txt: rename ENABLE_SIMMETRIX to PUMI_ENABLE_SIMMETRIX as
  requested in #337.
- allow unscoped ENABLE_SIMMETRIX to also enable it for PUMI.
- CMakeLists.txt, apf_sim/CMakeLists.txt, gmi_sim/CMakeLists.txt,
  phasta/CMakeLists.txt, python_wrappers/CMakeLists.txt,
  test/CMakeLists.txt, test/testing.cmake: replace all the
  ENABLE_SIMMETRIXs with PUMI_ENABLE_SIMMETRIX.

Signed-off-by: Aiden Woodruff <woodra@rpi.edu>
- CMakeLists.txt: change HAVE_SIMMETRIX compile definition to
  PUMI_HAS_SIMMETRIX.

- git grep HAVE_SIMMETRIX | cut -d: -f1 | uniq | xargs sed -i
  's/HAVE_SIMMETRIX/PUMI_HAS_SIMMETRIX/'

Signed-off-by: Aiden Woodruff <woodra@rpi.edu>
- git grep SCOREC_NO_MPI | cut -d: -f1 | uniq | xargs sed -i
  's/SCOREC_NO_MPI/PUMI_NO_MPI/'
- doc/myprogram.cpp: remove #ifdef PUMI_NO_MPI by using pcu::Init.

Signed-off-by: Aiden Woodruff <woodra@rpi.edu>
- CMakeLists.txt: rename ENABLE_CGNS to PUMI_ENABLE_CGNS and use old
  ENABLE_CGNS as the default value.
- rename ENABLE_OMEGA_H to PUMI_ENABLE_OMEGA_H and use old name as
  default value.
- change all conditionals to use the new scoped name.
- rename SCOREC_NO_MPI to PUMI_NO_MPI.
- change PUMI_ENABLE_SIMMETRIX to use ENABLE_SIMMETRIX as the default
  value like with cgns/omega_h.
- don't rename SCOREC_USE_Omega_h_DEFAULT yet because that is input for
  bob.cmake based on the project name.
- apf/CMakeLists.txt: add apfCGNSempty.cc file when CGNS is not enabled.
- apf/pkg_tribits.cmake: same thing as CMakeLists.txt.
- apf/apfCGNS.cc: remove HAVE_CGNS conditionals since the whole file is
  conditionally compiled based on PUMI_ENABLE_CGNS.
- apf/apfCGNSempty.cc: move #else cases for HAVE_CGNS here so that they
  are compiled. otherwise they never would be.
- cmake/bob.cmake: add documentation
- mds/CMakeLists.txt: add mdsCGNSempty.cc without PUMI_ENABLE_CGNS.
- mds/pkg_tribits.cmake: same thing.
- mds/mdsCGNS: remove #ifdef HAVE_CGNS since the whole file is
  conditionally compiled. move #else branches to mdsCGNSempty.cc.
- mds/mdsCGNSempty.cc: new file with empty functions that always fail.
- test/CMakeLists.txt: rename ENABLE_CGNS to PUMI_ENABLE_CGNS and
  ENABLE_OMEGA_H to PUMI_ENABLE_OMEGA_H.
- test/testing.cmake: same thing.

Signed-off-by: Aiden Woodruff <woodra@rpi.edu>
- CMakeLists.txt: rename option to PUMI_ENABLE_FPP and make default
  value ENABLE_FPP for compatibility.
- rename preprocessor definition to PUMI_DO_FPP.
- ma/maSnapper.cc: use PUMI_DO_FPP.

Signed-off-by: Aiden Woodruff <woodra@rpi.edu>
- apf_sim/CMakeLists.txt: add PUMI_ prefix to simmetrix feature macros
  (fieldsim and advanced meshing).
- change PUMI_USE_SIM_ADVMESHING to use the correct _FOUND variable from
  FindSimModSuite.cmake. I could not find HAVE_SIMADVMESHING anywhere
  and think it may have been leftover.
- apf_sim/apfSIM.cc: use prefixed macros.
- apf_sim/apf_simConfig.h.in: use prefixed macros.

Signed-off-by: Aiden Woodruff <woodra@rpi.edu>
Signed-off-by: Aiden Woodruff <woodra@rpi.edu>
- metis/CMakeLists.txt: update option name and if statements.
- ma/maInput.cc: update error message to reference new option name.
- test/CMakeLists.txt: update if statements.
- test/testing.cmake: update if statements.

Signed-off-by: Aiden Woodruff <woodra@rpi.edu>
- stk/CMakeLists.txt: add PUMI_ prefix to ENABLE_STK and
  ENABLE_STK_MESH.
- stk/apf_stkConfig.h.in: add PUMI_ prefix to HAS_STK and use
  PUMI_ENABLE_STK_MESH.
- stk/apfExodusOutput.cc: change HAS_STK to PUMI_HAS_STK.
- stk/apfMeshSTK.cc: use PUMI_HAS_STK.
- stk/apfSTK.cc: use PUMI_HAS_STK.

Signed-off-by: Aiden Woodruff <woodra@rpi.edu>
- zoltan/CMakeLists.txt: add PUMI_ prefix to ENABLE_ZOLTAN and make
  ENABLE_ZOLTAN value the default to inherit and for compatability.
- update message and if statements.
- zoltan/pkg_tribits.cmake: change variable to PUMI_ENABLE_ZOLTAN.
- test/capVol.cc (makeSplitter): fix typo in zoltan call.
- ma/maInput.cc: update error message when trying to run MeshAdapt with
  Zoltan but without compiling the support.

Signed-off-by: Aiden Woodruff <woodra@rpi.edu>
- test/CMakeLists.txt: rename ENABLE_ZOLTAN to PUMI_ENABLE_ZOLTAN
  wherever found.
- test/testing.cmake: replace ENABLE_ZOLTAN to PUMI_ENABLE_ZOLTAN.

Signed-off-by: Aiden Woodruff <woodra@rpi.edu>
- apf_sim/CMakeLists.txt: rename PUMI_USE_SIMADVMESHING to
  PUMI_HAS_SIMADVMESHING. in a7b765 I changed it because I could not
  find the input variable HAVE_SIMADVMESHING. turns out it was the name
  being used as a C macro.
- apf_sim/apf_simConfig.h.in: change #cmakedefine line
- phasta/CMakeLists.txt: remove HAVE_SIMADVMESHING from compile
  definitions since it should now be read from apf_simConfig.h.
- phasta/chef.cc: #include apf_simConfig.h and replace
  HAVE_SIMADVMESHING with PUMI_HAS_SIMADVMESHING.
- phasta/cut_interface.cc: #include apf_simConfig.h and replace
  HAVE_SIMADVMESHING with PUMI_HAS_SIMADVMESHING.
- phasta/phMeshQuality.cc: #include apf_simConfig.h and replace
  HAVE_SIMADVMESHING with PUMI_HAS_SIMADVMESHING.
- test/CMakeLists.txt: remove HAVE_SIMADVMESHING as a private compile
  definition since it shoudl be read from apf_simConfig.h
- test/measureAnisoStats.cc: #include apf_simConfig.h and replace
  HAVE_SIMADVMESHING with PUMI_HAS_SIMADVMESHING.
- test/measureIsoStats.cc: #include apf_simConfig.h and replace
  HAVE_SIMADVMESHING with PUMI_HAS_SIMADVMESHING.
- test/sim_part.cc: #include apf_simConfig.h and replace
  HAVE_SIMADVMESHING with PUMI_HAS_SIMADVMESHING.

Signed-off-by: Aiden Woodruff <woodra@rpi.edu>
@cwsmith cwsmith added building cmake v5.0.0 tracking features going into the v5.0.0 release labels Sep 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
building cmake v5.0.0 tracking features going into the v5.0.0 release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants