Page MenuHomeFreeBSD

science/lammps: fix build on GCC architectures
ClosedPublic

Authored by pkubaj on Oct 12 2019, 4:26 PM.
Tags
None
Referenced Files
F82117081: D21994.diff
Thu, Apr 25, 4:58 PM
Unknown Object (File)
Sat, Apr 20, 4:12 PM
Unknown Object (File)
Jan 12 2024, 3:23 PM
Unknown Object (File)
Dec 20 2023, 4:47 AM
Unknown Object (File)
Nov 14 2023, 6:41 AM
Unknown Object (File)
Nov 10 2023, 12:52 PM
Unknown Object (File)
Nov 6 2023, 7:31 PM
Unknown Object (File)
Nov 1 2023, 5:52 PM
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.