-
Notifications
You must be signed in to change notification settings - Fork 51
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
Linker error when switching off MPI (and hence ADIOS1) #317
Comments
Thanks for this detailed and concise report! To be honest, I have lost track of the valid build configurations regarding ADIOS1. The library itself is not intended to be used for the purposes we aim for in this API (frictionless serial/MPI interoperability in single source). See ornladios/ADIOS#183 if you're interested.
That is actually not our desired behaviour and might be a bug in our Looking at the CMake logic, I can not see an apparent problem there. The likely reason why ADIOS gets disabled in the first place in your build is that it can not be found:
You may have to adjust your environment (see PIConGPU). ... which still does not solve the linking problem. Are you able to build the examples and tests from the I'm honestly out of ideas what the cause could be. My suspicion is that this |
Thx! |
...
|
The complete #include <openPMD/openPMD.hpp>
#include <iostream>
#include <memory>
#include <cstddef>
using std::cout;
using namespace openPMD;
int main()
{
Series series = Series(
"../samples/git-sample/data%T.h5",
AccessType::READ_ONLY
);
cout << "Read a Series with openPMD standard version "
<< series.openPMD() << '\n';
cout << "The Series contains " << series.iterations.size() << " iterations:";
for( auto const& i : series.iterations )
cout << "\n\t" << i.first;
cout << '\n';
Iteration i = series.iterations[100];
cout << "Iteration 100 contains " << i.meshes.size() << " meshes:";
for( auto const& m : i.meshes )
cout << "\n\t" << m.first;
cout << '\n';
cout << "Iteration 100 contains " << i.particles.size() << " particle species:";
for( auto const& ps : i.particles )
cout << "\n\t" << ps.first;
cout << '\n';
MeshRecordComponent E_x = i.meshes["E"]["x"];
Extent extent = E_x.getExtent();
cout << "Field E/x has shape (";
for( auto const& dim : extent )
cout << dim << ',';
cout << ") and has datatype " << E_x.getDatatype() << '\n';
Offset chunk_offset = {1, 1, 1};
Extent chunk_extent = {2, 2, 1};
auto chunk_data = E_x.loadChunk<double>(chunk_offset, chunk_extent);
cout << "Queued the loading of a single chunk from disk, "
"ready to execute\n";
series.flush();
cout << "Chunk has been read from disk\n"
<< "Read chunk contains:\n";
for( size_t row = 0; row < chunk_extent[0]; ++row )
{
for( size_t col = 0; col < chunk_extent[1]; ++col )
cout << "\t"
<< '(' << row + chunk_offset[0] << '|' << col + chunk_offset[1] << '|' << 1 << ")\t"
<< chunk_data.get()[row*chunk_extent[1]+col];
cout << '\n';
}
return 0;
} |
You grabbed a hammer and there might be a nail: |
Could be. But I think I just forgot to pass the dummy-ADIOS lib to the CMake config package. We will debug this, he sits next seat to me :D |
@C0nsultant The tests and examples build without any problems. |
First note: the linker line in target_link_libraries(targetName PRIVATE openPMD::openPMD) ( |
Yep, that's the error. You just find the include already because you installed in a system path. |
Ok, so it was on my side. It's working fine now, thanks for your help! |
Describe the bug
When building and installing openPMD using the CMake script without support for MPI (which will also switch off support for ADIOS1), attempts to include the installed library into another project will fail.
To Reproduce
Build the library without support for MPI:
cmake -D openPMD_USE_MPI=OFF -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON <path to source>
Output:
Install the library using
cmake --build . --target install
and create a new sample project that includes the library (e.g. the example in the openPMD documentation).Use CMake to build this project, CMakeLists.txt:
Use
cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON <path to sample project>
:Build the sample project using
cmake --build .
:Expected behavior
The library should be possible to include into other projects after building it without support for MPI.
Software Environment:
Additional context
A current workaround is to comment out the line
return std::make_shared< ADIOS1IOHandler >(path, accessType);
in/src/IO/AbstractIOHandlerHelper.cpp
, the library will include without any errors then.The text was updated successfully, but these errors were encountered: