Coder Social home page Coder Social logo

Comments (8)

gonuke avatar gonuke commented on August 13, 2024

To make sure I understand: the solution would be to force all tests to use the headers from the build directory, right?

from dagmc.

pshriwise avatar pshriwise commented on August 13, 2024

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.

from dagmc.

ahnaf-tahmid-chowdhury avatar ahnaf-tahmid-chowdhury commented on August 13, 2024

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"

from dagmc.

gonuke avatar gonuke commented on August 13, 2024

What if we add SET(CMAKE_INCLUDE_DIRECTORES_BEFORE ON)?

Seems like a big hammer, and surprised we haven't encountered it before, but should work?

from dagmc.

ahnaf-tahmid-chowdhury avatar ahnaf-tahmid-chowdhury commented on August 13, 2024

What if we add SET(CMAKE_INCLUDE_DIRECTORES_BEFORE ON)?

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.

from dagmc.

gonuke avatar gonuke commented on August 13, 2024

But for the purpose of testing we probably always want the most local headers, right?

from dagmc.

ahnaf-tahmid-chowdhury avatar ahnaf-tahmid-chowdhury commented on August 13, 2024

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 CMAKE_INCLUDE_DIRECTORIES_BEFORE to ON can be one way to achieve this, but as I mentioned earlier, it can have unintended consequences if not used carefully.

from dagmc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.