2 # CMake project file for cluster analysis from WHAM for single-chain proteins
5 enable_language (Fortran)
7 #================================
8 # Set source file lists
9 #================================
10 set(UNRES_CLUSTER_WHAM_SRC0
44 set(UNRES_CLUSTER_WHAM_PP_SRC
59 #================================================
60 # Set comipiler flags for different sourcefiles
61 #================================================
62 if (Fortran_COMPILER_NAME STREQUAL "ifort")
63 set(FFLAGS0 "-ip -w -I. -I${CMAKE_CURRENT_SOURCE_DIR}/include_unres " )
64 elseif (Fortran_COMPILER_NAME STREQUAL "gfortran")
65 set(FFLAGS0 "-I. -I${CMAKE_CURRENT_SOURCE_DIR}/include_unres " )
66 endif (Fortran_COMPILER_NAME STREQUAL "ifort")
68 # Add MPI compiler flags
70 set(FFLAGS0 "${FFLAGS0} -I${MPIF_INCLUDE_DIRECTORIES}")
73 set_property(SOURCE ${UNRES_CLUSTER_WHAM_SRC0} PROPERTY COMPILE_FLAGS ${FFLAGS0} )
75 set(CPPFLAGS "PROCOR -DSPLITELE -DPROCOR -DCRYST_BOND -DCRYST_THETA -DCRYST_SC" )
77 if (Fortran_COMPILER_NAME STREQUAL "ifort")
78 # Add ifort preprocessor flags
79 set(CPPFLAGS "${CPPFLAGS} -DPGI")
80 elseif (Fortran_COMPILER_NAME STREQUAL "f95")
81 # Add new gfortran flags
82 set(CPPFLAGS "${CPPFLAGS} -DG77")
83 elseif (Fortran_COMPILER_NAME STREQUAL "gfortran")
84 # Add old gfortran flags
85 set(CPPFLAGS "${CPPFLAGS} -DG77")
86 endif (Fortran_COMPILER_NAME STREQUAL "ifort")
89 #=========================================
90 # System specific flags
91 #=========================================
92 if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
93 set(CPPFLAGS "${CPPFLAGS} -DLINUX")
94 endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
96 #=========================================
97 # Add MPI preprocessor flags
98 #=========================================
100 set(CPPFLAGS "${CPPFLAGS} -DMP -DMPI")
101 endif(UNRES_WITH_MPI)
104 #=========================================
105 # Apply preprocesor flags to *.F files
106 #=========================================
107 set_property(SOURCE ${UNRES_CLUSTER_WHAM_PP_SRC} PROPERTY COMPILE_DEFINITIONS ${CPPFLAGS} )
110 #========================================
111 # Setting binary name
112 #========================================
113 set(UNRES_CLUSTER_WHAM_BIN "unres_clustMD.exe")
115 #=========================================
116 # cinfo.f stupid workaround for cmake
118 #=========================================
119 #set_property(SOURCE compinfo.c PROPERTY CMAKE_C_FLAGS "-c" )
120 #add_executable(compinfo-wham-m compinfo.c)
121 #set_target_properties(compinfo-wham-m PROPERTIES OUTPUT_NAME compinfo)
123 #set(UNRES_CINFO_DIR "${CMAKE_CURRENT_BINARY_DIR}" )
124 #add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/cinfo.f
125 # COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/cinfo.f ${CMAKE_CURRENT_BINARY_DIR}/cinfo.f
126 # COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/COMMON.IOUNITS ${CMAKE_CURRENT_BINARY_DIR}/COMMON.IOUNITS
127 # COMMAND ${CMAKE_CURRENT_BINARY_DIR}/compinfo | true
128 # DEPENDS compinfo-wham-m )
129 #set_property(SOURCE ${UNRES_CINFO_DIR}/cinfo.f PROPERTY COMPILE_FLAGS ${FFLAGS0} )
131 set_property(SOURCE proc_proc.c PROPERTY COMPILE_DEFINITIONS "LINUX -DPGI" )
135 #=========================================
136 # Set full unres CLUSTER sources
137 #=========================================
138 set(UNRES_CLUSTER_WHAM_SRCS ${UNRES_CLUSTER_WHAM_SRC0} proc_proc.c)
142 #=========================================
144 #=========================================
145 add_executable(UNRES_CLUSTER_WHAM_BIN ${UNRES_CLUSTER_WHAM_SRCS} )
146 set_target_properties(UNRES_CLUSTER_WHAM_BIN PROPERTIES OUTPUT_NAME ${UNRES_CLUSTER_WHAM_BIN})
148 #=========================================
150 #=========================================
151 # link MPI library (libmpich.a)
153 target_link_libraries( UNRES_CLUSTER_WHAM_BIN ${MPIF_LIBRARIES} )
154 endif(UNRES_WITH_MPI)
156 target_link_libraries( UNRES_CLUSTER_WHAM_BIN xdrf )
158 #=========================================
160 #=========================================
162 #-- Copy all the data files from the test directory into the source directory
163 #SET(UNRES_TEST_FILES
167 #FOREACH (UNRES_TEST_FILE ${UNRES_TEST_FILES})
168 # SET (unres_test_dest "${CMAKE_CURRENT_BINARY_DIR}/${UNRES_TEST_FILE}")
169 # MESSAGE (STATUS " Copying ${UNRES_TEST_FILE} from ${CMAKE_SOURCE_DIR}/examples/unres/MD/ff_gab/${UNRES_TEST_FILE} to ${unres_test_dest}")
170 # ADD_CUSTOM_COMMAND (
171 # TARGET ${UNRES_BIN}
173 # COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/examples/unres/MD/ff_gab/${UNRES_TEST_FILE} ${unres_test_dest}
175 #ENDFOREACH (UNRES_TEST_FILE ${UNRES_TEST_FILES})
177 #=========================================
178 # Generate data test files
179 #=========================================
181 #=========================================
183 #FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/test_single_ala.sh
187 #-----------------------------------------------------------------------------
188 #UNRES_BIN=./${UNRES_BIN}
189 #-----------------------------------------------------------------------------
190 #DD=${CMAKE_SOURCE_DIR}/PARAM
191 #export BONDPAR=$DD/bond.parm
192 #export THETPAR=$DD/thetaml.5parm
193 #export ROTPAR=$DD/scgauss.parm
194 #export TORPAR=$DD/torsion_631Gdp.parm
195 #export TORDPAR=$DD/torsion_double_631Gdp.parm
196 #export ELEPAR=$DD/electr_631Gdp.parm
197 #export SIDEPAR=$DD/sc_GB_opt.1gab_3S_qclass5no310-shan2-sc-16-10-8k
198 #export FOURIER=$DD/fourier_opt.parm.1igd_hc_iter3_3
199 #export SCPPAR=$DD/scp.parm
200 #export SCCORPAR=$DD/rotcorr_AM1.parm
201 #export PATTERN=$DD/patterns.cart
202 #-----------------------------------------------------------------------------
206 #=========================================
208 #=========================================
210 #file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/ala10.inp
212 #SEED=-1111333 MD ONE_LETTER rescale_mode=2 PDBOUT
213 #nstep=15000 ntwe=100 ntwx=1000 dt=0.1 lang=0 tbf t_bath=300 damax=1.0 &
214 #reset_moment=1000 reset_vel=1000 MDPDB
215 #WLONG=1.35279 WSCP=1.59304 WELEC=0.71534 WBOND=1.00000 WANG=1.13873 &
216 #WSCLOC=0.16258 WTOR=1.98599 WTORD=1.57069 WCORRH=0.42887 WCORR5=0.00000 &
217 #WCORR6=0.00000 WEL_LOC=0.16036 WTURN3=1.68722 WTURN4=0.66230 WTURN6=0.00000 &
218 #WVDWPP=0.11371 WHPB=1.00000 &
219 #CUTOFF=7.00000 WCORR4=0.00000
224 # 90.0000 90.0000 90.0000 90.000 90.000 90.000 90.000 90.000
226 # 180.0000 180.0000 180.0000 180.000 180.000 180.000 180.000 180.000
228 # 110.0000 110.0000 110.0000 100.000 110.000 100.000 110.000 110.000
230 # -120.0000 -120.0000 -120.000 -120.000 -120.000 -120.000 -120.000 -120.000
231 # -120.0000 -120.0000
237 #if(NOT UNRES_WITH_MPI)
239 # add_test(NAME UNRES_MD_Ala10 COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_single_ala.sh )
241 #endif(NOT UNRES_WITH_MPI)