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
Collected small changes and bugfixes #2023
Conversation
…yles also improve error message
…ing people downloading LAMMPS via git on windows
…that a windows target means cross-compiling
…into collected-small-changes
…ollected-small-changes
… to pick up the OpenMP ones otherwise
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@junghans is there a better way of doing this?
When compiling the GPU package with -DBUILD_MPI=off
and many other packages added somehow CMake picks up the path to a regular MPI package and thus linkage to the GPU library fails due to differences in the data type for the MPI communicator (with OpenMPI). With the changes in this commit things work again but it feels wrong. Shouldn't using the STUBS library replace any MPI library? Like it is done with the downloaded files for Windows?
(ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GPU GRANULAR KSPACE
MANYBODY MC MISC MOLECULE OPT PERI POEMS PYTHON QEQ REPLICA RIGID SHOCK SNAP
SPIN SRD USER-AWPMD USER-BOCS USER-CGDNA USER-CGSDK USER-COLVARS USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP USER-H5MD USER-INTEL USER-MANIFOLD USER-MEAMC USER-MESODPD USER-MISC USER-MOFFF USER-MOLFILE USER-OMP USER-PHONON USER-PTM USER-QTB USER-REACTION USER-REAXC USER-SDPD
USER-SMTBQ USER-SPH USER-TALLY USER-UEF USER-YAFF VORONOI)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@junghans I've seen this failing for flags like -g
or -march=native
and some others. For the latter I can see that this gives problems because of the =
sign. We should either find a better way to do this or just drop it and leave it to the user and just make certain that the flags that are enabled by default, if the CMAKE_TUNE_FLAGS
variable is not set, work with all supported compilers that match the compiler-ids we are comparing to.
cmake/Modules/Packages/GPU.cmake
Outdated
@@ -99,6 +99,9 @@ if(GPU_API STREQUAL "CUDA") | |||
add_library(gpu STATIC ${GPU_LIB_SOURCES} ${GPU_LIB_CUDPP_SOURCES} ${GPU_OBJS}) | |||
target_link_libraries(gpu PRIVATE ${CUDA_LIBRARIES} ${CUDA_CUDA_LIBRARY}) | |||
target_include_directories(gpu PRIVATE ${LAMMPS_LIB_BINARY_DIR}/gpu ${CUDA_INCLUDE_DIRS}) | |||
if(NOT BUILD_MPI) | |||
target_include_directories(gpu PRIVATE ${LAMMPS_SOURCE_DIR}/STUBS) | |||
endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you just do target_link_libraries(gpu PRIVATE MPI::MPI_CXX)
at the very bottom on GPU.cmake
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that is already there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think here is what is going on and I had similar discussion with @rbberger on #1956 as well. find_package(MPI)
will create an incomplete MPI::MPI_CXX
target and hence the aliasing of mpistubs
to MPI::MPI_CXX
will not forward the include directories.
One workaround to this would be to not use a target in the MPI::
namespace, e.g. LAMMPS::MPI
, however aliasing imported target, like MPI::MPI_CXX
(from find_package(MPI)
) isn't supported in CMake-3.10 yet, so this wasn't an option either.
See akohlmey#65 for slightly cleaner version of what you had.
cmake: reenable CMAKE_TUNE_FLAGS check
GPU.cmake: localize hackery
Summary
This PR combines multiple small changes that do not warrant a pull request of their own.
Author(s)
Axel Kohlmeyer (Temple U)
Related Issues
Includes and thus closes #2018
Includes and thus closes #2024
Closes #2028
Closes #2031
Includes and thus closes #2034
Licensing
By submitting this pull request, I agree, that my contribution will be included in LAMMPS and redistributed under either the GNU General Public License version 2 (GPL v2) or the GNU Lesser General Public License version 2.1 (LGPL v2.1).
Backward Compatibility
No known issues.
Implementation Notes
This PR addresses the following issues:
drip
compatible with suffix styles...
in src/MAKE/MINE to.gitignore
to avoid causing trouble for people using windowsThis should enable building on Windows natively with MinGW and a local MPI installation. See issue [BUG] Build with Win4MPI fails on Windows #2028
Post Submission Checklist