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

Possible logic error for exported targets #1243

Closed
chapman39 opened this issue Dec 14, 2023 · 2 comments
Closed

Possible logic error for exported targets #1243

chapman39 opened this issue Dec 14, 2023 · 2 comments
Labels
bug Something isn't working question Further information is requested

Comments

@chapman39
Copy link
Contributor

chapman39 commented Dec 14, 2023

In the following code chunk, there is a possibility a target is found but explicitly disabled. For example, I don't think you would append openmp if ENABLE_OPENMP=OFF despite OPENMP_FOUND=ON. Perhaps change OR to AND?

https://github.com/LLNL/axom/blob/9410ed3db64ca1ab33b6053d8fd3e452c20bb562/src/cmake/AxomConfig.cmake#L165C23-L165C23

set(_optional_targets cli11 fmt hdf5 lua openmp sol sparsehash)
foreach(_tar ${_optional_targets})
    string(TOUPPER ${_tar} _upper_tar)
    if(ENABLE_${_upper_tar} OR ${_upper_tar}_FOUND)
        list(APPEND _axom_exported_targets ${_tar})
    endif()
endforeach()
@chapman39 chapman39 added bug Something isn't working question Further information is requested labels Dec 14, 2023
@white238
Copy link
Member

This shouldn't have openmp in it. We purposefully do not make any targets depend on openmp due to the issue with generator expressions. This will change soon with the new BLT macro.

This loop handles multiple generated variables between TPLs and internal builtin TPLs. The TPLs set the _FOUND variables and without verifying it, I think openmp was the only one with an ENABLE_ variable. This shouldn't cause an issue though because we are not setting OPENMP_FOUND and CMake's FindOpenMP.cmake sets OpenMP_FOUND.

Did you hit a bug that was showing a problem that made you look at this?

@chapman39
Copy link
Contributor Author

@white238 One of the TPLs I was linking against had -fopenmp, which is what caused the error. The loop makes sense the way it is, since otherwise I wouldn't have noticed my bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants