Page MenuHomeFreeBSD

science/lammps: fix build on GCC architectures
ClosedPublic

Authored by pkubaj on Oct 12 2019, 4:26 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 19, 8:39 PM
Unknown Object (File)
Tue, Nov 12, 6:09 PM
Unknown Object (File)
Thu, Nov 7, 6:19 PM
Unknown Object (File)
Sep 30 2024, 4:58 AM
Unknown Object (File)
Sep 29 2024, 11:03 PM
Unknown Object (File)
Sep 26 2024, 1:30 AM
Unknown Object (File)
Sep 25 2024, 12:24 PM
Unknown Object (File)
Sep 25 2024, 7:02 AM
Subscribers
None

Details

Summary

Don't set BUILD_OMP. libomp is correctly found and used when building with clang anyway.

MPI needs C11 compiler.

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

tcberner added inline comments.
science/lammps/Makefile
36 ↗(On Diff #63183)

I don't undestand this change, the option toggle looked correct to me.

This revision now requires changes to proceed.Oct 12 2019, 7:57 PM

It breaks GCC: https://github.com/lammps/lammps/pull/1483

Clang can find libomp anyway without this switch and use it.

science/lammps/Makefile
36 ↗(On Diff #63183)

It breaks GCC: https://github.com/lammps/lammps/pull/1483

Clang can find libomp anyway without this switch and use it.

Then think about switching it to use CMAKE_DISABLE_FIND_PACKAGE_OpenMP. -- if you remove the toggle then you can just as well remove the option as it will not do anything sensible in an unclean environment, where the dependency may be present even though the option is off.

Set CMAKE_DISABLE_FIND_PACKAGE_OpenMP when using GCC.

I can confirm this builds on my blackbird.

Does that mean mentor approval?

I can confirm this builds on my blackbird.

tcberner: does the latest change answer your objection?

It still looks slightly wrong to me. Now on GCC wenn you set the option ON you'll disable finding it, but when you set the Option OFF it will try to execute the find call, and again might find it when installed. Imho you should disable the find call on GCC no matter what the option value, or mark option=on broken on GCC.

But...If you are sure that this is what you want, then go ahead :)

Make OPENMP option clang-only and add CMAKE_DISABLE_FIND_PACKAGE_OpenMP when using gcc.

science/lammps/Makefile
24 ↗(On Diff #64108)

^don't you want =true here?

30 ↗(On Diff #64108)

^ is the OPENMP no issue on gcc-architectures, where the option is not defined?

science/lammps/Makefile
24 ↗(On Diff #64108)

Actually, it doesn't seem to matter whether it's true or false, but some value needs to be passed, because otherwise there's an error:

Parse error in command line argument: -DCMAKE_DISABLE_FIND_PACKAGE_OpenMP
Should be: VAR:type=value
CMake Error: No cmake script provided.
30 ↗(On Diff #64108)

No, that's not an issue, the port builds.

Given you tested it, that looks good to me as a whole now (with that small nitpick above).

This revision is now accepted and ready to land.Nov 27 2019, 7:33 PM
This revision was automatically updated to reflect the committed changes.