Package: liggghts / 3.5.0+repack1-10

01_add_cmake_files.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
Description: adds cmake files. Will hopefully be accepted by upstream.
Author: Anton Gladky <gladk@debian.org>
Last-Update: 2015-06-22

Index: LIGGGHTS-PUBLIC-3.5.0/CMakeLists.txt
===================================================================
--- /dev/null
+++ LIGGGHTS-PUBLIC-3.5.0/CMakeLists.txt
@@ -0,0 +1,87 @@
+# ENABLE_PACKAGE: enable PACKAGE-modules (OFF by default)
+# ENABLE_PACKAGEUSER: enable PACKAGEUSER-modules (OFF by default)
+# SUFFIX: add sufix to binary-name (NONE by default)
+# USERPATH: use RPATH for search of the shared library libliggghts, need to be switched on by packaging (ON by default)
+# VERSION: version number (2.2 by default)
+# LIB_SUFFIX: suffix, where libliggghts library will be installed, lib/${LIB_SUFFIX} (NONE by default)
+
+PROJECT(LIGGGHTS C CXX)
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+
+SET(CMAKE_VERBOSE_MAKEFILE 1)
+SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cMake")
+
+SET(VERSION 3.3.1)
+#=======================================
+
+FIND_PACKAGE(Boost COMPONENTS mpi serialization REQUIRED)
+INCLUDE_DIRECTORIES (${Boost_INCLUDE_DIRS})
+#=======================================
+
+INCLUDE(GNUInstallDirs)
+INCLUDE(FindPythonLibs)
+FIND_PACKAGE(VTK COMPONENTS vtkChartsCore vtkViewsContext2D vtkCommonCore vtkIOImage vtkIOXML vtkRenderingOpenGL  vtkIOLegacy vtkIOParallelXML)
+INCLUDE(${VTK_USE_FILE})
+IF(VTK_FOUND)
+  IF(${VTK_MAJOR_VERSION} EQUAL 6)
+    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DLAMMPS_VTK6 -DLAMMPS_VTK")
+    MESSAGE(STATUS "Found VTK6")
+  ELSE(${VTK_MAJOR_VERSION} EQUAL 6)
+    LINK_DIRECTORIES(${VTK_LIBRARY_DIRS})
+    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DLAMMPS_VTK")
+    MESSAGE(STATUS "Found VTK")
+  ENDIF(${VTK_MAJOR_VERSION} EQUAL 6)
+  INCLUDE_DIRECTORIES(${VTK_INCLUDE_DIRS})
+  
+  FIND_PACKAGE(Eigen3 REQUIRED)
+  INCLUDE_DIRECTORIES(${EIGEN3_INCLUDE_DIR})
+  MESSAGE(STATUS "Found Eigen3")
+ELSE(VTK_FOUND)
+  MESSAGE(STATUS "VTK NOT found!")
+ENDIF(VTK_FOUND)
+
+#=======================================
+SET(CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -std=c++0x")
+
+INCLUDE(FindJPEG)
+IF(JPEG_FOUND)
+  INCLUDE_DIRECTORIES(${JPEG_INCLUDE_DIR})
+  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DLAMMPS_JPEG")
+ELSE(JPEG_FOUND)
+  MESSAGE(STATUS "JPEG NOT found!")
+ENDIF(JPEG_FOUND)
+
+#=======================================
+
+INCLUDE(FindMPI)
+IF(MPI_C_FOUND AND MPI_CXX_FOUND)
+  SET(CMAKE_C_COMPILER ${MPI_C_COMPILER})
+  SET(CMAKE_CXX_COMPILER ${MPI_CXX_COMPILER})
+ELSE(MPI_C_FOUND AND MPI_CXX_FOUND)
+  #Check old FindMPI version
+  IF(MPI_COMPILER)
+    SET(CMAKE_C_COMPILER ${MPI_COMPILER})
+    SET(CMAKE_CXX_COMPILER ${MPI_COMPILER})
+  ELSE(MPI_COMPILER)
+    MESSAGE(FATAL_ERROR "MPI-COMPILER NOT found!")
+  ENDIF(MPI_COMPILER)
+ENDIF(MPI_C_FOUND AND MPI_CXX_FOUND)
+
+#=======================================
+
+#Disabled modules
+#GPU KIM MEAM POEMS REAX SRD
+IF(ENABLE_PACKAGE)
+  SET(MODULES_PACKAGE ASPHERE CLASS2 COLLOID DIPOLE FLD GRANULAR KSPACE MANYBODY MC MOLECULE OPT PERI REPLICA SHOCK  XTC)
+ENDIF(ENABLE_PACKAGE)
+#Disabled modules
+#USER-MISC
+IF(ENABLE_PACKAGEUSER)
+  SET(MODULES_USER USER-ATC USER-AWPMD USER-CG-CMM USER-CUDA USER-EFF USER-EWALDN USER-OMP USER-REAXC USER-SPH)
+ENDIF(ENABLE_PACKAGEUSER)
+#=======================================
+
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR})
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src)
+
+ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/src")
Index: LIGGGHTS-PUBLIC-3.5.0/src/CMakeLists.txt
===================================================================
--- LIGGGHTS-PUBLIC-3.5.0.orig/src/CMakeLists.txt
+++ LIGGGHTS-PUBLIC-3.5.0/src/CMakeLists.txt
@@ -1,115 +1,57 @@
-PROJECT(LIGGGHTS C CXX)
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
+FILE(GLOB SRC_FILES_SRC "*.cpp")
+SET(SRC_FILES ${SRC_FILES_SRC})
 
-SET(LIGGGHTS_MAJOR_VERSION 3)
-SET(LIGGGHTS_MINOR_VERSION 2)
-SET(LIGGGHTS_PATCH_VERSION 1)
-SET(LIGGGHTS_VERSION ${LIGGGHTS_MAJOR_VERSION}.${LIGGGHTS_MINOR_VERSION}.${LIGGGHTS_PATCH_VERSION})
-
-IF (NOT CMAKE_CXX_FLAGS)
-  IF(CMAKE_COMPILER_IS_GNUCXX)
-    SET(CMAKE_CXX_FLAGS "-O2 -funroll-loops -fstrict-aliasing -Wall -Wno-uninitialized -std=c++11 -Wno-literal-suffix")
-  ENDIF()
-ENDIF()
-
-FILE(GLOB SOURCES *.cpp)
-#LIST(REMOVE_ITEM SOURCES main.cpp)
-
-IF(WIN32)
-  #include (GenerateExportHeader)
-  INCLUDE_DIRECTORIES(WINDOWS/extra)
-  ADD_DEFINITIONS(-D_USE_MATH_DEFINES -DNOMINMAX)
-
-  IF(MSVC)
-    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj")
-  ENDIF()
-
-  FIND_PACKAGE(Cygwin REQUIRED)
-
-  ADD_CUSTOM_TARGET(GenerateHeaders
-           COMMAND GenerateHeaders.bat ${CYGWIN_INSTALL_PATH}
-           WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/WINDOWS)
-ELSE()
-  ADD_CUSTOM_TARGET(GenerateHeaders
-           COMMAND sh Make.sh style
-           COMMAND sh Make.sh models
-           WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
-ENDIF()
-
-#ADD_LIBRARY(liggghts STATIC ${SOURCES})
-#ADD_LIBRARY(liggghts SHARED ${SOURCES})
-#GENERATE_EXPORT_HEADER( liggghts
-#             BASE_NAME liggghts
-#             EXPORT_MACRO_NAME liggghts_EXPORT
-#             EXPORT_FILE_NAME liggghts_Export.h
-#             STATIC_DEFINE liggghts_BUILT_AS_STATIC
-#)
-#ADD_DEPENDENCIES(liggghts GenerateHeaders)
-
-#ADD_EXECUTABLE(liggghts_bin main.cpp)
-ADD_EXECUTABLE(liggghts_bin ${SOURCES})
-#TARGET_LINK_LIBRARIES(liggghts_bin liggghts)
-ADD_DEPENDENCIES(liggghts_bin GenerateHeaders)
-SET_TARGET_PROPERTIES(liggghts_bin PROPERTIES OUTPUT_NAME liggghts)
+FILE(GLOB SRC_FILES_HEAD "*.h")
 
-#=======================================
+FOREACH(SUB_DIR_ADD ${MODULES_PACKAGE} ${MODULES_USER})
+ MESSAGE("SUB_DIR_ADD: ${SUB_DIR_ADD}")
+ FILE(GLOB SRC_FILES_ADD "${SUB_DIR_ADD}/*.cpp")
+ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/${SUB_DIR_ADD})
+ SET(SRC_FILES ${SRC_FILES} ${SRC_FILES_ADD})
+ENDFOREACH(SUB_DIR_ADD ${MODULES_PACKAGE} ${MODULES_USER})
+
+
+#======================================================
+IF (USERPATH)
+  SET(CMAKE_SKIP_BUILD_RPATH FALSE)
+  SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
+  SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/")
+  SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+ENDIF (USERPATH)
+#======================================================
+
+FILE(GLOB to_remove main.cpp)
+LIST(REMOVE_ITEM SRC_FILES ${to_remove})
+
+ADD_LIBRARY(libliggghts SHARED ${SRC_FILES})
+TARGET_LINK_LIBRARIES(libliggghts ${Boost_LIBRARIES})
+SET_TARGET_PROPERTIES(libliggghts PROPERTIES 
+  OUTPUT_NAME "liggghts${SUFFIX}"
+  VERSION ${VERSION}
+  SOVERSION 3)
 
-FIND_PACKAGE(VTK NO_MODULE)
+IF(JPEG_FOUND)
+  TARGET_LINK_LIBRARIES(libliggghts ${JPEG_LIBRARIES})
+ENDIF(JPEG_FOUND)
 
 IF(VTK_FOUND)
-  INCLUDE(${VTK_USE_FILE})
-  ADD_DEFINITIONS(-DLAMMPS_VTK)
-#  TARGET_LINK_LIBRARIES(liggghts ${VTK_LIBRARIES})
-  TARGET_LINK_LIBRARIES(liggghts_bin ${VTK_LIBRARIES})
-  MESSAGE(STATUS "Found VTK")
-ELSE(VTK_FOUND)
-  MESSAGE(STATUS "VTK NOT found!")
+  IF(${VTK_MAJOR_VERSION} EQUAL 6)
+    TARGET_LINK_LIBRARIES(libliggghts ${VTK_LIBRARIES})
+  ELSE(${VTK_MAJOR_VERSION} EQUAL 6)
+    TARGET_LINK_LIBRARIES(libliggghts vtkHybrid)
+  ENDIF(${VTK_MAJOR_VERSION} EQUAL 6)
 ENDIF(VTK_FOUND)
 
-#=======================================
-
-FIND_PACKAGE(JPEG)
+INSTALL(TARGETS libliggghts DESTINATION "${CMAKE_INSTALL_LIBDIR}/")
+#======================================================
 
-IF(JPEG_FOUND)
-  INCLUDE_DIRECTORIES(${JPEG_INCLUDE_DIR})
-  ADD_DEFINITIONS(-DLAMMPS_JPEG)
-  #TARGET_LINK_LIBRARIES(liggghts jpeg)
-  TARGET_LINK_LIBRARIES(liggghts_bin jpeg)
-ELSE(JPEG_FOUND)
-  MESSAGE(STATUS "JPEG NOT found!")
-ENDIF(JPEG_FOUND)
+ADD_EXECUTABLE(liggghts main.cpp)
+SET_TARGET_PROPERTIES(liggghts PROPERTIES OUTPUT_NAME "liggghts${SUFFIX}")
+TARGET_LINK_LIBRARIES(liggghts libliggghts)
 
-#=======================================
+INSTALL(TARGETS liggghts DESTINATION "${CMAKE_INSTALL_BINDIR}/")
 
-FIND_PACKAGE(MPI)
+#======================================================
 
-IF(MPI_FOUND)
-  INCLUDE_DIRECTORIES(${MPI_INCLUDE_PATH})
-#  TARGET_LINK_LIBRARIES(liggghts ${MPI_LIBRARIES})
-  TARGET_LINK_LIBRARIES(liggghts_bin ${MPI_LIBRARIES})
-
-  IF(MPI_COMPILE_FLAGS)
-#    SET_TARGET_PROPERTIES(liggghts PROPERTIES COMPILE_FLAGS "${MPI_COMPILE_FLAGS}")
-    SET_TARGET_PROPERTIES(liggghts_bin PROPERTIES COMPILE_FLAGS "${MPI_COMPILE_FLAGS}")
-  ENDIF()
-
-  IF(MPI_LINK_FLAGS)
-#    SET_TARGET_PROPERTIES(liggghts PROPERTIES LINK_FLAGS "${MPI_LINK_FLAGS}")
-    SET_TARGET_PROPERTIES(liggghts_bin PROPERTIES LINK_FLAGS "${MPI_LINK_FLAGS}")
-  ENDIF()
-ELSE(MPI_FOUND)
-  MESSAGE(STATUS "MPI NOT found! Using MPI Stubs instead.")
-  ADD_SUBDIRECTORY(STUBS)
-#  TARGET_LINK_LIBRARIES(liggghts mpi_stubs)
-  TARGET_LINK_LIBRARIES(liggghts_bin mpi_stubs)
-ENDIF(MPI_FOUND)
-
-#=======================================
-
-#install(TARGETS liggghts liggghts_bin
-#        RUNTIME DESTINATION bin
-#        LIBRARY DESTINATION lib)
-
-install(TARGETS liggghts_bin
-        RUNTIME DESTINATION bin
-        LIBRARY DESTINATION lib)
+INSTALL(FILES ${SRC_FILES_HEAD} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/liggghts${SUFFIX}/")
+#======================================================