Build documentation

From Sunil (moved from another post) :

Hi, I am attempting to follow the instructions to your fesapi configuration/build, found on the fesapi github site, and had some basic and some specific questions (apologies if any of these are silly) which I hope you can help clear for me. I have cloned the repository from your fesapi Github site. (1) My overall understanding was that your fesapi code provided a means to take any given version of the RESQML schema and convert it into C++ classes representing all the different RESQML data types (features, interpretations, representation, property). Is there more to it? So I wonder in the code repository, where is the RESQML schema and how does it locate it, because I looked and don’t find it anywhere? (2) There is already some apparently pre-compiled source (presumably generated from the RESQML schema) in the cloned repository under the src/ sub-folder. If that is the case, then what are we getting on top of that, from doing the configuration and build steps outlined? Is it some additional APIs serving some specific purpose? This is not clear to me. (3) It was noted that dependencies could be used as pre-compiled libraries or built & installed as required. Which is recommended and what to expect as gotchas in either? If I am building my own HDF5, should I build as static or dynamic libraries? I was planning to do the latter. Based on the comment on MINIZIP, I presume I have to configure and build HDF5 with ZLIB enabled? I am planning to use the following configuration for HDF5: cmake %PACKAGE_SRC_DIR% -G “%BUILD_GENERATOR%” -DCMAKE_INSTALL_PREFIX=%PACKAGE_DIST_DIR% -DBUILD_SHARED_LIBS=ON -DHDF5_BUILD_FORTRAN=OFF -DHDF5_ENABLE_SZIP_SUPPORT=OFF -DHDF5_ENABLE_SZIP_ENCODING=OFF -DHDF5_ENABLE_Z_LIB_SUPPORT=ON -DHDF5_BUILD_CPP_LIB=ON -DHDF5_BUILD_HL_LIB=ON -DHDF5_BUILD_TOOLS=ON -DBUILD_TESTING=OFF -DZLIB_ROOT=%ZLIB_DIR% (4) The comment on MINIZIP was confusing. I am not sure what is meant by “…it is recommended to create a static library of minizip dynamically linked to the same zlib library than the one used for the hdf5 library”. But I am guessing that I have create a static build of minizip, and link it to the same version of the ZLIB dll used in the HDF5 build, am I correct? (5) I presume we don’t need to bother about UUID-DEV if we are on Windows? (6) What version of VS is recommended for all this compiling? I have VS 2012, VS 2013, and VS 2015 installed on my workstation. Thanks in advance for any response & for your patience with this long message.

Hi Sunil

Good to see you here!

  1. Fesapi works only with resqml 2.0 (and 2.0.1) currently. It does not work with any other given version of the Resqml schema.
    Conversion of XML schemas into C++ classes is operated using gsoap. This is just one of the various parts of fesapi. And yes gsoap could work on any version of Resqml (even witsml, prodml and all other xml schema of the world).
    Fesapi adds some higher level methods (which are more business oriented) to gsoap output.
    Fesapi also takes care of HDF5 and EPC support.
    Fesapi also uses SWIG to expose the C++ methods to Java or C# application.
    Finaly, the Resqml xml schema is not delivered as a part of fesapi. But the gsoap output coming from the Resqml xml schema are provided : fyi, they are in src/proxies.
    Some CMake directives could help you to generate C++ classes from xml schema using gsoap but it is not a lot maintained. We generate these proxies out of fesapi currently.

  2. There is not precompiled source in src, there is just some code in src.
    You maybe talk about the src/proxies directory which I defined above. All other subfolders of src are hand coded.
    By following the build steps, you are going to compile all the source code into a dll/lib/a/so llibrary.

  3. You can really do what you want with the dependencies. Usually minizip is built as a static library and HDF5 as a dynamic library but really it depends about what you want. Fesapi does not require anything about that, it just exists some general usage.
    I personaly use official precompiled version of HDF5, and I build by myself minizip. You are not forced at all to enable zlib in HDF5 if you don’t want to (But you won’t be able to read some Resqml documents with compressed HDF5 datasets). In the latter case, feel free to link minzip with the zlib library you want.

  4. Yes

  5. You don’t

  6. You can use whatever you want. I personnaly use VS2013 pro. My colleague is using VS 2015 community. I guess it should work on VS 2012 but I would say the earliest versio of VS would probably be the best one.

Thanks for the response (and moving the post to a separate topic). I have also copied my message from basecamp and posted here instead. My follow up comment was as follows: “Update - I was able to clone repo, install 3rd party dependencies (I built them), and configure/build the solution. Now I am going to try to read and execute the tests and examples therein, to get an idea of what it does, so I can better understand how to use it.”.

But regarding your above response, esp to query #2, I guess if I had to summarize, “the RESQML XML schema is not delivered, but instead the gsoap output generated from the RESQML schema is delivered, as part of the Fesapi package. On top of that, the build and installed libraries delivers business oriented higher level APIs/methods”. Is that correct? Would it be also fair to state that the tests/examples would contain examples of these higher level methods? I will look into trying the tests out more in the coming days. Thanks again for your time.

YES

More or less. I don’t really understand what you mean by “build and installed libraries”. If you are talking about minizip, HDF5 etc… the answer is no. These libraries just respectively give basic zip and hdf5 support for example i.e. it is not business oriented.
If you are talking about the other subfolders of src (which are to be built), the answer is almost yes. Indeed, in addition to “business oriented higher level APIs/methods”, you would also find support for EPC and,probably this year, you will find support for ETP.

It is fair for the “example” folder. You should start with the main method of example.cpp.
“test” folder is dedicated to unit test. You would obviously find usage of higher level methods within it but the main purpose keeps “unit testing”.

Thanks for your patience with this delayed & long response. I looked at the main method of example.cpp and it is doing a bunch of serializations by taking some file relative path strings as input. I have some questions.
(1) If I understand correctly, the example is designed to generate example epc and H5 file combo packages named after the string inputs, and the serialization calls build various components of these packages, am I right? I am going to test this shortly.
(2) Is there also an example for reading an existing EPC+H5 file combo package? The example.cpp didn’t seem to have that as far as I could tell.
(3) Regarding the individual serialization methods, as I see they respectively, build the wells, boundaries, geobodies, structural models, grids, activities, representation sets, etc. It is indeed helpful to see how these are serialized. But can you advise which of these are essential from a reservoir simulation standpoint? I would imagine grid (together with their associated sub-representations and properties) is absolutely required, but wells, boundaries, geobodies, structural model, etc would not typically be required (at least for our simulator, which takes well input from its own input file - perhaps these other objects would be required upstream for geophysicists and geoscientists who may need to exchange data across different earth model platforms).
(4) “Activities” seems to be serializing some user activity objects into the file (perhaps for logging purposes), while representation set representation appears to be saving arbitrary representations, previously defined, into a set of representations?

Update 1 - Everything builds OK. I am having trouble running the example. I set it as start up project, but when I try to run, I got an error “can’t find hdf5.dll”. I tried fixing this by copying the hdf5.dll from the dependencies/hdf5*/bin folder to the build folder and it gets past this. Next it complains it “can’t find zlib.dll”. But I don’t have a zlib.dll, I only have a zlib.lib which I tried copying to the build folder, but that doesn’t work.

Update 2 - I was able to locate a pre-compiled (using exact same compiler - x64_vs120) version of the same version of zlib DLL, and when I copied it to build folder, the example runs just fine and generates the EPC+H5 file combo package(s), yay!! PS: No rush on the responses to the other questions. Thanks again.

Hi Sunil,

  1. The example writes resqml epc+hdf5 files according to the filepath defined just above the main method. This is the done at line “deserialize(filePath);” in main method.
    It also reads those file. This is the done at line “if (serialize(filePath))” in main method.
    It also writes prodml according to the prodml_filepath defined just above the main method. This is the done at line “if (prodml_serialize(prodml_filePath));” in main method.
    It also reads those file. This is the done at line “prodml_deserialize(prodml_filePath);” in main method.

  2. see point above

  3. This is more a Resqml question than a fesapi question. Fesapi just provides acces to most of Resqml data, the semantic of these Resqml data belongs to the Resqml standard with Resqml documentation which you can download here : http://www.energistics.org/reservoir/resqml-standards/current-standards

  4. yes. Again the purpose of the example is just to provide info on how to access in reading and writing Resqml (and Prodml) data. There is no real business or reservoir semantic in this example. The semantic of Resqml belongs to the standard itself not to fesapi.

Updates : Good to read that you could generate fesapi and the example! On windows, you always must copy
next to your executable each dll which you have referenced at cmake configuration time. This is not fesapi behaviour but Visual C++ behaviour. The alternative is to have those dlls in your windows path.
On linux, you have not to do that unless you type “make install”. Again this is not fesapi behaviour at all but gcc/Linux behaviour.

Thanks again for the detailed response. The examples certainly help a lot in understanding the logistics, but in response to your quote below:

Did you mean that the data loaded into your examples doesn’t necessarily make physical sense or even follow the requirements of the API (or the schema)? For e.g., for the example that writes a four faulted sugar cube grid with parametric geometry, the setGeometryAsParametricSplittedPillarNodes API demands (based on comments in the code) that control nodes be specified increasing by pillar first, and then by control node, but the array of control nodes passed as input doesn’t necessarily seem to honor that requirement, instead, appearing to specify the XYZ co-ordinates of the tops of each pillar? Am I correct in my understanding? In other words, these examples are just showing how to export and import, what might be bogus data in some cases, without conforming to the physical requirements of the APIs?

I also wonder how you come up with the choice of the UUIDs (e.g., "“f2060ce0-fa3d-11e5-8620-0002a5d5c51b”) when serializing various components of the EPC+H5 combo package(s)? Are these just arbitrarily chosen strings that simply satisfy the UUID structure requirements?

Yes the example data doesn’t necessarily make physical sense. However, the same data mainly conforms to the API and consequently to the schema.
For example, I have created some activities but they have no particular meaning except to show that fesapi can deal with Resqml activities. But the produced activites conform to the official Resqml schema.
This is nearly the same about RepresentationSetRepresentation.
Finally, maybe the most important point, Fesapi won’t tell you what is a Resqml activity or what is a RepresentationSetRepresentation. Only Resqml staff/documentation/experts can explain you that. Fesapi allows you to read and write Resqml objects, fesapi does not directly help you to understand their purpose.

The given geometry in the example is fine.
“by pillar first” means that you first give a point on the first pillar then on the second pillar, then on the third pillar etc…
But indeed, the official documentation regarding the ordering of coordinates in a 3D grid is in Resqml documentation. Fesapi documentation is just a reminder, a “shortcut” to this documentation.

Yes

By the way, if you want to check the example graphically (or another example), you can look at the example with Paraview.
We have developed a visualisation plugin for Resqml in Paraview which can be downloaded here : http://forge2.pole-aquinetic.fr/file/showfiles.php?group_id=116&release_id=9
Please respect the version : fespp1.4.0 only with ParaView 5.2 for Windows
Documentation :

Please create a new topic in https://discourse.f2i-consulting.com/c/fespp if you have question about Fespp which is a separate project from fesapi.