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

Just Questions: V2 and Install #192

Open
allan-bommer opened this issue Mar 6, 2023 · 5 comments
Open

Just Questions: V2 and Install #192

allan-bommer opened this issue Mar 6, 2023 · 5 comments

Comments

@allan-bommer
Copy link

The library looks very interesting (and sorely needed in the Fortran world!)

Is V2 ready to play with? The examples all seem to be for V1.

Is there a need to install to consume? As a template library, I was expecting to be able to just include the appropriate files from the include directory into my source.

The challenges I have are cloud build machines (not directly under my control), distributed team (would prefer not to require installs on everyone's machines) and builds for both Linux and Windows. We are using Intel OneAPI Fortan 2022.1.0 on both Windows and Linux. We are not using cmake as our build orchestrator.

Thanks!

@tclune
Copy link
Member

tclune commented Mar 6, 2023

Yes I routinely use V2 in my new development. I just never threw the switch to make v2 the default because it would just break older code.

The installation uses m4 to generate the appropriate include files. So it is extremely fast, but is a necessary step. The m4 bits allow me to treat the different template parameters consistently without code duplication. CPP/FPP was just not up to the task. Once installed, you just need your compilers built in preprocessor and the include paths.

You could always do the install once on a system you control and then just copy the install dir to the platforms that you want.

@tclune
Copy link
Member

tclune commented Mar 6, 2023

I should create a new suite of examples, but really don't have time for an organized response on that front just now. I can probably point you to a few cases in my other projects where v2 containers are being used. Or I could use this thread to at least create some starter examples. I'll start with a demonstration of a vector of integers when I have some time.

@allan-bommer
Copy link
Author

Thanks!

I'll try the install and copy approach.

If you could point at a couple other projects for examples that would be great!

@tclune
Copy link
Member

tclune commented Mar 8, 2023

I took a quick break today to at least get the ball rolling on bonafide examples. See
./example/v2/Vector/VecIntAndReal.F90 in branch
https://github.com/Goddard-Fortran-Ecosystem/gFTL/tree/feature/%23192-update-examples-for-v2-interfaces

Real-world examples coming in a moment.

@tclune
Copy link
Member

tclune commented Mar 8, 2023

First - just in case you've not seen them, there is some useful documentation at:
https://github.com/Goddard-Fortran-Ecosystem/gFTL/blob/main/include/v2/vector/vector.md
and https://github.com/Goddard-Fortran-Ecosystem/gFTL/blob/main/include/v2/map/map.md

There are several v2 containers used in my pFlogger project:
https://github.com/Goddard-Fortran-Ecosystem/pFlogger/tree/main/src

(Note that a few in there are still v1, because v2 dropped support for containers-of-pointers for technical reasons. And the replacement approach is just tedious enough that I did not bother to update here.) Try these in particular:

  • FormatTokenVector.F90 (vector of FormatTokens)
  • AbstractPolyFilterVector.F90 (container of polymorphic objects)
  • StringLockMap.F90 (map with string keys and (polymorphic) AbstractLoc values)

The simplest (non-polymorphic) map (that uses v2) that I could find is at:
https://github.com/GEOS-ESM/MAPL/blob/release/MAPL-v3/generic3g/specs/ChildSpecMap.F90

And of course in each example you'll have to wander around neighboring files/directories to find the uses, which is what you really need to see.

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

No branches or pull requests

2 participants