X-Git-Url: http://mmka.chem.univ.gda.pl/gitweb/?a=blobdiff_plain;ds=inline;f=source%2Funres%2Fsrc_MIN%2FCMakeLists.txt;h=dcc86b144226ed745d371c86716cb33226c3465c;hb=74bdd704fd49f47c96d95a5a70f37a2e6f46ace9;hp=668da3bc9e075352743fe399300dcb1ea2027e14;hpb=a1da60c51c6053818199a05696c4fcee6533f828;p=unres.git diff --git a/source/unres/src_MIN/CMakeLists.txt b/source/unres/src_MIN/CMakeLists.txt index 668da3b..dcc86b1 100644 --- a/source/unres/src_MIN/CMakeLists.txt +++ b/source/unres/src_MIN/CMakeLists.txt @@ -7,6 +7,7 @@ enable_language (Fortran) #================================ # Set source file lists #================================ +# sources used with FFLAGS0 set(UNRES_MIN_SRC0 arcos.f cartder.F @@ -14,8 +15,10 @@ set(UNRES_MIN_SRC0 chainbuild.F checkder_p.F convert.f + djacob.f econstr_local.F - geomout_min.F + gen_rand_conf.F + geomout_min.F initialize_p.F intcartderiv.F intcor.f @@ -30,27 +33,33 @@ set(UNRES_MIN_SRC0 printmat.f randgens.f readrtns_min.F + refsys.f rescode.f + refsys.f rmdd.f + sc_move.F sumsld.f timing.F unres_min.F ) - +# sources used with FFLAGS1 set(UNRES_MIN_SRC1 cored.f ) +# sources used with FFLAGS2 set(UNRES_MIN_SRC2 readpdb.F ) +# sources used with FFLAGS3 set(UNRES_MIN_SRC3 energy_p_new_barrier.F gradient_p.F ) +# sources used with preprocesor flags (should also be listed above with FFLAGSX) set(UNRES_MIN_PP_SRC bank.F cartder.F @@ -118,10 +127,10 @@ if (Fortran_COMPILER_NAME STREQUAL "ifort") set(FFLAGS2 "-w -g -00 ") set(FFLAGS3 "-g -w -ipo " ) elseif (Fortran_COMPILER_NAME STREQUAL "gfortran") - set(FFLAGS0 " " ) - set(FFLAGS1 "-g -C" ) - set(FFLAGS2 "-g -O0 ") - set(FFLAGS3 "-O3" ) + set(FFLAGS0 "-std=legacy -O " ) + set(FFLAGS1 "-std=legacy -g -C" ) + set(FFLAGS2 "-std=legacy -g -O0 ") + set(FFLAGS3 "-std=legacy -O3" ) endif (Fortran_COMPILER_NAME STREQUAL "ifort") @@ -160,12 +169,42 @@ set_property(SOURCE ${UNRES_MIN_PP_SRC} PROPERTY COMPILE_DEFINITIONS ${CPPFLAGS} #======================================== set(UNRES_BIN "unres_min_${Fortran_COMPILER_NAME}.exe") -#set(UNRES_CINFO_DIR "${CMAKE_CURRENT_BINARY_DIR}" ) +#======================================== +# cinfo.f workaround for Cmake +#======================================== +# get the current date +TODAY(DATE) +# generate cinfo.f + +set(CINFO "${CMAKE_CURRENT_BINARY_DIR}/cinfo.f") +FILE(WRITE ${CINFO} +"C CMake generated file + subroutine cinfo + include 'COMMON.IOUNITS' + write(iout,*)'++++ Compile info ++++' + write(iout,*)'Version ${UNRES_MAJOR}.${UNRES_MINOR} build ${UNRES_PATCH}' +") + +CINFO_FORMAT(${CINFO} "Compiled" "${DATE}" ) +CINFO_FORMAT(${CINFO} "Compiled by" "$ENV{USER}@$ENV{HOST}" ) +CINFO_FORMAT(${CINFO} "OS name:" "${CMAKE_SYSTEM_NAME}" ) +CINFO_FORMAT(${CINFO} "OS release:" "${CMAKE_SYSTEM}" ) +CINFO_FORMAT(${CINFO} "Fortran Compiler:" "${CMAKE_Fortran_COMPILER}" ) +CINFO_FORMAT(${CINFO} "CPPFLAGS =" "${CPPFLAGS}") + +FILE(APPEND ${CINFO} +" write(iout,*)'Version MINI energy and minimalization only' + write(iout,*)'++++ End of compile info ++++' + return + end ") + +# add include path +set_property(SOURCE ${CMAKE_CURRENT_BINARY_DIR}/cinfo.f PROPERTY COMPILE_FLAGS "${FFLAGS0} -I${CMAKE_CURRENT_SOURCE_DIR}") #========================================= # Set full unres MIN sources #========================================= -set(UNRES_MIN_SRCS ${UNRES_MIN_SRC0} ${UNRES_MIN_SRC1} ${UNRES_MIN_SRC2} ${UNRES_MIN_SRC3} cinfo.f ) +set(UNRES_MIN_SRCS ${UNRES_MIN_SRC0} ${UNRES_MIN_SRC1} ${UNRES_MIN_SRC2} ${UNRES_MIN_SRC3} ${CMAKE_CURRENT_BINARY_DIR}/cinfo.f ) #========================================= # Build the binary @@ -173,13 +212,19 @@ set(UNRES_MIN_SRCS ${UNRES_MIN_SRC0} ${UNRES_MIN_SRC1} ${UNRES_MIN_SRC2} ${UNRES 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") +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 ) #========================================= +# INSTALL +#========================================= + +install(TARGETS UNRES_BIN-MIN RUNTIME DESTINATION unrespack/bin) + +#========================================= # TESTS #=========================================