12df374773b06191fbf3d9d0d4f462d74a5456b6
[unres.git] / CMakeLists.txt
1 #
2 # CMake project file for UNRES with MD for single chains
3
4
5 enable_language (Fortran)
6
7 #================================
8 # Set source file lists
9 #================================
10 set(UNRES_MDM_SRC0 
11         add.f 
12         arcos.f
13         banach.f
14         bank.F 
15         blas.f 
16         bond_move.f 
17         cartder.F 
18         cartprint.f 
19         chainbuild.F 
20         check_bond.f 
21         checkder_p.F 
22         check_sc_distr.f
23         compare_s1.F 
24         contact.f 
25         convert.f 
26         cored.f
27         csa.f 
28         dihed_cons.F
29         diff12.f
30         distfit.f 
31         djacob.f
32         econstr_local.F
33         eigen.f 
34         elecont.f 
35         energy_split-sep.F 
36         entmcm.F
37         fitsq.f 
38         gauss.f 
39         gen_rand_conf.F
40         geomout.F 
41         gnmr1.f
42         indexx.f 
43         initialize_p.F 
44         intcartderiv.F
45         intcor.f 
46         intlocal.f 
47         int_to_cart.f 
48         kinetic_lesyng.f 
49         lagrangian_lesyng.F
50         local_move.f 
51         map.f 
52         matmult.f 
53         mc.F 
54         mcm.F 
55         MD_A-MTS.F 
56         minimize_p.F
57         minim_jlee.F 
58         minim_mcmf.F 
59         misc.f 
60         moments.f
61         MP.F 
62         MREMD.F 
63         muca_md.f 
64         newconf.f
65         parmread.F 
66         permut.F
67         pinorm.f 
68         printmat.f 
69         prng_32.F
70         q_measure.F 
71         ran.f
72         randgens.f 
73         rattle.F 
74         readpdb.F
75         readrtns_CSA.F 
76         refsys.f 
77         regularize.F
78         rescode.f 
79         rmdd.f 
80         rmsd.F 
81         sc_move.F 
82         shift.F
83         sort.f 
84         stochfric.F 
85         sumsld.f 
86         surfatom.f 
87         test.F 
88         thread.F 
89         timing.F
90         together.F
91         unres.F
92         ssMD.F
93 )
94
95 set(UNRES_MDM_SRC3 energy_p_new_barrier.F energy_p_new-sep_barrier.F gradient_p.F )
96
97 set(UNRES_MDM_PP_SRC
98         bank.F 
99         cartder.F 
100         chainbuild.F 
101         checkder_p.F 
102         compare_s1.F
103         cored.f
104         csa.f 
105         dihed_cons.F
106         diff12.f 
107         econstr_local.F 
108         energy_p_new.F
109         energy_p_new_barrier.F 
110         energy_p_new-sep_barrier.F 
111         energy_split-sep.F 
112         entmcm.F 
113         gen_rand_conf.F
114         geomout.F 
115         gradient_p.F 
116         intcor.f
117         initialize_p.F 
118         intcartderiv.F 
119         lagrangian_lesyng.F 
120         matmult.f
121         mc.F 
122         mcm.F 
123         MD_A-MTS.F
124         minimize_p.F 
125         minim_jlee.F
126         minim_mcmf.F 
127         MP.F 
128         MREMD.F
129         newconf.f 
130         parmread.F 
131         permut.F
132         prng_32.F
133         q_measure1.F 
134         q_measure3.F 
135         q_measure.F
136         ran.f
137         rattle.F 
138         readpdb.F 
139         readrtns_CSA.F 
140         regularize.F
141         rmdd.f 
142         rmsd.F 
143         sc_move.F
144         shift.F 
145         stochfric.F
146         sumsld.f 
147         test.F 
148         thread.F 
149         timing.F
150         together.F
151         unres.F
152         proc_proc.c
153
154
155
156 if(NOT Fortran_COMPILER_NAME STREQUAL "ifort")
157   set(UNRES_MDM_PP_SRC "${UNRES_MDM_PP_SRC} prng_32.F") 
158 endif(NOT Fortran_COMPILER_NAME STREQUAL "ifort")
159
160
161 #================================================
162 # Set comipiler flags for different sourcefiles  
163 #================================================
164 if (Fortran_COMPILER_NAME STREQUAL "ifort")
165   set(FFLAGS0 "-ip -w" ) 
166   set(FFLAGS1 "-w -g -d2 -CA -CB" ) 
167   set(FFLAGS2 "-w -g -00 ")
168   set(FFLAGS3 "-w -ipo " )
169 elseif (Fortran_COMPILER_NAME STREQUAL "gfortran")
170   set(FFLAGS0 "-std=legacy -I. " ) 
171   set(FFLAGS1 "-std=legacy -g -I. " ) 
172   set(FFLAGS2 "-std=legacy -I. ")
173   set(FFLAGS3 "-std=legacy -I. " )
174 endif (Fortran_COMPILER_NAME STREQUAL "ifort")
175
176
177 # Add MPI compiler flags
178 if(UNRES_WITH_MPI)
179   set(FFLAGS0 "${FFLAGS0} -I${MPI_Fortran_INCLUDE_PATH}")
180   set(FFLAGS1 "${FFLAGS1} -I${MPI_Fortran_INCLUDE_PATH}")
181   set(FFLAGS2 "${FFLAGS2} -I${MPI_Fortran_INCLUDE_PATH}")
182   set(FFLAGS3 "${FFLAGS3} -I${MPI_Fortran_INCLUDE_PATH}")
183 endif(UNRES_WITH_MPI)
184
185 set_property(SOURCE ${UNRES_MDM_SRC0} APPEND PROPERTY COMPILE_FLAGS ${FFLAGS0} )
186 #set_property(SOURCE ${UNRES_MD_SRC1} PROPERTY COMPILE_FLAGS ${FFLAGS1} )
187 #set_property(SOURCE ${UNRES_MD_SRC2} PROPERTY COMPILE_FLAGS ${FFLAGS2} )
188 set_property(SOURCE ${UNRES_MDM_SRC3} PROPERTY COMPILE_FLAGS ${FFLAGS3} )
189
190 #=========================================
191 # Settings for GAB force field 
192 #=========================================
193 if(UNRES_MD_FF STREQUAL "GAB" )
194   # set preprocesor flags   
195   set(CPPFLAGS "PROCOR -DUNRES -DISNAN -DSPLITELE -DLANG0 -DCRYST_BOND -DCRYST_THETA -DCRYST_SC" )
196
197 #=========================================
198 #  Settings for E0LL2Y force field
199 #=========================================
200 elseif(UNRES_MD_FF STREQUAL "E0LL2Y")
201   # set preprocesor flags   
202   set(CPPFLAGS "PROCOR -DUNRES -DISNAN -DSPLITELE -DLANG0" )
203 elseif(UNRES_MD_FF STREQUAL "4P")
204   set(CPPFLAGS "UNRES -DISNAN -DSPLITELE -DLANG0 -DCRYST_BOND -DCRYST_THETA -DCRYST_SC -DSCCORPDB" )
205 endif(UNRES_MD_FF STREQUAL "GAB")
206
207
208 #=========================================
209 # System specific flags
210 #=========================================
211 if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
212   set(CPPFLAGS "${CPPFLAGS} -DLINUX") 
213 endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
214
215
216 #=========================================
217 # Compiler specific flags
218 #=========================================
219
220 if (Fortran_COMPILER_NAME STREQUAL "ifort")
221   # Add ifort preprocessor flags
222   set(CPPFLAGS "${CPPFLAGS} -DPGI") 
223 elseif (Fortran_COMPILER_NAME STREQUAL "f95")
224   # Add new gfortran flags
225   set(CPPFLAGS "${CPPFLAGS} -DG77") 
226 elseif (Fortran_COMPILER_NAME STREQUAL "gfortran")
227   # Add old gfortran flags
228   set(CPPFLAGS "${CPPFLAGS} -DG77") 
229 elseif (Fortran_COMPILER_NAME STREQUAL "pgf90")
230   set(CPPFLAGS "${CPPFLAGS} -DPGI")
231   FILE(COPY ${CMAKE_SOURCE_DIR}/source/lib/isnan_pgi.f DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
232   list(APPEND UNRES_MDM_SRC0 ${CMAKE_CURRENT_BINARY_DIR}/isnan_pgi.f)
233 endif (Fortran_COMPILER_NAME STREQUAL "ifort")
234
235
236 #=========================================
237 # Add MPI preprocessor flags
238 #=========================================
239 if (UNRES_WITH_MPI)
240   set(CPPFLAGS "${CPPFLAGS} -DMP -DMPI") 
241 endif(UNRES_WITH_MPI)
242
243
244 #=========================================
245 # add 64-bit specific preprocessor flags
246 #=========================================
247 if (architektura STREQUAL "64")
248   set(CPPFLAGS "${CPPFLAGS} -DAMD64")
249 endif (architektura STREQUAL "64")
250
251
252
253 # Apply preprocesor flags to *.F files
254 set_property(SOURCE ${UNRES_MDM_PP_SRC} PROPERTY COMPILE_DEFINITIONS ${CPPFLAGS} )  
255
256 # Apply preprocesor flags to proc_proc.c
257 set_property(SOURCE proc_proc.c PROPERTY COMPILE_DEFINITIONS "SGI" )  
258
259
260 #========================================
261 #  Setting binary name
262 #========================================
263 if(UNRES_WITH_MPI) 
264   # binary with mpi
265   set(UNRES_BIN "unresMD-mult_${Fortran_COMPILER_NAME}_MPI_${UNRES_MD_FF}.exe")
266 else(UNRES_WITH_MPI)
267   # binary without mpi
268   set(UNRES_BIN "unresMD-mult_${Fortran_COMPILER_NAME}_single_${UNRES_MD_FF}.exe")
269 endif(UNRES_WITH_MPI)  
270
271 #=========================================
272 # cinfo.f workaround for cmake
273 #=========================================
274 # get the current date  
275 TODAY(DATE)
276 # generate cinfo.f
277 set(CINFO "${CMAKE_CURRENT_BINARY_DIR}/cinfo.f")
278 FILE(WRITE ${CINFO}
279 "C CMake generated file
280        subroutine cinfo
281        include 'COMMON.IOUNITS'
282        write(iout,*)'++++ Compile info ++++'
283        write(iout,*)'Version ${UNRES_MAJOR}.${UNRES_MINOR} build ${UNRES_PATCH}'
284 ")
285
286 CINFO_FORMAT(${CINFO} "Compiled" "${DATE}" )
287 CINFO_FORMAT(${CINFO} "Compiled by" "$ENV{USER}@$ENV{HOST}" )
288 CINFO_FORMAT(${CINFO} "OS name:" "${CMAKE_SYSTEM_NAME}" )
289 CINFO_FORMAT(${CINFO} "OS release:" "${CMAKE_SYSTEM}" )
290 CINFO_FORMAT(${CINFO} "Fortran Compiler:" "${CMAKE_Fortran_COMPILER}" )
291 CINFO_FORMAT(${CINFO} "MD Force field:" "${UNRES_MD_FF}" )
292 CINFO_FORMAT(${CINFO} "CPPFLAGS =" "${CPPFLAGS}")
293
294 FILE(APPEND ${CINFO} 
295 "       write(iout,*)'++++ End of compile info ++++'  
296        return 
297        end ")
298
299
300 # add include path
301 set_property(SOURCE ${CMAKE_CURRENT_BINARY_DIR}/cinfo.f PROPERTY COMPILE_FLAGS "${FFLAGS0} -I${CMAKE_CURRENT_SOURCE_DIR}")
302
303 #=========================================
304 # Set full unres MD-M sources
305 #=========================================
306 set(UNRES_MDM_SRCS ${UNRES_MDM_SRC0} ${UNRES_MDM_SRC3} ${CMAKE_CURRENT_BINARY_DIR}/cinfo.f proc_proc.c )
307
308 #=========================================
309 # Build the binary
310 #=========================================
311 add_executable(UNRES_BIN-MD-M ${UNRES_MDM_SRCS} )
312 set_target_properties(UNRES_BIN-MD-M PROPERTIES OUTPUT_NAME ${UNRES_BIN})
313 set_property(TARGET UNRES_BIN-MD-M PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin )
314 #add_dependencies (${UNRES_BIN} ${UNRES_XDRFLIB})
315
316 #=========================================
317 # Link libraries
318 #=========================================
319 # link MPI library (libmpich.a)  
320 if(UNRES_WITH_MPI)
321   target_link_libraries( UNRES_BIN-MD-M ${MPI_Fortran_LIBRARIES} )
322 endif(UNRES_WITH_MPI)
323 # link libxdrf.a 
324 #message("UNRES_XDRFLIB=${UNRES_XDRFLIB}")
325 target_link_libraries( UNRES_BIN-MD-M xdrf )
326
327 #=========================================
328 # Install Path
329 #=========================================
330 install(TARGETS UNRES_BIN-MD-M DESTINATION ${CMAKE_INSTALL_PREFIX}/unres/MD)
331
332 #=========================================
333 # TESTS 
334 #=========================================
335
336 #=========================================
337 # Generate data test files
338 #=========================================
339 #  test_single_ala.sh
340 #=========================================
341
342 FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/scripts/test_single_ala.sh
343 "#!/bin/sh
344 export POT=GB
345 export PREFIX=ala10
346 #-----------------------------------------------------------------------------
347 UNRES_BIN=${CMAKE_BINARY_DIR}/bin/${UNRES_BIN}
348 #-----------------------------------------------------------------------------
349 DD=${CMAKE_SOURCE_DIR}/PARAM
350 export BONDPAR=$DD/bond.parm
351 export THETPAR=$DD/thetaml.5parm
352 export ROTPAR=$DD/scgauss.parm
353 export TORPAR=$DD/torsion_631Gdp.parm
354 export TORDPAR=$DD/torsion_double_631Gdp.parm
355 export ELEPAR=$DD/electr_631Gdp.parm
356 export SIDEPAR=$DD/sc_GB_opt.1gab_3S_qclass5no310-shan2-sc-16-10-8k
357 export FOURIER=$DD/fourier_opt.parm.1igd_hc_iter3_3
358 export SCPPAR=$DD/scp.parm
359 export SCCORPAR=$DD/sccor_pdb_shelly.dat
360 export PATTERN=$DD/patterns.cart
361 #-----------------------------------------------------------------------------
362 $UNRES_BIN
363 ")
364
365 #
366 # File permissions workaround
367 #
368 FILE(   COPY ${CMAKE_CURRENT_BINARY_DIR}/scripts/test_single_ala.sh 
369         DESTINATION ${CMAKE_CURRENT_BINARY_DIR}
370         FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
371 )
372
373
374
375 #=========================================
376 #  ala10.inp
377 #=========================================
378
379 file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/ala10.inp
380 "ala10 unblocked
381 SEED=-1111333 MD ONE_LETTER rescale_mode=2 
382 nstep=15000 ntwe=100 ntwx=1000 dt=0.1 lang=0 tbf t_bath=300 damax=1.0          &
383 reset_moment=1000 reset_vel=1000
384 WLONG=1.35279 WSCP=1.59304 WELEC=0.71534 WBOND=1.00000 WANG=1.13873            &
385 WSCLOC=0.16258 WTOR=1.98599 WTORD=1.57069 WCORRH=0.42887 WCORR5=0.00000        &
386 WCORR6=0.00000 WEL_LOC=0.16036 WTURN3=1.68722 WTURN4=0.66230 WTURN6=0.00000    &
387 WVDWPP=0.11371 WHPB=1.00000                                                    &
388 CUTOFF=7.00000 WCORR4=0.00000
389 12
390 XAAAAAAAAAAX 
391  0
392  0
393    90.0000   90.0000   90.0000  90.000   90.000   90.000   90.000   90.000 
394    90.0000   90.0000
395   180.0000  180.0000  180.0000 180.000  180.000  180.000  180.000  180.000
396   180.0000
397   110.0000  110.0000  110.0000 100.000  110.000  100.000  110.000  110.000 
398   110.0000  110.0000
399  -120.0000 -120.0000 -120.000 -120.000 -120.000 -120.000 -120.000 -120.000
400  -120.0000 -120.0000
401 ")
402
403 if(UNRES_MD_FF STREQUAL "E0LL2Y")
404
405 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/prota.pdb
406         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
407
408 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/prota_unres.pdb
409         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
410
411 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/prota_ENE.inp
412         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
413
414 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/prota_MIN_CART.inp
415         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
416
417 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/1l2y_micro.inp
418         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
419
420 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/1l2y_MIN_INT.inp
421         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
422
423 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/1l2y_MIN_REGULAR_INT.inp
424         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
425
426 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/1L2Y_B.inp
427         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
428
429 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/1L2Y_L.inp
430         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
431
432 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/1L2Y_NH.inp
433         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
434
435
436 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/1L2Y.pdb
437         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
438
439 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/1L2Y_remd.inp
440         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
441
442 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/1dkz_cut.pdb
443         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
444
445 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/1dkz_cut_unres.pdb
446         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
447
448 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/1DKZcut-ber.inp
449         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
450
451 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/1DKZcut-ene.inp
452         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
453
454 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/1DKZcut-lang.inp
455         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
456
457 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/1DKZcut-micro.inp
458         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
459
460 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/1DKZcut-min.inp
461         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
462
463 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/prota_unres_energy_check.sh
464         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} 
465         FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
466 )
467
468 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/matplotlib_fit_hist.py
469         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} 
470         FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
471 )
472
473 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/matplotlib_hist.py
474         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} 
475         FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
476 )
477
478 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/checkgrad.awk
479         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
480
481 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/prota_CHECKGRAD.inp
482         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
483
484 FILE(COPY ${CMAKE_SOURCE_DIR}/ctest/1DKZcut-checkgrad.inp
485         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
486
487
488 #=========================================
489 #  test_prota_E0LL2Y.sh
490 #=========================================
491
492 FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/scripts/test_prota_E0LL2Y.sh
493 "#!/bin/sh
494 export POT=GB
495 export FGPROCS=$2
496 export PREFIX=$1
497 #-----------------------------------------------------------------------------
498 UNRES_BIN=${CMAKE_BINARY_DIR}/bin/${UNRES_BIN}
499 #-----------------------------------------------------------------------------
500 DD=${CMAKE_SOURCE_DIR}/PARAM
501 export BONDPAR=$DD/bond_AM1.parm
502 export THETPAR=$DD/theta_abinitio.parm
503 export ROTPAR=$DD/rotamers_AM1_aura.10022007.parm
504 export TORPAR=$DD/torsion_631Gdp.parm
505 export TORDPAR=$DD/torsion_double_631Gdp.parm
506 export ELEPAR=$DD/electr_631Gdp.parm
507 export SIDEPAR=$DD/scinter_$POT.parm
508 export FOURIER=$DD/fourier_opt.parm.1igd_hc_iter3_3
509 export SCPPAR=$DD/scp.parm
510 export SCCORPAR=$DD/sccor_am1_pawel.dat
511 export THETPARPDB=$DD/thetaml.5parm
512 export ROTPARPDB=$DD/scgauss.parm
513 export PATTERN=$DD/patterns.cart
514 #-----------------------------------------------------------------------------
515 echo CTEST_FULL_OUTPUT
516 $UNRES_BIN
517 ./prota_unres_energy_check.sh $1 ${UNRES_BIN}
518 ")
519
520 #  MESSAGE (STATUS "${MPI_Fortran_LIBRARIES}")
521   if ("${MPI_Fortran_LIBRARIES}"  MATCHES "lam")
522      MESSAGE (STATUS "LAM MPI library detected")
523      set (boot_lam "-boot")
524   else()
525      set (boot_lam "")
526   endif()
527
528   if (UNRES_SRUN)
529    set (np "-n")
530    set (mpiexec "srun")
531   elseif(UNRES_MPIRUN)
532    set (np "-np")
533    set (mpiexec "mpirun")
534   else()
535    set (np "-np")
536    set (mpiexec "mpiexec")
537   endif()
538
539
540 #
541 # File permissions workaround
542 #
543 FILE(   COPY ${CMAKE_CURRENT_BINARY_DIR}/scripts/test_prota_E0LL2Y.sh 
544         DESTINATION ${CMAKE_CURRENT_BINARY_DIR}
545         FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
546 )
547
548 FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/scripts/test_mpi_E0LL2Y.sh
549 "#!/bin/sh
550 export POT=GB
551 export FGPROCS=$2
552 export PREFIX=$1
553 #-----------------------------------------------------------------------------
554 UNRES_BIN=${CMAKE_BINARY_DIR}/bin/${UNRES_BIN}
555 #-----------------------------------------------------------------------------
556 DD=${CMAKE_SOURCE_DIR}/PARAM
557 export BONDPAR=$DD/bond_AM1.parm
558 export THETPAR=$DD/theta_abinitio.parm
559 export ROTPAR=$DD/rotamers_AM1_aura.10022007.parm
560 export TORPAR=$DD/torsion_631Gdp.parm
561 export TORDPAR=$DD/torsion_double_631Gdp.parm
562 export ELEPAR=$DD/electr_631Gdp.parm
563 export SIDEPAR=$DD/scinter_$POT.parm
564 export FOURIER=$DD/fourier_opt.parm.1igd_hc_iter3_3
565 export SCPPAR=$DD/scp.parm
566 export SCCORPAR=$DD/sccor_am1_pawel.dat
567 export THETPARPDB=$DD/thetaml.5parm
568 export ROTPARPDB=$DD/scgauss.parm
569 export PATTERN=$DD/patterns.cart
570 #-----------------------------------------------------------------------------
571 echo CTEST_FULL_OUTPUT
572 ${mpiexec} ${boot_lam} ${np} $3 $UNRES_BIN | grep -v traj1file
573 ./prota_unres_energy_check.sh $1 ${UNRES_BIN}
574 ")
575
576 #
577 # File permissions workaround
578 #
579 FILE(   COPY ${CMAKE_CURRENT_BINARY_DIR}/scripts/test_mpi_E0LL2Y.sh 
580         DESTINATION ${CMAKE_CURRENT_BINARY_DIR}
581         FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
582 )
583
584
585 endif(UNRES_MD_FF STREQUAL "E0LL2Y")
586
587
588
589 # Add tests
590
591 if(NOT UNRES_WITH_MPI)
592                   
593   if(UNRES_MD_FF STREQUAL "GAB")
594     add_test(NAME UNRES_M_MD_Ala10 COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_single_ala.sh )
595   endif(UNRES_MD_FF STREQUAL "GAB")
596  
597   if(UNRES_MD_FF STREQUAL "E0LL2Y")
598     add_test(NAME UNRES_M_ENE_prota COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh prota_ENE 1 )
599     add_test(NAME UNRES_M_CHECKGRAD_prota COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh prota_CHECKGRAD 1 )
600     add_test(NAME UNRES_M_MIN_prota COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh prota_MIN_CART 1 )
601     add_test(NAME UNRES_M_MIN_INT COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh 1l2y_MIN_INT 1 )
602     add_test(NAME UNRES_M_REGULAR COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh 1l2y_MIN_REGULAR_INT 1 )
603     add_test(NAME UNRES_M_MD_microcanonical COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh 1l2y_micro 1 )
604     add_test(NAME UNRES_M_Langevin COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh 1L2Y_L 1 )
605 #no NH in MD-M
606 #    add_test(NAME UNRES_M_NoseHoover COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh 1L2Y_NH 1 )
607     add_test(NAME UNRES_M_Berendsen COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh 1L2Y_B 1 )
608     add_test(NAME UNRES_M_multi_ene COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh 1DKZcut-ene 1 )
609     add_test(NAME UNRES_M_multi_checkgrad COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh 1DKZcut-checkgrad 1 )
610     add_test(NAME UNRES_M_multi_min COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh 1DKZcut-min 1 )
611     add_test(NAME UNRES_M_multi_microcanonical COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh 1DKZcut-micro 1 )
612     add_test(NAME UNRES_M_multi_Berendsen COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh 1DKZcut-ber 1 )
613     add_test(NAME UNRES_M_multi_Langevin COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh 1DKZcut-lang 1 )
614   endif(UNRES_MD_FF STREQUAL "E0LL2Y")
615
616 else(NOT UNRES_WITH_MPI)
617
618
619   if(UNRES_MD_FF STREQUAL "GAB")
620     add_test(NAME UNRES_M_MD_MPI_Ala10 COMMAND ${mpiexec} ${boot_lam} ${CMAKE_CURRENT_BINARY_DIR}/test_single_ala.sh )
621   endif(UNRES_MD_FF STREQUAL "GAB")
622
623   if(UNRES_MD_FF STREQUAL "E0LL2Y")
624     add_test(NAME UNRES_M_ENE_prota COMMAND ${mpiexec} ${boot_lam} ${np} 2 ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh prota_ENE 2 )
625     add_test(NAME UNRES_M_ENE1_prota COMMAND ${mpiexec} ${boot_lam} ${np} 1 ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh prota_ENE 1 )
626     add_test(NAME UNRES_M_CHECKGRAD_prota COMMAND ${mpiexec} sh ${CMAKE_CURRENT_BINARY_DIR}/test_mpi_E0LL2Y.sh prota_CHECKGRAD 2 2 )   
627     add_test(NAME UNRES_M_CHECKGRAD1_prota COMMAND ${mpiexec} ${boot_lam} ${np} 1 ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh prota_CHECKGRAD 1 )   
628     add_test(NAME UNRES_M_MIN_prota COMMAND ${mpiexec} ${boot_lam} ${np} 2 ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh prota_MIN_CART 2 )
629     add_test(NAME UNRES_M_MIN_INT COMMAND ${mpiexec} ${boot_lam} ${np} 1 ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh 1l2y_MIN_INT 1 )
630     add_test(NAME UNRES_M_REGULAR COMMAND ${mpiexec} ${boot_lam} ${np} 1 ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh 1l2y_MIN_REGULAR_INT 1 )
631     add_test(NAME UNRES_M_MD_microcanonical COMMAND ${mpiexec} ${boot_lam} ${np} 2 ${CMAKE_CURRENT_BINARY_DIR}/test_prota_E0LL2Y.sh 1l2y_micro 2 )
632     add_test(NAME UNRES_M_Langevin COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_mpi_E0LL2Y.sh 1L2Y_L 2 2 )
633 # no NH in src_MD-M code
634 #    add_test(NAME UNRES_M_NoseHoover COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_mpi_E0LL2Y.sh 1L2Y_NH 2 2 )
635     add_test(NAME UNRES_M_Berendsen COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_mpi_E0LL2Y.sh 1L2Y_B 2 2 )
636     add_test(NAME UNRES_M_remd COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_mpi_E0LL2Y.sh 1L2Y_remd 1 8 )
637     add_test(NAME UNRES_M_multi_ene COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_mpi_E0LL2Y.sh 1DKZcut-ene 2 2 )
638     add_test(NAME UNRES_M_multi_ene1 COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_mpi_E0LL2Y.sh 1DKZcut-ene 1 1 )
639     add_test(NAME UNRES_M_multi_checkgrad COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_mpi_E0LL2Y.sh 1DKZcut-checkgrad 2 2 )
640     add_test(NAME UNRES_M_multi_checkgrad1 COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_mpi_E0LL2Y.sh 1DKZcut-checkgrad 1 1 )
641     add_test(NAME UNRES_M_multi_min COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_mpi_E0LL2Y.sh 1DKZcut-min 2 2 )
642     add_test(NAME UNRES_M_multi_microcanonical COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_mpi_E0LL2Y.sh 1DKZcut-micro 2 2 )
643     add_test(NAME UNRES_M_multi_Berendsen COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_mpi_E0LL2Y.sh 1DKZcut-ber 2 2 )
644     add_test(NAME UNRES_M_multi_Langevin COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_mpi_E0LL2Y.sh 1DKZcut-lang 2 2 )
645
646   endif(UNRES_MD_FF STREQUAL "E0LL2Y")
647
648 endif(NOT UNRES_WITH_MPI)
649