-
Notifications
You must be signed in to change notification settings - Fork 463
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
Updates to VersionInfo module and its dependencies #1124
Conversation
…dule -moved all code that was in NWTC_IO that called the version info module into the version info module. This allows us to rebuild the version info stuff without having to rebuild the NWTC library. - Updated cmake dependencies on VersionInfo + NWTC_Library - Also moved some of the more generic GetVersion functions from FAST into the version info module so we won't have to duplicate code with every driver that wants to use it.
Moved CheckArgs test from NWTC_IO into VersionInfo
I had a hard time remembering if the new test directory was the `test` or `tests` one, so I renamed `test` to `Old_test` to help me remember.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. I think we should merge this as part of the 3.2 milestone.
use nwtc_library_test_tools | ||
use VersionInfo | ||
! use nwtc_library_test_tools | ||
! bjj: I haven't figured out how to get the unit tests to consistently find the file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rafmudaf, any thoughts on getting cmake/ctest to find the nwtc_library_test_tools.F90 consistently?
Thanks for this pull request @bjonkman. I'm documenting this info primarily for our own future reference. The issue in the previous implementation of the git-based version numbering via CMake was that it was done through a compiler directive. This meant that any change to the git-status also changed the compiler command (see v1.0.0) and every file then had to be recompiled. The I tested changing the version (i.e. the git status) and compiling ## STARTING 1 COMMIT PRIOR TO `dev`
(openfast) >>mbp@~/Development/openfast_forks/bonnie/build (dev)$ git co b0ac7ad5
Note: switching to 'b0ac7ad5'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:
git switch -c <new-branch-name>
Or undo this operation with:
git switch -
Turn off this advice by setting config variable advice.detachedHead to false
HEAD is now at b0ac7ad5 Merge pull request #1050 from ptrbortolotti/stability
(openfast) >>mbp@~/Development/openfast_forks/bonnie/build ((b0ac7ad5...))$ cmake ..
-- Enabling Fortran 2008 features
-- Setting system file as: src/SysGnuLinux.f90
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/rmudafor/Development/openfast_forks/bonnie/build
(openfast) >>mbp@~/Development/openfast_forks/bonnie/build ((b0ac7ad5...))$ make nwtc_library_utest -j2
Scanning dependencies of target versioninfolib
[ 0%] Creating directories for 'pfunit'
[ 0%] Building Fortran object modules/version/CMakeFiles/versioninfolib.dir/src/VersionInfo.f90.o
[ 0%] No download step for 'pfunit'
[ 0%] No update step for 'pfunit'
[ 7%] Linking Fortran static library libversioninfolib.a
[ 14%] No patch step for 'pfunit'
[ 14%] Built target versioninfolib
Scanning dependencies of target nwtclibs
... REMOVED THE COMPILE DETAILS But trust me in that this was the full compile for this target...
[100%] Linking Fortran executable nwtc_library_utest
[100%] Built target nwtc_library_utest
## Checkout `dev`
(openfast) >>mbp@~/Development/openfast_forks/bonnie/build ((b0ac7ad5...))$ git co dev
Previous HEAD position was b0ac7ad5 Merge pull request #1050 from ptrbortolotti/stability
Switched to branch 'dev'
Your branch is up to date with 'openfast/dev'.
(openfast) >>mbp@~/Development/openfast_forks/bonnie/build (dev)$ make nwtc_library_utest -j2
-- Enabling Fortran 2008 features
-- Setting system file as: src/SysGnuLinux.f90
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/rmudafor/Development/openfast_forks/bonnie/build
Scanning dependencies of target versioninfolib
[ 14%] Built target pfunit
[ 14%] Building Fortran object modules/version/CMakeFiles/versioninfolib.dir/src/VersionInfo.f90.o
[ 21%] Linking Fortran static library libversioninfolib.a
[ 21%] Built target versioninfolib
Scanning dependencies of target nwtclibs
[ 85%] Built target nwtclibs
Scanning dependencies of target nwtc_library_utest
[ 85%] Building Fortran object unit_tests/nwtc-library/CMakeFiles/nwtc_library_utest.dir/__/pfunit/include/driver.F90.o
[ 85%] Linking Fortran executable nwtc_library_utest
[100%] Built target nwtc_library_utest At least in CMake, I think this is a desirable compile pipeline. Waay back in #42, we decided to remove the specific library versions in favor of a global OpenFAST version. In the current implementation, each compile target gets its version by linking to VersionInfo. With this pull request, the git-status (therefore, the version) can change and NWTC Library recompiled, but it is no longer associated with a version number. However, I don't think this matters in practice since in order to get a module library's version, it would have to link with VersionInfo at compile-time. It's a "does a tree fall in the woods" situation. Continuing from above, the test below checks out this pull request's branch and compiles
|
Feature or improvement description
The
VersionInfo
module was originally created to avoid having the version information at the lowest level of the build. This would avoid having to rebuild NWTC Library every time the git hash changed. (See #267 and #269.) However, in a later pull request, the NWTC Library added a dependency on VersionInfo (see #428), putting VersionInfo at the lowest level of the build again.This pull request takes the subroutines from NWTC_IO.f90 that use version information and puts them into the VersionInfo module so that NWTC_Library no longer uses the VersionInfo module.
Related issue, if one exists
#267, #269, #428
Impacted areas of the software
Additional supporting information
I also renamed the (unused)
modules/nwtc_library/test
directory tomodules/nwtc_library/old_test
to avoid confusion with themodules/nwtc_library/tests
directory.Test results, if applicable
This should not change any test results, though the screen output for driver codes may change.