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
43 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 #=========================================
132 # Set full unres CLUSTER sources
133 #=========================================
134 set(UNRES_CLUSTER_WHAM_SRCS ${UNRES_CLUSTER_WHAM_SRC0} ${CMAKE_CURRENT_SOURCE_DIR}/proc_proc.c)
136 #=========================================
138 #=========================================
139 add_executable(UNRES_CLUSTER_WHAM_BIN ${UNRES_CLUSTER_WHAM_SRCS} )
140 set_target_properties(UNRES_CLUSTER_WHAM_BIN PROPERTIES OUTPUT_NAME ${UNRES_CLUSTER_WHAM_BIN})
142 #=========================================
144 #=========================================
145 # link MPI library (libmpich.a)
147 target_link_libraries( UNRES_CLUSTER_WHAM_BIN ${MPIF_LIBRARIES} )
148 endif(UNRES_WITH_MPI)
150 target_link_libraries( UNRES_CLUSTER_WHAM_BIN xdrf )
152 #=========================================
154 #=========================================
156 #-- Copy all the data files from the test directory into the source directory
157 #SET(UNRES_TEST_FILES
161 #FOREACH (UNRES_TEST_FILE ${UNRES_TEST_FILES})
162 # SET (unres_test_dest "${CMAKE_CURRENT_BINARY_DIR}/${UNRES_TEST_FILE}")
163 # MESSAGE (STATUS " Copying ${UNRES_TEST_FILE} from ${CMAKE_SOURCE_DIR}/examples/unres/MD/ff_gab/${UNRES_TEST_FILE} to ${unres_test_dest}")
164 # ADD_CUSTOM_COMMAND (
165 # TARGET ${UNRES_BIN}
167 # COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/examples/unres/MD/ff_gab/${UNRES_TEST_FILE} ${unres_test_dest}
169 #ENDFOREACH (UNRES_TEST_FILE ${UNRES_TEST_FILES})
171 #=========================================
172 # Generate data test files
173 #=========================================
175 #=========================================
177 #FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/test_single_ala.sh
181 #-----------------------------------------------------------------------------
182 #UNRES_BIN=./${UNRES_BIN}
183 #-----------------------------------------------------------------------------
184 #DD=${CMAKE_SOURCE_DIR}/PARAM
185 #export BONDPAR=$DD/bond.parm
186 #export THETPAR=$DD/thetaml.5parm
187 #export ROTPAR=$DD/scgauss.parm
188 #export TORPAR=$DD/torsion_631Gdp.parm
189 #export TORDPAR=$DD/torsion_double_631Gdp.parm
190 #export ELEPAR=$DD/electr_631Gdp.parm
191 #export SIDEPAR=$DD/sc_GB_opt.1gab_3S_qclass5no310-shan2-sc-16-10-8k
192 #export FOURIER=$DD/fourier_opt.parm.1igd_hc_iter3_3
193 #export SCPPAR=$DD/scp.parm
194 #export SCCORPAR=$DD/rotcorr_AM1.parm
195 #export PATTERN=$DD/patterns.cart
196 #-----------------------------------------------------------------------------
200 #=========================================
202 #=========================================
204 #file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/ala10.inp
206 #SEED=-1111333 MD ONE_LETTER rescale_mode=2 PDBOUT
207 #nstep=15000 ntwe=100 ntwx=1000 dt=0.1 lang=0 tbf t_bath=300 damax=1.0 &
208 #reset_moment=1000 reset_vel=1000 MDPDB
209 #WLONG=1.35279 WSCP=1.59304 WELEC=0.71534 WBOND=1.00000 WANG=1.13873 &
210 #WSCLOC=0.16258 WTOR=1.98599 WTORD=1.57069 WCORRH=0.42887 WCORR5=0.00000 &
211 #WCORR6=0.00000 WEL_LOC=0.16036 WTURN3=1.68722 WTURN4=0.66230 WTURN6=0.00000 &
212 #WVDWPP=0.11371 WHPB=1.00000 &
213 #CUTOFF=7.00000 WCORR4=0.00000
218 # 90.0000 90.0000 90.0000 90.000 90.000 90.000 90.000 90.000
220 # 180.0000 180.0000 180.0000 180.000 180.000 180.000 180.000 180.000
222 # 110.0000 110.0000 110.0000 100.000 110.000 100.000 110.000 110.000
224 # -120.0000 -120.0000 -120.000 -120.000 -120.000 -120.000 -120.000 -120.000
225 # -120.0000 -120.0000
231 #if(NOT UNRES_WITH_MPI)
233 # add_test(NAME UNRES_MD_Ala10 COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_single_ala.sh )
235 #endif(NOT UNRES_WITH_MPI)