2 # CMake project file for UNRES with Minimazation
5 enable_language (Fortran)
7 #================================
8 # Set source file lists
9 #================================
10 # sources used with FFLAGS0
45 # sources used with FFLAGS1
50 # sources used with FFLAGS2
55 # sources used with FFLAGS3
57 energy_p_new_barrier.F
61 # sources used with preprocesor flags (should also be listed above with FFLAGSX)
74 energy_p_new_barrier.F
119 #================================================
120 # Set comipiler flags for different sourcefiles
121 #================================================
122 if (Fortran_COMPILER_NAME STREQUAL "ifort")
123 find_package (Threads)
124 set(FFLAGS0 "-g -ip -w" )
125 set(FFLAGS1 "-w -g -d2 -CA -CB" )
126 set(FFLAGS2 "-w -g -00 ")
127 set(FFLAGS3 "-g -w -ipo " )
128 elseif (Fortran_COMPILER_NAME STREQUAL "gfortran")
129 set(FFLAGS0 "-std=legacy -O " )
130 set(FFLAGS1 "-std=legacy -g -C" )
131 set(FFLAGS2 "-std=legacy -g -O0 ")
132 set(FFLAGS3 "-std=legacy -O3" )
133 endif (Fortran_COMPILER_NAME STREQUAL "ifort")
136 set_property(SOURCE ${UNRES_MIN_SRC0} PROPERTY COMPILE_FLAGS ${FFLAGS0} )
137 set_property(SOURCE ${UNRES_MIN_SRC1} PROPERTY COMPILE_FLAGS ${FFLAGS1} )
138 set_property(SOURCE ${UNRES_MIN_SRC2} PROPERTY COMPILE_FLAGS ${FFLAGS2} )
139 set_property(SOURCE ${UNRES_MIM_SRC3} PROPERTY COMPILE_FLAGS ${FFLAGS3} )
141 # set preprocesor flags
142 set(CPPFLAGS "PROCOR -DLINUX -DISNAN -DSPLITELE -DLANG0 -DSCCORPDB" )
144 if (Fortran_COMPILER_NAME STREQUAL "ifort")
145 # Add ifort preprocessor flags
146 set(CPPFLAGS "${CPPFLAGS} -DPGI")
147 elseif (Fortran_COMPILER_NAME STREQUAL "f95")
149 set(CPPFLAGS "${CPPFLAGS} -DG77")
150 elseif (Fortran_COMPILER_NAME STREQUAL "gfortran")
152 set(CPPFLAGS "${CPPFLAGS} -DG77")
153 endif (Fortran_COMPILER_NAME STREQUAL "ifort")
156 # add 64-bit specific preprocessor flags
157 if (architektura STREQUAL "64")
158 set(CPPFLAGS "${CPPFLAGS} -DAMD64")
159 endif (architektura STREQUAL "64")
161 # Apply preprocesor flags to *.F files
162 set_property(SOURCE ${UNRES_MIN_PP_SRC} PROPERTY COMPILE_DEFINITIONS ${CPPFLAGS} )
166 #========================================
167 # Setting binary name
168 #========================================
169 set(UNRES_BIN "unres_${Fortran_COMPILER_NAME}_MIN_single_${UNRES_MD_FF}.exe")
171 #========================================
172 # cinfo.f workaround for Cmake
173 #========================================
174 # get the current date
178 set(CINFO "${CMAKE_CURRENT_BINARY_DIR}/cinfo.f")
180 "C CMake generated file
182 include 'COMMON.IOUNITS'
183 write(iout,*)'++++ Compile info ++++'
184 write(iout,*)'Version ${UNRES_MAJOR}.${UNRES_MINOR} build ${UNRES_PATCH}'
187 CINFO_FORMAT(${CINFO} "Compiled" "${DATE}" )
188 CINFO_FORMAT(${CINFO} "Compiled by" "$ENV{USER}@$ENV{HOST}" )
189 CINFO_FORMAT(${CINFO} "OS name:" "${CMAKE_SYSTEM_NAME}" )
190 CINFO_FORMAT(${CINFO} "OS release:" "${CMAKE_SYSTEM}" )
191 CINFO_FORMAT(${CINFO} "Fortran Compiler:" "${CMAKE_Fortran_COMPILER}" )
192 CINFO_FORMAT(${CINFO} "CPPFLAGS =" "${CPPFLAGS}")
195 " write(iout,*)'Version MINI energy and minimalization only'
196 write(iout,*)'++++ End of compile info ++++'
201 set_property(SOURCE ${CMAKE_CURRENT_BINARY_DIR}/cinfo.f PROPERTY COMPILE_FLAGS "${FFLAGS0} -I${CMAKE_CURRENT_SOURCE_DIR}")
203 #=========================================
204 # Set full unres MIN sources
205 #=========================================
206 set(UNRES_MIN_SRCS ${UNRES_MIN_SRC0} ${UNRES_MIN_SRC1} ${UNRES_MIN_SRC2} ${UNRES_MIN_SRC3} ${CMAKE_CURRENT_BINARY_DIR}/cinfo.f )
208 #=========================================
210 #=========================================
211 add_executable(UNRES_MIN_BIN ${UNRES_MIN_SRCS} )
212 set_target_properties(UNRES_MIN_BIN PROPERTIES OUTPUT_NAME ${UNRES_BIN})
214 if (Fortran_COMPILER_NAME STREQUAL "ifort")
215 target_link_libraries (UNRES_MIN_BIN ${CMAKE_THREAD_LIBS_INIT})
216 endif (Fortran_COMPILER_NAME STREQUAL "ifort")
217 set_property(TARGET UNRES_MIN_BIN PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin )
220 #=========================================
222 #=========================================
223 install(TARGETS UNRES_MIN_BIN DESTINATION ${CMAKE_INSTALL_PREFIX}/unres/MINIM)
225 #=========================================
227 #=========================================
229 #=========================================
230 # Generate data test files
231 #=========================================
233 #=========================================
235 FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/scripts/test_single_ala.sh
239 #-----------------------------------------------------------------------------
240 UNRES_BIN=${CMAKE_BINARY_DIR}/bin/${UNRES_BIN}
241 #-----------------------------------------------------------------------------
242 DD=${CMAKE_SOURCE_DIR}/PARAM
243 export BONDPAR=$DD/bond.parm
244 export THETPAR=$DD/thetaml.5parm
245 export ROTPAR=$DD/scgauss.parm
246 export TORPAR=$DD/torsion_631Gdp.parm
247 export TORDPAR=$DD/torsion_double_631Gdp.parm
248 export ELEPAR=$DD/electr_631Gdp.parm
249 export SIDEPAR=$DD/sc_GB_opt.1gab_3S_qclass5no310-shan2-sc-16-10-8k
250 export FOURIER=$DD/fourier_opt.parm.1igd_hc_iter3_3
251 export SCPPAR=$DD/scp.parm
252 export SCCORPAR=$DD/sccor_pdb_shelly.dat
253 export PATTERN=$DD/patterns.cart
254 #-----------------------------------------------------------------------------
259 # File permissions workaround
261 FILE( COPY ${CMAKE_CURRENT_BINARY_DIR}/scripts/test_single_ala.sh
262 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}
263 FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
268 #=========================================
270 #=========================================
272 file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/ala10.inp
274 SEED=-1111333 MD ONE_LETTER rescale_mode=2
275 nstep=15000 ntwe=100 ntwx=1000 dt=0.1 lang=0 tbf t_bath=300 damax=1.0 &
276 reset_moment=1000 reset_vel=1000
277 WLONG=1.35279 WSCP=1.59304 WELEC=0.71534 WBOND=1.00000 WANG=1.13873 &
278 WSCLOC=0.16258 WTOR=1.98599 WTORD=1.57069 WCORRH=0.42887 WCORR5=0.00000 &
279 WCORR6=0.00000 WEL_LOC=0.16036 WTURN3=1.68722 WTURN4=0.66230 WTURN6=0.00000 &
280 WVDWPP=0.11371 WHPB=1.00000 &
281 CUTOFF=7.00000 WCORR4=0.00000
286 90.0000 90.0000 90.0000 90.000 90.000 90.000 90.000 90.000
288 180.0000 180.0000 180.0000 180.000 180.000 180.000 180.000 180.000
290 110.0000 110.0000 110.0000 100.000 110.000 100.000 110.000 110.000
292 -120.0000 -120.0000 -120.000 -120.000 -120.000 -120.000 -120.000 -120.000
296 if(UNRES_MD_FF STREQUAL "E0LL2Y")
298 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/prota.pdb
299 DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
301 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/prota_ENE.inp
302 DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
304 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/prota_MIN_CART.inp
305 DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
307 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/1l2y_MIN_INT.inp
308 DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
310 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/1L2Y.pdb
311 DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
313 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/prota_unres_energy_check.sh
314 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}
315 FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
319 #=========================================
320 # test_prota_E0LL2Y.sh
321 #=========================================
323 FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/scripts/test_prota_E0LL2Y.sh
328 #-----------------------------------------------------------------------------
329 UNRES_BIN=${CMAKE_BINARY_DIR}/bin/${UNRES_BIN}
330 #-----------------------------------------------------------------------------
331 DD=${CMAKE_SOURCE_DIR}/PARAM
332 export BONDPAR=$DD/bond_AM1.parm
333 export THETPAR=$DD/theta_abinitio.parm
334 export ROTPAR=$DD/rotamers_AM1_aura.10022007.parm
335 export TORPAR=$DD/torsion_631Gdp.parm
336 export TORDPAR=$DD/torsion_double_631Gdp.parm
337 export ELEPAR=$DD/electr_631Gdp.parm
338 export SIDEPAR=$DD/scinter_$POT.parm
339 export FOURIER=$DD/fourier_opt.parm.1igd_hc_iter3_3
340 export SCPPAR=$DD/scp.parm
341 export SCCORPAR=$DD/sccor_am1_pawel.dat
342 export THETPARPDB=$DD/thetaml.5parm
343 export ROTPARPDB=$DD/scgauss.parm
344 export PATTERN=$DD/patterns.cart
345 #-----------------------------------------------------------------------------
346 echo CTEST_FULL_OUTPUT
348 ./prota_unres_energy_check.sh $1 ${UNRES_BIN}
352 # File permissions workaround
354 FILE( COPY ${CMAKE_CURRENT_BINARY_DIR}/scripts/test_prota_E0LL2Y.sh
355 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}
356 FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
359 endif(UNRES_MD_FF STREQUAL "E0LL2Y")
365 if(UNRES_MD_FF STREQUAL "GAB")
366 add_test(NAME UNRES-MIN_Ala10 COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_single_ala.sh )
367 endif(UNRES_MD_FF STREQUAL "GAB")
369 if(UNRES_MD_FF STREQUAL "E0LL2Y")
370 add_test(NAME UNRES-MIN_ENE_prota COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh prota_ENE 1 )
371 add_test(NAME UNRES-MIN_MIN_prota COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh prota_MIN_CART 1 )
372 add_test(NAME UNRES-MIN_MIN_INT COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh 1l2y_MIN_INT 1 )
373 endif(UNRES_MD_FF STREQUAL "E0LL2Y")