-
Notifications
You must be signed in to change notification settings - Fork 66
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
Tests build with installed version of DAGMC if present #877
Comments
To make sure I understand: the solution would be to force all tests to use the headers from the build directory, right? |
That would be my proposal, yes. I haven't looked at the CMake files, but I don't expect it would be a big change. |
One way to do this is by adding the build directory to the include path before the installation directory. include_directories(${CMAKE_BINARY_DIR}/src/dagmc ${CMAKE_INSTALL_INCLUDEDIR}) Or, we can modify the tests themselves. #include "${CMAKE_BINARY_DIR}/src/dagmc/DagMC.hpp" |
What if we add Seems like a big hammer, and surprised we haven't encountered it before, but should work? |
According to my knowledge, DAGMC depends on third-party libraries installed in the system include directories. So, if these libraries have conflicting versions or headers with DAGMC, this could lead to unexpected behavior or compilation errors. However, we can resolve that by testing DAGMC in different build environments (Geant4, OpenMC, PyNE etc) to ensure that it works as expected. |
But for the purpose of testing we probably always want the most local headers, right? |
Yes, it is usually best to use the most local headers to ensure that the tests are using the correct version of the code. Setting |
I have tried all the methods above, but nothing has worked out. I think we need to reconfigure the |
Describe the Bug
With the merge of #876 I noticed after pulling those changes that I couldn't rebuild DagMC successfully due to missing symbols at the linking stage of building our test programs. The error was a missing symbol to the DagMC constructor with signature
DagMC::DagMC(std::shared_ptr<Interface>, double, double)
We of course now have an extra
int
argument at the end of our constructors. The problem turned out to be that the test program is using the installedDagMC.hpp
header instead of the one in the build directory. The installed header came from before I pulled the recent changes in that PR and contains the old constructor signature. When that test program tries to link to the DAGMC library compiled in the build directory, it then throws an error for a missing symbol.To Reproduce
For an existing build of DAGMC (w/
PATH
env var set to include the current DAGMC installation), pull the changes from #876 and attempt to rebuild DAGMC.The text was updated successfully, but these errors were encountered: