X-Git-Url: http://mmka.chem.univ.gda.pl/gitweb/?a=blobdiff_plain;f=source%2Funres%2Fsrc_MIN%2FCMakeLists.txt;fp=source%2Funres%2Fsrc_MIN%2FCMakeLists.txt;h=c57587a51cd9cec79ff93011fba261474def64f7;hb=0a11a2c4ccee14ed99ae44f2565b270ba8d4bbb6;hp=0000000000000000000000000000000000000000;hpb=5eb407964903815242c59de10960f42761139e10;p=unres.git diff --git a/source/unres/src_MIN/CMakeLists.txt b/source/unres/src_MIN/CMakeLists.txt new file mode 100644 index 0000000..c57587a --- /dev/null +++ b/source/unres/src_MIN/CMakeLists.txt @@ -0,0 +1,210 @@ +# +# CMake project file for UNRES with Minimazation +# + +enable_language (Fortran) + +#================================ +# Set source file lists +#================================ +set(UNRES_MIN_SRC0 + arcos.f + cartder.F + cartprint.f + chainbuild.F + checkder_p.F + convert.f + econstr_local.F + geomout_min.F + initialize_p.F + intcartderiv.F + intcor.f + intlocal.f + int_to_cart.f + matmult.f + minimize_p.F + misc.f + MP.F + parmread.F + pinorm.f + printmat.f + randgens.f + readrtns_min.F + rescode.f + rmdd.f + sumsld.f + timing.F + unres_min.F + +) + +set(UNRES_MIN_SRC1 + cored.f +) + +set(UNRES_MIN_SRC2 + readpdb.F +) + +set(UNRES_MIN_SRC3 + energy_p_new_barrier.F + gradient_p.F +) + +set(UNRES_MIN_PP_SRC + bank.F + cartder.F + chainbuild.F + checkder_p.F + compare_s1.F + cored.f + csa.f + dihed_cons.F + diff12.f + econstr_local.F + energy_p_new.F + energy_p_new_barrier.F + energy_split-sep.F + entmcm.F + gen_rand_conf.F + geomout.F + gradient_p.F + intcor.f + initialize_p.F + intcartderiv.F + lagrangian_lesyng.F + matmult.f + mc.F + mcm.F + MD_A-MTS.F + minimize_p.F + minim_jlee.F + minim_mcmf.F + MP.F + MREMD.F + newconf.f + parmread.F + permut.F + prng_32.F + q_measure1.F + q_measure3.F + q_measure.F + ran.f + rattle.F + readpdb.F + readrtns_min.F + regularize.F + rmdd.f + rmsd.F + sc_move.F + shift.F + stochfric.F + sumsld.f + test.F + thread.F + timing.F + together.F + unres.F +) + + +#================================================ +# Set comipiler flags for different sourcefiles +#================================================ +if (Fortran_COMPILER_NAME STREQUAL "ifort") + find_package (Threads) + set(FFLAGS0 "-g -ip -w" ) + set(FFLAGS1 "-w -g -d2 -CA -CB" ) + set(FFLAGS2 "-w -g -00 ") + set(FFLAGS3 "-g -w -ipo " ) +elseif (Fortran_COMPILER_NAME STREQUAL "gfortran") + set(FFLAGS0 "-O" ) + set(FFLAGS1 "-g -C" ) + set(FFLAGS2 "-g -O0 ") + set(FFLAGS3 "-O3" ) +endif (Fortran_COMPILER_NAME STREQUAL "ifort") + + +set_property(SOURCE ${UNRES_MIN_SRC0} PROPERTY COMPILE_FLAGS ${FFLAGS0} ) +set_property(SOURCE ${UNRES_MIN_SRC1} PROPERTY COMPILE_FLAGS ${FFLAGS1} ) +set_property(SOURCE ${UNRES_MIN_SRC2} PROPERTY COMPILE_FLAGS ${FFLAGS2} ) +set_property(SOURCE ${UNRES_MIM_SRC3} PROPERTY COMPILE_FLAGS ${FFLAGS3} ) + +# set preprocesor flags +set(CPPFLAGS "PROCOR -DLINUX -DISNAN -DSPLITELE -DLANG0" ) + +if (Fortran_COMPILER_NAME STREQUAL "ifort") + # Add ifort preprocessor flags + set(CPPFLAGS "${CPPFLAGS} -DPGI") +elseif (Fortran_COMPILER_NAME STREQUAL "f95") + # Add gfortran flags + set(CPPFLAGS "${CPPFLAGS} -DG77") +elseif (Fortran_COMPILER_NAME STREQUAL "gfortran") + # Add gfortran flags + set(CPPFLAGS "${CPPFLAGS} -DG77") +endif (Fortran_COMPILER_NAME STREQUAL "ifort") + + +# add 64-bit specific preprocessor flags +if (architektura STREQUAL "64") + set(CPPFLAGS "${CPPFLAGS} -DAMD64") +endif (architektura STREQUAL "64") + +# Apply preprocesor flags to *.F files +set_property(SOURCE ${UNRES_MIN_PP_SRC} PROPERTY COMPILE_DEFINITIONS ${CPPFLAGS} ) + + + +#======================================== +# Setting binary name +#======================================== +set(UNRES_BIN "unres_min_${Fortran_COMPILER_NAME}.exe") + +#set(UNRES_CINFO_DIR "${CMAKE_CURRENT_BINARY_DIR}" ) + +#========================================= +# Set full unres MIN sources +#========================================= +set(UNRES_MIN_SRCS ${UNRES_MIN_SRC0} ${UNRES_MIN_SRC1} ${UNRES_MIN_SRC2} ${UNRES_MIN_SRC3} cinfo.f ) + +#========================================= +# Build the binary +#========================================= +add_executable(UNRES_BIN-MIN ${UNRES_MIN_SRCS} ) +set_target_properties(UNRES_BIN-MIN PROPERTIES OUTPUT_NAME ${UNRES_BIN}) + +if (Fortran_COMPILER_NAME STREQUAL "ifort") + target_link_libraries (UNRES_BIN-MIN ${CMAKE_THREAD_LIBS_INIT}) +endif (Fortran_COMPILER_NAME STREQUAL "ifort") + +#set_property(TARGET ${UNRES_BIN} PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/unres/MD ) + +#========================================= +# TESTS +#========================================= + +#-- Copy all the data files from the test directory into the source directory +#SET(UNRES_TEST_FILES +# ala10.inp +# ) + +#FOREACH (UNRES_TEST_FILE ${UNRES_TEST_FILES}) +# SET (unres_test_dest "${CMAKE_CURRENT_BINARY_DIR}/${UNRES_TEST_FILE}") +# MESSAGE (STATUS " Copying ${UNRES_TEST_FILE} from ${CMAKE_SOURCE_DIR}/examples/unres/MD/ff_gab/${UNRES_TEST_FILE} to ${unres_test_dest}") +# ADD_CUSTOM_COMMAND ( +# TARGET ${UNRES_BIN} +# POST_BUILD +# COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/examples/unres/MD/ff_gab/${UNRES_TEST_FILE} ${unres_test_dest} +# ) +#ENDFOREACH (UNRES_TEST_FILE ${UNRES_TEST_FILES}) + +#========================================= +# Generate data test files +#========================================= + +#if(NOT UNRES_WITH_MPI) + +# add_test(NAME UNRES_MD_Ala10 COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_single_ala.sh ) + +#endif(NOT UNRES_WITH_MPI) +