Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why does CMake trigger a StratChem rebuild? #108

Closed
mathomp4 opened this issue Dec 2, 2020 · 5 comments · Fixed by GEOS-ESM/GEOSgcm#237
Closed

Why does CMake trigger a StratChem rebuild? #108

mathomp4 opened this issue Dec 2, 2020 · 5 comments · Fixed by GEOS-ESM/GEOSgcm#237

Comments

@mathomp4
Copy link
Member

mathomp4 commented Dec 2, 2020

This is an issue mainly for @tclune and myself, though if we figure it out, we'll need to loop in others.

Namely, if you do this:

  1. Clone GEOSgcm
  2. Make a build directory, run cmake, and run make install
  3. Re-run cmake with a new CMAKE_INSTALL_PREFIX and then make install

StratChem will rebuild. Even though nothing has changed:

$ make install |& tee make.remake.log
[  0%] Built target MAPL_cfio_r4
[  0%] Built target MAPL_cfio_r8
[  1%] Built target MAPL.shared
[  3%] Built target MAPL.pfio
[  4%] Built target MAPL.profiler
...
[ 56%] Built target phony_NI_GridComp
[ 56%] Built target NI_GridComp
[ 56%] Built target GOCART_GridComp
[ 56%] Built target phony_StratChem_GridComp
Scanning dependencies of target StratChem_GridComp
[ 56%] Building Fortran object src/Components/@GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSphysics_GridComp/@GEOSchem_GridComp/StratChem_GridComp/CMakeFiles/StratChem_GridComp.dir/StratChem_GridCompMod.F90.o
/discover/swdev/mathomp4/Models/GEOSgcm-InstallChangeInstall/GEOSgcm/src/Components/@GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSphysics_GridComp/@GEOSchem_GridComp/StratChem_GridComp/StratChem_GridCompMod.F90(100): remark #7712: This variable has not been used.   [I_XX]
    integer                          :: n, nq, i_XX, j_XX
-----------------------------------------------^
/discover/swdev/mathomp4/Models/GEOSgcm-InstallChangeInstall/GEOSgcm/src/Components/@GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSphysics_GridComp/@GEOSchem_GridComp/StratChem_GridComp/StratChem_GridCompMod.F90(100): remark #7712: This variable has not been used.   [J_XX]
    integer                          :: n, nq, i_XX, j_XX
-----------------------------------------------------^
/discover/swdev/mathomp4/Models/GEOSgcm-InstallChangeInstall/GEOSgcm/src/Components/@GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSphysics_GridComp/@GEOSchem_GridComp/StratChem_GridComp/StratChem_GridCompMod.F90(375): remark #7712: This variable has not been used.   [K]
   integer                         :: k, n, dims(3), l, split
--------------------------------------^
/discover/swdev/mathomp4/Models/GEOSgcm-InstallChangeInstall/GEOSgcm/src/Components/@GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSphysics_GridComp/@GEOSchem_GridComp/StratChem_GridComp/StratChem_GridCompMod.F90(377): remark #7712: This variable has not been used.   [Q]
   type(Chem_Array), pointer       :: q(:)         ! array of pointers
--------------------------------------^
/discover/swdev/mathomp4/Models/GEOSgcm-InstallChangeInstall/GEOSgcm/src/Components/@GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSphysics_GridComp/@GEOSchem_GridComp/StratChem_GridComp/StratChem_GridCompMod.F90(385): remark #7712: This variable has not been used.   [DEPO]
   REAL, POINTER, DIMENSION(:,:)   :: depo
--------------------------------------^
/discover/swdev/mathomp4/Models/GEOSgcm-InstallChangeInstall/GEOSgcm/src/Components/@GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSphysics_GridComp/@GEOSchem_GridComp/StratChem_GridComp/StratChem_GridCompMod.F90(627): remark #7712: This variable has not been used.   [FIELD]
   TYPE(ESMF_Field)                :: FIELD
--------------------------------------^
/discover/swdev/mathomp4/Models/GEOSgcm-InstallChangeInstall/GEOSgcm/src/Components/@GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSphysics_GridComp/@GEOSchem_GridComp/StratChem_GridComp/StratChem_GridCompMod.F90(387): remark #7712: This variable has not been used.   [FIELD]
   TYPE(ESMF_Field)                :: field
--------------------------------------^
/discover/swdev/mathomp4/Models/GEOSgcm-InstallChangeInstall/GEOSgcm/src/Components/@GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSphysics_GridComp/@GEOSchem_GridComp/StratChem_GridComp/StratChem_GridCompMod.F90(389): remark #7712: This variable has not been used.   [BUNDLE]
   TYPE(ESMF_FieldBundle)          :: bundle
