Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lammps
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
multiscale
lammps
Commits
29e55521
Unverified
Commit
29e55521
authored
6 years ago
by
Steve Plimpton
Committed by
GitHub
6 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #924 from junghans/cmake_misc
miscellaneous CMake Fixes
parents
6cb0c2e9
965ac3ce
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cmake/CMakeLists.txt
+16
-9
16 additions, 9 deletions
cmake/CMakeLists.txt
with
16 additions
and
9 deletions
cmake/CMakeLists.txt
+
16
−
9
View file @
29e55521
...
@@ -2,9 +2,9 @@
...
@@ -2,9 +2,9 @@
# CMake build system
# CMake build system
# This file is part of LAMMPS
# This file is part of LAMMPS
# Created by Christoph Junghans and Richard Berger
# Created by Christoph Junghans and Richard Berger
cmake_minimum_required
(
VERSION
3
.1
)
cmake_minimum_required
(
VERSION
2.8
.1
2
)
project
(
lammps
LANGUAGES
CXX
)
project
(
lammps CXX
)
set
(
SOVERSION 0
)
set
(
SOVERSION 0
)
set
(
LAMMPS_SOURCE_DIR
${
CMAKE_CURRENT_SOURCE_DIR
}
/../src
)
set
(
LAMMPS_SOURCE_DIR
${
CMAKE_CURRENT_SOURCE_DIR
}
/../src
)
set
(
LAMMPS_LIB_SOURCE_DIR
${
CMAKE_CURRENT_SOURCE_DIR
}
/../lib
)
set
(
LAMMPS_LIB_SOURCE_DIR
${
CMAKE_CURRENT_SOURCE_DIR
}
/../lib
)
...
@@ -129,7 +129,7 @@ foreach(PKG ${ACCEL_PACKAGES} ${OTHER_PACKAGES})
...
@@ -129,7 +129,7 @@ foreach(PKG ${ACCEL_PACKAGES} ${OTHER_PACKAGES})
endforeach
()
endforeach
()
macro
(
pkg_depends PKG1 PKG2
)
macro
(
pkg_depends PKG1 PKG2
)
if
(
PKG_
${
PKG1
}
AND NOT PKG_
${
PKG2
}
)
if
(
PKG_
${
PKG1
}
AND
NOT
(
PKG_
${
PKG2
}
OR BUILD_
${
PKG2
}
)
)
message
(
FATAL_ERROR
"
${
PKG1
}
package needs LAMMPS to be build with
${
PKG2
}
"
)
message
(
FATAL_ERROR
"
${
PKG1
}
package needs LAMMPS to be build with
${
PKG2
}
"
)
endif
()
endif
()
endmacro
()
endmacro
()
...
@@ -137,23 +137,27 @@ endmacro()
...
@@ -137,23 +137,27 @@ endmacro()
pkg_depends
(
MPIIO MPI
)
pkg_depends
(
MPIIO MPI
)
pkg_depends
(
QEQ MANYBODY
)
pkg_depends
(
QEQ MANYBODY
)
pkg_depends
(
USER-ATC MANYBODY
)
pkg_depends
(
USER-ATC MANYBODY
)
pkg_depends
(
USER-H5MD MPI
)
pkg_depends
(
USER-LB MPI
)
pkg_depends
(
USER-LB MPI
)
pkg_depends
(
USER-MISC MANYBODY
)
pkg_depends
(
USER-MISC MANYBODY
)
pkg_depends
(
USER-PHONON KSPACE
)
pkg_depends
(
USER-PHONON KSPACE
)
pkg_depends
(
CORESHELL KSPACE
)
######################################################
######################################################
# packages with special compiler needs or external libs
# packages with special compiler needs or external libs
######################################################
######################################################
if
(
PKG_REAX OR PKG_MEAM OR PKG_USER-QUIP OR PKG_USER-QMMM OR PKG_LATTE
)
if
(
PKG_REAX OR PKG_MEAM OR PKG_USER-QUIP OR PKG_USER-QMMM OR PKG_LATTE
)
enable_language
(
Fortran
)
enable_language
(
Fortran
)
list
(
APPEND LAMMPS_LINK_LIBS
${
CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES
}
)
endif
()
endif
()
if
(
PKG_MEAM
)
if
(
PKG_MEAM
OR PKG_USER-H5MD OR PKG_USER-QMMM
)
enable_language
(
C
)
enable_language
(
C
)
endif
()
endif
()
if
(
PKG_KOKKOS OR PKG_MSCG
)
if
(
PKG_MSCG
)
if
(
CMAKE_VERSION VERSION_LESS
"3.1"
)
message
(
FATAL_ERROR
"For the MSCG package you need at least cmake-3.1"
)
endif
()
# starting with CMake 3.1 this is all you have to do to enforce C++11
# starting with CMake 3.1 this is all you have to do to enforce C++11
set
(
CMAKE_CXX_STANDARD 11
)
# C++11...
set
(
CMAKE_CXX_STANDARD 11
)
# C++11...
set
(
CMAKE_CXX_STANDARD_REQUIRED ON
)
#...is required...
set
(
CMAKE_CXX_STANDARD_REQUIRED ON
)
#...is required...
...
@@ -312,7 +316,7 @@ if(PKG_LATTE)
...
@@ -312,7 +316,7 @@ if(PKG_LATTE)
message
(
FATAL_ERROR
"LATTE not found, help CMake to find it by setting LATTE_LIBRARY, or set DOWNLOAD_LATTE=ON to download it"
)
message
(
FATAL_ERROR
"LATTE not found, help CMake to find it by setting LATTE_LIBRARY, or set DOWNLOAD_LATTE=ON to download it"
)
endif
()
endif
()
endif
()
endif
()
list
(
APPEND LAMMPS_LINK_LIBS
${
LATTE_LIBRARIES
}
${
LAPACK_LIBRARIES
}
${
CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES
}
)
list
(
APPEND LAMMPS_LINK_LIBS
${
LATTE_LIBRARIES
}
${
LAPACK_LIBRARIES
}
)
endif
()
endif
()
if
(
PKG_USER-MOLFILE
)
if
(
PKG_USER-MOLFILE
)
...
@@ -355,14 +359,14 @@ endif()
...
@@ -355,14 +359,14 @@ endif()
if
(
PKG_USER-QUIP
)
if
(
PKG_USER-QUIP
)
find_package
(
QUIP REQUIRED
)
find_package
(
QUIP REQUIRED
)
list
(
APPEND LAMMPS_LINK_LIBS
${
QUIP_LIBRARIES
}
${
LAPACK_LIBRARIES
}
${
CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES
}
)
list
(
APPEND LAMMPS_LINK_LIBS
${
QUIP_LIBRARIES
}
${
LAPACK_LIBRARIES
}
)
endif
()
endif
()
if
(
PKG_USER-QMMM
)
if
(
PKG_USER-QMMM
)
message
(
WARNING
"Building QMMM with CMake is still experimental"
)
message
(
WARNING
"Building QMMM with CMake is still experimental"
)
find_package
(
QE REQUIRED
)
find_package
(
QE REQUIRED
)
include_directories
(
${
QE_INCLUDE_DIRS
}
)
include_directories
(
${
QE_INCLUDE_DIRS
}
)
list
(
APPEND LAMMPS_LINK_LIBS
${
QE_LIBRARIES
}
${
CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES
}
)
list
(
APPEND LAMMPS_LINK_LIBS
${
QE_LIBRARIES
}
)
endif
()
endif
()
if
(
PKG_USER-VTK
)
if
(
PKG_USER-VTK
)
...
@@ -657,6 +661,9 @@ if(PKG_USER-INTEL)
...
@@ -657,6 +661,9 @@ if(PKG_USER-INTEL)
endif
()
endif
()
if
(
PKG_GPU
)
if
(
PKG_GPU
)
if
(
CMAKE_VERSION VERSION_LESS
"3.1"
)
message
(
FATAL_ERROR
"For the GPU package you need at least cmake-3.1"
)
endif
()
set
(
GPU_SOURCES_DIR
${
LAMMPS_SOURCE_DIR
}
/GPU
)
set
(
GPU_SOURCES_DIR
${
LAMMPS_SOURCE_DIR
}
/GPU
)
set
(
GPU_SOURCES
${
GPU_SOURCES_DIR
}
/gpu_extra.h
set
(
GPU_SOURCES
${
GPU_SOURCES_DIR
}
/gpu_extra.h
${
GPU_SOURCES_DIR
}
/fix_gpu.h
${
GPU_SOURCES_DIR
}
/fix_gpu.h
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment