force legacy standard for gfortran
[unres.git] / source / cluster / unres / src / CMakeLists.txt
1 #
2 # CMake project file for cluster analysis from UNRESMD  
3
4
5 enable_language (Fortran)
6
7 #================================
8 # Set source file lists
9 #================================
10 set(UNRES_CLUSTER_UNRES_SRC0 
11         arcos.f
12         cartprint.f
13         chainbuild.f
14         contact.f
15         convert.f
16         fitsq.f
17         geomout.F
18         hc.f
19         initialize.f
20         intcor.f
21         main_clust.f
22         matmult.f
23         misc.f
24         noyes.f
25         pinorm.f
26         readpdb.f
27         readrtns.F
28         rescode.f
29         srtclust.f
30         timing.F
31         track.F
32         wrtclust.f
33 )
34
35 set(UNRES_CLUSTER_PP_SRC
36         geomout.F
37         readrtns.F
38         timing.F
39         track.F
40
41
42
43 #================================================
44 # Set comipiler flags for different sourcefiles  
45 #================================================
46 if (Fortran_COMPILER_NAME STREQUAL "ifort")
47   set(FFLAGS0 "-ip -w -I." ) 
48 elseif (Fortran_COMPILER_NAME STREQUAL "gfortran")
49   set(FFLAGS0 "-std=legacy -I. " ) 
50 endif (Fortran_COMPILER_NAME STREQUAL "ifort")
51
52
53 set_property(SOURCE ${UNRES_CLUSTER_SRC0} PROPERTY COMPILE_FLAGS ${FFLAGS0} )
54
55
56 #=========================================
57 # System specific flags
58 #=========================================
59 if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
60   set(CPPFLAGS "${CPPFLAGS} LINUX") 
61 endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
62
63
64
65 #=========================================
66 # Apply preprocesor flags to *.F files
67 #=========================================
68 set_property(SOURCE ${UNRES_CLUSTER_PP_SRC} PROPERTY COMPILE_DEFINITIONS ${CPPFLAGS} )  
69
70
71 #========================================
72 #  Setting binary name
73 #========================================
74 set(UNRES_CLUSTER_BIN "unres_clustMD.exe")
75
76 #=========================================
77 # cinfo.f stupid workaround for cmake
78 #  - shame on me ]:)
79 #=========================================
80 #set_property(SOURCE compinfo.c PROPERTY CMAKE_C_FLAGS "-c" )
81 #add_executable(compinfo-wham-m compinfo.c)
82 #set_target_properties(compinfo-wham-m PROPERTIES OUTPUT_NAME compinfo)
83
84 #set(UNRES_CINFO_DIR "${CMAKE_CURRENT_BINARY_DIR}" )
85 #add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/cinfo.f 
86 #       COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/cinfo.f ${CMAKE_CURRENT_BINARY_DIR}/cinfo.f
87 #       COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/COMMON.IOUNITS ${CMAKE_CURRENT_BINARY_DIR}/COMMON.IOUNITS 
88 #       COMMAND ${CMAKE_CURRENT_BINARY_DIR}/compinfo | true     
89 #       DEPENDS compinfo-wham-m )
90 #set_property(SOURCE ${UNRES_CINFO_DIR}/cinfo.f PROPERTY COMPILE_FLAGS ${FFLAGS0} )
91
92 #=========================================
93 # Set full unres CLUSTER sources
94 #=========================================
95 set(UNRES_CLUSTER_SRCS ${UNRES_CLUSTER_UNRES_SRC0} )
96
97 #=========================================
98 # Build the binary
99 #=========================================
100 add_executable(UNRES_CLUSTER_BIN ${UNRES_CLUSTER_SRCS} )
101 set_target_properties(UNRES_CLUSTER_BIN PROPERTIES OUTPUT_NAME ${UNRES_CLUSTER_BIN})
102
103
104 #=========================================
105 # TESTS 
106 #=========================================
107
108 #-- Copy all the data files from the test directory into the source directory
109 #SET(UNRES_TEST_FILES
110 #       ala10.inp
111 #    )
112
113 #FOREACH (UNRES_TEST_FILE ${UNRES_TEST_FILES})
114 #      SET (unres_test_dest "${CMAKE_CURRENT_BINARY_DIR}/${UNRES_TEST_FILE}")
115 #      MESSAGE (STATUS " Copying ${UNRES_TEST_FILE} from ${CMAKE_SOURCE_DIR}/examples/unres/MD/ff_gab/${UNRES_TEST_FILE} to ${unres_test_dest}")
116 #      ADD_CUSTOM_COMMAND (
117 #          TARGET     ${UNRES_BIN}
118 #          POST_BUILD
119 #          COMMAND    ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/examples/unres/MD/ff_gab/${UNRES_TEST_FILE} ${unres_test_dest}
120 #      )
121 #ENDFOREACH (UNRES_TEST_FILE ${UNRES_TEST_FILES})
122
123 #=========================================
124 # Generate data test files
125 #=========================================
126 #  test_single_ala.sh
127 #=========================================
128
129 #FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/test_single_ala.sh
130 #"#!/bin/sh
131 #export POT=GB
132 #export PREFIX=ala10
133 #-----------------------------------------------------------------------------
134 #UNRES_BIN=./${UNRES_BIN}
135 #-----------------------------------------------------------------------------
136 #DD=${CMAKE_SOURCE_DIR}/PARAM
137 #export BONDPAR=$DD/bond.parm
138 #export THETPAR=$DD/thetaml.5parm
139 #export ROTPAR=$DD/scgauss.parm
140 #export TORPAR=$DD/torsion_631Gdp.parm
141 #export TORDPAR=$DD/torsion_double_631Gdp.parm
142 #export ELEPAR=$DD/electr_631Gdp.parm
143 #export SIDEPAR=$DD/sc_GB_opt.1gab_3S_qclass5no310-shan2-sc-16-10-8k
144 #export FOURIER=$DD/fourier_opt.parm.1igd_hc_iter3_3
145 #export SCPPAR=$DD/scp.parm
146 #export SCCORPAR=$DD/rotcorr_AM1.parm
147 #export PATTERN=$DD/patterns.cart
148 #-----------------------------------------------------------------------------
149 #$UNRES_BIN
150 #")
151
152 #=========================================
153 #  ala10.inp
154 #=========================================
155
156 #file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/ala10.inp
157 #"ala10 unblocked
158 #SEED=-1111333 MD ONE_LETTER rescale_mode=2 PDBOUT
159 #nstep=15000 ntwe=100 ntwx=1000 dt=0.1 lang=0 tbf t_bath=300 damax=1.0          &
160 #reset_moment=1000 reset_vel=1000 MDPDB
161 #WLONG=1.35279 WSCP=1.59304 WELEC=0.71534 WBOND=1.00000 WANG=1.13873            &
162 #WSCLOC=0.16258 WTOR=1.98599 WTORD=1.57069 WCORRH=0.42887 WCORR5=0.00000        &
163 #WCORR6=0.00000 WEL_LOC=0.16036 WTURN3=1.68722 WTURN4=0.66230 WTURN6=0.00000    &
164 #WVDWPP=0.11371 WHPB=1.00000                                                    &
165 #CUTOFF=7.00000 WCORR4=0.00000
166 #12
167 #XAAAAAAAAAAX 
168 # 0
169 # 0
170 #   90.0000   90.0000   90.0000  90.000   90.000   90.000   90.000   90.000 
171 #   90.0000   90.0000
172 #  180.0000  180.0000  180.0000 180.000  180.000  180.000  180.000  180.000
173 #  180.0000
174 #  110.0000  110.0000  110.0000 100.000  110.000  100.000  110.000  110.000 
175 #  110.0000  110.0000
176 # -120.0000 -120.0000 -120.000 -120.000 -120.000 -120.000 -120.000 -120.000
177 # -120.0000 -120.0000
178 #")
179
180
181 # Add tests
182
183 #if(NOT UNRES_WITH_MPI)
184
185 #  add_test(NAME UNRES_MD_Ala10 COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_single_ala.sh )
186
187 #endif(NOT UNRES_WITH_MPI)