--------------------------------------^
/discover/swdev/mathomp4/Models/GEOSgcm-InstallChangeInstall/GEOSgcm/src/Components/@GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSphysics_GridComp/@GEOSchem_GridComp/StratChem_GridComp/StratChem_GridCompMod.F90(392): remark #7712: This variable has not been used.   [FIELDNAMES]
   CHARACTER(LEN=ESMF_MAXSTR), POINTER, DIMENSION(:) :: fieldNames
--------------------------------------------------------^
[ 56%] Linking Fortran static library ../../../../../../../lib/libStratChem_GridComp.a
[ 57%] Built target StratChem_GridComp
[ 57%] Built target phony_gmi
[ 59%] Built target GMIchem_GridComp
[ 59%] Built target phony_CARMAchem_GridComp
[ 61%] Built target CARMAchem_GridComp
[ 61%] Built target phony_GEOSCHEMchem_GridComp
...
[ 98%] Built target mk_CatchCNRestarts
[ 98%] Built target mk_CatchRestarts
[ 98%] Built target mk_LakeLandiceSaltRestarts
[ 98%] Linking Fortran executable ../../../bin/GEOSgcm.x
[ 98%] Built target GEOSgcm.x
[ 98%] Linking Fortran executable ../../../bin/idfupd.x
[ 98%] Built target idfupd.x
[ 98%] Built target oceanda.x
[ 98%] Built target oceanobsop.x
[ 98%] Built target oceanobs_nc2bin.x
[ 98%] Built target ocean_recenter.x
[ 98%] Built target anaice2rst.x
[ 98%] Built target ocean_moments.x
[ 98%] Built target read_merra2_bcs
[ 98%] Built target ocean_iau.x
[100%] Built target sosie.x
[100%] Built target corr_vect.x
[100%] Built target interp_to_line.x
[100%] Built target mask_drown_field.x
Install the project...
-- Install configuration: "Debug"

If we do cmake and make a third time, then it's happy:

$ make install |& tee make.thirdmake.log
[  0%] Built target MAPL_cfio_r4
[  0%] Built target MAPL_cfio_r8
[  1%] Built target MAPL.shared
[  3%] Built target MAPL.pfio
...
[ 56%] Built target CH4_GridComp
[ 56%] Built target phony_NI_GridComp
[ 56%] Built target NI_GridComp
[ 56%] Built target GOCART_GridComp
[ 56%] Built target phony_StratChem_GridComp
[ 57%] Built target StratChem_GridComp
[ 57%] Built target phony_gmi
[ 59%] Built target GMIchem_GridComp
[ 59%] Built target phony_CARMAchem_GridComp
...
[ 98%] Built target GEOSgcm.x
[ 98%] Built target idfupd.x
[ 98%] Built target oceanda.x
[ 98%] Built target oceanobsop.x
[ 98%] Built target oceanobs_nc2bin.x
[ 98%] Built target ocean_recenter.x
[ 98%] Built target anaice2rst.x
[ 98%] Built target ocean_moments.x
[ 98%] Built target read_merra2_bcs
[ 98%] Built target ocean_iau.x
[100%] Built target sosie.x
[100%] Built target corr_vect.x
[100%] Built target interp_to_line.x
[100%] Built target mask_drown_field.x
Install the project...
-- Install configuration: "Debug"

To me this points to some sort of CMake issue? Race condition? Bad order? Something. I am trying to capture the build dirs with this process and see if we can see any differences...

@mathomp4
Copy link
Member Author

mathomp4 commented Dec 2, 2020

Annoying. Araxis sees a difference in the StratChem_GridCompMod.o:
Screen Shot 2020-12-02 at 11 46 15 AM
but can't really figure out from that. (All the cmake_install.cmake differences are due to the differently-named install dir.)

@tclune
Copy link
Collaborator

tclune commented Dec 2, 2020

Looking at the CMakeLists.txt, my first guess is that this is related to the automatically generated #include files. So the question becomes how does the automatic generation differ here from other such instances under Chem.

@mathomp4
Copy link
Member Author

mathomp4 commented Dec 2, 2020

@tclune About the only thing I can see is that StratChem's registry file is in a subdirectory? For example, Achem looks like:

new_esma_generate_automatic_code (
  ${this} GEOSachem_Registry.rc
  "GEOS_AChem_ExportSpec___.h;GEOS_AChem_GetPointer___.h"
  GEOS_AChem_History___.rc
  ${include_GEOSachem_GridComp} ${esma_etc}
  "-f"
  )

whereas StratChem is:

new_esma_generate_automatic_code (
   ${this} SC_GridComp/SC_Registry.rc
   "StratChem_ExportSpec___.h;StratChem_ImportSpec___.h;StratChem_GetPointer___.h"
   StratChem_History___.rc
   ${include_StratChem_GridComp} ${esma_etc}
   "-N STRATCHEM"
   )

I did try a version without the -N option, but no difference.

@mathomp4
Copy link
Member Author

mathomp4 commented Dec 2, 2020

Also, no matter what I do, CMake says these are the dependencies of StratChem:
SC_dependencies1
and these are the dependers:
SC_dependers1
And that's it!

@mathomp4
Copy link
Member Author

mathomp4 commented Dec 4, 2020

Some more. After the first build is done we see:

$ fd -t f stratchem_ -X ls --full-time
-rw-r--r-- 1 mathomp4 g0620   15024 2020-12-04 08:44:50.485337551 -0500 etc/StratChem_History___.rc
-rw-r--r-- 1 mathomp4 g0620   54184 2020-12-04 08:44:50.477110044 -0500 include/StratChem_GridComp/StratChem_ExportSpec___.h
-rw-r--r-- 1 mathomp4 g0620   23578 2020-12-04 08:44:50.478425326 -0500 include/StratChem_GridComp/StratChem_GetPointer___.h
-rw-r--r-- 1 mathomp4 g0620 3228829 2020-12-04 08:47:57.320594507 -0500 include/StratChem_GridComp/stratchem_gridcompmod.mod
-rw-r--r-- 1 mathomp4 g0620   13937 2020-12-04 08:44:50.477799512 -0500 include/StratChem_GridComp/StratChem_ImportSpec___.h
-rw-r--r-- 1 mathomp4 g0620 6674170 2020-12-04 08:47:58.629251731 -0500 lib/libStratChem_GridComp.a
-rwxr-xr-x 1 mathomp4 g0620  120217 2020-12-04 08:42:46.535127435 -0500 src/Applications/@GEOSgcm_App/stratchem_setup
-rw-r--r-- 1 mathomp4 g0620 1077976 2020-12-04 08:47:57.755787763 -0500 src/Components/@GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSphysics_GridComp/@GEOSchem_GridComp/StratChem_GridComp/CMakeFiles/StratChem_GridComp.dir/StratChem_GridCompMod.F90.o
-rw-r--r-- 1 mathomp4 g0620       0 2020-12-04 08:47:58.635538000 -0500 src/Components/@GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSphysics_GridComp/@GEOSchem_GridComp/StratChem_GridComp/CMakeFiles/StratChem_GridComp.dir/StratChem_GridCompMod.F90.o.provides.build
-rw-r--r-- 1 mathomp4 g0620 3228829 2020-12-04 08:47:58.483078851 -0500 src/Components/@GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSphysics_GridComp/@GEOSchem_GridComp/StratChem_GridComp/CMakeFiles/StratChem_GridComp.dir/stratchem_gridcompmod.mod.stamp
-rw-r--r-- 1 mathomp4 g0620   20416 2020-12-04 08:44:50.463119751 -0500 src/Components/@GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSphysics_GridComp/@GEOSchem_GridComp/StratChem_GridComp/StratChem_DeclarePointer___.h
-rw-r--r-- 1 mathomp4 g0620   54184 2020-12-04 08:44:50.455820304 -0500 src/Components/@GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSphysics_GridComp/@GEOSchem_GridComp/StratChem_GridComp/StratChem_ExportSpec___.h
-rw-r--r-- 1 mathomp4 g0620   23578 2020-12-04 08:44:50.464361709 -0500 src/Components/@GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSphysics_GridComp/@GEOSchem_GridComp/StratChem_GridComp/StratChem_GetPointer___.h
-rw-r--r-- 1 mathomp4 g0620  119319 2020-12-04 08:47:55.181093000 -0500 src/Components/@GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSphysics_GridComp/@GEOSchem_GridComp/StratChem_GridComp/StratChem_GridCompMod.i90
-rw-r--r-- 1 mathomp4 g0620   15024 2020-12-04 08:44:50.466355116 -0500 src/Components/@GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSphysics_GridComp/@GEOSchem_GridComp/StratChem_GridComp/StratChem_History___.rc
-rw-r--r-- 1 mathomp4 g0620   13937 2020-12-04 08:44:50.454443687 -0500 src/Components/@GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSphysics_GridComp/@GEOSchem_GridComp/StratChem_GridComp/StratChem_ImportSpec___.h
-rw-r--r-- 1 mathomp4 g0620   29781 2020-12-04 08:44:50.453849677 -0500 src/Components/@GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSphysics_GridComp/@GEOSchem_GridComp/StratChem_GridComp/StratChem_InternalSpec___.h

So, the .i90, .mod, and .a were all after all the .h.

Now we run the second make:

$ fd -t f stratchem_ -X ls --full-time
-rw-r--r-- 1 mathomp4 g0620   15024 2020-12-04 08:44:50.485337551 -0500 etc/StratChem_History___.rc
-rw-r--r-- 1 mathomp4 g0620   54184 2020-12-04 08:44:50.477110044 -0500 include/StratChem_GridComp/StratChem_ExportSpec___.h
-rw-r--r-- 1 mathomp4 g0620   23578 2020-12-04 08:44:50.478425326 -0500 include/StratChem_GridComp/StratChem_GetPointer___.h
-rw-r--r-- 1 mathomp4 g0620 3228829 2020-12-04 08:58:06.261943709 -0500 include/StratChem_GridComp/stratchem_gridcompmod.mod
-rw-r--r-- 1 mathomp4 g0620   13937 2020-12-04 08:44:50.477799512 -0500 include/StratChem_GridComp/StratChem_ImportSpec___.h
-rw-r--r-- 1 mathomp4 g0620 6674170 2020-12-04 08:58:07.060898711 -0500 lib/libStratChem_GridComp.a
-rwxr-xr-x 1 mathomp4 g0620  120217 2020-12-04 08:42:46.535127435 -0500 src/Applications/@GEOSgcm_App/stratchem_setup
-rw-r--r-- 1 mathomp4 g0620 1077976 2020-12-04 08:58:06.822765676 -0500 src/Components/@GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSphysics_GridComp/@GEOSchem_GridComp/StratChem_GridComp/CMakeFiles/StratChem_GridComp.dir/StratChem_GridCompMod.F90.o
-rw-r--r-- 1 mathomp4 g0620       0 2020-12-04 08:47:58.635538000 -0500 src/Components/@GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSphysics_GridComp/@GEOSchem_GridComp/StratChem_GridComp/CMakeFiles/StratChem_GridComp.dir/StratChem_GridCompMod.F90.o.provides.build
-rw-r--r-- 1 mathomp4 g0620 3228829 2020-12-04 08:47:58.483078851 -0500 src/Components/@GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSphysics_GridComp/@GEOSchem_GridComp/StratChem_GridComp/CMakeFiles/StratChem_GridComp.dir/stratchem_gridcompmod.mod.stamp
-rw-r--r-- 1 mathomp4 g0620   20416 2020-12-04 08:44:50.463119751 -0500 src/Components/@GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSphysics_GridComp/@GEOSchem_GridComp/StratChem_GridComp/StratChem_DeclarePointer___.h
-rw-r--r-- 1 mathomp4 g0620   54184 2020-12-04 08:44:50.455820304 -0500 src/Components/@GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSphysics_GridComp/@GEOSchem_GridComp/StratChem_GridComp/StratChem_ExportSpec___.h
-rw-r--r-- 1 mathomp4 g0620   23578 2020-12-04 08:44:50.464361709 -0500 src/Components/@GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSphysics_GridComp/@GEOSchem_GridComp/StratChem_GridComp/StratChem_GetPointer___.h
-rw-r--r-- 1 mathomp4 g0620  119319 2020-12-04 08:58:03.163967000 -0500 src/Components/@GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSphysics_GridComp/@GEOSchem_GridComp/StratChem_GridComp/StratChem_GridCompMod.i90
-rw-r--r-- 1 mathomp4 g0620   15024 2020-12-04 08:44:50.466355116 -0500 src/Components/@GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSphysics_GridComp/@GEOSchem_GridComp/StratChem_GridComp/StratChem_History___.rc
-rw-r--r-- 1 mathomp4 g0620   13937 2020-12-04 08:58:02.508466125 -0500 src/Components/@GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSphysics_GridComp/@GEOSchem_GridComp/StratChem_GridComp/StratChem_ImportSpec___.h
-rw-r--r-- 1 mathomp4 g0620   29781 2020-12-04 08:44:50.453849677 -0500 src/Components/@GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSphysics_GridComp/@GEOSchem_GridComp/StratChem_GridComp/StratChem_InternalSpec___.h

and the StratChem_ImportSpec___.h is now remade! But it's like the macro didn't do it because the version in include/ has not changed its timestamp. And I do not see any echoes that I put into the macro!

christophkeller pushed a commit that referenced this issue May 19, 2021
…ax. MEGAN is now a single extension (#108) and all elements of extension #109 (which was a MEGAN 'submodule') are now part of the core MEGAN implementation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants