From 22fe1d6f146992b1e0a73979331b49c5e4e50aa0 Mon Sep 17 00:00:00 2001 From: Daniele Rapetti Date: Tue, 2 May 2023 13:54:55 +0200 Subject: [PATCH 01/40] starting to add cmake compilation --- CMakeLists.txt | 5 ++ src/CMakeLists.txt | 145 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 150 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 src/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000000..a167a82349 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,5 @@ +cmake_minimum_required(VERSION 3.20.2) + +project(Plumed2 LANGUAGES CXX) + +add_subdirectory(src) \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000000..b70c8eabac --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,145 @@ +cmake_minimum_required(VERSION 3.20.2) + +project(Plumed2 LANGUAGES CXX) + +MACRO(SUBDIRLIST result curdir) + FILE(GLOB children RELATIVE ${curdir} ${curdir}/*) + SET(dirlist "") + FOREACH(child ${children}) + IF(IS_DIRECTORY ${curdir}/${child}) + LIST(APPEND dirlist ${child}) + ENDIF() + ENDFOREACH() + SET(${result} ${dirlist}) +ENDMACRO() + +SUBDIRLIST(alldirs ${CMAKE_CURRENT_SOURCE_DIR})# CACHE INTERNAL FORCE) +set(dirs ${alldirs})# CACHE INTERNAL FORCE) +#message("${alldirs}") +#message("${dirs}") +#these are the diretory to compile that do not have a module.type inside +set(coredirs main config wrapper) +list(REMOVE_ITEM dirs lib include maketools CMakeFiles ${coredirs}) + + +foreach(dir ${coredirs}) + set(module_${dir} ON CACHE INTERNAL "always active core module ${dir}") +endforeach(dir ${coredirs}) + +foreach(dir ${dirs}) + #this may the set up to be done in personal subdiretctories + file(STRINGS ${dir}/module.type mt ) + if(mt STREQUAL "default-off") + option(module_${dir} "activate module ${dir}" OFF) + elseif(mt STREQUAL "default-on") + option(module_${dir} "activate module ${dir}" ON) + elseif(mt STREQUAL "always") + set(module_${dir} ON CACHE INTERNAL "always active module ${dir}") + else() + #message( "${dir} ${mt}") + message(FATAL_ERROR "module:\"${dir}\" type:\"${mt}\": module type must be \"always\" or \"deafult-on\" or \"default-off\"") + endif() + #this gets the dependency for the modules + #file(STRINGS ${dir}/Makefile rgx REGEX "USE=.*") + #STRING(REPLACE "USE=" "" rgx "${rgx}") + #separate_arguments(rgx) + +endforeach(dir ${dirs}) + +# --bindir=DIR user executables [EPREFIX/bin] +# --sbindir=DIR system admin executables [EPREFIX/sbin] +# --libexecdir=DIR program executables [EPREFIX/libexec] +# --sysconfdir=DIR read-only single-machine data [PREFIX/etc] +# --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] +# --localstatedir=DIR modifiable single-machine data [PREFIX/var] +# --libdir=DIR object code libraries [EPREFIX/lib] +# --includedir=DIR C header files [PREFIX/include] +# --oldincludedir=DIR C header files for non-gcc [/usr/include] +# --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] +# --datadir=DIR read-only architecture-independent data [DATAROOTDIR] +# --infodir=DIR info documentation [DATAROOTDIR/info] +# --localedir=DIR locale-dependent data [DATAROOTDIR/locale] +# --mandir=DIR man documentation [DATAROOTDIR/man] +# --docdir=DIR documentation root [DATAROOTDIR/doc/plumed] +# --htmldir=DIR html documentation [DOCDIR] +# --dvidir=DIR dvi documentation [DOCDIR] +# --pdfdir=DIR pdf documentation [DOCDIR] +# --psdir=DIR ps documentation [DOCDIR] +# +#Program names: +# --program-prefix=PREFIX prepend PREFIX to installed program names +# --program-suffix=SUFFIX append SUFFIX to installed program names +# --program-transform-name=PROGRAM run sed PROGRAM on installed program names +# +#Optional Features: +# --disable-option-checking ignore unrecognized --enable/--with options +# --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) +# --enable-FEATURE[=ARG] include FEATURE [ARG=yes] +# --enable-modules all/none/reset or : separated list such as +# +crystallization:-bias default: reset +# --enable-libsearch enable search for libraries, default: yes +# --enable-static-patch enable allow statically linking plumed, default: yes +# --enable-doc enable documentation, default: yes +# --enable-pdfdoc enable pdf version of the manual, default: no +# --enable-debug enable debugging, default: no +# --enable-gcov enable gcov to estimate code coverage, default: no +# --enable-cxx 11 or 14. To link libraries with headers that need +# this C++ level. Use --enable-cxx=none to remove +# -std=c++ flag +# --enable-basic-warnings enable basic warnings, default: yes +# --enable-fussy enable fussy warnings, default: no +# --enable-debug-glibcxx enable enable boundary check, default: no +# --enable-shared enable shared libs, default: yes +# --enable-dependency-tracking +# enable dependency tracking, default: yes +# --enable-rpath enable store rpath, default: no +# --enable-absolute-soname +# enable store absolute soname (Linux only - this is +# the default behavior on OSX). Only enable for +# testing!, default: no +# --enable-absolute-install-name +# enable store absolute relative (OSX only - disable +# to have a behavior similar to Linux). Only disable +# for testing!, default: yes +# --enable-loader-path enable use @loader_path to find +# libplumedKernel.dylib (OSX only), default: yes +# --enable-bsymbolic enable use -Bsymbolic flag in making shared +# libraries (Linux only), default: yes +# --enable-ld-r enable group object files, default: yes +# --enable-ar-cr enable use ar to build libplumedWrapper.a, default: +# yes +# --enable-static-archive enable try to build libplumed.a for static linking, +# default: yes +# --enable-asmjit enable enable embedded asmjit, default: yes +# --enable-mpi enable search for mpi, default: yes +# --enable-external-lapack +# enable search for external lapack, default: yes +# --enable-external-blas enable search for external blas, default: yes +# --enable-molfile-plugins +# enable use molfile_plugins, default: yes +# --enable-external-molfile-plugins +# enable search for external molfile_plugins, default: +# yes +# --enable-zlib enable search for zlib, default: yes +# --enable-readdir-r enable search for readdir_r (threadsafe), default: +# no +# --enable-cregex enable search for C regular expression, default: yes +# --enable-dlopen enable search for dlopen, default: yes +# --enable-rtld_default enable search for RTLD_DEFAULT macro, default: yes +# --enable-chdir enable search for chdir function, default: yes +# --enable-subprocess enable search for functions needed to manage a +# subprocess, default: yes +# --enable-getcwd enable search for getcwd function, default: yes +# --enable-popen enable search for popen, default: yes +# --enable-execinfo enable search for execinfo, default: yes +# --enable-gsl enable search for gsl, default: yes +# --enable-boost_graph enable search for boost graph, default: no +# --enable-boost_serialization +# enable search for boost serialization, default: no +# --enable-fftw enable search for fftw, default: yes +# --enable-python enable search for python, default: yes +# --enable-af_ocl enable search for arrayfire_ocl, default: no +# --enable-af_cuda enable search for arrayfire_cuda, default: no +# --enable-af_cpu enable search for arrayfire_cpu, default: no +# --enable-libtorch enable search for libtorch, default: no +# --disable-openmp do not use OpenMP \ No newline at end of file From 81a9ef4a1771961e7357bfedb8c5bcf8c1145d67 Mon Sep 17 00:00:00 2001 From: Daniele Rapetti Date: Tue, 2 May 2023 14:36:47 +0200 Subject: [PATCH 02/40] dded findblas and findlapack --- src/CMakeLists.txt | 45 +++++++++++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b70c8eabac..d48d9dd91e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -21,7 +21,6 @@ set(dirs ${alldirs})# CACHE INTERNAL FORCE) set(coredirs main config wrapper) list(REMOVE_ITEM dirs lib include maketools CMakeFiles ${coredirs}) - foreach(dir ${coredirs}) set(module_${dir} ON CACHE INTERNAL "always active core module ${dir}") endforeach(dir ${coredirs}) @@ -46,14 +45,36 @@ foreach(dir ${dirs}) endforeach(dir ${dirs}) -# --bindir=DIR user executables [EPREFIX/bin] -# --sbindir=DIR system admin executables [EPREFIX/sbin] -# --libexecdir=DIR program executables [EPREFIX/libexec] -# --sysconfdir=DIR read-only single-machine data [PREFIX/etc] +option(useExternal_BLAS "enable search for external BLAS, default ON" ON) +option(useExternal_LAPACK "enable search for external LAPACK, default ON" ON) +if (useExternal_BLAS) + include(FindBLAS) +endif(useExternal_BLAS) +if(useExternal_LAPACK) + include(FindLAPACK) +endif(useExternal_LAPACK) + +if (BLAS_FOUND) + set(module_blas OFF) + #target_compile_options(${PROJECT_NAME} PRIVATE ${BLAS_LINKER_FLAGS}) + #target_link_libraries(${PROJECT_NAME} ${BLAS_LIBRARIES}) +endif () +if (LAPACK_FOUND) + set(module_lapack OFF) + #target_compile_options(${PROJECT_NAME} PRIVATE ${BLAS_LINKER_FLAGS}) + #target_link_libraries(${PROJECT_NAME} ${BLAS_LIBRARIES}) +endif () +message("BLAS internal:${module_blas}") +message("LAPACK internal:${module_lapack}") +#options ## options are already done +## --bindir=DIR user executables [EPREFIX/bin] +## --sbindir=DIR system admin executables [EPREFIX/sbin] +# --libexecdir=DIR program executables [EPREFIX/libexec] +## --sysconfdir=DIR read-only single-machine data [PREFIX/etc] # --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] # --localstatedir=DIR modifiable single-machine data [PREFIX/var] -# --libdir=DIR object code libraries [EPREFIX/lib] -# --includedir=DIR C header files [PREFIX/include] +## --libdir=DIR object code libraries [EPREFIX/lib] +## --includedir=DIR C header files [PREFIX/include] # --oldincludedir=DIR C header files for non-gcc [/usr/include] # --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] # --datadir=DIR read-only architecture-independent data [DATAROOTDIR] @@ -75,8 +96,8 @@ endforeach(dir ${dirs}) # --disable-option-checking ignore unrecognized --enable/--with options # --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) # --enable-FEATURE[=ARG] include FEATURE [ARG=yes] -# --enable-modules all/none/reset or : separated list such as -# +crystallization:-bias default: reset +## --enable-modules all/none/reset or : separated list such as +## +crystallization:-bias default: reset # --enable-libsearch enable search for libraries, default: yes # --enable-static-patch enable allow statically linking plumed, default: yes # --enable-doc enable documentation, default: yes @@ -112,9 +133,9 @@ endforeach(dir ${dirs}) # default: yes # --enable-asmjit enable enable embedded asmjit, default: yes # --enable-mpi enable search for mpi, default: yes -# --enable-external-lapack -# enable search for external lapack, default: yes -# --enable-external-blas enable search for external blas, default: yes +## --enable-external-lapack +## enable search for external lapack, default: yes +## --enable-external-blas enable search for external blas, default: yes # --enable-molfile-plugins # enable use molfile_plugins, default: yes # --enable-external-molfile-plugins From 326cf0c58c2133acbfd3a0a815bb7f9bd2420bfe Mon Sep 17 00:00:00 2001 From: Daniele Rapetti Date: Tue, 2 May 2023 14:56:13 +0200 Subject: [PATCH 03/40] now blas/lapack research works easier --- src/CMakeLists.txt | 40 +++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d48d9dd91e..92d097c558 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -45,25 +45,35 @@ foreach(dir ${dirs}) endforeach(dir ${dirs}) +if(all_modules) + foreach(dir ${dirs}) + set(module_${dir} ON) + endforeach(dir ${dirs}) +endif(all_modules) + +# --enable-external-molfile-plugins +# enable search for external molfile_plugins, default: +# yes + option(useExternal_BLAS "enable search for external BLAS, default ON" ON) option(useExternal_LAPACK "enable search for external LAPACK, default ON" ON) -if (useExternal_BLAS) - include(FindBLAS) -endif(useExternal_BLAS) -if(useExternal_LAPACK) - include(FindLAPACK) -endif(useExternal_LAPACK) -if (BLAS_FOUND) - set(module_blas OFF) - #target_compile_options(${PROJECT_NAME} PRIVATE ${BLAS_LINKER_FLAGS}) - #target_link_libraries(${PROJECT_NAME} ${BLAS_LIBRARIES}) -endif () -if (LAPACK_FOUND) - set(module_lapack OFF) - #target_compile_options(${PROJECT_NAME} PRIVATE ${BLAS_LINKER_FLAGS}) - #target_link_libraries(${PROJECT_NAME} ${BLAS_LIBRARIES}) +foreach(externalLib BLAS LAPACK) + string(TOLOWER ${externalLib} externalMod) + if (useExternal_${externalLib}) + include(Find${externalLib}) + else() + set(${externalLib}_FOUND OFF) + set(module_${externalMod} ON) + endif(useExternal_${externalLib}) + if (${externalLib}_FOUND) + set(module_${externalMod} OFF) + #target_compile_options(${PROJECT_NAME} PRIVATE ${BLAS_LINKER_FLAGS}) + #target_link_libraries(${PROJECT_NAME} ${BLAS_LIBRARIES}) endif () +endforeach(externalLib BLAS LAPACK) + + message("BLAS internal:${module_blas}") message("LAPACK internal:${module_lapack}") #options ## options are already done From 2a89c5e0e14b73016157de5fa2e27faab322428a Mon Sep 17 00:00:00 2001 From: Daniele Rapetti Date: Tue, 2 May 2023 15:23:49 +0200 Subject: [PATCH 04/40] added all_modules --- src/CMakeLists.txt | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 92d097c558..94dcdef855 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -19,18 +19,26 @@ set(dirs ${alldirs})# CACHE INTERNAL FORCE) #message("${dirs}") #these are the diretory to compile that do not have a module.type inside set(coredirs main config wrapper) -list(REMOVE_ITEM dirs lib include maketools CMakeFiles ${coredirs}) +set(mayBeExternal blas lapack) +list(REMOVE_ITEM dirs lib include maketools CMakeFiles ${coredirs} ${mayBeExternal}) + foreach(dir ${coredirs}) set(module_${dir} ON CACHE INTERNAL "always active core module ${dir}") endforeach(dir ${coredirs}) +foreach(dir ${mayBeExternal}) + option(module_${dir} "activate module ${dir}" ON) +endforeach(dir ${mayBeExternal}) + +option(all_modules "Activates all modules, if on ignores the values of module_name when compiling" OFF) + foreach(dir ${dirs}) #this may the set up to be done in personal subdiretctories file(STRINGS ${dir}/module.type mt ) - if(mt STREQUAL "default-off") + if(mt STREQUAL "default-off" AND NOT all_modules) option(module_${dir} "activate module ${dir}" OFF) - elseif(mt STREQUAL "default-on") + elseif(mt STREQUAL "default-on" OR (mt STREQUAL "default-off" AND all_modules)) option(module_${dir} "activate module ${dir}" ON) elseif(mt STREQUAL "always") set(module_${dir} ON CACHE INTERNAL "always active module ${dir}") @@ -42,15 +50,13 @@ foreach(dir ${dirs}) #file(STRINGS ${dir}/Makefile rgx REGEX "USE=.*") #STRING(REPLACE "USE=" "" rgx "${rgx}") #separate_arguments(rgx) - endforeach(dir ${dirs}) - if(all_modules) +#forceactivates all modules foreach(dir ${dirs}) - set(module_${dir} ON) + set(module_${dir} ON) endforeach(dir ${dirs}) -endif(all_modules) - +endif() # --enable-external-molfile-plugins # enable search for external molfile_plugins, default: # yes @@ -59,15 +65,15 @@ option(useExternal_BLAS "enable search for external BLAS, default ON" ON) option(useExternal_LAPACK "enable search for external LAPACK, default ON" ON) foreach(externalLib BLAS LAPACK) - string(TOLOWER ${externalLib} externalMod) + string(TOLOWER ${externalLib} dir) if (useExternal_${externalLib}) include(Find${externalLib}) else() set(${externalLib}_FOUND OFF) - set(module_${externalMod} ON) + set(module_${dir} ON CACHE BOOL "activate module ${dir}" FORCE) endif(useExternal_${externalLib}) if (${externalLib}_FOUND) - set(module_${externalMod} OFF) + set(module_${dir} OFF CACHE BOOL "activate module ${dir}" FORCE) #target_compile_options(${PROJECT_NAME} PRIVATE ${BLAS_LINKER_FLAGS}) #target_link_libraries(${PROJECT_NAME} ${BLAS_LIBRARIES}) endif () @@ -173,4 +179,9 @@ message("LAPACK internal:${module_lapack}") # --enable-af_cuda enable search for arrayfire_cuda, default: no # --enable-af_cpu enable search for arrayfire_cpu, default: no # --enable-libtorch enable search for libtorch, default: no -# --disable-openmp do not use OpenMP \ No newline at end of file +# --disable-openmp do not use OpenMP + +#for debugging purpose +#foreach(dir ${dirs} ${coredirs} ${mayBeExternal}) +# message("${dir}: ${module_${dir}}") +#endforeach(dir ${dirs} ${coredirs} ${mayBeExternal}) \ No newline at end of file From 379dfa9a188bbc742d3fb678508002ba22e0394e Mon Sep 17 00:00:00 2001 From: Daniele Rapetti Date: Tue, 2 May 2023 18:10:50 +0200 Subject: [PATCH 05/40] trying to add the "main" plumed directories --- CMakeLists.txt | 2 +- src/CMakeLists.txt | 17 +++++++++++++++-- src/config/CMakeLists.txt | 20 ++++++++++++++++++++ src/main/CMakeLists.txt | 2 ++ src/wrapper/CMakeLists.txt | 2 ++ 5 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 src/config/CMakeLists.txt create mode 100644 src/main/CMakeLists.txt create mode 100644 src/wrapper/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index a167a82349..6e3e6594ce 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,4 +2,4 @@ cmake_minimum_required(VERSION 3.20.2) project(Plumed2 LANGUAGES CXX) -add_subdirectory(src) \ No newline at end of file +add_subdirectory(src) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 94dcdef855..1ff6e5d4b9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,8 +1,16 @@ cmake_minimum_required(VERSION 3.20.2) -project(Plumed2 LANGUAGES CXX) +project(Plumed2 LANGUAGES C CXX) + +set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS None Debug Release RelWithDebInfo MinSizeRel) +#some settingsvalues +set(program_name "plumed" CACHE STRING "the name of the main executable") +set(SOEXT "so" CACHE STRING "The extension of dynamic libraries (so/dylib)") +set_property(CACHE SOEXT PROPERTY STRINGS "so" "dylib") + MACRO(SUBDIRLIST result curdir) + #This macro is from a lot of posts on stackoverflow FILE(GLOB children RELATIVE ${curdir} ${curdir}/*) SET(dirlist "") FOREACH(child ${children}) @@ -19,11 +27,13 @@ set(dirs ${alldirs})# CACHE INTERNAL FORCE) #message("${dirs}") #these are the diretory to compile that do not have a module.type inside set(coredirs main config wrapper) + set(mayBeExternal blas lapack) list(REMOVE_ITEM dirs lib include maketools CMakeFiles ${coredirs} ${mayBeExternal}) foreach(dir ${coredirs}) + add_subdirectory(${dir}) set(module_${dir} ON CACHE INTERNAL "always active core module ${dir}") endforeach(dir ${coredirs}) @@ -35,6 +45,9 @@ option(all_modules "Activates all modules, if on ignores the values of module_na foreach(dir ${dirs}) #this may the set up to be done in personal subdiretctories + #as option(module_${dir} "activate module ${dir}" OFF/ON) directly + #in the CMakeLists.txt, and then forced to ON with all_modules, we'll see in + #the next iteration file(STRINGS ${dir}/module.type mt ) if(mt STREQUAL "default-off" AND NOT all_modules) option(module_${dir} "activate module ${dir}" OFF) @@ -184,4 +197,4 @@ message("LAPACK internal:${module_lapack}") #for debugging purpose #foreach(dir ${dirs} ${coredirs} ${mayBeExternal}) # message("${dir}: ${module_${dir}}") -#endforeach(dir ${dirs} ${coredirs} ${mayBeExternal}) \ No newline at end of file +#endforeach(dir ${dirs} ${coredirs} ${mayBeExternal}) diff --git a/src/config/CMakeLists.txt b/src/config/CMakeLists.txt new file mode 100644 index 0000000000..b9353b19ad --- /dev/null +++ b/src/config/CMakeLists.txt @@ -0,0 +1,20 @@ + +#SOEXT is set in ./src +set(ISINSTALLED "true") +#must go to /lib/plumed +set(PLUMED_ROOT ${CMAKE_INSTALL_PREFIX}/${program_name}) +set (htmldir ${htmldir}) +set (includedir ${includedir}) +set (program_name ${program_name}) +set (libdir ${libdir}) +configure_file(Config.inc.in ConfigInstall.inc) + +set(ISINSTALLED "false") +set (PLUMED_ROOT ${CMAKE_SOURCE_DIR}) +set (htmldir "xxxxNAxxxx") +set (includedir "xxxxNAxxxx") +set (program_name "xxxxNAxxxx") +configure_file(Config.inc.in Config.inc) + +add_library(Config OBJECT Config.cpp) +add_library(ConfigInstall OBJECT ConfigInstall.cpp) \ No newline at end of file diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt new file mode 100644 index 0000000000..071d73ebae --- /dev/null +++ b/src/main/CMakeLists.txt @@ -0,0 +1,2 @@ +add_executable(${program_name} main.cpp) +target_link_libraries(${program_name} ConfigInstall Plumed) \ No newline at end of file diff --git a/src/wrapper/CMakeLists.txt b/src/wrapper/CMakeLists.txt new file mode 100644 index 0000000000..7ec57c4a9d --- /dev/null +++ b/src/wrapper/CMakeLists.txt @@ -0,0 +1,2 @@ +#add_library(PlumedStatic OBJECT PlumedStatic.cpp) +add_library(Plumed OBJECT Plumed.c) \ No newline at end of file From ccb630060f1119de1cd9f011b804bf774b01e701 Mon Sep 17 00:00:00 2001 From: Daniele Rapetti Date: Wed, 3 May 2023 09:10:35 +0200 Subject: [PATCH 06/40] updated gitignores --- .gitignore | 1 + src/.gitignore | 1 + 2 files changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index e85ec29741..cbac3cd960 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,4 @@ makefile.dep /config.* /autom4* /stamp-h +build \ No newline at end of file diff --git a/src/.gitignore b/src/.gitignore index 258add5ef0..4f935271f3 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -55,6 +55,7 @@ !/s2cm !/pytorch !/membranefusion +!CMakeLists.txt # And just ignore these files *.xxd From a4ff2ef9d27e739d4642afef3d6cb9371467f739 Mon Sep 17 00:00:00 2001 From: Daniele Rapetti Date: Wed, 3 May 2023 11:03:31 +0200 Subject: [PATCH 07/40] making some progresses --- src/CMakeLists.txt | 36 ++++++++++++++++++++++++++++++++++++ src/main/CMakeLists.txt | 2 +- src/wrapper/CMakeLists.txt | 8 ++++++-- 3 files changed, 43 insertions(+), 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1ff6e5d4b9..d5af07859f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -8,6 +8,7 @@ set(program_name "plumed" CACHE STRING "the name of the main executable") set(SOEXT "so" CACHE STRING "The extension of dynamic libraries (so/dylib)") set_property(CACHE SOEXT PROPERTY STRINGS "so" "dylib") +set(modulesDependencies "") MACRO(SUBDIRLIST result curdir) #This macro is from a lot of posts on stackoverflow @@ -21,6 +22,20 @@ MACRO(SUBDIRLIST result curdir) SET(${result} ${dirlist}) ENDMACRO() +set (PLUMED_INCLUDE $) +MACRO(ADDMODULETOKERNEL module_var module_name) + + if(${module_var} ) + set(OTHERARGS ${ARGV}) + list(REMOVE_ITEM OTHERARGS ${module_var} ${module_name}) + + add_library(${module_name} OBJECT ${OTHERARGS} ) + target_include_directories(${module_name} PRIVATE ${PLUMED_INCLUDE}) + list(APPEND modulesDependencies ${module_name}) + set(modulesDependencies ${modulesDependencies} PARENT_SCOPE) + endif(${module_var} ) +ENDMACRO(ADDMODULETOKERNEL) + SUBDIRLIST(alldirs ${CMAKE_CURRENT_SOURCE_DIR})# CACHE INTERNAL FORCE) set(dirs ${alldirs})# CACHE INTERNAL FORCE) #message("${alldirs}") @@ -70,6 +85,11 @@ if(all_modules) set(module_${dir} ON) endforeach(dir ${dirs}) endif() +foreach(dir "colvar")#${dirs}) + if(module_${dir}) + add_subdirectory(${dir}) + endif(module_${dir}) +endforeach(dir ${dirs}) # --enable-external-molfile-plugins # enable search for external molfile_plugins, default: # yes @@ -198,3 +218,19 @@ message("LAPACK internal:${module_lapack}") #foreach(dir ${dirs} ${coredirs} ${mayBeExternal}) # message("${dir}: ${module_${dir}}") #endforeach(dir ${dirs} ${coredirs} ${mayBeExternal}) + +#these targets build the two libPlumedKernel.so + +set(KernelTargets "") + +foreach(activeModule ${modulesDependencies}) + list(APPEND KernelTargets $) +endforeach(activeModule ${modulesDependencies}) +add_library(plumedKernel SHARED ${KernelTargets}) +#add_dependencies(plumedKernel #modulesDependencies +#) +#these targets build the libPlumed.so +add_library(libplumed SHARED $) +add_dependencies(libplumed #modulesDependencies + PlumedWrapper +) \ No newline at end of file diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt index 071d73ebae..d220cdd225 100644 --- a/src/main/CMakeLists.txt +++ b/src/main/CMakeLists.txt @@ -1,2 +1,2 @@ add_executable(${program_name} main.cpp) -target_link_libraries(${program_name} ConfigInstall Plumed) \ No newline at end of file +target_link_libraries(${program_name} plumedKernel libplumed) \ No newline at end of file diff --git a/src/wrapper/CMakeLists.txt b/src/wrapper/CMakeLists.txt index 7ec57c4a9d..29556c7c37 100644 --- a/src/wrapper/CMakeLists.txt +++ b/src/wrapper/CMakeLists.txt @@ -1,2 +1,6 @@ -#add_library(PlumedStatic OBJECT PlumedStatic.cpp) -add_library(Plumed OBJECT Plumed.c) \ No newline at end of file +add_library(PlumedStaticWrapper OBJECT PlumedStatic.cpp) +add_library(PlumedWrapper OBJECT Plumed.c) + +#add here the lib so and the lib static for Plumed.so and PlumedKernel.so +#find a way to add all the activated libraries here or add them to tha main CMakeList.txt? +#Then cmake should short all the mess for you, hopefully \ No newline at end of file From 3ba4365c92164631ac1f6f72cd99168d19e85b24 Mon Sep 17 00:00:00 2001 From: Daniele Rapetti Date: Wed, 3 May 2023 12:22:30 +0200 Subject: [PATCH 08/40] autogenerated the CMakeLists.txt for all the noncore modules --- src/CMakeLists.txt | 38 ++++++++-------- src/adjmat/.gitignore | 1 + src/adjmat/CMakeLists.txt | 32 ++++++++++++++ src/analysis/.gitignore | 1 + src/analysis/CMakeLists.txt | 30 +++++++++++++ src/annfunc/.gitignore | 1 + src/annfunc/CMakeLists.txt | 11 +++++ src/asmjit/CMakeLists.txt | 40 +++++++++++++++++ src/bias/.gitignore | 1 + src/bias/CMakeLists.txt | 27 +++++++++++ src/blas/.gitignore | 1 + src/blas/CMakeLists.txt | 11 +++++ src/cltools/.gitignore | 1 + src/cltools/CMakeLists.txt | 25 +++++++++++ src/colvar/.gitignore | 1 + src/colvar/CMakeLists.txt | 41 +++++++++++++++++ src/core/.gitignore | 1 + src/core/CMakeLists.txt | 37 ++++++++++++++++ src/crystallization/.gitignore | 1 + src/crystallization/CMakeLists.txt | 32 ++++++++++++++ src/dimred/.gitignore | 1 + src/dimred/CMakeLists.txt | 23 ++++++++++ src/drr/.gitignore | 1 + src/drr/CMakeLists.txt | 14 ++++++ src/eds/.gitignore | 1 + src/eds/CMakeLists.txt | 11 +++++ src/fisst/.gitignore | 1 + src/fisst/CMakeLists.txt | 12 +++++ src/function/.gitignore | 1 + src/function/CMakeLists.txt | 22 +++++++++ src/funnel/.gitignore | 1 + src/funnel/CMakeLists.txt | 12 +++++ src/generic/.gitignore | 1 + src/generic/CMakeLists.txt | 32 ++++++++++++++ src/gridtools/.gitignore | 1 + src/gridtools/CMakeLists.txt | 29 ++++++++++++ src/isdb/.gitignore | 1 + src/isdb/CMakeLists.txt | 24 ++++++++++ src/lapack/.gitignore | 1 + src/lapack/CMakeLists.txt | 11 +++++ src/lepton/.gitignore | 1 + src/lepton/CMakeLists.txt | 16 +++++++ src/logmfd/.gitignore | 1 + src/logmfd/CMakeLists.txt | 11 +++++ src/manyrestraints/.gitignore | 1 + src/manyrestraints/CMakeLists.txt | 13 ++++++ src/mapping/.gitignore | 1 + src/mapping/CMakeLists.txt | 21 +++++++++ src/maze/.gitignore | 1 + src/maze/CMakeLists.txt | 22 +++++++++ src/membranefusion/.gitignore | 1 + src/membranefusion/CMakeLists.txt | 13 ++++++ src/molfile/CMakeLists.txt | 14 ++++++ src/multicolvar/.gitignore | 1 + src/multicolvar/CMakeLists.txt | 47 ++++++++++++++++++++ src/opes/.gitignore | 1 + src/opes/CMakeLists.txt | 19 ++++++++ src/pamm/.gitignore | 1 + src/pamm/CMakeLists.txt | 15 +++++++ src/piv/.gitignore | 1 + src/piv/CMakeLists.txt | 11 +++++ src/pytorch/.gitignore | 1 + src/pytorch/CMakeLists.txt | 11 +++++ src/reference/.gitignore | 1 + src/reference/CMakeLists.txt | 30 +++++++++++++ src/s2cm/.gitignore | 1 + src/s2cm/CMakeLists.txt | 11 +++++ src/sasa/.gitignore | 1 + src/sasa/CMakeLists.txt | 13 ++++++ src/secondarystructure/.gitignore | 1 + src/secondarystructure/CMakeLists.txt | 14 ++++++ src/setup/.gitignore | 1 + src/setup/CMakeLists.txt | 13 ++++++ src/tools/.gitignore | 1 + src/tools/CMakeLists.txt | 58 ++++++++++++++++++++++++ src/vatom/.gitignore | 1 + src/vatom/CMakeLists.txt | 14 ++++++ src/ves/.gitignore | 1 + src/ves/CMakeLists.txt | 64 +++++++++++++++++++++++++++ src/vesselbase/.gitignore | 1 + src/vesselbase/CMakeLists.txt | 34 ++++++++++++++ src/xdrfile/.gitignore | 1 + src/xdrfile/CMakeLists.txt | 10 +++++ 83 files changed, 1008 insertions(+), 20 deletions(-) create mode 100644 src/adjmat/CMakeLists.txt create mode 100644 src/analysis/CMakeLists.txt create mode 100644 src/annfunc/CMakeLists.txt create mode 100644 src/asmjit/CMakeLists.txt create mode 100644 src/bias/CMakeLists.txt create mode 100644 src/blas/CMakeLists.txt create mode 100644 src/cltools/CMakeLists.txt create mode 100644 src/colvar/CMakeLists.txt create mode 100644 src/core/CMakeLists.txt create mode 100644 src/crystallization/CMakeLists.txt create mode 100644 src/dimred/CMakeLists.txt create mode 100644 src/drr/CMakeLists.txt create mode 100644 src/eds/CMakeLists.txt create mode 100644 src/fisst/CMakeLists.txt create mode 100644 src/function/CMakeLists.txt create mode 100644 src/funnel/CMakeLists.txt create mode 100644 src/generic/CMakeLists.txt create mode 100644 src/gridtools/CMakeLists.txt create mode 100644 src/isdb/CMakeLists.txt create mode 100644 src/lapack/CMakeLists.txt create mode 100644 src/lepton/CMakeLists.txt create mode 100644 src/logmfd/CMakeLists.txt create mode 100644 src/manyrestraints/CMakeLists.txt create mode 100644 src/mapping/CMakeLists.txt create mode 100644 src/maze/CMakeLists.txt create mode 100644 src/membranefusion/CMakeLists.txt create mode 100644 src/molfile/CMakeLists.txt create mode 100644 src/multicolvar/CMakeLists.txt create mode 100644 src/opes/CMakeLists.txt create mode 100644 src/pamm/CMakeLists.txt create mode 100644 src/piv/CMakeLists.txt create mode 100644 src/pytorch/CMakeLists.txt create mode 100644 src/reference/CMakeLists.txt create mode 100644 src/s2cm/CMakeLists.txt create mode 100644 src/sasa/CMakeLists.txt create mode 100644 src/secondarystructure/CMakeLists.txt create mode 100644 src/setup/CMakeLists.txt create mode 100644 src/tools/CMakeLists.txt create mode 100644 src/vatom/CMakeLists.txt create mode 100644 src/ves/CMakeLists.txt create mode 100644 src/vesselbase/CMakeLists.txt create mode 100644 src/xdrfile/CMakeLists.txt diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d5af07859f..4e1528e4c2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -23,17 +23,18 @@ MACRO(SUBDIRLIST result curdir) ENDMACRO() set (PLUMED_INCLUDE $) -MACRO(ADDMODULETOKERNEL module_var module_name) - - if(${module_var} ) +MACRO(ADDMODULETOKERNEL module_name) + #use: ADDMODULETOKERNEL(module_name listOfSources) + #Please write the source files explicitly + if(${module_${module_name}} ) set(OTHERARGS ${ARGV}) - list(REMOVE_ITEM OTHERARGS ${module_var} ${module_name}) + list(REMOVE_ITEM OTHERARGS ${module_name}) add_library(${module_name} OBJECT ${OTHERARGS} ) target_include_directories(${module_name} PRIVATE ${PLUMED_INCLUDE}) list(APPEND modulesDependencies ${module_name}) set(modulesDependencies ${modulesDependencies} PARENT_SCOPE) - endif(${module_var} ) + endif(${module_${module_name}}) ENDMACRO(ADDMODULETOKERNEL) SUBDIRLIST(alldirs ${CMAKE_CURRENT_SOURCE_DIR})# CACHE INTERNAL FORCE) @@ -59,21 +60,18 @@ endforeach(dir ${mayBeExternal}) option(all_modules "Activates all modules, if on ignores the values of module_name when compiling" OFF) foreach(dir ${dirs}) - #this may the set up to be done in personal subdiretctories - #as option(module_${dir} "activate module ${dir}" OFF/ON) directly - #in the CMakeLists.txt, and then forced to ON with all_modules, we'll see in - #the next iteration - file(STRINGS ${dir}/module.type mt ) - if(mt STREQUAL "default-off" AND NOT all_modules) - option(module_${dir} "activate module ${dir}" OFF) - elseif(mt STREQUAL "default-on" OR (mt STREQUAL "default-off" AND all_modules)) - option(module_${dir} "activate module ${dir}" ON) - elseif(mt STREQUAL "always") - set(module_${dir} ON CACHE INTERNAL "always active module ${dir}") - else() - #message( "${dir} ${mt}") - message(FATAL_ERROR "module:\"${dir}\" type:\"${mt}\": module type must be \"always\" or \"deafult-on\" or \"default-off\"") - endif() + add_subdirectory(${dir}) + # file(STRINGS ${dir}/module.type mt ) + # if(mt STREQUAL "default-off" AND NOT all_modules) + # option(module_${dir} "activate module ${dir}" OFF) + # elseif(mt STREQUAL "default-on" OR (mt STREQUAL "default-off" AND all_modules)) + # option(module_${dir} "activate module ${dir}" ON) + # elseif(mt STREQUAL "always") + # set(module_${dir} ON CACHE INTERNAL "always active module ${dir}") + # else() + # #message( "${dir} ${mt}") + # message(FATAL_ERROR "module:\"${dir}\" type:\"${mt}\": module type must be \"always\" or \"deafult-on\" or \"default-off\"") + # endif() #this gets the dependency for the modules #file(STRINGS ${dir}/Makefile rgx REGEX "USE=.*") #STRING(REPLACE "USE=" "" rgx "${rgx}") diff --git a/src/adjmat/.gitignore b/src/adjmat/.gitignore index 4888552338..7a6d8238fd 100644 --- a/src/adjmat/.gitignore +++ b/src/adjmat/.gitignore @@ -7,3 +7,4 @@ !/Makefile !/README !/module.type +!/CMakeLists.txt diff --git a/src/adjmat/CMakeLists.txt b/src/adjmat/CMakeLists.txt new file mode 100644 index 0000000000..947c744e21 --- /dev/null +++ b/src/adjmat/CMakeLists.txt @@ -0,0 +1,32 @@ +#automatically generated CMakeLists.txt, may not work! +#the variable module_name is set up as a sugar to reduce "copy-paste" errors +set (module_name "adjmat") +#Note that the macros here require this directory added as a subdir of plumed/src +option(module_${module_name} "activate module adjmat" OFF) +ADDMODULETOKERNEL(${module_name} +ActionWithInputMatrix.cpp +AdjacencyMatrixBase.cpp +AdjacencyMatrixVessel.cpp +AlignedMatrixBase.cpp +ClusterAnalysisBase.cpp +ClusterDiameter.cpp +ClusterDistribution.cpp +ClusteringBase.cpp +ClusterProperties.cpp +ClusterSize.cpp +ClusterWithSurface.cpp +ContactAlignedMatrix.cpp +ContactMatrix.cpp +DFSClustering.cpp +DumpGraph.cpp +HbondMatrix.cpp +MatrixColumnSums.cpp +MatrixRowSums.cpp +OutputCluster.cpp +SMACMatrix.cpp +Sprint.cpp +TopologyMatrix.cpp +) +ADDMODULEDEPENDENCIES(${module_name} +core tools vesselbase multicolvar +) diff --git a/src/analysis/.gitignore b/src/analysis/.gitignore index 4888552338..7a6d8238fd 100644 --- a/src/analysis/.gitignore +++ b/src/analysis/.gitignore @@ -7,3 +7,4 @@ !/Makefile !/README !/module.type +!/CMakeLists.txt diff --git a/src/analysis/CMakeLists.txt b/src/analysis/CMakeLists.txt new file mode 100644 index 0000000000..d0ff041b1a --- /dev/null +++ b/src/analysis/CMakeLists.txt @@ -0,0 +1,30 @@ +#automatically generated CMakeLists.txt, may not work! +#the variable module_name is set up as a sugar to reduce "copy-paste" errors +set (module_name "analysis") +#Note that the macros here require this directory added as a subdir of plumed/src +option(module_${module_name} "activate module analysis" ON) +ADDMODULETOKERNEL(${module_name} +AnalysisBase.cpp +Average.cpp +AverageVessel.cpp +Committor.cpp +DataCollectionObject.cpp +EuclideanDissimilarityMatrix.cpp +FarthestPointSampling.cpp +Histogram.cpp +LandmarkSelectionBase.cpp +LandmarkStaged.cpp +OutputColvarFile.cpp +OutputPDBFile.cpp +PrintDissimilarityMatrix.cpp +ReadAnalysisFrames.cpp +ReadDissimilarityMatrix.cpp +ReselectLandmarks.cpp +SelectRandomFrames.cpp +SelectWithStride.cpp +WhamHistogram.cpp +WhamWeights.cpp +) +ADDMODULEDEPENDENCIES(${module_name} +core tools reference vesselbase gridtools multicolvar bias +) diff --git a/src/annfunc/.gitignore b/src/annfunc/.gitignore index f51ff1c574..d30b99acd8 100644 --- a/src/annfunc/.gitignore +++ b/src/annfunc/.gitignore @@ -2,3 +2,4 @@ core/** deps/** function/** *.o +!/CMakeLists.txt diff --git a/src/annfunc/CMakeLists.txt b/src/annfunc/CMakeLists.txt new file mode 100644 index 0000000000..ada5b017da --- /dev/null +++ b/src/annfunc/CMakeLists.txt @@ -0,0 +1,11 @@ +#automatically generated CMakeLists.txt, may not work! +#the variable module_name is set up as a sugar to reduce "copy-paste" errors +set (module_name "annfunc") +#Note that the macros here require this directory added as a subdir of plumed/src +option(module_${module_name} "activate module annfunc" OFF) +ADDMODULETOKERNEL(${module_name} +ANN.cpp +) +ADDMODULEDEPENDENCIES(${module_name} +core function +) diff --git a/src/asmjit/CMakeLists.txt b/src/asmjit/CMakeLists.txt new file mode 100644 index 0000000000..3ca5111ff1 --- /dev/null +++ b/src/asmjit/CMakeLists.txt @@ -0,0 +1,40 @@ +#automatically generated CMakeLists.txt, may not work! +#the variable module_name is set up as a sugar to reduce "copy-paste" errors +set (module_name "asmjit") +#Note that the macros here require this directory added as a subdir of plumed/src +set(module_${module_name} ON CACHE INTERNAL "always active module asmjit") +ADDMODULETOKERNEL(${module_name} +arch.cpp +assembler.cpp +codebuilder.cpp +codecompiler.cpp +codeemitter.cpp +codeholder.cpp +constpool.cpp +cpuinfo.cpp +func.cpp +globals.cpp +inst.cpp +logging.cpp +operand.cpp +osutils.cpp +regalloc.cpp +runtime.cpp +string.cpp +utils.cpp +vmem.cpp +x86assembler.cpp +x86builder.cpp +x86compiler.cpp +x86inst.cpp +x86instimpl.cpp +x86internal.cpp +x86logging.cpp +x86operand.cpp +x86operand_regs.cpp +x86regalloc.cpp +zone.cpp +) +ADDMODULEDEPENDENCIES(${module_name} + +) diff --git a/src/bias/.gitignore b/src/bias/.gitignore index 4888552338..7a6d8238fd 100644 --- a/src/bias/.gitignore +++ b/src/bias/.gitignore @@ -7,3 +7,4 @@ !/Makefile !/README !/module.type +!/CMakeLists.txt diff --git a/src/bias/CMakeLists.txt b/src/bias/CMakeLists.txt new file mode 100644 index 0000000000..30155af0a8 --- /dev/null +++ b/src/bias/CMakeLists.txt @@ -0,0 +1,27 @@ +#automatically generated CMakeLists.txt, may not work! +#the variable module_name is set up as a sugar to reduce "copy-paste" errors +set (module_name "bias") +#Note that the macros here require this directory added as a subdir of plumed/src +option(module_${module_name} "activate module bias" ON) +ADDMODULETOKERNEL(${module_name} +ABMD.cpp +Bias.cpp +BiasValue.cpp +ExtendedLagrangian.cpp +External.cpp +LWalls.cpp +MaxEnt.cpp +MetaD.cpp +MovingRestraint.cpp +PBMetaD.cpp +Restraint.cpp +ReweightBase.cpp +ReweightBias.cpp +ReweightMetad.cpp +ReweightTemperaturePressure.cpp +ReweightWham.cpp +UWalls.cpp +) +ADDMODULEDEPENDENCIES(${module_name} +core tools +) diff --git a/src/blas/.gitignore b/src/blas/.gitignore index 4888552338..7a6d8238fd 100644 --- a/src/blas/.gitignore +++ b/src/blas/.gitignore @@ -7,3 +7,4 @@ !/Makefile !/README !/module.type +!/CMakeLists.txt diff --git a/src/blas/CMakeLists.txt b/src/blas/CMakeLists.txt new file mode 100644 index 0000000000..9e6b3e355f --- /dev/null +++ b/src/blas/CMakeLists.txt @@ -0,0 +1,11 @@ +#automatically generated CMakeLists.txt, may not work! +#the variable module_name is set up as a sugar to reduce "copy-paste" errors +set (module_name "blas") +#Note that the macros here require this directory added as a subdir of plumed/src +set(module_${module_name} ON CACHE INTERNAL "always active module blas") +ADDMODULETOKERNEL(${module_name} +blas.cpp +) +ADDMODULEDEPENDENCIES(${module_name} + +) diff --git a/src/cltools/.gitignore b/src/cltools/.gitignore index 3ad7042f02..08bb696c89 100644 --- a/src/cltools/.gitignore +++ b/src/cltools/.gitignore @@ -8,3 +8,4 @@ !/README !/module.type !/*.sh +!/CMakeLists.txt diff --git a/src/cltools/CMakeLists.txt b/src/cltools/CMakeLists.txt new file mode 100644 index 0000000000..a342e13d2f --- /dev/null +++ b/src/cltools/CMakeLists.txt @@ -0,0 +1,25 @@ +#automatically generated CMakeLists.txt, may not work! +#the variable module_name is set up as a sugar to reduce "copy-paste" errors +set (module_name "cltools") +#Note that the macros here require this directory added as a subdir of plumed/src +option(module_${module_name} "activate module cltools" ON) +ADDMODULETOKERNEL(${module_name} +CLTool.cpp +Completion.cpp +Driver.cpp +DriverDouble.cpp +DriverFloat.cpp +GenExample.cpp +GenJson.cpp +GenTemplate.cpp +Info.cpp +kT.cpp +Manual.cpp +PdbRenumber.cpp +pesmd.cpp +SimpleMD.cpp +SumHills.cpp +) +ADDMODULEDEPENDENCIES(${module_name} +core config tools molfile xdrfile +) diff --git a/src/colvar/.gitignore b/src/colvar/.gitignore index 4888552338..7a6d8238fd 100644 --- a/src/colvar/.gitignore +++ b/src/colvar/.gitignore @@ -7,3 +7,4 @@ !/Makefile !/README !/module.type +!/CMakeLists.txt diff --git a/src/colvar/CMakeLists.txt b/src/colvar/CMakeLists.txt new file mode 100644 index 0000000000..d99bda608a --- /dev/null +++ b/src/colvar/CMakeLists.txt @@ -0,0 +1,41 @@ +#automatically generated CMakeLists.txt, may not work! +#the variable module_name is set up as a sugar to reduce "copy-paste" errors +set (module_name "colvar") +#Note that the macros here require this directory added as a subdir of plumed/src +option(module_${module_name} "activate module colvar" ON) +ADDMODULETOKERNEL(${module_name} +Angle.cpp +Cell.cpp +Colvar.cpp +Constant.cpp +ContactMap.cpp +CoordinationBase.cpp +Coordination.cpp +DHEnergy.cpp +Dimer.cpp +Dipole.cpp +Distance.cpp +DRMSD.cpp +EEFSolv.cpp +Energy.cpp +ERMSD.cpp +ExtraCV.cpp +Fake.cpp +GHBFIX.cpp +Gyration.cpp +MultiRMSD.cpp +PathMSDBase.cpp +PathMSD.cpp +PCARMSD.cpp +Position.cpp +ProjectionOnAxis.cpp +PropertyMap.cpp +Puckering.cpp +RMSD.cpp +Template.cpp +Torsion.cpp +Volume.cpp +) +ADDMODULEDEPENDENCIES(${module_name} +core reference tools +) diff --git a/src/core/.gitignore b/src/core/.gitignore index 4888552338..7a6d8238fd 100644 --- a/src/core/.gitignore +++ b/src/core/.gitignore @@ -7,3 +7,4 @@ !/Makefile !/README !/module.type +!/CMakeLists.txt diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt new file mode 100644 index 0000000000..a2d14dc635 --- /dev/null +++ b/src/core/CMakeLists.txt @@ -0,0 +1,37 @@ +#automatically generated CMakeLists.txt, may not work! +#the variable module_name is set up as a sugar to reduce "copy-paste" errors +set (module_name "core") +#Note that the macros here require this directory added as a subdir of plumed/src +set(module_${module_name} ON CACHE INTERNAL "always active module core") +ADDMODULETOKERNEL(${module_name} +ActionAnyorder.cpp +ActionAtomistic.cpp +Action.cpp +ActionPilot.cpp +ActionRegister.cpp +ActionSet.cpp +ActionSetup.cpp +ActionShortcut.cpp +ActionWithArguments.cpp +ActionWithValue.cpp +ActionWithVirtualAtom.cpp +Atoms.cpp +CLTool.cpp +CLToolMain.cpp +CLToolRegister.cpp +Colvar.cpp +DataFetchingObject.cpp +ExchangePatterns.cpp +FlexibleBin.cpp +GenericMolInfo.cpp +GREX.cpp +MDAtoms.cpp +PlumedMain.cpp +PlumedMainInitializer.cpp +TargetDist.cpp +Value.cpp +WithCmd.cpp +) +ADDMODULEDEPENDENCIES(${module_name} +config tools lepton +) diff --git a/src/crystallization/.gitignore b/src/crystallization/.gitignore index 4888552338..7a6d8238fd 100644 --- a/src/crystallization/.gitignore +++ b/src/crystallization/.gitignore @@ -7,3 +7,4 @@ !/Makefile !/README !/module.type +!/CMakeLists.txt diff --git a/src/crystallization/CMakeLists.txt b/src/crystallization/CMakeLists.txt new file mode 100644 index 0000000000..29617898c1 --- /dev/null +++ b/src/crystallization/CMakeLists.txt @@ -0,0 +1,32 @@ +#automatically generated CMakeLists.txt, may not work! +#the variable module_name is set up as a sugar to reduce "copy-paste" errors +set (module_name "crystallization") +#Note that the macros here require this directory added as a subdir of plumed/src +option(module_${module_name} "activate module crystallization" OFF) +ADDMODULETOKERNEL(${module_name} +BondOrientation.cpp +CubicHarmonicBase.cpp +EnvironmentSimilarity.cpp +Fccubic.cpp +Gradient.cpp +GradientVessel.cpp +InterMolecularTorsions.cpp +LocalSteinhardt.cpp +MoleculeOrientation.cpp +MoleculePlane.cpp +OrientationSphere.cpp +PolymerAngles.cpp +Q3.cpp +Q4.cpp +Q6.cpp +SimpleCubic.cpp +SMAC.cpp +Steinhardt.cpp +Tetrahedral.cpp +VectorMean.cpp +VectorMultiColvar.cpp +VectorSum.cpp +) +ADDMODULEDEPENDENCIES(${module_name} +core tools vesselbase multicolvar +) diff --git a/src/dimred/.gitignore b/src/dimred/.gitignore index 4888552338..7a6d8238fd 100644 --- a/src/dimred/.gitignore +++ b/src/dimred/.gitignore @@ -7,3 +7,4 @@ !/Makefile !/README !/module.type +!/CMakeLists.txt diff --git a/src/dimred/CMakeLists.txt b/src/dimred/CMakeLists.txt new file mode 100644 index 0000000000..868fc6513b --- /dev/null +++ b/src/dimred/CMakeLists.txt @@ -0,0 +1,23 @@ +#automatically generated CMakeLists.txt, may not work! +#the variable module_name is set up as a sugar to reduce "copy-paste" errors +set (module_name "dimred") +#Note that the macros here require this directory added as a subdir of plumed/src +option(module_${module_name} "activate module dimred" OFF) +ADDMODULETOKERNEL(${module_name} +ClassicalMultiDimensionalScaling.cpp +DimensionalityReductionBase.cpp +OutputPCAProjections.cpp +PCA.cpp +ProjectNonLandmarkPoints.cpp +SketchMapBase.cpp +SketchMapConjGrad.cpp +SketchMap.cpp +SketchMapPointwise.cpp +SketchMapRead.cpp +SketchMapSmacof.cpp +SMACOF.cpp +SmacoffMDS.cpp +) +ADDMODULEDEPENDENCIES(${module_name} +core tools reference gridtools analysis +) diff --git a/src/drr/.gitignore b/src/drr/.gitignore index 8a5c88d566..b6d0926269 100644 --- a/src/drr/.gitignore +++ b/src/drr/.gitignore @@ -9,3 +9,4 @@ !/README.md !/COPYRIGHT !/module.type +!/CMakeLists.txt diff --git a/src/drr/CMakeLists.txt b/src/drr/CMakeLists.txt new file mode 100644 index 0000000000..70e2d19779 --- /dev/null +++ b/src/drr/CMakeLists.txt @@ -0,0 +1,14 @@ +#automatically generated CMakeLists.txt, may not work! +#the variable module_name is set up as a sugar to reduce "copy-paste" errors +set (module_name "drr") +#Note that the macros here require this directory added as a subdir of plumed/src +option(module_${module_name} "activate module drr" OFF) +ADDMODULETOKERNEL(${module_name} +colvar_UIestimator.cpp +DRR.cpp +drrtool.cpp +DynamicReferenceRestraining.cpp +) +ADDMODULEDEPENDENCIES(${module_name} +core tools bias cltools config +) diff --git a/src/eds/.gitignore b/src/eds/.gitignore index 8a5c88d566..b6d0926269 100644 --- a/src/eds/.gitignore +++ b/src/eds/.gitignore @@ -9,3 +9,4 @@ !/README.md !/COPYRIGHT !/module.type +!/CMakeLists.txt diff --git a/src/eds/CMakeLists.txt b/src/eds/CMakeLists.txt new file mode 100644 index 0000000000..262e38f4d7 --- /dev/null +++ b/src/eds/CMakeLists.txt @@ -0,0 +1,11 @@ +#automatically generated CMakeLists.txt, may not work! +#the variable module_name is set up as a sugar to reduce "copy-paste" errors +set (module_name "eds") +#Note that the macros here require this directory added as a subdir of plumed/src +option(module_${module_name} "activate module eds" OFF) +ADDMODULETOKERNEL(${module_name} +EDS.cpp +) +ADDMODULEDEPENDENCIES(${module_name} +core tools bias +) diff --git a/src/fisst/.gitignore b/src/fisst/.gitignore index 25449c7172..bc1f5d9091 100644 --- a/src/fisst/.gitignore +++ b/src/fisst/.gitignore @@ -8,3 +8,4 @@ !/README !/module.type !/COPYRIGHT +!/CMakeLists.txt diff --git a/src/fisst/CMakeLists.txt b/src/fisst/CMakeLists.txt new file mode 100644 index 0000000000..9076401128 --- /dev/null +++ b/src/fisst/CMakeLists.txt @@ -0,0 +1,12 @@ +#automatically generated CMakeLists.txt, may not work! +#the variable module_name is set up as a sugar to reduce "copy-paste" errors +set (module_name "fisst") +#Note that the macros here require this directory added as a subdir of plumed/src +option(module_${module_name} "activate module fisst" OFF) +ADDMODULETOKERNEL(${module_name} +FISST.cpp +legendre_rule_fast.cpp +) +ADDMODULEDEPENDENCIES(${module_name} +core tools bias +) diff --git a/src/function/.gitignore b/src/function/.gitignore index 4888552338..7a6d8238fd 100644 --- a/src/function/.gitignore +++ b/src/function/.gitignore @@ -7,3 +7,4 @@ !/Makefile !/README !/module.type +!/CMakeLists.txt diff --git a/src/function/CMakeLists.txt b/src/function/CMakeLists.txt new file mode 100644 index 0000000000..f1cedda85c --- /dev/null +++ b/src/function/CMakeLists.txt @@ -0,0 +1,22 @@ +#automatically generated CMakeLists.txt, may not work! +#the variable module_name is set up as a sugar to reduce "copy-paste" errors +set (module_name "function") +#Note that the macros here require this directory added as a subdir of plumed/src +option(module_${module_name} "activate module function" ON) +ADDMODULETOKERNEL(${module_name} +Combine.cpp +Custom.cpp +Ensemble.cpp +FuncPathGeneral.cpp +FuncPathMSD.cpp +FuncSumHills.cpp +Function.cpp +LocalEnsemble.cpp +Piecewise.cpp +Sort.cpp +Stats.cpp +Target.cpp +) +ADDMODULEDEPENDENCIES(${module_name} +core reference tools lepton +) diff --git a/src/funnel/.gitignore b/src/funnel/.gitignore index 25449c7172..bc1f5d9091 100644 --- a/src/funnel/.gitignore +++ b/src/funnel/.gitignore @@ -8,3 +8,4 @@ !/README !/module.type !/COPYRIGHT +!/CMakeLists.txt diff --git a/src/funnel/CMakeLists.txt b/src/funnel/CMakeLists.txt new file mode 100644 index 0000000000..9617cd5fb1 --- /dev/null +++ b/src/funnel/CMakeLists.txt @@ -0,0 +1,12 @@ +#automatically generated CMakeLists.txt, may not work! +#the variable module_name is set up as a sugar to reduce "copy-paste" errors +set (module_name "funnel") +#Note that the macros here require this directory added as a subdir of plumed/src +option(module_${module_name} "activate module funnel" OFF) +ADDMODULETOKERNEL(${module_name} +FPS.cpp +Funnel.cpp +) +ADDMODULEDEPENDENCIES(${module_name} +core tools colvar bias +) diff --git a/src/generic/.gitignore b/src/generic/.gitignore index 4888552338..7a6d8238fd 100644 --- a/src/generic/.gitignore +++ b/src/generic/.gitignore @@ -7,3 +7,4 @@ !/Makefile !/README !/module.type +!/CMakeLists.txt diff --git a/src/generic/CMakeLists.txt b/src/generic/CMakeLists.txt new file mode 100644 index 0000000000..d517310d99 --- /dev/null +++ b/src/generic/CMakeLists.txt @@ -0,0 +1,32 @@ +#automatically generated CMakeLists.txt, may not work! +#the variable module_name is set up as a sugar to reduce "copy-paste" errors +set (module_name "generic") +#Note that the macros here require this directory added as a subdir of plumed/src +option(module_${module_name} "activate module generic" ON) +ADDMODULETOKERNEL(${module_name} +Debug.cpp +DumpAtoms.cpp +DumpDerivatives.cpp +DumpForces.cpp +DumpMassCharge.cpp +DumpProjections.cpp +EffectiveEnergyDrift.cpp +EndPlumed.cpp +FitToTemplate.cpp +Flush.cpp +Group.cpp +Include.cpp +MolInfo.cpp +Plumed.cpp +Print.cpp +RandomExchanges.cpp +Read.cpp +ResetCell.cpp +Time.cpp +UpdateIf.cpp +WholeMolecules.cpp +WrapAround.cpp +) +ADDMODULEDEPENDENCIES(${module_name} +core tools xdrfile +) diff --git a/src/gridtools/.gitignore b/src/gridtools/.gitignore index 4888552338..7a6d8238fd 100644 --- a/src/gridtools/.gitignore +++ b/src/gridtools/.gitignore @@ -7,3 +7,4 @@ !/Makefile !/README !/module.type +!/CMakeLists.txt diff --git a/src/gridtools/CMakeLists.txt b/src/gridtools/CMakeLists.txt new file mode 100644 index 0000000000..e7758cd734 --- /dev/null +++ b/src/gridtools/CMakeLists.txt @@ -0,0 +1,29 @@ +#automatically generated CMakeLists.txt, may not work! +#the variable module_name is set up as a sugar to reduce "copy-paste" errors +set (module_name "gridtools") +#Note that the macros here require this directory added as a subdir of plumed/src +option(module_${module_name} "activate module gridtools" ON) +ADDMODULETOKERNEL(${module_name} +ActionWithGrid.cpp +ActionWithInputGrid.cpp +ActionWithIntegral.cpp +AverageOnGrid.cpp +ContourFindingBase.cpp +ConvertToFES.cpp +DumpCube.cpp +DumpGrid.cpp +FindContour.cpp +FindContourSurface.cpp +FindSphericalContour.cpp +FourierTransform.cpp +GridPrintingBase.cpp +GridSearch.cpp +GridToXYZ.cpp +GridVessel.cpp +HistogramOnGrid.cpp +IntegrateGrid.cpp +InterpolateGrid.cpp +) +ADDMODULEDEPENDENCIES(${module_name} +core tools vesselbase +) diff --git a/src/isdb/.gitignore b/src/isdb/.gitignore index 4888552338..7a6d8238fd 100644 --- a/src/isdb/.gitignore +++ b/src/isdb/.gitignore @@ -7,3 +7,4 @@ !/Makefile !/README !/module.type +!/CMakeLists.txt diff --git a/src/isdb/CMakeLists.txt b/src/isdb/CMakeLists.txt new file mode 100644 index 0000000000..ba2cc79be0 --- /dev/null +++ b/src/isdb/CMakeLists.txt @@ -0,0 +1,24 @@ +#automatically generated CMakeLists.txt, may not work! +#the variable module_name is set up as a sugar to reduce "copy-paste" errors +set (module_name "isdb") +#Note that the macros here require this directory added as a subdir of plumed/src +option(module_${module_name} "activate module isdb" ON) +ADDMODULETOKERNEL(${module_name} +Caliber.cpp +CS2Backbone.cpp +EMMI.cpp +FretEfficiency.cpp +Jcoupling.cpp +MetainferenceBase.cpp +Metainference.cpp +NOE.cpp +PRE.cpp +RDC.cpp +Rescale.cpp +SAXS.cpp +Select.cpp +Selector.cpp +) +ADDMODULEDEPENDENCIES(${module_name} +bias colvar core reference tools function +) diff --git a/src/lapack/.gitignore b/src/lapack/.gitignore index 4888552338..7a6d8238fd 100644 --- a/src/lapack/.gitignore +++ b/src/lapack/.gitignore @@ -7,3 +7,4 @@ !/Makefile !/README !/module.type +!/CMakeLists.txt diff --git a/src/lapack/CMakeLists.txt b/src/lapack/CMakeLists.txt new file mode 100644 index 0000000000..b0236796a8 --- /dev/null +++ b/src/lapack/CMakeLists.txt @@ -0,0 +1,11 @@ +#automatically generated CMakeLists.txt, may not work! +#the variable module_name is set up as a sugar to reduce "copy-paste" errors +set (module_name "lapack") +#Note that the macros here require this directory added as a subdir of plumed/src +set(module_${module_name} ON CACHE INTERNAL "always active module lapack") +ADDMODULETOKERNEL(${module_name} +lapack.cpp +) +ADDMODULEDEPENDENCIES(${module_name} +blas +) diff --git a/src/lepton/.gitignore b/src/lepton/.gitignore index 64daaf4527..3ea3aefd38 100644 --- a/src/lepton/.gitignore +++ b/src/lepton/.gitignore @@ -9,3 +9,4 @@ !/module.type !/COPYRIGHT !/import.sh +!/CMakeLists.txt diff --git a/src/lepton/CMakeLists.txt b/src/lepton/CMakeLists.txt new file mode 100644 index 0000000000..29f63d06b7 --- /dev/null +++ b/src/lepton/CMakeLists.txt @@ -0,0 +1,16 @@ +#automatically generated CMakeLists.txt, may not work! +#the variable module_name is set up as a sugar to reduce "copy-paste" errors +set (module_name "lepton") +#Note that the macros here require this directory added as a subdir of plumed/src +set(module_${module_name} ON CACHE INTERNAL "always active module lepton") +ADDMODULETOKERNEL(${module_name} +CompiledExpression.cpp +ExpressionProgram.cpp +ExpressionTreeNode.cpp +Operation.cpp +ParsedExpression.cpp +Parser.cpp +) +ADDMODULEDEPENDENCIES(${module_name} +asmjit +) diff --git a/src/logmfd/.gitignore b/src/logmfd/.gitignore index 4888552338..7a6d8238fd 100644 --- a/src/logmfd/.gitignore +++ b/src/logmfd/.gitignore @@ -7,3 +7,4 @@ !/Makefile !/README !/module.type +!/CMakeLists.txt diff --git a/src/logmfd/CMakeLists.txt b/src/logmfd/CMakeLists.txt new file mode 100644 index 0000000000..22b2f9f6d4 --- /dev/null +++ b/src/logmfd/CMakeLists.txt @@ -0,0 +1,11 @@ +#automatically generated CMakeLists.txt, may not work! +#the variable module_name is set up as a sugar to reduce "copy-paste" errors +set (module_name "logmfd") +#Note that the macros here require this directory added as a subdir of plumed/src +option(module_${module_name} "activate module logmfd" OFF) +ADDMODULETOKERNEL(${module_name} +LogMFD.cpp +) +ADDMODULEDEPENDENCIES(${module_name} +core tools bias +) diff --git a/src/manyrestraints/.gitignore b/src/manyrestraints/.gitignore index 4888552338..7a6d8238fd 100644 --- a/src/manyrestraints/.gitignore +++ b/src/manyrestraints/.gitignore @@ -7,3 +7,4 @@ !/Makefile !/README !/module.type +!/CMakeLists.txt diff --git a/src/manyrestraints/CMakeLists.txt b/src/manyrestraints/CMakeLists.txt new file mode 100644 index 0000000000..15bf7077c0 --- /dev/null +++ b/src/manyrestraints/CMakeLists.txt @@ -0,0 +1,13 @@ +#automatically generated CMakeLists.txt, may not work! +#the variable module_name is set up as a sugar to reduce "copy-paste" errors +set (module_name "manyrestraints") +#Note that the macros here require this directory added as a subdir of plumed/src +option(module_${module_name} "activate module manyrestraints" OFF) +ADDMODULETOKERNEL(${module_name} +LWalls.cpp +ManyRestraintsBase.cpp +UWalls.cpp +) +ADDMODULEDEPENDENCIES(${module_name} +core tools vesselbase +) diff --git a/src/mapping/.gitignore b/src/mapping/.gitignore index 4888552338..7a6d8238fd 100644 --- a/src/mapping/.gitignore +++ b/src/mapping/.gitignore @@ -7,3 +7,4 @@ !/Makefile !/README !/module.type +!/CMakeLists.txt diff --git a/src/mapping/CMakeLists.txt b/src/mapping/CMakeLists.txt new file mode 100644 index 0000000000..08777bbd43 --- /dev/null +++ b/src/mapping/CMakeLists.txt @@ -0,0 +1,21 @@ +#automatically generated CMakeLists.txt, may not work! +#the variable module_name is set up as a sugar to reduce "copy-paste" errors +set (module_name "mapping") +#Note that the macros here require this directory added as a subdir of plumed/src +option(module_${module_name} "activate module mapping" ON) +ADDMODULETOKERNEL(${module_name} +AdaptivePath.cpp +Mapping.cpp +PathBase.cpp +Path.cpp +PathReparameterization.cpp +PathTools.cpp +PCAVars.cpp +PropertyMap.cpp +SpathVessel.cpp +TrigonometricPathVessel.cpp +ZpathVessel.cpp +) +ADDMODULEDEPENDENCIES(${module_name} +core tools cltools reference vesselbase +) diff --git a/src/maze/.gitignore b/src/maze/.gitignore index b920aee1b1..97db3530c8 100644 --- a/src/maze/.gitignore +++ b/src/maze/.gitignore @@ -9,3 +9,4 @@ !/README.md !/module.type !/COPYRIGHT +!/CMakeLists.txt diff --git a/src/maze/CMakeLists.txt b/src/maze/CMakeLists.txt new file mode 100644 index 0000000000..2002b0f21a --- /dev/null +++ b/src/maze/CMakeLists.txt @@ -0,0 +1,22 @@ +#automatically generated CMakeLists.txt, may not work! +#the variable module_name is set up as a sugar to reduce "copy-paste" errors +set (module_name "maze") +#Note that the macros here require this directory added as a subdir of plumed/src +option(module_${module_name} "activate module maze" OFF) +ADDMODULETOKERNEL(${module_name} +Core.cpp +Loss.cpp +Member.cpp +Memetic.cpp +Optimizer_Bias.cpp +Optimizer.cpp +Random_Acceleration_MD.cpp +Random_MT.cpp +Random_Walk.cpp +Simulated_Annealing.cpp +Steered_MD.cpp +Tools.cpp +) +ADDMODULEDEPENDENCIES(${module_name} +core tools colvar bias +) diff --git a/src/membranefusion/.gitignore b/src/membranefusion/.gitignore index 4888552338..7a6d8238fd 100644 --- a/src/membranefusion/.gitignore +++ b/src/membranefusion/.gitignore @@ -7,3 +7,4 @@ !/Makefile !/README !/module.type +!/CMakeLists.txt diff --git a/src/membranefusion/CMakeLists.txt b/src/membranefusion/CMakeLists.txt new file mode 100644 index 0000000000..3b8fd12012 --- /dev/null +++ b/src/membranefusion/CMakeLists.txt @@ -0,0 +1,13 @@ +#automatically generated CMakeLists.txt, may not work! +#the variable module_name is set up as a sugar to reduce "copy-paste" errors +set (module_name "membranefusion") +#Note that the macros here require this directory added as a subdir of plumed/src +option(module_${module_name} "activate module membranefusion" OFF) +ADDMODULETOKERNEL(${module_name} +FusionPoreExpansionP.cpp +FusionPoreNucleationP.cpp +MemFusionP.cpp +) +ADDMODULEDEPENDENCIES(${module_name} +core reference tools colvar +) diff --git a/src/molfile/CMakeLists.txt b/src/molfile/CMakeLists.txt new file mode 100644 index 0000000000..22f01c1f7a --- /dev/null +++ b/src/molfile/CMakeLists.txt @@ -0,0 +1,14 @@ +#automatically generated CMakeLists.txt, may not work! +#the variable module_name is set up as a sugar to reduce "copy-paste" errors +set (module_name "molfile") +#Note that the macros here require this directory added as a subdir of plumed/src +option(module_${module_name} "activate module molfile" ON) +ADDMODULETOKERNEL(${module_name} +crdplugin.cpp +dcdplugin.cpp +gromacsplugin.cpp +pdbplugin.cpp +) +ADDMODULEDEPENDENCIES(${module_name} + +) diff --git a/src/multicolvar/.gitignore b/src/multicolvar/.gitignore index 4888552338..7a6d8238fd 100644 --- a/src/multicolvar/.gitignore +++ b/src/multicolvar/.gitignore @@ -7,3 +7,4 @@ !/Makefile !/README !/module.type +!/CMakeLists.txt diff --git a/src/multicolvar/CMakeLists.txt b/src/multicolvar/CMakeLists.txt new file mode 100644 index 0000000000..6ff43b442a --- /dev/null +++ b/src/multicolvar/CMakeLists.txt @@ -0,0 +1,47 @@ +#automatically generated CMakeLists.txt, may not work! +#the variable module_name is set up as a sugar to reduce "copy-paste" errors +set (module_name "multicolvar") +#Note that the macros here require this directory added as a subdir of plumed/src +option(module_${module_name} "activate module multicolvar" ON) +ADDMODULETOKERNEL(${module_name} +ActionVolume.cpp +AlphaBeta.cpp +Angles.cpp +AtomValuePack.cpp +Bridge.cpp +BridgedMultiColvarFunction.cpp +CatomPack.cpp +CenterOfMultiColvar.cpp +CoordinationNumbers.cpp +Density.cpp +DihedralCorrelation.cpp +DistanceFromContour.cpp +Distances.cpp +DumpMultiColvar.cpp +FilterBetween.cpp +FilterLessThan.cpp +FilterMoreThan.cpp +InPlaneDistances.cpp +LocalAverage.cpp +MultiColvarBase.cpp +MultiColvarCombine.cpp +MultiColvarDensity.cpp +MultiColvarFilter.cpp +MultiColvarProduct.cpp +NumberOfLinks.cpp +Torsions.cpp +VolumeAround.cpp +VolumeBetweenContours.cpp +VolumeCavity.cpp +VolumeGradientBase.cpp +VolumeInCylinder.cpp +VolumeInSphere.cpp +VolumeTetrapore.cpp +XAngle.cpp +XDistances.cpp +XYDistances.cpp +XYTorsion.cpp +) +ADDMODULEDEPENDENCIES(${module_name} +core tools vesselbase gridtools +) diff --git a/src/opes/.gitignore b/src/opes/.gitignore index d22daff42d..d8cc7be903 100644 --- a/src/opes/.gitignore +++ b/src/opes/.gitignore @@ -9,3 +9,4 @@ !/COPYRIGHT !/module.type !/postprocessing +!/CMakeLists.txt diff --git a/src/opes/CMakeLists.txt b/src/opes/CMakeLists.txt new file mode 100644 index 0000000000..ce089a9f34 --- /dev/null +++ b/src/opes/CMakeLists.txt @@ -0,0 +1,19 @@ +#automatically generated CMakeLists.txt, may not work! +#the variable module_name is set up as a sugar to reduce "copy-paste" errors +set (module_name "opes") +#Note that the macros here require this directory added as a subdir of plumed/src +option(module_${module_name} "activate module opes" OFF) +ADDMODULETOKERNEL(${module_name} +ECVcustom.cpp +ECVlinear.cpp +ECVmultiThermalBaric.cpp +ECVmultiThermal.cpp +ECVumbrellasFile.cpp +ECVumbrellasLine.cpp +ExpansionCVs.cpp +OPESexpanded.cpp +OPESmetad.cpp +) +ADDMODULEDEPENDENCIES(${module_name} +bias core tools +) diff --git a/src/pamm/.gitignore b/src/pamm/.gitignore index 4888552338..7a6d8238fd 100644 --- a/src/pamm/.gitignore +++ b/src/pamm/.gitignore @@ -7,3 +7,4 @@ !/Makefile !/README !/module.type +!/CMakeLists.txt diff --git a/src/pamm/CMakeLists.txt b/src/pamm/CMakeLists.txt new file mode 100644 index 0000000000..9987aa855c --- /dev/null +++ b/src/pamm/CMakeLists.txt @@ -0,0 +1,15 @@ +#automatically generated CMakeLists.txt, may not work! +#the variable module_name is set up as a sugar to reduce "copy-paste" errors +set (module_name "pamm") +#Note that the macros here require this directory added as a subdir of plumed/src +option(module_${module_name} "activate module pamm" OFF) +ADDMODULETOKERNEL(${module_name} +HBPammHydrogens.cpp +HBPammMatrix.cpp +HBPammObject.cpp +PAMM.cpp +PammObject.cpp +) +ADDMODULEDEPENDENCIES(${module_name} +core tools vesselbase multicolvar adjmat +) diff --git a/src/piv/.gitignore b/src/piv/.gitignore index b920aee1b1..97db3530c8 100644 --- a/src/piv/.gitignore +++ b/src/piv/.gitignore @@ -9,3 +9,4 @@ !/README.md !/module.type !/COPYRIGHT +!/CMakeLists.txt diff --git a/src/piv/CMakeLists.txt b/src/piv/CMakeLists.txt new file mode 100644 index 0000000000..1cb39073fb --- /dev/null +++ b/src/piv/CMakeLists.txt @@ -0,0 +1,11 @@ +#automatically generated CMakeLists.txt, may not work! +#the variable module_name is set up as a sugar to reduce "copy-paste" errors +set (module_name "piv") +#Note that the macros here require this directory added as a subdir of plumed/src +option(module_${module_name} "activate module piv" OFF) +ADDMODULETOKERNEL(${module_name} +PIV.cpp +) +ADDMODULEDEPENDENCIES(${module_name} +core tools bias colvar +) diff --git a/src/pytorch/.gitignore b/src/pytorch/.gitignore index d22daff42d..d8cc7be903 100644 --- a/src/pytorch/.gitignore +++ b/src/pytorch/.gitignore @@ -9,3 +9,4 @@ !/COPYRIGHT !/module.type !/postprocessing +!/CMakeLists.txt diff --git a/src/pytorch/CMakeLists.txt b/src/pytorch/CMakeLists.txt new file mode 100644 index 0000000000..1e4f4a09ef --- /dev/null +++ b/src/pytorch/CMakeLists.txt @@ -0,0 +1,11 @@ +#automatically generated CMakeLists.txt, may not work! +#the variable module_name is set up as a sugar to reduce "copy-paste" errors +set (module_name "pytorch") +#Note that the macros here require this directory added as a subdir of plumed/src +option(module_${module_name} "activate module pytorch" OFF) +ADDMODULETOKERNEL(${module_name} +PytorchModel.cpp +) +ADDMODULEDEPENDENCIES(${module_name} +core function +) diff --git a/src/reference/.gitignore b/src/reference/.gitignore index 4888552338..7a6d8238fd 100644 --- a/src/reference/.gitignore +++ b/src/reference/.gitignore @@ -7,3 +7,4 @@ !/Makefile !/README !/module.type +!/CMakeLists.txt diff --git a/src/reference/CMakeLists.txt b/src/reference/CMakeLists.txt new file mode 100644 index 0000000000..bb5652dc63 --- /dev/null +++ b/src/reference/CMakeLists.txt @@ -0,0 +1,30 @@ +#automatically generated CMakeLists.txt, may not work! +#the variable module_name is set up as a sugar to reduce "copy-paste" errors +set (module_name "reference") +#Note that the macros here require this directory added as a subdir of plumed/src +option(module_${module_name} "activate module reference" ON) +ADDMODULETOKERNEL(${module_name} +ArgumentOnlyDistance.cpp +Direction.cpp +DotProductDistance.cpp +DRMSD.cpp +EuclideanDistance.cpp +FakeFrame.cpp +IntermolecularDRMSD.cpp +IntramolecularDRMSD.cpp +MahalanobisDistance.cpp +MetricRegister.cpp +MultiDomainRMSD.cpp +NormalizedEuclideanDistance.cpp +OptimalRMSD.cpp +ReferenceArguments.cpp +ReferenceAtoms.cpp +ReferenceConfiguration.cpp +ReferenceValuePack.cpp +RMSDBase.cpp +SimpleRMSD.cpp +SingleDomainRMSD.cpp +) +ADDMODULEDEPENDENCIES(${module_name} +core tools +) diff --git a/src/s2cm/.gitignore b/src/s2cm/.gitignore index fccfac3dd0..ad9c181bc0 100644 --- a/src/s2cm/.gitignore +++ b/src/s2cm/.gitignore @@ -7,3 +7,4 @@ !/Makefile !/COPYRIGHT !/module.type +!/CMakeLists.txt diff --git a/src/s2cm/CMakeLists.txt b/src/s2cm/CMakeLists.txt new file mode 100644 index 0000000000..2b815473de --- /dev/null +++ b/src/s2cm/CMakeLists.txt @@ -0,0 +1,11 @@ +#automatically generated CMakeLists.txt, may not work! +#the variable module_name is set up as a sugar to reduce "copy-paste" errors +set (module_name "s2cm") +#Note that the macros here require this directory added as a subdir of plumed/src +option(module_${module_name} "activate module s2cm" OFF) +ADDMODULETOKERNEL(${module_name} +S2ContactModel.cpp +) +ADDMODULEDEPENDENCIES(${module_name} +core tools colvar +) diff --git a/src/sasa/.gitignore b/src/sasa/.gitignore index 4888552338..7a6d8238fd 100644 --- a/src/sasa/.gitignore +++ b/src/sasa/.gitignore @@ -7,3 +7,4 @@ !/Makefile !/README !/module.type +!/CMakeLists.txt diff --git a/src/sasa/CMakeLists.txt b/src/sasa/CMakeLists.txt new file mode 100644 index 0000000000..ead122b567 --- /dev/null +++ b/src/sasa/CMakeLists.txt @@ -0,0 +1,13 @@ +#automatically generated CMakeLists.txt, may not work! +#the variable module_name is set up as a sugar to reduce "copy-paste" errors +set (module_name "sasa") +#Note that the macros here require this directory added as a subdir of plumed/src +option(module_${module_name} "activate module sasa" OFF) +ADDMODULETOKERNEL(${module_name} +Sasa.cpp +sasa_HASEL.cpp +sasa_LCPO.cpp +) +ADDMODULEDEPENDENCIES(${module_name} +core tools config +) diff --git a/src/secondarystructure/.gitignore b/src/secondarystructure/.gitignore index 4888552338..7a6d8238fd 100644 --- a/src/secondarystructure/.gitignore +++ b/src/secondarystructure/.gitignore @@ -7,3 +7,4 @@ !/Makefile !/README !/module.type +!/CMakeLists.txt diff --git a/src/secondarystructure/CMakeLists.txt b/src/secondarystructure/CMakeLists.txt new file mode 100644 index 0000000000..6e009d0903 --- /dev/null +++ b/src/secondarystructure/CMakeLists.txt @@ -0,0 +1,14 @@ +#automatically generated CMakeLists.txt, may not work! +#the variable module_name is set up as a sugar to reduce "copy-paste" errors +set (module_name "secondarystructure") +#Note that the macros here require this directory added as a subdir of plumed/src +option(module_${module_name} "activate module secondarystructure" ON) +ADDMODULETOKERNEL(${module_name} +AlphaRMSD.cpp +AntibetaRMSD.cpp +ParabetaRMSD.cpp +SecondaryStructureRMSD.cpp +) +ADDMODULEDEPENDENCIES(${module_name} +core tools reference vesselbase +) diff --git a/src/setup/.gitignore b/src/setup/.gitignore index 4888552338..7a6d8238fd 100644 --- a/src/setup/.gitignore +++ b/src/setup/.gitignore @@ -7,3 +7,4 @@ !/Makefile !/README !/module.type +!/CMakeLists.txt diff --git a/src/setup/CMakeLists.txt b/src/setup/CMakeLists.txt new file mode 100644 index 0000000000..accb18e9a6 --- /dev/null +++ b/src/setup/CMakeLists.txt @@ -0,0 +1,13 @@ +#automatically generated CMakeLists.txt, may not work! +#the variable module_name is set up as a sugar to reduce "copy-paste" errors +set (module_name "setup") +#Note that the macros here require this directory added as a subdir of plumed/src +option(module_${module_name} "activate module setup" ON) +ADDMODULETOKERNEL(${module_name} +Load.cpp +Restart.cpp +Units.cpp +) +ADDMODULEDEPENDENCIES(${module_name} +core tools +) diff --git a/src/tools/.gitignore b/src/tools/.gitignore index 4888552338..7a6d8238fd 100644 --- a/src/tools/.gitignore +++ b/src/tools/.gitignore @@ -7,3 +7,4 @@ !/Makefile !/README !/module.type +!/CMakeLists.txt diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt new file mode 100644 index 0000000000..b709dac597 --- /dev/null +++ b/src/tools/CMakeLists.txt @@ -0,0 +1,58 @@ +#automatically generated CMakeLists.txt, may not work! +#the variable module_name is set up as a sugar to reduce "copy-paste" errors +set (module_name "tools") +#Note that the macros here require this directory added as a subdir of plumed/src +set(module_${module_name} ON CACHE INTERNAL "always active module tools") +ADDMODULETOKERNEL(${module_name} +Angle.cpp +AtomNumber.cpp +BiasRepresentation.cpp +Brent1DRootSearch.cpp +Citations.cpp +Communicator.cpp +ConjugateGradient.cpp +DLLoader.cpp +DynamicList.cpp +ERMSD.cpp +Exception.cpp +FileBase.cpp +ForwardDecl.cpp +Grid.cpp +h36.cpp +HistogramBead.cpp +IFile.cpp +KernelFunctions.cpp +Keywords.cpp +LatticeReduction.cpp +LinkCells.cpp +Log.cpp +LoopUnroller.cpp +Matrix.cpp +MatrixSquareBracketsAccess.cpp +Minimise1DBrent.cpp +MinimiseBase.cpp +MolDataClass.cpp +MultiValue.cpp +NeighborList.cpp +OFile.cpp +OpenMP.cpp +Pbc.cpp +PDB.cpp +PlumedHandle.cpp +Random.cpp +RMSD.cpp +RootFindingBase.cpp +Stopwatch.cpp +Subprocess.cpp +SwitchingFunction.cpp +Tensor.cpp +Tools.cpp +Torsion.cpp +Tree.cpp +TypesafePtr.cpp +Units.cpp +Vector.cpp +) +ADDMODULEDEPENDENCIES(${module_name} +core lapack lepton +) diff --git a/src/vatom/.gitignore b/src/vatom/.gitignore index 4888552338..7a6d8238fd 100644 --- a/src/vatom/.gitignore +++ b/src/vatom/.gitignore @@ -7,3 +7,4 @@ !/Makefile !/README !/module.type +!/CMakeLists.txt diff --git a/src/vatom/CMakeLists.txt b/src/vatom/CMakeLists.txt new file mode 100644 index 0000000000..889773d9a0 --- /dev/null +++ b/src/vatom/CMakeLists.txt @@ -0,0 +1,14 @@ +#automatically generated CMakeLists.txt, may not work! +#the variable module_name is set up as a sugar to reduce "copy-paste" errors +set (module_name "vatom") +#Note that the macros here require this directory added as a subdir of plumed/src +option(module_${module_name} "activate module vatom" ON) +ADDMODULETOKERNEL(${module_name} +ActionWithVirtualAtom.cpp +Center.cpp +FixedAtom.cpp +Ghost.cpp +) +ADDMODULEDEPENDENCIES(${module_name} +core tools +) diff --git a/src/ves/.gitignore b/src/ves/.gitignore index 3dcf47bc7b..197c9dd0bd 100644 --- a/src/ves/.gitignore +++ b/src/ves/.gitignore @@ -9,3 +9,4 @@ !/COPYRIGHT !/PEOPLE-VES !/module.type +!/CMakeLists.txt diff --git a/src/ves/CMakeLists.txt b/src/ves/CMakeLists.txt new file mode 100644 index 0000000000..86ecb71766 --- /dev/null +++ b/src/ves/CMakeLists.txt @@ -0,0 +1,64 @@ +#automatically generated CMakeLists.txt, may not work! +#the variable module_name is set up as a sugar to reduce "copy-paste" errors +set (module_name "ves") +#Note that the macros here require this directory added as a subdir of plumed/src +option(module_${module_name} "activate module ves" OFF) +ADDMODULETOKERNEL(${module_name} +BasisFunctions.cpp +BF_Chebyshev.cpp +BF_Combined.cpp +BF_Cosine.cpp +BF_CubicBsplines.cpp +BF_Custom.cpp +BF_Fourier.cpp +BF_Gaussians.cpp +BF_Legendre.cpp +BF_Powers.cpp +BF_Sine.cpp +BF_Wavelets.cpp +CoeffsBase.cpp +CoeffsMatrix.cpp +CoeffsVector.cpp +FermiSwitchingFunction.cpp +GridIntegrationWeights.cpp +GridLinearInterpolation.cpp +GridProjWeights.cpp +LinearBasisSetExpansion.cpp +MD_LinearExpansionPES.cpp +Opt_Adam.cpp +Opt_BachAveragedSGD.cpp +Opt_Dummy.cpp +Optimizer.cpp +Opt_RobbinsMonroSGD.cpp +OutputBasisFunctions.cpp +OutputFesBias.cpp +OutputTargetDistribution.cpp +TargetDistModifer.cpp +TargetDistribution.cpp +TD_Chi.cpp +TD_ChiSquared.cpp +TD_Custom.cpp +TD_Exponential.cpp +TD_ExponentiallyModifiedGaussian.cpp +TD_Gaussian.cpp +TD_GeneralizedExtremeValue.cpp +TD_GeneralizedNormal.cpp +TD_Grid.cpp +TD_LinearCombination.cpp +TD_Multicanonical.cpp +TD_MultithermalMultibaric.cpp +TD_ProductCombination.cpp +TD_ProductDistribution.cpp +TD_Uniform.cpp +TD_VonMises.cpp +TD_WellTempered.cpp +VesBias.cpp +VesDeltaF.cpp +VesLinearExpansion.cpp +VesTools.cpp +WaveletCoeffs.cpp +WaveletGrid.cpp +) +ADDMODULEDEPENDENCIES(${module_name} +bias cltools colvar config core tools lepton +) diff --git a/src/vesselbase/.gitignore b/src/vesselbase/.gitignore index 4888552338..7a6d8238fd 100644 --- a/src/vesselbase/.gitignore +++ b/src/vesselbase/.gitignore @@ -7,3 +7,4 @@ !/Makefile !/README !/module.type +!/CMakeLists.txt diff --git a/src/vesselbase/CMakeLists.txt b/src/vesselbase/CMakeLists.txt new file mode 100644 index 0000000000..ed9bb0e2b5 --- /dev/null +++ b/src/vesselbase/CMakeLists.txt @@ -0,0 +1,34 @@ +#automatically generated CMakeLists.txt, may not work! +#the variable module_name is set up as a sugar to reduce "copy-paste" errors +set (module_name "vesselbase") +#Note that the macros here require this directory added as a subdir of plumed/src +option(module_${module_name} "activate module vesselbase" ON) +ADDMODULETOKERNEL(${module_name} +ActionWithAveraging.cpp +ActionWithInputVessel.cpp +ActionWithVessel.cpp +AltMin.cpp +AveragingVessel.cpp +Between.cpp +BridgeVessel.cpp +FunctionVessel.cpp +Highest.cpp +Histogram.cpp +LessThan.cpp +Lowest.cpp +Max.cpp +Mean.cpp +Min.cpp +Moments.cpp +MoreThan.cpp +OrderingVessel.cpp +ShortcutVessel.cpp +StoreDataVessel.cpp +Sum.cpp +ValueVessel.cpp +Vessel.cpp +VesselRegister.cpp +) +ADDMODULEDEPENDENCIES(${module_name} +core tools bias analysis +) diff --git a/src/xdrfile/.gitignore b/src/xdrfile/.gitignore index 64daaf4527..3ea3aefd38 100644 --- a/src/xdrfile/.gitignore +++ b/src/xdrfile/.gitignore @@ -9,3 +9,4 @@ !/module.type !/COPYRIGHT !/import.sh +!/CMakeLists.txt diff --git a/src/xdrfile/CMakeLists.txt b/src/xdrfile/CMakeLists.txt new file mode 100644 index 0000000000..8cf7b4c424 --- /dev/null +++ b/src/xdrfile/CMakeLists.txt @@ -0,0 +1,10 @@ +#automatically generated CMakeLists.txt, may not work! +#the variable module_name is set up as a sugar to reduce "copy-paste" errors +set (module_name "xdrfile") +#Note that the macros here require this directory added as a subdir of plumed/src +option(module_${module_name} "activate module xdrfile" ON) +ADDMODULETOKERNEL(${module_name} +xdrfile.cpp +xdrfile_trr.cpp +xdrfile_xtc.cpp +) From ee2d5210aecee1cba10f7837926b32a0980f8e35 Mon Sep 17 00:00:00 2001 From: Daniele Rapetti Date: Wed, 3 May 2023 15:09:15 +0200 Subject: [PATCH 09/40] attacking the non standard makefiles --- src/CMakeLists.txt | 21 ++++++++++++++------- src/cltools/CMakeLists.txt | 13 +++++++++++++ src/core/CMakeLists.txt | 1 + src/molfile/CMakeLists.txt | 1 + 4 files changed, 29 insertions(+), 7 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4e1528e4c2..9ed2d95517 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -22,7 +22,8 @@ MACRO(SUBDIRLIST result curdir) SET(${result} ${dirlist}) ENDMACRO() -set (PLUMED_INCLUDE $) +set (PLUMED_SRC $) +set (PLUMED_MAKETOOLS ${PLUMED_SRC}/maketools) MACRO(ADDMODULETOKERNEL module_name) #use: ADDMODULETOKERNEL(module_name listOfSources) #Please write the source files explicitly @@ -31,12 +32,23 @@ MACRO(ADDMODULETOKERNEL module_name) list(REMOVE_ITEM OTHERARGS ${module_name}) add_library(${module_name} OBJECT ${OTHERARGS} ) - target_include_directories(${module_name} PRIVATE ${PLUMED_INCLUDE}) + target_include_directories(${module_name} PRIVATE ${PLUMED_SRC}) list(APPEND modulesDependencies ${module_name}) set(modulesDependencies ${modulesDependencies} PARENT_SCOPE) endif(${module_${module_name}}) ENDMACRO(ADDMODULETOKERNEL) +MACRO(ADDMODULEDEPENDENCIES module_name) + #use: ADDMODULEDEPENDENCIES(module_name listOfModules) + #Please write the source files explicitly + if(${module_${module_name}} ) + set(OTHERARGS ${ARGV}) + list(REMOVE_ITEM OTHERARGS ${module_name}) + target_link_libraries(${module_name} PRIVATE ${OTHERARGS}) + + endif(${module_${module_name}}) +ENDMACRO(ADDMODULEDEPENDENCIES) + SUBDIRLIST(alldirs ${CMAKE_CURRENT_SOURCE_DIR})# CACHE INTERNAL FORCE) set(dirs ${alldirs})# CACHE INTERNAL FORCE) #message("${alldirs}") @@ -83,11 +95,6 @@ if(all_modules) set(module_${dir} ON) endforeach(dir ${dirs}) endif() -foreach(dir "colvar")#${dirs}) - if(module_${dir}) - add_subdirectory(${dir}) - endif(module_${dir}) -endforeach(dir ${dirs}) # --enable-external-molfile-plugins # enable search for external molfile_plugins, default: # yes diff --git a/src/cltools/CMakeLists.txt b/src/cltools/CMakeLists.txt index a342e13d2f..4520994ed3 100644 --- a/src/cltools/CMakeLists.txt +++ b/src/cltools/CMakeLists.txt @@ -2,6 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "cltools") #Note that the macros here require this directory added as a subdir of plumed/src + option(module_${module_name} "activate module cltools" ON) ADDMODULETOKERNEL(${module_name} CLTool.cpp @@ -19,7 +20,19 @@ PdbRenumber.cpp pesmd.cpp SimpleMD.cpp SumHills.cpp +completion.xxd ) ADDMODULEDEPENDENCIES(${module_name} core config tools molfile xdrfile ) + +#add_custom_command(OUTPUT completion.xxd +execute_process( + COMMAND echo "\{ ${PLUMED_MAKETOOLS}/make-scripts-options.sh ; cat completion.sh; \} \| ${PLUMED_MAKETOOLS}/xxd > ${CMAKE_CURRENT_BINARY_DIR}/completion.xxd" + COMMAND_ECHO STDOUT +) + +message (FATAL_ERROR "cltools has a non standard Makefile (more than 4 lines) you need to modify the CMakeLists.txt!") + +#completion.xxd: completion.sh ../../scripts/*.sh ../../patches/*.sh +#q { ../maketools/make-scripts-options.sh ; cat completion.sh ; }| ../maketools/xxd > completion.xxd \ No newline at end of file diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index a2d14dc635..112ee2e136 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -2,6 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "core") #Note that the macros here require this directory added as a subdir of plumed/src +message (FATAL_ERROR "core has a non standard Makefile (more than 4 lines) you need to modify the CMakeLists.txt!") set(module_${module_name} ON CACHE INTERNAL "always active module core") ADDMODULETOKERNEL(${module_name} ActionAnyorder.cpp diff --git a/src/molfile/CMakeLists.txt b/src/molfile/CMakeLists.txt index 22f01c1f7a..74448a0aff 100644 --- a/src/molfile/CMakeLists.txt +++ b/src/molfile/CMakeLists.txt @@ -2,6 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "molfile") #Note that the macros here require this directory added as a subdir of plumed/src +message (FATAL_ERROR "molfile has a non standard Makefile (more than 4 lines) you need to modify the CMakeLists.txt!") option(module_${module_name} "activate module molfile" ON) ADDMODULETOKERNEL(${module_name} crdplugin.cpp From 67d09e6e87950164e8fbc47937479a93bb5818e5 Mon Sep 17 00:00:00 2001 From: Daniele Rapetti Date: Wed, 3 May 2023 15:56:47 +0200 Subject: [PATCH 10/40] working on setting up better cltools --- src/CMakeLists.txt | 2 +- src/cltools/CMakeLists.txt | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9ed2d95517..1a999347f6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -22,7 +22,7 @@ MACRO(SUBDIRLIST result curdir) SET(${result} ${dirlist}) ENDMACRO() -set (PLUMED_SRC $) +set (PLUMED_SRC ${CMAKE_CURRENT_SOURCE_DIR}) set (PLUMED_MAKETOOLS ${PLUMED_SRC}/maketools) MACRO(ADDMODULETOKERNEL module_name) #use: ADDMODULETOKERNEL(module_name listOfSources) diff --git a/src/cltools/CMakeLists.txt b/src/cltools/CMakeLists.txt index 4520994ed3..bf30de4897 100644 --- a/src/cltools/CMakeLists.txt +++ b/src/cltools/CMakeLists.txt @@ -26,12 +26,24 @@ ADDMODULEDEPENDENCIES(${module_name} core config tools molfile xdrfile ) +#TODO: this is a workaround, need to be done as add_custom_command #add_custom_command(OUTPUT completion.xxd execute_process( - COMMAND echo "\{ ${PLUMED_MAKETOOLS}/make-scripts-options.sh ; cat completion.sh; \} \| ${PLUMED_MAKETOOLS}/xxd > ${CMAKE_CURRENT_BINARY_DIR}/completion.xxd" - COMMAND_ECHO STDOUT + COMMAND ${PLUMED_MAKETOOLS}/make-scripts-options.sh + OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/make_scripts_options + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + ) +execute_process( + COMMAND cat ${CMAKE_CURRENT_BINARY_DIR}/make_scripts_options ${CMAKE_CURRENT_SOURCE_DIR}/completion.sh + OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/completions ) +execute_process( + COMMAND ${PLUMED_MAKETOOLS}/xxd + INPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/completions + OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/completion.xxd +) +#message("${cat_make_scripts_options} ${cat_completion}") message (FATAL_ERROR "cltools has a non standard Makefile (more than 4 lines) you need to modify the CMakeLists.txt!") #completion.xxd: completion.sh ../../scripts/*.sh ../../patches/*.sh From 177963bfe9007c8ab80731718f010cda5e5ad38e Mon Sep 17 00:00:00 2001 From: Daniele Rapetti Date: Thu, 4 May 2023 10:03:55 +0200 Subject: [PATCH 11/40] cltools now should work --- src/CMakeLists.txt | 30 ++++++++++++++---- src/cltools/CMakeLists.txt | 38 +++++++++++------------ src/cltools/completion.xxd.compiler.sh.in | 15 +++++++++ 3 files changed, 58 insertions(+), 25 deletions(-) create mode 100755 src/cltools/completion.xxd.compiler.sh.in diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1a999347f6..2bacde3ebb 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -23,7 +23,11 @@ MACRO(SUBDIRLIST result curdir) ENDMACRO() set (PLUMED_SRC ${CMAKE_CURRENT_SOURCE_DIR}) -set (PLUMED_MAKETOOLS ${PLUMED_SRC}/maketools) +set (PLUMED_MAKETOOLS ${PLUMED_SRC}/maketools ) +cmake_path (GET PLUMED_SRC PARENT_PATH PLUMED_MAIN_DIR) +set (PLUMED_SCRIPTS ${PLUMED_MAIN_DIR}/scripts) +set (PLUMED_PATCHES ${PLUMED_MAIN_DIR}/patches) + MACRO(ADDMODULETOKERNEL module_name) #use: ADDMODULETOKERNEL(module_name listOfSources) #Please write the source files explicitly @@ -231,11 +235,25 @@ set(KernelTargets "") foreach(activeModule ${modulesDependencies}) list(APPEND KernelTargets $) endforeach(activeModule ${modulesDependencies}) -add_library(plumedKernel SHARED ${KernelTargets}) -#add_dependencies(plumedKernel #modulesDependencies -#) -#these targets build the libPlumed.so + +#building the shared libraries with the collected modules +add_library(libplumedKernel SHARED ${KernelTargets}) +set_target_properties(libplumedKernel + PROPERTIES LIBRARY_OUTPUT_NAME ${program_name}Kernel.${SOEXT} + ) + add_library(libplumed SHARED $) -add_dependencies(libplumed #modulesDependencies +set_target_properties(libplumed + PROPERTIES LIBRARY_OUTPUT_NAME ${program_name}.${SOEXT} + ) +target_link_libraries(libplumed + PlumedWrapper +) + +add_library(libplumedWrapper ARCHIVE $) +set_target_properties(libplumedWrapper + PROPERTIES LIBRARY_OUTPUT_NAME ${program_name}Wrapper.${SOEXT} + ) + target_link_libraries(libplumedWrapper PlumedWrapper ) \ No newline at end of file diff --git a/src/cltools/CMakeLists.txt b/src/cltools/CMakeLists.txt index bf30de4897..14e3fb88a3 100644 --- a/src/cltools/CMakeLists.txt +++ b/src/cltools/CMakeLists.txt @@ -25,26 +25,26 @@ completion.xxd ADDMODULEDEPENDENCIES(${module_name} core config tools molfile xdrfile ) +#this file once compiled reproduces +#completion.xxd: completion.sh ../../scripts/*.sh ../../patches/*.sh +# { ../maketools/make-scripts-options.sh ; cat completion.sh ; }| ../maketools/xxd > completion.xxd +configure_file(completion.xxd.compiler.sh.in completion.xxd.compiler.sh @ONLY) +#this is used to test completion.xxd.compiler.sh +#execute_process( +# COMMAND bash completion.xxd.compiler.sh +# WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} +# #OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/completion.xxd +#) -#TODO: this is a workaround, need to be done as add_custom_command -#add_custom_command(OUTPUT completion.xxd -execute_process( - COMMAND ${PLUMED_MAKETOOLS}/make-scripts-options.sh - OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/make_scripts_options - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - ) -execute_process( - COMMAND cat ${CMAKE_CURRENT_BINARY_DIR}/make_scripts_options ${CMAKE_CURRENT_SOURCE_DIR}/completion.sh - OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/completions -) +file(GLOB script_deps ${PLUMED_SCRIPTS}/*.sh) +file(GLOB patches_deps ${PLUMED_PATCHES}/*.sh) -execute_process( - COMMAND ${PLUMED_MAKETOOLS}/xxd - INPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/completions - OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/completion.xxd +add_custom_command(OUTPUT completion.xxd + DEPENDS completion.sh ${script_deps} ${patches_deps} + COMMAND bash completion.xxd.compiler.sh + COMMENT "Generationc completion.xxd" + #WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) -#message("${cat_make_scripts_options} ${cat_completion}") -message (FATAL_ERROR "cltools has a non standard Makefile (more than 4 lines) you need to modify the CMakeLists.txt!") -#completion.xxd: completion.sh ../../scripts/*.sh ../../patches/*.sh -#q { ../maketools/make-scripts-options.sh ; cat completion.sh ; }| ../maketools/xxd > completion.xxd \ No newline at end of file +#message("scripts ${script_deps} ${PLUMED_SCRIPTS}") +#message("patches ${patches_deps} ${PLUMED_PATCHES}") diff --git a/src/cltools/completion.xxd.compiler.sh.in b/src/cltools/completion.xxd.compiler.sh.in new file mode 100755 index 0000000000..96858b23a3 --- /dev/null +++ b/src/cltools/completion.xxd.compiler.sh.in @@ -0,0 +1,15 @@ +{ + #TODO: this may be configured in a more general environment + #replaces make-scripts-options.sh + for file in @PLUMED_SCRIPTS@/*.sh + do + name=${file##*/} + name=${name%.sh} + name=${name//-/_} + echo -n "local cmd_keys_${name}=\"" + echo -n $(PLUMED_ROOT=@PLUMED_MAIN_DIR@ $file --options) + echo "\"" + done + #end TODO + cat @CMAKE_CURRENT_SOURCE_DIR@/completion.sh +} | @PLUMED_MAKETOOLS@/xxd > completion.xxd \ No newline at end of file From e05e6010a8c41732b5fcf688ae413a15532bb113 Mon Sep 17 00:00:00 2001 From: Daniele Rapetti Date: Thu, 4 May 2023 10:04:17 +0200 Subject: [PATCH 12/40] small workaround to have target and libraries with the same name --- src/main/CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt index d220cdd225..4a8a681084 100644 --- a/src/main/CMakeLists.txt +++ b/src/main/CMakeLists.txt @@ -1,2 +1,5 @@ -add_executable(${program_name} main.cpp) -target_link_libraries(${program_name} plumedKernel libplumed) \ No newline at end of file +add_executable(plumed_bin main.cpp) +target_link_libraries(plumed_bin libplumedKernel libplumed) +set_target_properties(plumed_bin + PROPERTIES RUNTIME_OUTPUT_NAME ${program_name} + ) \ No newline at end of file From d252d1b94403a98fede2c675d221086e2fa6e902 Mon Sep 17 00:00:00 2001 From: Daniele Rapetti Date: Thu, 4 May 2023 10:51:33 +0200 Subject: [PATCH 13/40] now also core should work --- src/core/CMakeLists.txt | 29 ++++++++++++++++++++++++++++- src/maketools/makecmd_cmake | 5 +++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 src/maketools/makecmd_cmake diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 112ee2e136..07738a1192 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -2,7 +2,6 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "core") #Note that the macros here require this directory added as a subdir of plumed/src -message (FATAL_ERROR "core has a non standard Makefile (more than 4 lines) you need to modify the CMakeLists.txt!") set(module_${module_name} ON CACHE INTERNAL "always active module core") ADDMODULETOKERNEL(${module_name} ActionAnyorder.cpp @@ -32,7 +31,35 @@ PlumedMainInitializer.cpp TargetDist.cpp Value.cpp WithCmd.cpp +#file generated during the build process +PlumedMainMap.inc PlumedMainEnum.inc +GREXMap.inc GREXEnum.inc +CLToolMainMap.inc CLToolMainEnum.inc ) ADDMODULEDEPENDENCIES(${module_name} config tools lepton ) + +#execute_process( +# COMMAND bash ${PLUMED_MAKETOOLS}/makecmd_cmake map "${CMAKE_CURRENT_SOURCE_DIR}/PlumedMain.cpp" PlumedMainMap.inc +# WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} +#) + +MACRO(CREATEINC cppFile type outputFile) + add_custom_command(OUTPUT ${outputFile} + DEPENDS ${cppFile} + COMMAND bash ${PLUMED_MAKETOOLS}/makecmd_cmake map "${CMAKE_CURRENT_SOURCE_DIR}/${cppFile}" ${outputFile} + COMMENT "Generating ${outputFile}" + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + ) +ENDMACRO() + +CREATEINC(PlumedMain.cpp map PlumedMainMap.inc) +CREATEINC(PlumedMain.cpp enum PlumedMainEnum.inc) +CREATEINC(GREX.cpp map GREXMap.inc) +CREATEINC(GREX.cpp enum GREXEnum.inc) +CREATEINC(CLToolMain.cpp map CLToolMainMap.inc) +CREATEINC(CLToolMain.cpp enum CLToolMainEnum.inc) + + + diff --git a/src/maketools/makecmd_cmake b/src/maketools/makecmd_cmake new file mode 100644 index 0000000000..11bb8375a9 --- /dev/null +++ b/src/maketools/makecmd_cmake @@ -0,0 +1,5 @@ +#! /usr/bin/env bash +#workaround to call makecmd with add_custom_command +SCRIPTPATH=$(dirname "$(realpath -s "$0")") + +${SCRIPTPATH}/makecmd "$1" < "$2" > "$3" \ No newline at end of file From a043f10bed0e523eaf8a4b2ed6899ccbb3786f11 Mon Sep 17 00:00:00 2001 From: Daniele Rapetti Date: Thu, 4 May 2023 11:32:55 +0200 Subject: [PATCH 14/40] Now also molfile should be compiled correctly --- src/molfile/CMakeLists.txt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/molfile/CMakeLists.txt b/src/molfile/CMakeLists.txt index 74448a0aff..f6aeb4313a 100644 --- a/src/molfile/CMakeLists.txt +++ b/src/molfile/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "molfile") #Note that the macros here require this directory added as a subdir of plumed/src -message (FATAL_ERROR "molfile has a non standard Makefile (more than 4 lines) you need to modify the CMakeLists.txt!") + option(module_${module_name} "activate module molfile" ON) ADDMODULETOKERNEL(${module_name} crdplugin.cpp @@ -13,3 +13,14 @@ pdbplugin.cpp ADDMODULEDEPENDENCIES(${module_name} ) + +#The following lines should mimik the following line +#CPPFLAGS+=-DSTATIC_PLUGIN -DVMDPLUGIN=molfile_$(patsubst %.o,%,$@) +target_compile_definitions(${module_name} PRIVATE STATIC_PLUGIN) +get_target_property(MY_PROJECT_SOURCES ${module_name} SOURCES) +foreach(sourcefile ${MY_PROJECT_SOURCES}) + string(REPLACE ".cpp" "" simpleName ${sourcefile}) + + set_source_files_properties(${sourcefile} PROPERTIES COMPILE_DEFINITIONS VMDPLUGIN=molfile_${simpleName}) + +endforeach(sourcefile in ${MY_PROJECT_SOURCES}) From b992859d3c2bdc6575aa14578286d2ec89630d50 Mon Sep 17 00:00:00 2001 From: Daniele Rapetti Date: Thu, 4 May 2023 12:23:08 +0200 Subject: [PATCH 15/40] better module depenency set up --- src/CMakeLists.txt | 65 +++++++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 29 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2bacde3ebb..c108974ab9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.20.2) project(Plumed2 LANGUAGES C CXX) +set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE) set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS None Debug Release RelWithDebInfo MinSizeRel) #some settingsvalues set(program_name "plumed" CACHE STRING "the name of the main executable") @@ -22,7 +23,7 @@ MACRO(SUBDIRLIST result curdir) SET(${result} ${dirlist}) ENDMACRO() -set (PLUMED_SRC ${CMAKE_CURRENT_SOURCE_DIR}) +set (PLUMED_SRC ${CMAKE_CURRENT_SOURCE_DIR}) set (PLUMED_MAKETOOLS ${PLUMED_SRC}/maketools ) cmake_path (GET PLUMED_SRC PARENT_PATH PLUMED_MAIN_DIR) set (PLUMED_SCRIPTS ${PLUMED_MAIN_DIR}/scripts) @@ -44,13 +45,14 @@ ENDMACRO(ADDMODULETOKERNEL) MACRO(ADDMODULEDEPENDENCIES module_name) #use: ADDMODULEDEPENDENCIES(module_name listOfModules) - #Please write the source files explicitly - if(${module_${module_name}} ) - set(OTHERARGS ${ARGV}) - list(REMOVE_ITEM OTHERARGS ${module_name}) - target_link_libraries(${module_name} PRIVATE ${OTHERARGS}) - - endif(${module_${module_name}}) + set(OTHERARGS ${ARGV}) + list(REMOVE_ITEM OTHERARGS ${module_name}) + set(moduleNeeds_${module_name} ${OTHERARGS} PARENT_SCOPE) + #if(${module_${module_name}} ) + # set(OTHERARGS ${ARGV}) + # list(REMOVE_ITEM OTHERARGS ${module_name}) + # target_link_libraries(${module_name} PRIVATE ${OTHERARGS}) + #endif(${module_${module_name}}) ENDMACRO(ADDMODULEDEPENDENCIES) SUBDIRLIST(alldirs ${CMAKE_CURRENT_SOURCE_DIR})# CACHE INTERNAL FORCE) @@ -77,31 +79,13 @@ option(all_modules "Activates all modules, if on ignores the values of module_na foreach(dir ${dirs}) add_subdirectory(${dir}) - # file(STRINGS ${dir}/module.type mt ) - # if(mt STREQUAL "default-off" AND NOT all_modules) - # option(module_${dir} "activate module ${dir}" OFF) - # elseif(mt STREQUAL "default-on" OR (mt STREQUAL "default-off" AND all_modules)) - # option(module_${dir} "activate module ${dir}" ON) - # elseif(mt STREQUAL "always") - # set(module_${dir} ON CACHE INTERNAL "always active module ${dir}") - # else() - # #message( "${dir} ${mt}") - # message(FATAL_ERROR "module:\"${dir}\" type:\"${mt}\": module type must be \"always\" or \"deafult-on\" or \"default-off\"") - # endif() - #this gets the dependency for the modules - #file(STRINGS ${dir}/Makefile rgx REGEX "USE=.*") - #STRING(REPLACE "USE=" "" rgx "${rgx}") - #separate_arguments(rgx) endforeach(dir ${dirs}) if(all_modules) -#forceactivates all modules + #forceactivates all modules foreach(dir ${dirs}) set(module_${dir} ON) endforeach(dir ${dirs}) endif() -# --enable-external-molfile-plugins -# enable search for external molfile_plugins, default: -# yes option(useExternal_BLAS "enable search for external BLAS, default ON" ON) option(useExternal_LAPACK "enable search for external LAPACK, default ON" ON) @@ -228,8 +212,31 @@ message("LAPACK internal:${module_lapack}") # message("${dir}: ${module_${dir}}") #endforeach(dir ${dirs} ${coredirs} ${mayBeExternal}) -#these targets build the two libPlumedKernel.so +#check module dependencies +foreach(dir ${dirs}) + if(${module_${dir}}) + set(notFound "") + #message("${dir} ${moduleNeeds_${dir}}") + foreach(otherModule ${moduleNeeds_${dir}}) + if (NOT module_${otherModule}) + list(FIND mayBeExternal ${otherModule} isExternal) + if(${isExternal}) + string(TOUPPER ${otherModule} capsName) + if(${capsName}_FOUND) + continue() + endif(${capsName}_FOUND) + endif(${isExternal}) + list(APPEND notFound ${otherModule}) + endif(NOT module_${otherModule}) + endforeach(otherModule moduleNeeds_${dir}) + if (notFound) + message(FATAL_ERROR "Module \"${dir}\" needs the following modules active: ${notFound}") + endif(notFound) + unset(notFound) + endif(${module_${dir}}) +endforeach(dir ${dirs}) +#these targets build the two libPlumedKernel.so set(KernelTargets "") foreach(activeModule ${modulesDependencies}) @@ -250,7 +257,7 @@ target_link_libraries(libplumed PlumedWrapper ) -add_library(libplumedWrapper ARCHIVE $) +add_library(libplumedWrapper STATIC $) set_target_properties(libplumedWrapper PROPERTIES LIBRARY_OUTPUT_NAME ${program_name}Wrapper.${SOEXT} ) From 1e6e3e9943298e7d8207c84dc3d3cf465d2e4acc Mon Sep 17 00:00:00 2001 From: Daniele Rapetti Date: Thu, 4 May 2023 14:10:59 +0200 Subject: [PATCH 16/40] working on molfile --- src/CMakeLists.txt | 2 +- src/cltools/CMakeLists.txt | 7 +++++++ src/molfile/CMakeLists.txt | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c108974ab9..69d0a5cee1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -62,7 +62,7 @@ set(dirs ${alldirs})# CACHE INTERNAL FORCE) #these are the diretory to compile that do not have a module.type inside set(coredirs main config wrapper) -set(mayBeExternal blas lapack) +set(mayBeExternal blas lapack molfile) list(REMOVE_ITEM dirs lib include maketools CMakeFiles ${coredirs} ${mayBeExternal}) diff --git a/src/cltools/CMakeLists.txt b/src/cltools/CMakeLists.txt index 14e3fb88a3..25204ff3e5 100644 --- a/src/cltools/CMakeLists.txt +++ b/src/cltools/CMakeLists.txt @@ -20,11 +20,18 @@ PdbRenumber.cpp pesmd.cpp SimpleMD.cpp SumHills.cpp +#generated file completion.xxd ) ADDMODULEDEPENDENCIES(${module_name} core config tools molfile xdrfile ) + +get_target_property(t ${module_name} INCLUDE_DIRECTORIES) +message("id: ${t}") +target_include_directories(${module_name} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) +get_target_property(t ${module_name} INCLUDE_DIRECTORIES) +message("id: ${t}") #this file once compiled reproduces #completion.xxd: completion.sh ../../scripts/*.sh ../../patches/*.sh # { ../maketools/make-scripts-options.sh ; cat completion.sh ; }| ../maketools/xxd > completion.xxd diff --git a/src/molfile/CMakeLists.txt b/src/molfile/CMakeLists.txt index f6aeb4313a..1485fef4b0 100644 --- a/src/molfile/CMakeLists.txt +++ b/src/molfile/CMakeLists.txt @@ -24,3 +24,6 @@ foreach(sourcefile ${MY_PROJECT_SOURCES}) set_source_files_properties(${sourcefile} PROPERTIES COMPILE_DEFINITIONS VMDPLUGIN=molfile_${simpleName}) endforeach(sourcefile in ${MY_PROJECT_SOURCES}) + +#this should propagate the compile definition to the main +target_compile_definitions(${module_name} PUBLIC __PLUMED_HAS_MOLFILE_PLUGINS) \ No newline at end of file From 7a2e49e75e97d221a2b2271277b713ac9a5e0297 Mon Sep 17 00:00:00 2001 From: Daniele Rapetti Date: Thu, 4 May 2023 14:27:14 +0200 Subject: [PATCH 17/40] cosmetic change in cmakefiles --- src/adjmat/CMakeLists.txt | 2 +- src/analysis/CMakeLists.txt | 2 +- src/annfunc/CMakeLists.txt | 2 +- src/asmjit/CMakeLists.txt | 2 +- src/bias/CMakeLists.txt | 2 +- src/blas/CMakeLists.txt | 2 +- src/cltools/CMakeLists.txt | 12 +++++------- src/colvar/CMakeLists.txt | 2 +- src/core/CMakeLists.txt | 3 +-- src/crystallization/CMakeLists.txt | 2 +- src/dimred/CMakeLists.txt | 2 +- src/drr/CMakeLists.txt | 2 +- src/eds/CMakeLists.txt | 2 +- src/fisst/CMakeLists.txt | 2 +- src/function/CMakeLists.txt | 2 +- src/funnel/CMakeLists.txt | 2 +- src/generic/CMakeLists.txt | 2 +- src/gridtools/CMakeLists.txt | 2 +- src/isdb/CMakeLists.txt | 2 +- src/lapack/CMakeLists.txt | 2 +- src/lepton/CMakeLists.txt | 2 +- src/logmfd/CMakeLists.txt | 2 +- src/manyrestraints/CMakeLists.txt | 2 +- src/mapping/CMakeLists.txt | 2 +- src/maze/CMakeLists.txt | 2 +- src/membranefusion/CMakeLists.txt | 2 +- src/molfile/CMakeLists.txt | 4 +--- src/multicolvar/CMakeLists.txt | 2 +- src/opes/CMakeLists.txt | 2 +- src/pamm/CMakeLists.txt | 2 +- src/piv/CMakeLists.txt | 2 +- src/pytorch/CMakeLists.txt | 2 +- src/reference/CMakeLists.txt | 2 +- src/s2cm/CMakeLists.txt | 2 +- src/sasa/CMakeLists.txt | 2 +- src/secondarystructure/CMakeLists.txt | 2 +- src/setup/CMakeLists.txt | 2 +- src/tools/CMakeLists.txt | 2 +- src/vatom/CMakeLists.txt | 2 +- src/ves/CMakeLists.txt | 2 +- src/vesselbase/CMakeLists.txt | 2 +- src/xdrfile/CMakeLists.txt | 2 +- 42 files changed, 46 insertions(+), 51 deletions(-) diff --git a/src/adjmat/CMakeLists.txt b/src/adjmat/CMakeLists.txt index 947c744e21..d9a7c3ac18 100644 --- a/src/adjmat/CMakeLists.txt +++ b/src/adjmat/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "adjmat") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module adjmat" OFF) +option(module_${module_name} "activate module ${module_name}" OFF) ADDMODULETOKERNEL(${module_name} ActionWithInputMatrix.cpp AdjacencyMatrixBase.cpp diff --git a/src/analysis/CMakeLists.txt b/src/analysis/CMakeLists.txt index d0ff041b1a..c6a4d20d8c 100644 --- a/src/analysis/CMakeLists.txt +++ b/src/analysis/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "analysis") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module analysis" ON) +option(module_${module_name} "activate module ${module_name}" ON) ADDMODULETOKERNEL(${module_name} AnalysisBase.cpp Average.cpp diff --git a/src/annfunc/CMakeLists.txt b/src/annfunc/CMakeLists.txt index ada5b017da..6a77f75d6f 100644 --- a/src/annfunc/CMakeLists.txt +++ b/src/annfunc/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "annfunc") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module annfunc" OFF) +option(module_${module_name} "activate module ${module_name}" OFF) ADDMODULETOKERNEL(${module_name} ANN.cpp ) diff --git a/src/asmjit/CMakeLists.txt b/src/asmjit/CMakeLists.txt index 3ca5111ff1..dc8b307326 100644 --- a/src/asmjit/CMakeLists.txt +++ b/src/asmjit/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "asmjit") #Note that the macros here require this directory added as a subdir of plumed/src -set(module_${module_name} ON CACHE INTERNAL "always active module asmjit") +set(module_${module_name} ON CACHE INTERNAL "always active module ${module_name}") ADDMODULETOKERNEL(${module_name} arch.cpp assembler.cpp diff --git a/src/bias/CMakeLists.txt b/src/bias/CMakeLists.txt index 30155af0a8..18ddbae361 100644 --- a/src/bias/CMakeLists.txt +++ b/src/bias/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "bias") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module bias" ON) +option(module_${module_name} "activate module ${module_name}" ON) ADDMODULETOKERNEL(${module_name} ABMD.cpp Bias.cpp diff --git a/src/blas/CMakeLists.txt b/src/blas/CMakeLists.txt index 9e6b3e355f..b0c2875191 100644 --- a/src/blas/CMakeLists.txt +++ b/src/blas/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "blas") #Note that the macros here require this directory added as a subdir of plumed/src -set(module_${module_name} ON CACHE INTERNAL "always active module blas") +set(module_${module_name} ON CACHE INTERNAL "always active module ${module_name}") ADDMODULETOKERNEL(${module_name} blas.cpp ) diff --git a/src/cltools/CMakeLists.txt b/src/cltools/CMakeLists.txt index 25204ff3e5..981065cc55 100644 --- a/src/cltools/CMakeLists.txt +++ b/src/cltools/CMakeLists.txt @@ -1,9 +1,7 @@ -#automatically generated CMakeLists.txt, may not work! #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "cltools") #Note that the macros here require this directory added as a subdir of plumed/src - -option(module_${module_name} "activate module cltools" ON) +option(module_${module_name} "activate module ${module_name}" ON) ADDMODULETOKERNEL(${module_name} CLTool.cpp Completion.cpp @@ -27,11 +25,11 @@ ADDMODULEDEPENDENCIES(${module_name} core config tools molfile xdrfile ) -get_target_property(t ${module_name} INCLUDE_DIRECTORIES) -message("id: ${t}") +#get_target_property(t ${module_name} INCLUDE_DIRECTORIES) +#message("id: ${t}") target_include_directories(${module_name} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) -get_target_property(t ${module_name} INCLUDE_DIRECTORIES) -message("id: ${t}") +#get_target_property(t ${module_name} INCLUDE_DIRECTORIES) +#message("id: ${t}") #this file once compiled reproduces #completion.xxd: completion.sh ../../scripts/*.sh ../../patches/*.sh # { ../maketools/make-scripts-options.sh ; cat completion.sh ; }| ../maketools/xxd > completion.xxd diff --git a/src/colvar/CMakeLists.txt b/src/colvar/CMakeLists.txt index d99bda608a..b1c1a1d890 100644 --- a/src/colvar/CMakeLists.txt +++ b/src/colvar/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "colvar") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module colvar" ON) +option(module_${module_name} "activate module ${module_name}" ON) ADDMODULETOKERNEL(${module_name} Angle.cpp Cell.cpp diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 07738a1192..9931ff1e14 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -1,8 +1,7 @@ -#automatically generated CMakeLists.txt, may not work! #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "core") #Note that the macros here require this directory added as a subdir of plumed/src -set(module_${module_name} ON CACHE INTERNAL "always active module core") +set(module_${module_name} ON CACHE INTERNAL "always active module ${module_name}") ADDMODULETOKERNEL(${module_name} ActionAnyorder.cpp ActionAtomistic.cpp diff --git a/src/crystallization/CMakeLists.txt b/src/crystallization/CMakeLists.txt index 29617898c1..c0a3952e1f 100644 --- a/src/crystallization/CMakeLists.txt +++ b/src/crystallization/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "crystallization") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module crystallization" OFF) +option(module_${module_name} "activate module ${module_name}" OFF) ADDMODULETOKERNEL(${module_name} BondOrientation.cpp CubicHarmonicBase.cpp diff --git a/src/dimred/CMakeLists.txt b/src/dimred/CMakeLists.txt index 868fc6513b..e5dba416e2 100644 --- a/src/dimred/CMakeLists.txt +++ b/src/dimred/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "dimred") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module dimred" OFF) +option(module_${module_name} "activate module ${module_name}" OFF) ADDMODULETOKERNEL(${module_name} ClassicalMultiDimensionalScaling.cpp DimensionalityReductionBase.cpp diff --git a/src/drr/CMakeLists.txt b/src/drr/CMakeLists.txt index 70e2d19779..067461d410 100644 --- a/src/drr/CMakeLists.txt +++ b/src/drr/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "drr") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module drr" OFF) +option(module_${module_name} "activate module ${module_name}" OFF) ADDMODULETOKERNEL(${module_name} colvar_UIestimator.cpp DRR.cpp diff --git a/src/eds/CMakeLists.txt b/src/eds/CMakeLists.txt index 262e38f4d7..ebee8de992 100644 --- a/src/eds/CMakeLists.txt +++ b/src/eds/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "eds") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module eds" OFF) +option(module_${module_name} "activate module ${module_name}" OFF) ADDMODULETOKERNEL(${module_name} EDS.cpp ) diff --git a/src/fisst/CMakeLists.txt b/src/fisst/CMakeLists.txt index 9076401128..8fdb453b9a 100644 --- a/src/fisst/CMakeLists.txt +++ b/src/fisst/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "fisst") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module fisst" OFF) +option(module_${module_name} "activate module ${module_name}" OFF) ADDMODULETOKERNEL(${module_name} FISST.cpp legendre_rule_fast.cpp diff --git a/src/function/CMakeLists.txt b/src/function/CMakeLists.txt index f1cedda85c..de5e018ce6 100644 --- a/src/function/CMakeLists.txt +++ b/src/function/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "function") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module function" ON) +option(module_${module_name} "activate module ${module_name}" ON) ADDMODULETOKERNEL(${module_name} Combine.cpp Custom.cpp diff --git a/src/funnel/CMakeLists.txt b/src/funnel/CMakeLists.txt index 9617cd5fb1..5cb85ec2bd 100644 --- a/src/funnel/CMakeLists.txt +++ b/src/funnel/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "funnel") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module funnel" OFF) +option(module_${module_name} "activate module ${module_name}" OFF) ADDMODULETOKERNEL(${module_name} FPS.cpp Funnel.cpp diff --git a/src/generic/CMakeLists.txt b/src/generic/CMakeLists.txt index d517310d99..96768105ab 100644 --- a/src/generic/CMakeLists.txt +++ b/src/generic/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "generic") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module generic" ON) +option(module_${module_name} "activate module ${module_name}" ON) ADDMODULETOKERNEL(${module_name} Debug.cpp DumpAtoms.cpp diff --git a/src/gridtools/CMakeLists.txt b/src/gridtools/CMakeLists.txt index e7758cd734..af09850322 100644 --- a/src/gridtools/CMakeLists.txt +++ b/src/gridtools/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "gridtools") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module gridtools" ON) +option(module_${module_name} "activate module ${module_name}" ON) ADDMODULETOKERNEL(${module_name} ActionWithGrid.cpp ActionWithInputGrid.cpp diff --git a/src/isdb/CMakeLists.txt b/src/isdb/CMakeLists.txt index ba2cc79be0..1f656cfc2d 100644 --- a/src/isdb/CMakeLists.txt +++ b/src/isdb/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "isdb") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module isdb" ON) +option(module_${module_name} "activate module ${module_name}" ON) ADDMODULETOKERNEL(${module_name} Caliber.cpp CS2Backbone.cpp diff --git a/src/lapack/CMakeLists.txt b/src/lapack/CMakeLists.txt index b0236796a8..348f502325 100644 --- a/src/lapack/CMakeLists.txt +++ b/src/lapack/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "lapack") #Note that the macros here require this directory added as a subdir of plumed/src -set(module_${module_name} ON CACHE INTERNAL "always active module lapack") +set(module_${module_name} ON CACHE INTERNAL "always active module ${module_name}") ADDMODULETOKERNEL(${module_name} lapack.cpp ) diff --git a/src/lepton/CMakeLists.txt b/src/lepton/CMakeLists.txt index 29f63d06b7..b0014a1746 100644 --- a/src/lepton/CMakeLists.txt +++ b/src/lepton/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "lepton") #Note that the macros here require this directory added as a subdir of plumed/src -set(module_${module_name} ON CACHE INTERNAL "always active module lepton") +set(module_${module_name} ON CACHE INTERNAL "always active module ${module_name}") ADDMODULETOKERNEL(${module_name} CompiledExpression.cpp ExpressionProgram.cpp diff --git a/src/logmfd/CMakeLists.txt b/src/logmfd/CMakeLists.txt index 22b2f9f6d4..d451ff9107 100644 --- a/src/logmfd/CMakeLists.txt +++ b/src/logmfd/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "logmfd") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module logmfd" OFF) +option(module_${module_name} "activate module ${module_name}" OFF) ADDMODULETOKERNEL(${module_name} LogMFD.cpp ) diff --git a/src/manyrestraints/CMakeLists.txt b/src/manyrestraints/CMakeLists.txt index 15bf7077c0..cb49bbb5ff 100644 --- a/src/manyrestraints/CMakeLists.txt +++ b/src/manyrestraints/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "manyrestraints") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module manyrestraints" OFF) +option(module_${module_name} "activate module ${module_name}" OFF) ADDMODULETOKERNEL(${module_name} LWalls.cpp ManyRestraintsBase.cpp diff --git a/src/mapping/CMakeLists.txt b/src/mapping/CMakeLists.txt index 08777bbd43..b02d392a83 100644 --- a/src/mapping/CMakeLists.txt +++ b/src/mapping/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "mapping") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module mapping" ON) +option(module_${module_name} "activate module ${module_name}" ON) ADDMODULETOKERNEL(${module_name} AdaptivePath.cpp Mapping.cpp diff --git a/src/maze/CMakeLists.txt b/src/maze/CMakeLists.txt index 2002b0f21a..644646c68a 100644 --- a/src/maze/CMakeLists.txt +++ b/src/maze/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "maze") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module maze" OFF) +option(module_${module_name} "activate module ${module_name}" OFF) ADDMODULETOKERNEL(${module_name} Core.cpp Loss.cpp diff --git a/src/membranefusion/CMakeLists.txt b/src/membranefusion/CMakeLists.txt index 3b8fd12012..99678e2edd 100644 --- a/src/membranefusion/CMakeLists.txt +++ b/src/membranefusion/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "membranefusion") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module membranefusion" OFF) +option(module_${module_name} "activate module ${module_name}" OFF) ADDMODULETOKERNEL(${module_name} FusionPoreExpansionP.cpp FusionPoreNucleationP.cpp diff --git a/src/molfile/CMakeLists.txt b/src/molfile/CMakeLists.txt index 1485fef4b0..5f81cce6a7 100644 --- a/src/molfile/CMakeLists.txt +++ b/src/molfile/CMakeLists.txt @@ -1,9 +1,7 @@ -#automatically generated CMakeLists.txt, may not work! #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "molfile") #Note that the macros here require this directory added as a subdir of plumed/src - -option(module_${module_name} "activate module molfile" ON) +option(module_${module_name} "activate module ${module_name}" ON) ADDMODULETOKERNEL(${module_name} crdplugin.cpp dcdplugin.cpp diff --git a/src/multicolvar/CMakeLists.txt b/src/multicolvar/CMakeLists.txt index 6ff43b442a..9a0ac05123 100644 --- a/src/multicolvar/CMakeLists.txt +++ b/src/multicolvar/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "multicolvar") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module multicolvar" ON) +option(module_${module_name} "activate module ${module_name}" ON) ADDMODULETOKERNEL(${module_name} ActionVolume.cpp AlphaBeta.cpp diff --git a/src/opes/CMakeLists.txt b/src/opes/CMakeLists.txt index ce089a9f34..3dffa3d6cb 100644 --- a/src/opes/CMakeLists.txt +++ b/src/opes/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "opes") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module opes" OFF) +option(module_${module_name} "activate module ${module_name}" OFF) ADDMODULETOKERNEL(${module_name} ECVcustom.cpp ECVlinear.cpp diff --git a/src/pamm/CMakeLists.txt b/src/pamm/CMakeLists.txt index 9987aa855c..51366a92e5 100644 --- a/src/pamm/CMakeLists.txt +++ b/src/pamm/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "pamm") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module pamm" OFF) +option(module_${module_name} "activate module ${module_name}" OFF) ADDMODULETOKERNEL(${module_name} HBPammHydrogens.cpp HBPammMatrix.cpp diff --git a/src/piv/CMakeLists.txt b/src/piv/CMakeLists.txt index 1cb39073fb..cc54a99bfc 100644 --- a/src/piv/CMakeLists.txt +++ b/src/piv/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "piv") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module piv" OFF) +option(module_${module_name} "activate module ${module_name}" OFF) ADDMODULETOKERNEL(${module_name} PIV.cpp ) diff --git a/src/pytorch/CMakeLists.txt b/src/pytorch/CMakeLists.txt index 1e4f4a09ef..40e7e6a8dc 100644 --- a/src/pytorch/CMakeLists.txt +++ b/src/pytorch/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "pytorch") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module pytorch" OFF) +option(module_${module_name} "activate module ${module_name}" OFF) ADDMODULETOKERNEL(${module_name} PytorchModel.cpp ) diff --git a/src/reference/CMakeLists.txt b/src/reference/CMakeLists.txt index bb5652dc63..77cb65ed6a 100644 --- a/src/reference/CMakeLists.txt +++ b/src/reference/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "reference") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module reference" ON) +option(module_${module_name} "activate module ${module_name}" ON) ADDMODULETOKERNEL(${module_name} ArgumentOnlyDistance.cpp Direction.cpp diff --git a/src/s2cm/CMakeLists.txt b/src/s2cm/CMakeLists.txt index 2b815473de..78f3698cc4 100644 --- a/src/s2cm/CMakeLists.txt +++ b/src/s2cm/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "s2cm") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module s2cm" OFF) +option(module_${module_name} "activate module ${module_name}" OFF) ADDMODULETOKERNEL(${module_name} S2ContactModel.cpp ) diff --git a/src/sasa/CMakeLists.txt b/src/sasa/CMakeLists.txt index ead122b567..46ccec736f 100644 --- a/src/sasa/CMakeLists.txt +++ b/src/sasa/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "sasa") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module sasa" OFF) +option(module_${module_name} "activate module ${module_name}" OFF) ADDMODULETOKERNEL(${module_name} Sasa.cpp sasa_HASEL.cpp diff --git a/src/secondarystructure/CMakeLists.txt b/src/secondarystructure/CMakeLists.txt index 6e009d0903..3aad00d2bf 100644 --- a/src/secondarystructure/CMakeLists.txt +++ b/src/secondarystructure/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "secondarystructure") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module secondarystructure" ON) +option(module_${module_name} "activate module ${module_name}" ON) ADDMODULETOKERNEL(${module_name} AlphaRMSD.cpp AntibetaRMSD.cpp diff --git a/src/setup/CMakeLists.txt b/src/setup/CMakeLists.txt index accb18e9a6..d834764835 100644 --- a/src/setup/CMakeLists.txt +++ b/src/setup/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "setup") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module setup" ON) +option(module_${module_name} "activate module ${module_name}" ON) ADDMODULETOKERNEL(${module_name} Load.cpp Restart.cpp diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt index b709dac597..3fa597fc52 100644 --- a/src/tools/CMakeLists.txt +++ b/src/tools/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "tools") #Note that the macros here require this directory added as a subdir of plumed/src -set(module_${module_name} ON CACHE INTERNAL "always active module tools") +set(module_${module_name} ON CACHE INTERNAL "always active module ${module_name}") ADDMODULETOKERNEL(${module_name} Angle.cpp AtomNumber.cpp diff --git a/src/vatom/CMakeLists.txt b/src/vatom/CMakeLists.txt index 889773d9a0..bda82f2350 100644 --- a/src/vatom/CMakeLists.txt +++ b/src/vatom/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "vatom") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module vatom" ON) +option(module_${module_name} "activate module ${module_name}" ON) ADDMODULETOKERNEL(${module_name} ActionWithVirtualAtom.cpp Center.cpp diff --git a/src/ves/CMakeLists.txt b/src/ves/CMakeLists.txt index 86ecb71766..70608095a1 100644 --- a/src/ves/CMakeLists.txt +++ b/src/ves/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "ves") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module ves" OFF) +option(module_${module_name} "activate module ${module_name}" OFF) ADDMODULETOKERNEL(${module_name} BasisFunctions.cpp BF_Chebyshev.cpp diff --git a/src/vesselbase/CMakeLists.txt b/src/vesselbase/CMakeLists.txt index ed9bb0e2b5..051235c6e7 100644 --- a/src/vesselbase/CMakeLists.txt +++ b/src/vesselbase/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "vesselbase") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module vesselbase" ON) +option(module_${module_name} "activate module ${module_name}" ON) ADDMODULETOKERNEL(${module_name} ActionWithAveraging.cpp ActionWithInputVessel.cpp diff --git a/src/xdrfile/CMakeLists.txt b/src/xdrfile/CMakeLists.txt index 8cf7b4c424..fbdde2a572 100644 --- a/src/xdrfile/CMakeLists.txt +++ b/src/xdrfile/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "xdrfile") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module xdrfile" ON) +option(module_${module_name} "activate module ${module_name}" ON) ADDMODULETOKERNEL(${module_name} xdrfile.cpp xdrfile_trr.cpp From 6d77e8e789a24facc745f0c24a57a1cc004c81cc Mon Sep 17 00:00:00 2001 From: Daniele Rapetti Date: Thu, 4 May 2023 14:35:34 +0200 Subject: [PATCH 18/40] cosmetic change in cmakefiles --- src/CMakeLists.txt | 23 ++++++++++++++++------- src/adjmat/CMakeLists.txt | 4 ++-- src/analysis/CMakeLists.txt | 4 ++-- src/annfunc/CMakeLists.txt | 4 ++-- src/asmjit/CMakeLists.txt | 4 ++-- src/bias/CMakeLists.txt | 4 ++-- src/blas/CMakeLists.txt | 4 ++-- src/cltools/CMakeLists.txt | 15 +++++++-------- src/colvar/CMakeLists.txt | 4 ++-- src/core/CMakeLists.txt | 5 ++--- src/crystallization/CMakeLists.txt | 4 ++-- src/dimred/CMakeLists.txt | 4 ++-- src/drr/CMakeLists.txt | 4 ++-- src/eds/CMakeLists.txt | 4 ++-- src/fisst/CMakeLists.txt | 4 ++-- src/function/CMakeLists.txt | 4 ++-- src/funnel/CMakeLists.txt | 4 ++-- src/generic/CMakeLists.txt | 4 ++-- src/gridtools/CMakeLists.txt | 4 ++-- src/isdb/CMakeLists.txt | 4 ++-- src/lapack/CMakeLists.txt | 4 ++-- src/lepton/CMakeLists.txt | 4 ++-- src/logmfd/CMakeLists.txt | 4 ++-- src/manyrestraints/CMakeLists.txt | 4 ++-- src/mapping/CMakeLists.txt | 4 ++-- src/maze/CMakeLists.txt | 4 ++-- src/membranefusion/CMakeLists.txt | 4 ++-- src/molfile/CMakeLists.txt | 6 ++---- src/multicolvar/CMakeLists.txt | 4 ++-- src/opes/CMakeLists.txt | 4 ++-- src/pamm/CMakeLists.txt | 4 ++-- src/piv/CMakeLists.txt | 4 ++-- src/pytorch/CMakeLists.txt | 4 ++-- src/reference/CMakeLists.txt | 4 ++-- src/s2cm/CMakeLists.txt | 4 ++-- src/sasa/CMakeLists.txt | 4 ++-- src/secondarystructure/CMakeLists.txt | 4 ++-- src/setup/CMakeLists.txt | 4 ++-- src/tools/CMakeLists.txt | 4 ++-- src/vatom/CMakeLists.txt | 4 ++-- src/ves/CMakeLists.txt | 4 ++-- src/vesselbase/CMakeLists.txt | 4 ++-- src/xdrfile/CMakeLists.txt | 2 +- 43 files changed, 104 insertions(+), 99 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 69d0a5cee1..57a0865afb 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -43,16 +43,25 @@ MACRO(ADDMODULETOKERNEL module_name) endif(${module_${module_name}}) ENDMACRO(ADDMODULETOKERNEL) -MACRO(ADDMODULEDEPENDENCIES module_name) - #use: ADDMODULEDEPENDENCIES(module_name listOfModules) +MACRO(ADDMODULENEEDS module_name) + #use: ADDMODULENEEDS(module_name listOfModules) + set(OTHERARGS ${ARGV}) list(REMOVE_ITEM OTHERARGS ${module_name}) set(moduleNeeds_${module_name} ${OTHERARGS} PARENT_SCOPE) - #if(${module_${module_name}} ) - # set(OTHERARGS ${ARGV}) - # list(REMOVE_ITEM OTHERARGS ${module_name}) - # target_link_libraries(${module_name} PRIVATE ${OTHERARGS}) - #endif(${module_${module_name}}) + +ENDMACRO(ADDMODULENEEDS module_name) + +MACRO(ADDMODULEDEPENDENCIES) + #use: ADDMODULENEEDS(module_name listOfModules) + #adds the module on which this depends on (for compile definitions and so on) + #NB you may create circular dependencies + #NB this is particularly experimental + if(${module_${module_name}} ) + set(OTHERARGS ${ARGV}) + list(REMOVE_ITEM OTHERARGS ${module_name}) + target_link_libraries(${module_name} PRIVATE ${OTHERARGS}) + endif(${module_${module_name}}) ENDMACRO(ADDMODULEDEPENDENCIES) SUBDIRLIST(alldirs ${CMAKE_CURRENT_SOURCE_DIR})# CACHE INTERNAL FORCE) diff --git a/src/adjmat/CMakeLists.txt b/src/adjmat/CMakeLists.txt index 947c744e21..dde9efb997 100644 --- a/src/adjmat/CMakeLists.txt +++ b/src/adjmat/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "adjmat") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module adjmat" OFF) +option(module_${module_name} "activate module ${module_name}" OFF) ADDMODULETOKERNEL(${module_name} ActionWithInputMatrix.cpp AdjacencyMatrixBase.cpp @@ -27,6 +27,6 @@ SMACMatrix.cpp Sprint.cpp TopologyMatrix.cpp ) -ADDMODULEDEPENDENCIES(${module_name} +ADDMODULENEEDS(${module_name} core tools vesselbase multicolvar ) diff --git a/src/analysis/CMakeLists.txt b/src/analysis/CMakeLists.txt index d0ff041b1a..7db6c3c823 100644 --- a/src/analysis/CMakeLists.txt +++ b/src/analysis/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "analysis") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module analysis" ON) +option(module_${module_name} "activate module ${module_name}" ON) ADDMODULETOKERNEL(${module_name} AnalysisBase.cpp Average.cpp @@ -25,6 +25,6 @@ SelectWithStride.cpp WhamHistogram.cpp WhamWeights.cpp ) -ADDMODULEDEPENDENCIES(${module_name} +ADDMODULENEEDS(${module_name} core tools reference vesselbase gridtools multicolvar bias ) diff --git a/src/annfunc/CMakeLists.txt b/src/annfunc/CMakeLists.txt index ada5b017da..f2269d0e22 100644 --- a/src/annfunc/CMakeLists.txt +++ b/src/annfunc/CMakeLists.txt @@ -2,10 +2,10 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "annfunc") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module annfunc" OFF) +option(module_${module_name} "activate module ${module_name}" OFF) ADDMODULETOKERNEL(${module_name} ANN.cpp ) -ADDMODULEDEPENDENCIES(${module_name} +ADDMODULENEEDS(${module_name} core function ) diff --git a/src/asmjit/CMakeLists.txt b/src/asmjit/CMakeLists.txt index 3ca5111ff1..2080ba3f65 100644 --- a/src/asmjit/CMakeLists.txt +++ b/src/asmjit/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "asmjit") #Note that the macros here require this directory added as a subdir of plumed/src -set(module_${module_name} ON CACHE INTERNAL "always active module asmjit") +set(module_${module_name} ON CACHE INTERNAL "always active module ${module_name}") ADDMODULETOKERNEL(${module_name} arch.cpp assembler.cpp @@ -35,6 +35,6 @@ x86operand_regs.cpp x86regalloc.cpp zone.cpp ) -ADDMODULEDEPENDENCIES(${module_name} +ADDMODULENEEDS(${module_name} ) diff --git a/src/bias/CMakeLists.txt b/src/bias/CMakeLists.txt index 30155af0a8..9398e32cdb 100644 --- a/src/bias/CMakeLists.txt +++ b/src/bias/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "bias") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module bias" ON) +option(module_${module_name} "activate module ${module_name}" ON) ADDMODULETOKERNEL(${module_name} ABMD.cpp Bias.cpp @@ -22,6 +22,6 @@ ReweightTemperaturePressure.cpp ReweightWham.cpp UWalls.cpp ) -ADDMODULEDEPENDENCIES(${module_name} +ADDMODULENEEDS(${module_name} core tools ) diff --git a/src/blas/CMakeLists.txt b/src/blas/CMakeLists.txt index 9e6b3e355f..560eb18461 100644 --- a/src/blas/CMakeLists.txt +++ b/src/blas/CMakeLists.txt @@ -2,10 +2,10 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "blas") #Note that the macros here require this directory added as a subdir of plumed/src -set(module_${module_name} ON CACHE INTERNAL "always active module blas") +set(module_${module_name} ON CACHE INTERNAL "always active module ${module_name}") ADDMODULETOKERNEL(${module_name} blas.cpp ) -ADDMODULEDEPENDENCIES(${module_name} +ADDMODULENEEDS(${module_name} ) diff --git a/src/cltools/CMakeLists.txt b/src/cltools/CMakeLists.txt index 25204ff3e5..1a0f14ced1 100644 --- a/src/cltools/CMakeLists.txt +++ b/src/cltools/CMakeLists.txt @@ -1,9 +1,7 @@ -#automatically generated CMakeLists.txt, may not work! #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "cltools") #Note that the macros here require this directory added as a subdir of plumed/src - -option(module_${module_name} "activate module cltools" ON) +option(module_${module_name} "activate module ${module_name}" ON) ADDMODULETOKERNEL(${module_name} CLTool.cpp Completion.cpp @@ -23,15 +21,16 @@ SumHills.cpp #generated file completion.xxd ) -ADDMODULEDEPENDENCIES(${module_name} +ADDMODULENEEDS(${module_name} core config tools molfile xdrfile ) -get_target_property(t ${module_name} INCLUDE_DIRECTORIES) -message("id: ${t}") + +#get_target_property(t ${module_name} INCLUDE_DIRECTORIES) +#message("id: ${t}") target_include_directories(${module_name} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) -get_target_property(t ${module_name} INCLUDE_DIRECTORIES) -message("id: ${t}") +#get_target_property(t ${module_name} INCLUDE_DIRECTORIES) +#message("id: ${t}") #this file once compiled reproduces #completion.xxd: completion.sh ../../scripts/*.sh ../../patches/*.sh # { ../maketools/make-scripts-options.sh ; cat completion.sh ; }| ../maketools/xxd > completion.xxd diff --git a/src/colvar/CMakeLists.txt b/src/colvar/CMakeLists.txt index d99bda608a..0d6dc36881 100644 --- a/src/colvar/CMakeLists.txt +++ b/src/colvar/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "colvar") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module colvar" ON) +option(module_${module_name} "activate module ${module_name}" ON) ADDMODULETOKERNEL(${module_name} Angle.cpp Cell.cpp @@ -36,6 +36,6 @@ Template.cpp Torsion.cpp Volume.cpp ) -ADDMODULEDEPENDENCIES(${module_name} +ADDMODULENEEDS(${module_name} core reference tools ) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 07738a1192..49329476e8 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -1,8 +1,7 @@ -#automatically generated CMakeLists.txt, may not work! #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "core") #Note that the macros here require this directory added as a subdir of plumed/src -set(module_${module_name} ON CACHE INTERNAL "always active module core") +set(module_${module_name} ON CACHE INTERNAL "always active module ${module_name}") ADDMODULETOKERNEL(${module_name} ActionAnyorder.cpp ActionAtomistic.cpp @@ -36,7 +35,7 @@ PlumedMainMap.inc PlumedMainEnum.inc GREXMap.inc GREXEnum.inc CLToolMainMap.inc CLToolMainEnum.inc ) -ADDMODULEDEPENDENCIES(${module_name} +ADDMODULENEEDS(${module_name} config tools lepton ) diff --git a/src/crystallization/CMakeLists.txt b/src/crystallization/CMakeLists.txt index 29617898c1..d9722a50e2 100644 --- a/src/crystallization/CMakeLists.txt +++ b/src/crystallization/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "crystallization") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module crystallization" OFF) +option(module_${module_name} "activate module ${module_name}" OFF) ADDMODULETOKERNEL(${module_name} BondOrientation.cpp CubicHarmonicBase.cpp @@ -27,6 +27,6 @@ VectorMean.cpp VectorMultiColvar.cpp VectorSum.cpp ) -ADDMODULEDEPENDENCIES(${module_name} +ADDMODULENEEDS(${module_name} core tools vesselbase multicolvar ) diff --git a/src/dimred/CMakeLists.txt b/src/dimred/CMakeLists.txt index 868fc6513b..06e0af1dc4 100644 --- a/src/dimred/CMakeLists.txt +++ b/src/dimred/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "dimred") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module dimred" OFF) +option(module_${module_name} "activate module ${module_name}" OFF) ADDMODULETOKERNEL(${module_name} ClassicalMultiDimensionalScaling.cpp DimensionalityReductionBase.cpp @@ -18,6 +18,6 @@ SketchMapSmacof.cpp SMACOF.cpp SmacoffMDS.cpp ) -ADDMODULEDEPENDENCIES(${module_name} +ADDMODULENEEDS(${module_name} core tools reference gridtools analysis ) diff --git a/src/drr/CMakeLists.txt b/src/drr/CMakeLists.txt index 70e2d19779..cd3a618070 100644 --- a/src/drr/CMakeLists.txt +++ b/src/drr/CMakeLists.txt @@ -2,13 +2,13 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "drr") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module drr" OFF) +option(module_${module_name} "activate module ${module_name}" OFF) ADDMODULETOKERNEL(${module_name} colvar_UIestimator.cpp DRR.cpp drrtool.cpp DynamicReferenceRestraining.cpp ) -ADDMODULEDEPENDENCIES(${module_name} +ADDMODULENEEDS(${module_name} core tools bias cltools config ) diff --git a/src/eds/CMakeLists.txt b/src/eds/CMakeLists.txt index 262e38f4d7..535827896b 100644 --- a/src/eds/CMakeLists.txt +++ b/src/eds/CMakeLists.txt @@ -2,10 +2,10 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "eds") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module eds" OFF) +option(module_${module_name} "activate module ${module_name}" OFF) ADDMODULETOKERNEL(${module_name} EDS.cpp ) -ADDMODULEDEPENDENCIES(${module_name} +ADDMODULENEEDS(${module_name} core tools bias ) diff --git a/src/fisst/CMakeLists.txt b/src/fisst/CMakeLists.txt index 9076401128..5921f94ad9 100644 --- a/src/fisst/CMakeLists.txt +++ b/src/fisst/CMakeLists.txt @@ -2,11 +2,11 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "fisst") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module fisst" OFF) +option(module_${module_name} "activate module ${module_name}" OFF) ADDMODULETOKERNEL(${module_name} FISST.cpp legendre_rule_fast.cpp ) -ADDMODULEDEPENDENCIES(${module_name} +ADDMODULENEEDS(${module_name} core tools bias ) diff --git a/src/function/CMakeLists.txt b/src/function/CMakeLists.txt index f1cedda85c..9bd332427a 100644 --- a/src/function/CMakeLists.txt +++ b/src/function/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "function") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module function" ON) +option(module_${module_name} "activate module ${module_name}" ON) ADDMODULETOKERNEL(${module_name} Combine.cpp Custom.cpp @@ -17,6 +17,6 @@ Sort.cpp Stats.cpp Target.cpp ) -ADDMODULEDEPENDENCIES(${module_name} +ADDMODULENEEDS(${module_name} core reference tools lepton ) diff --git a/src/funnel/CMakeLists.txt b/src/funnel/CMakeLists.txt index 9617cd5fb1..b96636a62f 100644 --- a/src/funnel/CMakeLists.txt +++ b/src/funnel/CMakeLists.txt @@ -2,11 +2,11 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "funnel") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module funnel" OFF) +option(module_${module_name} "activate module ${module_name}" OFF) ADDMODULETOKERNEL(${module_name} FPS.cpp Funnel.cpp ) -ADDMODULEDEPENDENCIES(${module_name} +ADDMODULENEEDS(${module_name} core tools colvar bias ) diff --git a/src/generic/CMakeLists.txt b/src/generic/CMakeLists.txt index d517310d99..86647c2905 100644 --- a/src/generic/CMakeLists.txt +++ b/src/generic/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "generic") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module generic" ON) +option(module_${module_name} "activate module ${module_name}" ON) ADDMODULETOKERNEL(${module_name} Debug.cpp DumpAtoms.cpp @@ -27,6 +27,6 @@ UpdateIf.cpp WholeMolecules.cpp WrapAround.cpp ) -ADDMODULEDEPENDENCIES(${module_name} +ADDMODULENEEDS(${module_name} core tools xdrfile ) diff --git a/src/gridtools/CMakeLists.txt b/src/gridtools/CMakeLists.txt index e7758cd734..9b531bb6ef 100644 --- a/src/gridtools/CMakeLists.txt +++ b/src/gridtools/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "gridtools") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module gridtools" ON) +option(module_${module_name} "activate module ${module_name}" ON) ADDMODULETOKERNEL(${module_name} ActionWithGrid.cpp ActionWithInputGrid.cpp @@ -24,6 +24,6 @@ HistogramOnGrid.cpp IntegrateGrid.cpp InterpolateGrid.cpp ) -ADDMODULEDEPENDENCIES(${module_name} +ADDMODULENEEDS(${module_name} core tools vesselbase ) diff --git a/src/isdb/CMakeLists.txt b/src/isdb/CMakeLists.txt index ba2cc79be0..ae50b1ff87 100644 --- a/src/isdb/CMakeLists.txt +++ b/src/isdb/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "isdb") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module isdb" ON) +option(module_${module_name} "activate module ${module_name}" ON) ADDMODULETOKERNEL(${module_name} Caliber.cpp CS2Backbone.cpp @@ -19,6 +19,6 @@ SAXS.cpp Select.cpp Selector.cpp ) -ADDMODULEDEPENDENCIES(${module_name} +ADDMODULENEEDS(${module_name} bias colvar core reference tools function ) diff --git a/src/lapack/CMakeLists.txt b/src/lapack/CMakeLists.txt index b0236796a8..c2f4370178 100644 --- a/src/lapack/CMakeLists.txt +++ b/src/lapack/CMakeLists.txt @@ -2,10 +2,10 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "lapack") #Note that the macros here require this directory added as a subdir of plumed/src -set(module_${module_name} ON CACHE INTERNAL "always active module lapack") +set(module_${module_name} ON CACHE INTERNAL "always active module ${module_name}") ADDMODULETOKERNEL(${module_name} lapack.cpp ) -ADDMODULEDEPENDENCIES(${module_name} +ADDMODULENEEDS(${module_name} blas ) diff --git a/src/lepton/CMakeLists.txt b/src/lepton/CMakeLists.txt index 29f63d06b7..7898bd1443 100644 --- a/src/lepton/CMakeLists.txt +++ b/src/lepton/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "lepton") #Note that the macros here require this directory added as a subdir of plumed/src -set(module_${module_name} ON CACHE INTERNAL "always active module lepton") +set(module_${module_name} ON CACHE INTERNAL "always active module ${module_name}") ADDMODULETOKERNEL(${module_name} CompiledExpression.cpp ExpressionProgram.cpp @@ -11,6 +11,6 @@ Operation.cpp ParsedExpression.cpp Parser.cpp ) -ADDMODULEDEPENDENCIES(${module_name} +ADDMODULENEEDS(${module_name} asmjit ) diff --git a/src/logmfd/CMakeLists.txt b/src/logmfd/CMakeLists.txt index 22b2f9f6d4..aca9dcb7e5 100644 --- a/src/logmfd/CMakeLists.txt +++ b/src/logmfd/CMakeLists.txt @@ -2,10 +2,10 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "logmfd") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module logmfd" OFF) +option(module_${module_name} "activate module ${module_name}" OFF) ADDMODULETOKERNEL(${module_name} LogMFD.cpp ) -ADDMODULEDEPENDENCIES(${module_name} +ADDMODULENEEDS(${module_name} core tools bias ) diff --git a/src/manyrestraints/CMakeLists.txt b/src/manyrestraints/CMakeLists.txt index 15bf7077c0..660b3fcbc8 100644 --- a/src/manyrestraints/CMakeLists.txt +++ b/src/manyrestraints/CMakeLists.txt @@ -2,12 +2,12 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "manyrestraints") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module manyrestraints" OFF) +option(module_${module_name} "activate module ${module_name}" OFF) ADDMODULETOKERNEL(${module_name} LWalls.cpp ManyRestraintsBase.cpp UWalls.cpp ) -ADDMODULEDEPENDENCIES(${module_name} +ADDMODULENEEDS(${module_name} core tools vesselbase ) diff --git a/src/mapping/CMakeLists.txt b/src/mapping/CMakeLists.txt index 08777bbd43..9612f1880e 100644 --- a/src/mapping/CMakeLists.txt +++ b/src/mapping/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "mapping") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module mapping" ON) +option(module_${module_name} "activate module ${module_name}" ON) ADDMODULETOKERNEL(${module_name} AdaptivePath.cpp Mapping.cpp @@ -16,6 +16,6 @@ SpathVessel.cpp TrigonometricPathVessel.cpp ZpathVessel.cpp ) -ADDMODULEDEPENDENCIES(${module_name} +ADDMODULENEEDS(${module_name} core tools cltools reference vesselbase ) diff --git a/src/maze/CMakeLists.txt b/src/maze/CMakeLists.txt index 2002b0f21a..921c503ff7 100644 --- a/src/maze/CMakeLists.txt +++ b/src/maze/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "maze") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module maze" OFF) +option(module_${module_name} "activate module ${module_name}" OFF) ADDMODULETOKERNEL(${module_name} Core.cpp Loss.cpp @@ -17,6 +17,6 @@ Simulated_Annealing.cpp Steered_MD.cpp Tools.cpp ) -ADDMODULEDEPENDENCIES(${module_name} +ADDMODULENEEDS(${module_name} core tools colvar bias ) diff --git a/src/membranefusion/CMakeLists.txt b/src/membranefusion/CMakeLists.txt index 3b8fd12012..aad4621322 100644 --- a/src/membranefusion/CMakeLists.txt +++ b/src/membranefusion/CMakeLists.txt @@ -2,12 +2,12 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "membranefusion") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module membranefusion" OFF) +option(module_${module_name} "activate module ${module_name}" OFF) ADDMODULETOKERNEL(${module_name} FusionPoreExpansionP.cpp FusionPoreNucleationP.cpp MemFusionP.cpp ) -ADDMODULEDEPENDENCIES(${module_name} +ADDMODULENEEDS(${module_name} core reference tools colvar ) diff --git a/src/molfile/CMakeLists.txt b/src/molfile/CMakeLists.txt index 1485fef4b0..00e4e2fd88 100644 --- a/src/molfile/CMakeLists.txt +++ b/src/molfile/CMakeLists.txt @@ -1,16 +1,14 @@ -#automatically generated CMakeLists.txt, may not work! #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "molfile") #Note that the macros here require this directory added as a subdir of plumed/src - -option(module_${module_name} "activate module molfile" ON) +option(module_${module_name} "activate module ${module_name}" ON) ADDMODULETOKERNEL(${module_name} crdplugin.cpp dcdplugin.cpp gromacsplugin.cpp pdbplugin.cpp ) -ADDMODULEDEPENDENCIES(${module_name} +ADDMODULENEEDS(${module_name} ) diff --git a/src/multicolvar/CMakeLists.txt b/src/multicolvar/CMakeLists.txt index 6ff43b442a..3067917e7e 100644 --- a/src/multicolvar/CMakeLists.txt +++ b/src/multicolvar/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "multicolvar") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module multicolvar" ON) +option(module_${module_name} "activate module ${module_name}" ON) ADDMODULETOKERNEL(${module_name} ActionVolume.cpp AlphaBeta.cpp @@ -42,6 +42,6 @@ XDistances.cpp XYDistances.cpp XYTorsion.cpp ) -ADDMODULEDEPENDENCIES(${module_name} +ADDMODULENEEDS(${module_name} core tools vesselbase gridtools ) diff --git a/src/opes/CMakeLists.txt b/src/opes/CMakeLists.txt index ce089a9f34..6d0ee479b1 100644 --- a/src/opes/CMakeLists.txt +++ b/src/opes/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "opes") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module opes" OFF) +option(module_${module_name} "activate module ${module_name}" OFF) ADDMODULETOKERNEL(${module_name} ECVcustom.cpp ECVlinear.cpp @@ -14,6 +14,6 @@ ExpansionCVs.cpp OPESexpanded.cpp OPESmetad.cpp ) -ADDMODULEDEPENDENCIES(${module_name} +ADDMODULENEEDS(${module_name} bias core tools ) diff --git a/src/pamm/CMakeLists.txt b/src/pamm/CMakeLists.txt index 9987aa855c..ae7c6be701 100644 --- a/src/pamm/CMakeLists.txt +++ b/src/pamm/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "pamm") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module pamm" OFF) +option(module_${module_name} "activate module ${module_name}" OFF) ADDMODULETOKERNEL(${module_name} HBPammHydrogens.cpp HBPammMatrix.cpp @@ -10,6 +10,6 @@ HBPammObject.cpp PAMM.cpp PammObject.cpp ) -ADDMODULEDEPENDENCIES(${module_name} +ADDMODULENEEDS(${module_name} core tools vesselbase multicolvar adjmat ) diff --git a/src/piv/CMakeLists.txt b/src/piv/CMakeLists.txt index 1cb39073fb..1cc333cc47 100644 --- a/src/piv/CMakeLists.txt +++ b/src/piv/CMakeLists.txt @@ -2,10 +2,10 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "piv") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module piv" OFF) +option(module_${module_name} "activate module ${module_name}" OFF) ADDMODULETOKERNEL(${module_name} PIV.cpp ) -ADDMODULEDEPENDENCIES(${module_name} +ADDMODULENEEDS(${module_name} core tools bias colvar ) diff --git a/src/pytorch/CMakeLists.txt b/src/pytorch/CMakeLists.txt index 1e4f4a09ef..433dde9c99 100644 --- a/src/pytorch/CMakeLists.txt +++ b/src/pytorch/CMakeLists.txt @@ -2,10 +2,10 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "pytorch") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module pytorch" OFF) +option(module_${module_name} "activate module ${module_name}" OFF) ADDMODULETOKERNEL(${module_name} PytorchModel.cpp ) -ADDMODULEDEPENDENCIES(${module_name} +ADDMODULENEEDS(${module_name} core function ) diff --git a/src/reference/CMakeLists.txt b/src/reference/CMakeLists.txt index bb5652dc63..4f832c10fe 100644 --- a/src/reference/CMakeLists.txt +++ b/src/reference/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "reference") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module reference" ON) +option(module_${module_name} "activate module ${module_name}" ON) ADDMODULETOKERNEL(${module_name} ArgumentOnlyDistance.cpp Direction.cpp @@ -25,6 +25,6 @@ RMSDBase.cpp SimpleRMSD.cpp SingleDomainRMSD.cpp ) -ADDMODULEDEPENDENCIES(${module_name} +ADDMODULENEEDS(${module_name} core tools ) diff --git a/src/s2cm/CMakeLists.txt b/src/s2cm/CMakeLists.txt index 2b815473de..36edc801c1 100644 --- a/src/s2cm/CMakeLists.txt +++ b/src/s2cm/CMakeLists.txt @@ -2,10 +2,10 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "s2cm") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module s2cm" OFF) +option(module_${module_name} "activate module ${module_name}" OFF) ADDMODULETOKERNEL(${module_name} S2ContactModel.cpp ) -ADDMODULEDEPENDENCIES(${module_name} +ADDMODULENEEDS(${module_name} core tools colvar ) diff --git a/src/sasa/CMakeLists.txt b/src/sasa/CMakeLists.txt index ead122b567..aa14e1aabe 100644 --- a/src/sasa/CMakeLists.txt +++ b/src/sasa/CMakeLists.txt @@ -2,12 +2,12 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "sasa") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module sasa" OFF) +option(module_${module_name} "activate module ${module_name}" OFF) ADDMODULETOKERNEL(${module_name} Sasa.cpp sasa_HASEL.cpp sasa_LCPO.cpp ) -ADDMODULEDEPENDENCIES(${module_name} +ADDMODULENEEDS(${module_name} core tools config ) diff --git a/src/secondarystructure/CMakeLists.txt b/src/secondarystructure/CMakeLists.txt index 6e009d0903..87912b4f2a 100644 --- a/src/secondarystructure/CMakeLists.txt +++ b/src/secondarystructure/CMakeLists.txt @@ -2,13 +2,13 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "secondarystructure") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module secondarystructure" ON) +option(module_${module_name} "activate module ${module_name}" ON) ADDMODULETOKERNEL(${module_name} AlphaRMSD.cpp AntibetaRMSD.cpp ParabetaRMSD.cpp SecondaryStructureRMSD.cpp ) -ADDMODULEDEPENDENCIES(${module_name} +ADDMODULENEEDS(${module_name} core tools reference vesselbase ) diff --git a/src/setup/CMakeLists.txt b/src/setup/CMakeLists.txt index accb18e9a6..9f3ec4c5ac 100644 --- a/src/setup/CMakeLists.txt +++ b/src/setup/CMakeLists.txt @@ -2,12 +2,12 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "setup") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module setup" ON) +option(module_${module_name} "activate module ${module_name}" ON) ADDMODULETOKERNEL(${module_name} Load.cpp Restart.cpp Units.cpp ) -ADDMODULEDEPENDENCIES(${module_name} +ADDMODULENEEDS(${module_name} core tools ) diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt index b709dac597..9f3a00d1d6 100644 --- a/src/tools/CMakeLists.txt +++ b/src/tools/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "tools") #Note that the macros here require this directory added as a subdir of plumed/src -set(module_${module_name} ON CACHE INTERNAL "always active module tools") +set(module_${module_name} ON CACHE INTERNAL "always active module ${module_name}") ADDMODULETOKERNEL(${module_name} Angle.cpp AtomNumber.cpp @@ -53,6 +53,6 @@ TypesafePtr.cpp Units.cpp Vector.cpp ) -ADDMODULEDEPENDENCIES(${module_name} +ADDMODULENEEDS(${module_name} core lapack lepton ) diff --git a/src/vatom/CMakeLists.txt b/src/vatom/CMakeLists.txt index 889773d9a0..e3bb6f8dd1 100644 --- a/src/vatom/CMakeLists.txt +++ b/src/vatom/CMakeLists.txt @@ -2,13 +2,13 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "vatom") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module vatom" ON) +option(module_${module_name} "activate module ${module_name}" ON) ADDMODULETOKERNEL(${module_name} ActionWithVirtualAtom.cpp Center.cpp FixedAtom.cpp Ghost.cpp ) -ADDMODULEDEPENDENCIES(${module_name} +ADDMODULENEEDS(${module_name} core tools ) diff --git a/src/ves/CMakeLists.txt b/src/ves/CMakeLists.txt index 86ecb71766..bfc113328a 100644 --- a/src/ves/CMakeLists.txt +++ b/src/ves/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "ves") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module ves" OFF) +option(module_${module_name} "activate module ${module_name}" OFF) ADDMODULETOKERNEL(${module_name} BasisFunctions.cpp BF_Chebyshev.cpp @@ -59,6 +59,6 @@ VesTools.cpp WaveletCoeffs.cpp WaveletGrid.cpp ) -ADDMODULEDEPENDENCIES(${module_name} +ADDMODULENEEDS(${module_name} bias cltools colvar config core tools lepton ) diff --git a/src/vesselbase/CMakeLists.txt b/src/vesselbase/CMakeLists.txt index ed9bb0e2b5..dd7fc57ef2 100644 --- a/src/vesselbase/CMakeLists.txt +++ b/src/vesselbase/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "vesselbase") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module vesselbase" ON) +option(module_${module_name} "activate module ${module_name}" ON) ADDMODULETOKERNEL(${module_name} ActionWithAveraging.cpp ActionWithInputVessel.cpp @@ -29,6 +29,6 @@ ValueVessel.cpp Vessel.cpp VesselRegister.cpp ) -ADDMODULEDEPENDENCIES(${module_name} +ADDMODULENEEDS(${module_name} core tools bias analysis ) diff --git a/src/xdrfile/CMakeLists.txt b/src/xdrfile/CMakeLists.txt index 8cf7b4c424..fbdde2a572 100644 --- a/src/xdrfile/CMakeLists.txt +++ b/src/xdrfile/CMakeLists.txt @@ -2,7 +2,7 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "xdrfile") #Note that the macros here require this directory added as a subdir of plumed/src -option(module_${module_name} "activate module xdrfile" ON) +option(module_${module_name} "activate module ${module_name}" ON) ADDMODULETOKERNEL(${module_name} xdrfile.cpp xdrfile_trr.cpp From f8ba2fa9f95cd2920d8451c4b42fb11471950824 Mon Sep 17 00:00:00 2001 From: Daniele Rapetti Date: Fri, 5 May 2023 16:36:28 +0200 Subject: [PATCH 19/40] reorganized the main CmakeFile --- src/CMakeLists.txt | 165 +++++++++++++++++++++++++++++++++------------ 1 file changed, 121 insertions(+), 44 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 57a0865afb..c8740180d5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -9,8 +9,28 @@ set(program_name "plumed" CACHE STRING "the name of the main executable") set(SOEXT "so" CACHE STRING "The extension of dynamic libraries (so/dylib)") set_property(CACHE SOEXT PROPERTY STRINGS "so" "dylib") +set (PLUMED_SRC ${CMAKE_CURRENT_SOURCE_DIR}) +set (PLUMED_MAKETOOLS ${PLUMED_SRC}/maketools ) +cmake_path (GET PLUMED_SRC PARENT_PATH PLUMED_MAIN_DIR) +set (PLUMED_SCRIPTS ${PLUMED_MAIN_DIR}/scripts) +set (PLUMED_PATCHES ${PLUMED_MAIN_DIR}/patches) + +option(all_modules "Activates all modules, if on ignores the values of module_name when compiling" OFF) +option(useExternal_BLAS "enable search for external BLAS, default ON" ON) +option(useExternal_LAPACK "enable search for external LAPACK, default ON" ON) +option(useExternal_MOLFILE "enable search for external LAPACK, default OFF" OFF) + set(modulesDependencies "") +################################################################################ +#Setting up global options +################################################################################ + +add_compile_options(-fPIC) + +################################################################################ +#Macro definitions +################################################################################ MACRO(SUBDIRLIST result curdir) #This macro is from a lot of posts on stackoverflow FILE(GLOB children RELATIVE ${curdir} ${curdir}/*) @@ -23,12 +43,6 @@ MACRO(SUBDIRLIST result curdir) SET(${result} ${dirlist}) ENDMACRO() -set (PLUMED_SRC ${CMAKE_CURRENT_SOURCE_DIR}) -set (PLUMED_MAKETOOLS ${PLUMED_SRC}/maketools ) -cmake_path (GET PLUMED_SRC PARENT_PATH PLUMED_MAIN_DIR) -set (PLUMED_SCRIPTS ${PLUMED_MAIN_DIR}/scripts) -set (PLUMED_PATCHES ${PLUMED_MAIN_DIR}/patches) - MACRO(ADDMODULETOKERNEL module_name) #use: ADDMODULETOKERNEL(module_name listOfSources) #Please write the source files explicitly @@ -50,9 +64,9 @@ MACRO(ADDMODULENEEDS module_name) list(REMOVE_ITEM OTHERARGS ${module_name}) set(moduleNeeds_${module_name} ${OTHERARGS} PARENT_SCOPE) -ENDMACRO(ADDMODULENEEDS module_name) +ENDMACRO(ADDMODULENEEDS) -MACRO(ADDMODULEDEPENDENCIES) +MACRO(ADDMODULEDEPENDENCIES module_name) #use: ADDMODULENEEDS(module_name listOfModules) #adds the module on which this depends on (for compile definitions and so on) #NB you may create circular dependencies @@ -60,63 +74,61 @@ MACRO(ADDMODULEDEPENDENCIES) if(${module_${module_name}} ) set(OTHERARGS ${ARGV}) list(REMOVE_ITEM OTHERARGS ${module_name}) - target_link_libraries(${module_name} PRIVATE ${OTHERARGS}) + message("${module_name} is linked with ${OTHERARGS}") + target_link_libraries(${module_name} PUBLIC ${OTHERARGS}) endif(${module_${module_name}}) ENDMACRO(ADDMODULEDEPENDENCIES) +################################################################################ +#Setting up Modules +################################################################################ + SUBDIRLIST(alldirs ${CMAKE_CURRENT_SOURCE_DIR})# CACHE INTERNAL FORCE) set(dirs ${alldirs})# CACHE INTERNAL FORCE) -#message("${alldirs}") -#message("${dirs}") +#directories that do not contain modules +set(utildirs lib include maketools cmake) #these are the diretory to compile that do not have a module.type inside -set(coredirs main config wrapper) - +set(execDirs main config wrapper) +#these are directory with codes that may be external set(mayBeExternal blas lapack molfile) -list(REMOVE_ITEM dirs lib include maketools CMakeFiles ${coredirs} ${mayBeExternal}) +list(REMOVE_ITEM dirs ${utildirs} ${execDirs} ${mayBeExternal}) - -foreach(dir ${coredirs}) +foreach(dir ${execDirs}) add_subdirectory(${dir}) - set(module_${dir} ON CACHE INTERNAL "always active core module ${dir}") -endforeach(dir ${coredirs}) - -foreach(dir ${mayBeExternal}) - option(module_${dir} "activate module ${dir}" ON) -endforeach(dir ${mayBeExternal}) - -option(all_modules "Activates all modules, if on ignores the values of module_name when compiling" OFF) +endforeach(dir ${execDirs}) foreach(dir ${dirs}) add_subdirectory(${dir}) endforeach(dir ${dirs}) if(all_modules) - #forceactivates all modules + message("All module will be forced ON") foreach(dir ${dirs}) set(module_${dir} ON) endforeach(dir ${dirs}) endif() -option(useExternal_BLAS "enable search for external BLAS, default ON" ON) -option(useExternal_LAPACK "enable search for external LAPACK, default ON" ON) - -foreach(externalLib BLAS LAPACK) - string(TOLOWER ${externalLib} dir) +message("Checking if it is possible to find external alternatives for modules:") +#needed for FindMOLFILE +set (CMAKE_MODULE_PATH ${PLUMED_SRC}/cmake) +foreach(dir ${mayBeExternal}) + #todo port the maybe external to the single modules + string(TOUPPER ${dir} externalLib) if (useExternal_${externalLib}) - include(Find${externalLib}) - else() - set(${externalLib}_FOUND OFF) - set(module_${dir} ON CACHE BOOL "activate module ${dir}" FORCE) - endif(useExternal_${externalLib}) + find_package(${externalLib}) + endif (useExternal_${externalLib}) + if (${externalLib}_FOUND) set(module_${dir} OFF CACHE BOOL "activate module ${dir}" FORCE) + #add_library(${dir} ALIAS ${externalLib}:${externalLib}) #target_compile_options(${PROJECT_NAME} PRIVATE ${BLAS_LINKER_FLAGS}) #target_link_libraries(${PROJECT_NAME} ${BLAS_LIBRARIES}) -endif () -endforeach(externalLib BLAS LAPACK) - + else() + add_subdirectory(${dir}) + set(${externalLib}_FOUND OFF) + endif (${externalLib}_FOUND) + message(" ${dir} internal: ${module_${dir}}") +endforeach(dir ${mayBeExternal}) -message("BLAS internal:${module_blas}") -message("LAPACK internal:${module_lapack}") #options ## options are already done ## --bindir=DIR user executables [EPREFIX/bin] ## --sbindir=DIR system admin executables [EPREFIX/sbin] @@ -217,9 +229,9 @@ message("LAPACK internal:${module_lapack}") # --disable-openmp do not use OpenMP #for debugging purpose -#foreach(dir ${dirs} ${coredirs} ${mayBeExternal}) +#foreach(dir ${dirs} ${execDirs} ${mayBeExternal}) # message("${dir}: ${module_${dir}}") -#endforeach(dir ${dirs} ${coredirs} ${mayBeExternal}) +#endforeach(dir ${dirs} ${execDirs} ${mayBeExternal}) #check module dependencies foreach(dir ${dirs}) @@ -236,14 +248,21 @@ foreach(dir ${dirs}) endif(${capsName}_FOUND) endif(${isExternal}) list(APPEND notFound ${otherModule}) + set (modulesDependenciesProblems ON) endif(NOT module_${otherModule}) endforeach(otherModule moduleNeeds_${dir}) if (notFound) - message(FATAL_ERROR "Module \"${dir}\" needs the following modules active: ${notFound}") + message(SEND_ERROR "Module \"${dir}\" needs the following modules active: ${notFound}") endif(notFound) unset(notFound) endif(${module_${dir}}) endforeach(dir ${dirs}) +if (${modulesDependenciesProblems}) + message(FATAL_ERROR "Problems in module dependencies") +endif(${modulesDependenciesProblems}) +################################################################################ +#Setting up the main libraries +################################################################################ #these targets build the two libPlumedKernel.so set(KernelTargets "") @@ -272,4 +291,62 @@ set_target_properties(libplumedWrapper ) target_link_libraries(libplumedWrapper PlumedWrapper -) \ No newline at end of file +) + +function(print_target_property target_name property) + get_target_property(t ${target_name} ${property}) + message("${target_name} <${property}>: ${t}") + unset(t) +endfunction(print_target_property) + +#print_target_property(cltools COMPILE_DEFINITIONS) +#print_target_property(molfile COMPILE_DEFINITIONS) + +#TODO move this in a better place: +IF(${OPT_DEBUGWARNINGS}) + if(MSVC) + add_compile_options(/W4 /WX) + else() + add_compile_options( + -Wall + -Wextra + -Wshadow + -Wnon-virtual-dtor + -Wold-style-cast + -Wcast-align + -Wunused + -Woverloaded-virtual + -Wpedantic + -Wconversion + -Wsign-conversion + -Wnull-dereference + -Wdouble-promotion + -Wformat=2 + -Wduplicated-cond + -Wduplicated-branches + -Wlogical-op + -Wuseless-cast + #-Wlifetime + ) + endif() +endif() +#Warnings +#-Wall +#-Wextra # reasonable and standard +#-Wshadow # warn the user if a variable declaration shadows one from a# parent context +#-Wnon-virtual-dtor # warn the user if a class with virtual functions has a# non-virtual destructor. +#-Wold-style-cast # warn for c-style casts +#-Wcast-align # warn for potential performance problem casts +#-Wunused # warn on anything being unused +#-Woverloaded-virtual # warn if you overload (not override) a virtual func +#-Wpedantic # warn if non-standard C++ is used +#-Wconversion # warn on type conversions that may lose data +#-Wsign-conversion # warn on sign conversions +#-Wnull-dereference # warn if a null dereference is detected +#-Wdouble-promotion # warn if float is implicit promoted to double +#-Wformat=2 # warn on security issues around functions that format output# (ie printf) +#-Wduplicated-cond # warn if if / else chain has duplicated conditions +#-Wduplicated-branches # warn if if / else branches have duplicated code +#-Wlogical-op # warn about logical operations being used where bitwise were# probably wanted +#-Wuseless-cast # warn if you perform a cast to the same type +#-Wlifetime # /// \ No newline at end of file From f98f8f29f005a01b9bc6f13ca13595029744a76a Mon Sep 17 00:00:00 2001 From: Daniele Rapetti Date: Fri, 5 May 2023 16:40:00 +0200 Subject: [PATCH 20/40] working with dependencies --- src/adjmat/CMakeLists.txt | 3 +++ src/cltools/CMakeLists.txt | 5 ++++- src/config/CMakeLists.txt | 13 +++++++++++-- src/core/CMakeLists.txt | 8 ++++++-- src/lepton/CMakeLists.txt | 5 ++++- src/main/CMakeLists.txt | 5 ++++- src/molfile/CMakeLists.txt | 2 +- src/tools/CMakeLists.txt | 5 ++++- src/wrapper/CMakeLists.txt | 2 ++ 9 files changed, 39 insertions(+), 9 deletions(-) diff --git a/src/adjmat/CMakeLists.txt b/src/adjmat/CMakeLists.txt index dde9efb997..a0b1354de0 100644 --- a/src/adjmat/CMakeLists.txt +++ b/src/adjmat/CMakeLists.txt @@ -30,3 +30,6 @@ TopologyMatrix.cpp ADDMODULENEEDS(${module_name} core tools vesselbase multicolvar ) +# ADDMODULEDEPENDENCIES(${module_name} + # core multicolvar vesselbase tools +# ) \ No newline at end of file diff --git a/src/cltools/CMakeLists.txt b/src/cltools/CMakeLists.txt index cbc937b59d..26f8ca5076 100644 --- a/src/cltools/CMakeLists.txt +++ b/src/cltools/CMakeLists.txt @@ -24,6 +24,9 @@ completion.xxd ADDMODULENEEDS(${module_name} core config tools molfile xdrfile ) +ADDMODULEDEPENDENCIES(${module_name} + molfile +) #get_target_property(t ${module_name} INCLUDE_DIRECTORIES) #message("id: ${t}") @@ -52,4 +55,4 @@ add_custom_command(OUTPUT completion.xxd ) #message("scripts ${script_deps} ${PLUMED_SCRIPTS}") -#message("patches ${patches_deps} ${PLUMED_PATCHES}") +#message("patches ${patches_deps} ${PLUMED_PATCHES}") \ No newline at end of file diff --git a/src/config/CMakeLists.txt b/src/config/CMakeLists.txt index b9353b19ad..5f71302f0b 100644 --- a/src/config/CMakeLists.txt +++ b/src/config/CMakeLists.txt @@ -1,4 +1,5 @@ - +# set(module_name config) +# set(module_${module_name} ON CACHE INTERNAL "always active core module ${module_name}") #SOEXT is set in ./src set(ISINSTALLED "true") #must go to /lib/plumed @@ -17,4 +18,12 @@ set (program_name "xxxxNAxxxx") configure_file(Config.inc.in Config.inc) add_library(Config OBJECT Config.cpp) -add_library(ConfigInstall OBJECT ConfigInstall.cpp) \ No newline at end of file +add_library(ConfigInstall OBJECT ConfigInstall.cpp) +target_include_directories(Config PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) +target_include_directories(ConfigInstall PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) +function(print_target_property target_name property) + get_target_property(t ${target_name} ${property}) + message("${target_name} <${property}>: ${t}") + unset(t) +endfunction(print_target_property) +print_target_property(ConfigInstall INCLUDE_DIRECTORIES) \ No newline at end of file diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 49329476e8..824e3bf5eb 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -39,15 +39,19 @@ ADDMODULENEEDS(${module_name} config tools lepton ) +#ADDMODULEDEPENDENCIES(${module_name} +# tools #commenting this avoids circular references error +#) + #execute_process( # COMMAND bash ${PLUMED_MAKETOOLS}/makecmd_cmake map "${CMAKE_CURRENT_SOURCE_DIR}/PlumedMain.cpp" PlumedMainMap.inc # WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} #) - +target_include_directories(${module_name} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) MACRO(CREATEINC cppFile type outputFile) add_custom_command(OUTPUT ${outputFile} DEPENDS ${cppFile} - COMMAND bash ${PLUMED_MAKETOOLS}/makecmd_cmake map "${CMAKE_CURRENT_SOURCE_DIR}/${cppFile}" ${outputFile} + COMMAND bash ${PLUMED_MAKETOOLS}/makecmd_cmake ${type} "${CMAKE_CURRENT_SOURCE_DIR}/${cppFile}" ${outputFile} COMMENT "Generating ${outputFile}" WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) diff --git a/src/lepton/CMakeLists.txt b/src/lepton/CMakeLists.txt index 7898bd1443..3374789860 100644 --- a/src/lepton/CMakeLists.txt +++ b/src/lepton/CMakeLists.txt @@ -12,5 +12,8 @@ ParsedExpression.cpp Parser.cpp ) ADDMODULENEEDS(${module_name} -asmjit + asmjit +) +ADDMODULEDEPENDENCIES(${module_name} + asmjit ) diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt index 4a8a681084..718a615747 100644 --- a/src/main/CMakeLists.txt +++ b/src/main/CMakeLists.txt @@ -1,5 +1,8 @@ +# set(module_name main) +# set(module_${module_name} ON CACHE INTERNAL "always active core module ${module_name}") add_executable(plumed_bin main.cpp) target_link_libraries(plumed_bin libplumedKernel libplumed) set_target_properties(plumed_bin PROPERTIES RUNTIME_OUTPUT_NAME ${program_name} - ) \ No newline at end of file + ) +target_include_directories(plumed_bin PRIVATE ${PLUMED_SRC}) diff --git a/src/molfile/CMakeLists.txt b/src/molfile/CMakeLists.txt index 00e4e2fd88..b81b986a32 100644 --- a/src/molfile/CMakeLists.txt +++ b/src/molfile/CMakeLists.txt @@ -24,4 +24,4 @@ foreach(sourcefile ${MY_PROJECT_SOURCES}) endforeach(sourcefile in ${MY_PROJECT_SOURCES}) #this should propagate the compile definition to the main -target_compile_definitions(${module_name} PUBLIC __PLUMED_HAS_MOLFILE_PLUGINS) \ No newline at end of file +target_compile_definitions(${module_name} INTERFACE __PLUMED_HAS_MOLFILE_PLUGINS) \ No newline at end of file diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt index 9f3a00d1d6..173bc6f98d 100644 --- a/src/tools/CMakeLists.txt +++ b/src/tools/CMakeLists.txt @@ -54,5 +54,8 @@ Units.cpp Vector.cpp ) ADDMODULENEEDS(${module_name} -core lapack lepton + core lapack lepton ) +ADDMODULEDEPENDENCIES(${module_name} + core lapack lepton +) \ No newline at end of file diff --git a/src/wrapper/CMakeLists.txt b/src/wrapper/CMakeLists.txt index 29556c7c37..44b1c9bec7 100644 --- a/src/wrapper/CMakeLists.txt +++ b/src/wrapper/CMakeLists.txt @@ -1,3 +1,5 @@ +# set(module_name wrapper) +# set(module_${module_name} ON CACHE INTERNAL "always active core module ${module_name}") add_library(PlumedStaticWrapper OBJECT PlumedStatic.cpp) add_library(PlumedWrapper OBJECT Plumed.c) From 23e754fd48b355c049ed01659d59c8e22e11d0e3 Mon Sep 17 00:00:00 2001 From: Daniele Rapetti Date: Fri, 5 May 2023 16:52:30 +0200 Subject: [PATCH 21/40] better way to define fPIC --- src/CMakeLists.txt | 2 +- src/config/CMakeLists.txt | 5 +++-- src/main/CMakeLists.txt | 5 +++-- src/wrapper/CMakeLists.txt | 5 +++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c8740180d5..eeebdd6323 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -26,7 +26,7 @@ set(modulesDependencies "") #Setting up global options ################################################################################ -add_compile_options(-fPIC) +set(CMAKE_POSITION_INDEPENDENT_CODE ON) ################################################################################ #Macro definitions diff --git a/src/config/CMakeLists.txt b/src/config/CMakeLists.txt index 5f71302f0b..175fabdb44 100644 --- a/src/config/CMakeLists.txt +++ b/src/config/CMakeLists.txt @@ -1,5 +1,6 @@ -# set(module_name config) -# set(module_${module_name} ON CACHE INTERNAL "always active core module ${module_name}") +set(module_name config) +#this is not a module, this is set up to make easier the dependency interface +set(module_${module_name} ON CACHE INTERNAL "always active core module ${module_name}") #SOEXT is set in ./src set(ISINSTALLED "true") #must go to /lib/plumed diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt index 718a615747..480fdcb949 100644 --- a/src/main/CMakeLists.txt +++ b/src/main/CMakeLists.txt @@ -1,5 +1,6 @@ -# set(module_name main) -# set(module_${module_name} ON CACHE INTERNAL "always active core module ${module_name}") +set(module_name main) +#this is not a module, this is set up to make easier the dependency interface +set(module_${module_name} ON CACHE INTERNAL "always active core module ${module_name}") add_executable(plumed_bin main.cpp) target_link_libraries(plumed_bin libplumedKernel libplumed) set_target_properties(plumed_bin diff --git a/src/wrapper/CMakeLists.txt b/src/wrapper/CMakeLists.txt index 44b1c9bec7..61438a985a 100644 --- a/src/wrapper/CMakeLists.txt +++ b/src/wrapper/CMakeLists.txt @@ -1,5 +1,6 @@ -# set(module_name wrapper) -# set(module_${module_name} ON CACHE INTERNAL "always active core module ${module_name}") +set(module_name wrapper) +#this is not a module, this is set up to make easier the dependency interface +set(module_${module_name} ON CACHE INTERNAL "always active core module ${module_name}") add_library(PlumedStaticWrapper OBJECT PlumedStatic.cpp) add_library(PlumedWrapper OBJECT Plumed.c) From 805743889cea7c4e0fc14066458a003fef98d661 Mon Sep 17 00:00:00 2001 From: Daniele Rapetti Date: Fri, 5 May 2023 17:57:55 +0200 Subject: [PATCH 22/40] on the way of the compilation --- CMakeLists.txt | 13 +++++++++++ src/CMakeLists.txt | 25 +++++++++++++++------ src/config/CMakeLists.txt | 22 +++++++++++++----- src/config/Makefile.conf.xxd.compiler.sh.in | 1 + src/config/version.h.in | 9 ++++++++ 5 files changed, 58 insertions(+), 12 deletions(-) create mode 100755 src/config/Makefile.conf.xxd.compiler.sh.in create mode 100644 src/config/version.h.in diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e3e6594ce..bd48a8039b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,4 +2,17 @@ cmake_minimum_required(VERSION 3.20.2) project(Plumed2 LANGUAGES CXX) +set(PLUMED_VERSION_SHORT "2.10") +set(PLUMED_VERSION_LONG "2.10.0-dev") +#set(PLUMED_VERSION_GIT "23e754fd4-dirty") +execute_process( + COMMAND git describe --long --dirty --always + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} + OUTPUT_VARIABLE PLUMED_VERSION_GIT + OUTPUT_STRIP_TRAILING_WHITESPACE +) +set(PLUMED_VERSION_MAJOR 2) +set(PLUMED_VERSION_MINOR 10) +set(PLUMED_VERSION_PATCH 0) + add_subdirectory(src) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index eeebdd6323..18fa8bde95 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -119,9 +119,11 @@ foreach(dir ${mayBeExternal}) if (${externalLib}_FOUND) set(module_${dir} OFF CACHE BOOL "activate module ${dir}" FORCE) + add_library(${dir} INTERFACE) + #add_library(${dir} ALIAS ${externalLib}:${externalLib}) #target_compile_options(${PROJECT_NAME} PRIVATE ${BLAS_LINKER_FLAGS}) - #target_link_libraries(${PROJECT_NAME} ${BLAS_LIBRARIES}) + target_link_libraries(${dir} INTERFACE ${externalLib}::${externalLib}) else() add_subdirectory(${dir}) set(${externalLib}_FOUND OFF) @@ -274,23 +276,32 @@ endforeach(activeModule ${modulesDependencies}) #building the shared libraries with the collected modules add_library(libplumedKernel SHARED ${KernelTargets}) set_target_properties(libplumedKernel - PROPERTIES LIBRARY_OUTPUT_NAME ${program_name}Kernel.${SOEXT} + PROPERTIES + LIBRARY_OUTPUT_NAME ${program_name}Kernel + SUFFIX .${SOEXT} ) + add_library(libplumed SHARED $) set_target_properties(libplumed - PROPERTIES LIBRARY_OUTPUT_NAME ${program_name}.${SOEXT} + PROPERTIES + LIBRARY_OUTPUT_NAME ${program_name} + SUFFIX .${SOEXT} ) target_link_libraries(libplumed - PlumedWrapper + PlumedWrapper + ConfigInstall ) add_library(libplumedWrapper STATIC $) set_target_properties(libplumedWrapper - PROPERTIES LIBRARY_OUTPUT_NAME ${program_name}Wrapper.${SOEXT} + PROPERTIES + LIBRARY_OUTPUT_NAME ${program_name}Wrapper + ARCHIVE_OUTPUT_NAME ${program_name}Wrapper ) - target_link_libraries(libplumedWrapper - PlumedWrapper +target_link_libraries(libplumedWrapper + PlumedWrapper + ConfigInstall ) function(print_target_property target_name property) diff --git a/src/config/CMakeLists.txt b/src/config/CMakeLists.txt index 175fabdb44..a1d84f1e74 100644 --- a/src/config/CMakeLists.txt +++ b/src/config/CMakeLists.txt @@ -18,13 +18,25 @@ set (includedir "xxxxNAxxxx") set (program_name "xxxxNAxxxx") configure_file(Config.inc.in Config.inc) -add_library(Config OBJECT Config.cpp) -add_library(ConfigInstall OBJECT ConfigInstall.cpp) -target_include_directories(Config PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) -target_include_directories(ConfigInstall PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) +#TODO: verify if the version number are not set +configure_file(version.h.in version.h) + +add_library(Config OBJECT Config.cpp Makefile.conf.xxd) +add_library(ConfigInstall OBJECT ConfigInstall.cpp Makefile.conf.xxd) +target_include_directories(Config PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories(ConfigInstall PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) + +configure_file(Makefile.conf.xxd.compiler.sh.in Makefile.conf.xxd.compiler.sh @ONLY) +configure_file(${PLUMED_MAIN_DIR}/Makefile.conf.in Makefile.cmakeMocked.conf @ONLY) +add_custom_command(OUTPUT Makefile.conf.xxd + DEPENDS ${PLUMED_MAIN_DIR}/Makefile.conf.in + COMMAND bash Makefile.conf.xxd.compiler.sh + COMMENT "Generationc completion.xxd" + #WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} +) function(print_target_property target_name property) get_target_property(t ${target_name} ${property}) message("${target_name} <${property}>: ${t}") unset(t) endfunction(print_target_property) -print_target_property(ConfigInstall INCLUDE_DIRECTORIES) \ No newline at end of file +print_target_property(ConfigInstall INCLUDE_DIRECTORIES) diff --git a/src/config/Makefile.conf.xxd.compiler.sh.in b/src/config/Makefile.conf.xxd.compiler.sh.in new file mode 100755 index 0000000000..f2a0601aaf --- /dev/null +++ b/src/config/Makefile.conf.xxd.compiler.sh.in @@ -0,0 +1 @@ +cat @CMAKE_CURRENT_BINARY_DIR@/Makefile.cmakeMocked.conf | @PLUMED_MAKETOOLS@/xxd > Makefile.conf.xxd \ No newline at end of file diff --git a/src/config/version.h.in b/src/config/version.h.in new file mode 100644 index 0000000000..1608633a92 --- /dev/null +++ b/src/config/version.h.in @@ -0,0 +1,9 @@ +#ifndef __PLUMED_config_version_h +#define __PLUMED_config_version_h +#define PLUMED_VERSION_SHORT "@PLUMED_VERSION_SHORT@" +#define PLUMED_VERSION_LONG "@PLUMED_VERSION_LONG@" +#define PLUMED_VERSION_GIT "@PLUMED_VERSION_GIT@" +#define PLUMED_VERSION_MAJOR @PLUMED_VERSION_MAJOR@ +#define PLUMED_VERSION_MINOR @PLUMED_VERSION_MINOR@ +#define PLUMED_VERSION_PATCH @PLUMED_VERSION_PATCH@ +#endif From b0c25d2c9b3c49f44430c022340d0da91e95494b Mon Sep 17 00:00:00 2001 From: Daniele Rapetti Date: Mon, 8 May 2023 10:27:56 +0200 Subject: [PATCH 23/40] set up blas and lapack --- src/CMakeLists.txt | 47 +++++++++++++-------------------------- src/blas/CMakeLists.txt | 20 +++++++++++++++++ src/lapack/CMakeLists.txt | 23 ++++++++++++++++--- 3 files changed, 55 insertions(+), 35 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 18fa8bde95..31dbb2fb23 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.20.2) -project(Plumed2 LANGUAGES C CXX) +project(Plumed2 LANGUAGES C CXX Fortran) set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE) set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS None Debug Release RelWithDebInfo MinSizeRel) @@ -20,7 +20,7 @@ option(useExternal_BLAS "enable search for external BLAS, default ON" ON) option(useExternal_LAPACK "enable search for external LAPACK, default ON" ON) option(useExternal_MOLFILE "enable search for external LAPACK, default OFF" OFF) -set(modulesDependencies "") +set(modulesForKernel "") ################################################################################ #Setting up global options @@ -52,8 +52,8 @@ MACRO(ADDMODULETOKERNEL module_name) add_library(${module_name} OBJECT ${OTHERARGS} ) target_include_directories(${module_name} PRIVATE ${PLUMED_SRC}) - list(APPEND modulesDependencies ${module_name}) - set(modulesDependencies ${modulesDependencies} PARENT_SCOPE) + list(APPEND modulesForKernel ${module_name}) + set(modulesForKernel ${modulesForKernel} PARENT_SCOPE) endif(${module_${module_name}}) ENDMACRO(ADDMODULETOKERNEL) @@ -97,6 +97,13 @@ foreach(dir ${execDirs}) add_subdirectory(${dir}) endforeach(dir ${execDirs}) +message("Checking if it is possible to find external alternatives for modules:") +#needed for FindMOLFILE +set (CMAKE_MODULE_PATH ${PLUMED_SRC}/cmake) +foreach(dir ${mayBeExternal}) + add_subdirectory(${dir}) +endforeach(dir ${mayBeExternal}) + foreach(dir ${dirs}) add_subdirectory(${dir}) endforeach(dir ${dirs}) @@ -107,30 +114,6 @@ if(all_modules) endforeach(dir ${dirs}) endif() -message("Checking if it is possible to find external alternatives for modules:") -#needed for FindMOLFILE -set (CMAKE_MODULE_PATH ${PLUMED_SRC}/cmake) -foreach(dir ${mayBeExternal}) - #todo port the maybe external to the single modules - string(TOUPPER ${dir} externalLib) - if (useExternal_${externalLib}) - find_package(${externalLib}) - endif (useExternal_${externalLib}) - - if (${externalLib}_FOUND) - set(module_${dir} OFF CACHE BOOL "activate module ${dir}" FORCE) - add_library(${dir} INTERFACE) - - #add_library(${dir} ALIAS ${externalLib}:${externalLib}) - #target_compile_options(${PROJECT_NAME} PRIVATE ${BLAS_LINKER_FLAGS}) - target_link_libraries(${dir} INTERFACE ${externalLib}::${externalLib}) - else() - add_subdirectory(${dir}) - set(${externalLib}_FOUND OFF) - endif (${externalLib}_FOUND) - message(" ${dir} internal: ${module_${dir}}") -endforeach(dir ${mayBeExternal}) - #options ## options are already done ## --bindir=DIR user executables [EPREFIX/bin] ## --sbindir=DIR system admin executables [EPREFIX/sbin] @@ -236,7 +219,7 @@ endforeach(dir ${mayBeExternal}) #endforeach(dir ${dirs} ${execDirs} ${mayBeExternal}) #check module dependencies -foreach(dir ${dirs}) +foreach(dir ${dirs} ${mayBeExternal}) if(${module_${dir}}) set(notFound "") #message("${dir} ${moduleNeeds_${dir}}") @@ -266,13 +249,13 @@ endif(${modulesDependenciesProblems}) #Setting up the main libraries ################################################################################ -#these targets build the two libPlumedKernel.so set(KernelTargets "") -foreach(activeModule ${modulesDependencies}) +foreach(activeModule ${modulesForKernel}) list(APPEND KernelTargets $) -endforeach(activeModule ${modulesDependencies}) +endforeach(activeModule ${modulesForKernel}) +#these targets build the two libPlumedKernel.so #building the shared libraries with the collected modules add_library(libplumedKernel SHARED ${KernelTargets}) set_target_properties(libplumedKernel diff --git a/src/blas/CMakeLists.txt b/src/blas/CMakeLists.txt index 560eb18461..d148c59fd9 100644 --- a/src/blas/CMakeLists.txt +++ b/src/blas/CMakeLists.txt @@ -9,3 +9,23 @@ blas.cpp ADDMODULENEEDS(${module_name} ) + +#include(FortranCInterface) + +string(TOUPPER ${module_name} externalLib) +if (useExternal_${externalLib}) + find_package(${externalLib}) +endif (useExternal_${externalLib}) + +if (${externalLib}_FOUND) + target_compile_definitions(${module_name} PUBLIC __PLUMED_HAS_EXTERNAL_BLAS=1) + #activate/deactivate +# (underscore) search_for=dsyevr_ ;; +# (nounderscore) search_for=dsyevr ;; + target_compile_definitions(${module_name} PUBLIC F77_NO_UNDERSCORE) + target_compile_options(${module_name} PRIVATE ${BLAS_LINKER_FLAGS}) + target_link_libraries(${module_name} PUBLIC ${BLAS_LIBRARIES}) #${externalLib}::${externalLib}) +else() + set(${externalLib}_FOUND OFF) +endif (${externalLib}_FOUND) +set (${externalLib}_FOUND ${externalLib}_FOUND PARENT_SCOPE) \ No newline at end of file diff --git a/src/lapack/CMakeLists.txt b/src/lapack/CMakeLists.txt index c2f4370178..375c32497d 100644 --- a/src/lapack/CMakeLists.txt +++ b/src/lapack/CMakeLists.txt @@ -1,11 +1,28 @@ -#automatically generated CMakeLists.txt, may not work! #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "lapack") #Note that the macros here require this directory added as a subdir of plumed/src set(module_${module_name} ON CACHE INTERNAL "always active module ${module_name}") ADDMODULETOKERNEL(${module_name} -lapack.cpp + lapack.cpp ) ADDMODULENEEDS(${module_name} -blas + blas ) + +ADDMODULEDEPENDENCIES(${module_name} + blas +) + +string(TOUPPER ${module_name} externalLib) +if (useExternal_${externalLib} AND ${BLAS_FOUND}) + find_package(${externalLib}) +endif (useExternal_${externalLib} AND ${BLAS_FOUND}) + +if (${externalLib}_FOUND) + target_compile_definitions(${module_name} PUBLIC __PLUMED_HAS_EXTERNAL_LAPACK=1) + target_compile_options(${module_name} PRIVATE ${BLAS_LINKER_FLAGS}) + target_link_libraries(${module_name} INTERFACE ${externalLib}::${externalLib}) +else() + set(${externalLib}_FOUND OFF) +endif (${externalLib}_FOUND) +set (${externalLib}_FOUND ${externalLib}_FOUND PARENT_SCOPE) \ No newline at end of file From 0aad3868f8388f95f503c556d2921024ea2824a9 Mon Sep 17 00:00:00 2001 From: Daniele Rapetti Date: Mon, 8 May 2023 10:37:20 +0200 Subject: [PATCH 24/40] added dependencies to the modules --- src/adjmat/CMakeLists.txt | 8 ++++---- src/analysis/CMakeLists.txt | 5 ++++- src/annfunc/CMakeLists.txt | 5 ++++- src/asmjit/CMakeLists.txt | 5 ++++- src/bias/CMakeLists.txt | 5 ++++- src/blas/CMakeLists.txt | 1 - src/cltools/CMakeLists.txt | 2 +- src/colvar/CMakeLists.txt | 5 ++++- src/core/CMakeLists.txt | 2 +- src/crystallization/CMakeLists.txt | 5 ++++- src/dimred/CMakeLists.txt | 5 ++++- src/drr/CMakeLists.txt | 5 ++++- src/eds/CMakeLists.txt | 5 ++++- src/fisst/CMakeLists.txt | 5 ++++- src/function/CMakeLists.txt | 5 ++++- src/funnel/CMakeLists.txt | 5 ++++- src/generic/CMakeLists.txt | 5 ++++- src/gridtools/CMakeLists.txt | 5 ++++- src/isdb/CMakeLists.txt | 5 ++++- src/lapack/CMakeLists.txt | 2 +- src/lepton/CMakeLists.txt | 4 ++-- src/logmfd/CMakeLists.txt | 5 ++++- src/manyrestraints/CMakeLists.txt | 5 ++++- src/mapping/CMakeLists.txt | 5 ++++- src/maze/CMakeLists.txt | 5 ++++- src/membranefusion/CMakeLists.txt | 5 ++++- src/multicolvar/CMakeLists.txt | 5 ++++- src/opes/CMakeLists.txt | 5 ++++- src/pamm/CMakeLists.txt | 5 ++++- src/piv/CMakeLists.txt | 5 ++++- src/pytorch/CMakeLists.txt | 5 ++++- src/reference/CMakeLists.txt | 5 ++++- src/s2cm/CMakeLists.txt | 5 ++++- src/sasa/CMakeLists.txt | 5 ++++- src/secondarystructure/CMakeLists.txt | 5 ++++- src/setup/CMakeLists.txt | 5 ++++- src/tools/CMakeLists.txt | 6 +++--- src/vatom/CMakeLists.txt | 5 ++++- src/ves/CMakeLists.txt | 5 ++++- src/vesselbase/CMakeLists.txt | 5 ++++- 40 files changed, 144 insertions(+), 46 deletions(-) diff --git a/src/adjmat/CMakeLists.txt b/src/adjmat/CMakeLists.txt index a0b1354de0..a5100bbf97 100644 --- a/src/adjmat/CMakeLists.txt +++ b/src/adjmat/CMakeLists.txt @@ -28,8 +28,8 @@ Sprint.cpp TopologyMatrix.cpp ) ADDMODULENEEDS(${module_name} -core tools vesselbase multicolvar + core tools vesselbase multicolvar +) +ADDMODULEDEPENDENCIES(${module_name} + core tools vesselbase multicolvar ) -# ADDMODULEDEPENDENCIES(${module_name} - # core multicolvar vesselbase tools -# ) \ No newline at end of file diff --git a/src/analysis/CMakeLists.txt b/src/analysis/CMakeLists.txt index 7db6c3c823..db5432a6ac 100644 --- a/src/analysis/CMakeLists.txt +++ b/src/analysis/CMakeLists.txt @@ -26,5 +26,8 @@ WhamHistogram.cpp WhamWeights.cpp ) ADDMODULENEEDS(${module_name} -core tools reference vesselbase gridtools multicolvar bias + core tools reference vesselbase gridtools multicolvar bias +) +ADDMODULEDEPENDENCIES(${module_name} + core tools reference vesselbase gridtools multicolvar bias ) diff --git a/src/annfunc/CMakeLists.txt b/src/annfunc/CMakeLists.txt index f2269d0e22..59afbdce88 100644 --- a/src/annfunc/CMakeLists.txt +++ b/src/annfunc/CMakeLists.txt @@ -7,5 +7,8 @@ ADDMODULETOKERNEL(${module_name} ANN.cpp ) ADDMODULENEEDS(${module_name} -core function + core function +) +ADDMODULEDEPENDENCIES(${module_name} + core function ) diff --git a/src/asmjit/CMakeLists.txt b/src/asmjit/CMakeLists.txt index 2080ba3f65..cd7992e303 100644 --- a/src/asmjit/CMakeLists.txt +++ b/src/asmjit/CMakeLists.txt @@ -36,5 +36,8 @@ x86regalloc.cpp zone.cpp ) ADDMODULENEEDS(${module_name} - + +) +ADDMODULEDEPENDENCIES(${module_name} + ) diff --git a/src/bias/CMakeLists.txt b/src/bias/CMakeLists.txt index 9398e32cdb..6c092a19c6 100644 --- a/src/bias/CMakeLists.txt +++ b/src/bias/CMakeLists.txt @@ -23,5 +23,8 @@ ReweightWham.cpp UWalls.cpp ) ADDMODULENEEDS(${module_name} -core tools + core tools +) +ADDMODULEDEPENDENCIES(${module_name} + core tools ) diff --git a/src/blas/CMakeLists.txt b/src/blas/CMakeLists.txt index d148c59fd9..39ea16f8e5 100644 --- a/src/blas/CMakeLists.txt +++ b/src/blas/CMakeLists.txt @@ -1,4 +1,3 @@ -#automatically generated CMakeLists.txt, may not work! #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "blas") #Note that the macros here require this directory added as a subdir of plumed/src diff --git a/src/cltools/CMakeLists.txt b/src/cltools/CMakeLists.txt index 26f8ca5076..4a9e515326 100644 --- a/src/cltools/CMakeLists.txt +++ b/src/cltools/CMakeLists.txt @@ -24,7 +24,7 @@ completion.xxd ADDMODULENEEDS(${module_name} core config tools molfile xdrfile ) -ADDMODULEDEPENDENCIES(${module_name} +ADDMODULENEEDS(${module_name} molfile ) diff --git a/src/colvar/CMakeLists.txt b/src/colvar/CMakeLists.txt index 0d6dc36881..0c6fcb6d5e 100644 --- a/src/colvar/CMakeLists.txt +++ b/src/colvar/CMakeLists.txt @@ -37,5 +37,8 @@ Torsion.cpp Volume.cpp ) ADDMODULENEEDS(${module_name} -core reference tools + core reference tools +) +ADDMODULEDEPENDENCIES(${module_name} + core reference tools ) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 824e3bf5eb..5e7af6dbbd 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -39,7 +39,7 @@ ADDMODULENEEDS(${module_name} config tools lepton ) -#ADDMODULEDEPENDENCIES(${module_name} +#ADDMODULENEEDS(${module_name} # tools #commenting this avoids circular references error #) diff --git a/src/crystallization/CMakeLists.txt b/src/crystallization/CMakeLists.txt index d9722a50e2..e4af34fa43 100644 --- a/src/crystallization/CMakeLists.txt +++ b/src/crystallization/CMakeLists.txt @@ -28,5 +28,8 @@ VectorMultiColvar.cpp VectorSum.cpp ) ADDMODULENEEDS(${module_name} -core tools vesselbase multicolvar + core tools vesselbase multicolvar +) +ADDMODULEDEPENDENCIES(${module_name} + core tools vesselbase multicolvar ) diff --git a/src/dimred/CMakeLists.txt b/src/dimred/CMakeLists.txt index 06e0af1dc4..26b628bcbf 100644 --- a/src/dimred/CMakeLists.txt +++ b/src/dimred/CMakeLists.txt @@ -19,5 +19,8 @@ SMACOF.cpp SmacoffMDS.cpp ) ADDMODULENEEDS(${module_name} -core tools reference gridtools analysis + core tools reference gridtools analysis +) +ADDMODULEDEPENDENCIES(${module_name} + core tools reference gridtools analysis ) diff --git a/src/drr/CMakeLists.txt b/src/drr/CMakeLists.txt index cd3a618070..dfeb815a65 100644 --- a/src/drr/CMakeLists.txt +++ b/src/drr/CMakeLists.txt @@ -10,5 +10,8 @@ drrtool.cpp DynamicReferenceRestraining.cpp ) ADDMODULENEEDS(${module_name} -core tools bias cltools config + core tools bias cltools config +) +ADDMODULEDEPENDENCIES(${module_name} + core tools bias cltools config ) diff --git a/src/eds/CMakeLists.txt b/src/eds/CMakeLists.txt index 535827896b..99155abb95 100644 --- a/src/eds/CMakeLists.txt +++ b/src/eds/CMakeLists.txt @@ -7,5 +7,8 @@ ADDMODULETOKERNEL(${module_name} EDS.cpp ) ADDMODULENEEDS(${module_name} -core tools bias + core tools bias +) +ADDMODULEDEPENDENCIES(${module_name} + core tools bias ) diff --git a/src/fisst/CMakeLists.txt b/src/fisst/CMakeLists.txt index 5921f94ad9..7880c26ae3 100644 --- a/src/fisst/CMakeLists.txt +++ b/src/fisst/CMakeLists.txt @@ -8,5 +8,8 @@ FISST.cpp legendre_rule_fast.cpp ) ADDMODULENEEDS(${module_name} -core tools bias + core tools bias +) +ADDMODULEDEPENDENCIES(${module_name} + core tools bias ) diff --git a/src/function/CMakeLists.txt b/src/function/CMakeLists.txt index 9bd332427a..6fc6a2312b 100644 --- a/src/function/CMakeLists.txt +++ b/src/function/CMakeLists.txt @@ -18,5 +18,8 @@ Stats.cpp Target.cpp ) ADDMODULENEEDS(${module_name} -core reference tools lepton + core reference tools lepton +) +ADDMODULEDEPENDENCIES(${module_name} + core reference tools lepton ) diff --git a/src/funnel/CMakeLists.txt b/src/funnel/CMakeLists.txt index b96636a62f..c3692903eb 100644 --- a/src/funnel/CMakeLists.txt +++ b/src/funnel/CMakeLists.txt @@ -8,5 +8,8 @@ FPS.cpp Funnel.cpp ) ADDMODULENEEDS(${module_name} -core tools colvar bias + core tools colvar bias +) +ADDMODULEDEPENDENCIES(${module_name} + core tools colvar bias ) diff --git a/src/generic/CMakeLists.txt b/src/generic/CMakeLists.txt index 86647c2905..8b8a2dce9a 100644 --- a/src/generic/CMakeLists.txt +++ b/src/generic/CMakeLists.txt @@ -28,5 +28,8 @@ WholeMolecules.cpp WrapAround.cpp ) ADDMODULENEEDS(${module_name} -core tools xdrfile + core tools xdrfile +) +ADDMODULEDEPENDENCIES(${module_name} + core tools xdrfile ) diff --git a/src/gridtools/CMakeLists.txt b/src/gridtools/CMakeLists.txt index 9b531bb6ef..8c604f8d7f 100644 --- a/src/gridtools/CMakeLists.txt +++ b/src/gridtools/CMakeLists.txt @@ -25,5 +25,8 @@ IntegrateGrid.cpp InterpolateGrid.cpp ) ADDMODULENEEDS(${module_name} -core tools vesselbase + core tools vesselbase +) +ADDMODULEDEPENDENCIES(${module_name} + core tools vesselbase ) diff --git a/src/isdb/CMakeLists.txt b/src/isdb/CMakeLists.txt index ae50b1ff87..cb90f78d5f 100644 --- a/src/isdb/CMakeLists.txt +++ b/src/isdb/CMakeLists.txt @@ -20,5 +20,8 @@ Select.cpp Selector.cpp ) ADDMODULENEEDS(${module_name} -bias colvar core reference tools function + bias colvar core reference tools function +) +ADDMODULEDEPENDENCIES(${module_name} + bias colvar core reference tools function ) diff --git a/src/lapack/CMakeLists.txt b/src/lapack/CMakeLists.txt index 375c32497d..cd2bf938ca 100644 --- a/src/lapack/CMakeLists.txt +++ b/src/lapack/CMakeLists.txt @@ -9,7 +9,7 @@ ADDMODULENEEDS(${module_name} blas ) -ADDMODULEDEPENDENCIES(${module_name} +ADDMODULENEEDS(${module_name} blas ) diff --git a/src/lepton/CMakeLists.txt b/src/lepton/CMakeLists.txt index 3374789860..5ac59e77d8 100644 --- a/src/lepton/CMakeLists.txt +++ b/src/lepton/CMakeLists.txt @@ -12,8 +12,8 @@ ParsedExpression.cpp Parser.cpp ) ADDMODULENEEDS(${module_name} - asmjit + asmjit ) ADDMODULEDEPENDENCIES(${module_name} - asmjit + asmjit ) diff --git a/src/logmfd/CMakeLists.txt b/src/logmfd/CMakeLists.txt index aca9dcb7e5..d59cddadb8 100644 --- a/src/logmfd/CMakeLists.txt +++ b/src/logmfd/CMakeLists.txt @@ -7,5 +7,8 @@ ADDMODULETOKERNEL(${module_name} LogMFD.cpp ) ADDMODULENEEDS(${module_name} -core tools bias + core tools bias +) +ADDMODULEDEPENDENCIES(${module_name} + core tools bias ) diff --git a/src/manyrestraints/CMakeLists.txt b/src/manyrestraints/CMakeLists.txt index 660b3fcbc8..649438716e 100644 --- a/src/manyrestraints/CMakeLists.txt +++ b/src/manyrestraints/CMakeLists.txt @@ -9,5 +9,8 @@ ManyRestraintsBase.cpp UWalls.cpp ) ADDMODULENEEDS(${module_name} -core tools vesselbase + core tools vesselbase +) +ADDMODULEDEPENDENCIES(${module_name} + core tools vesselbase ) diff --git a/src/mapping/CMakeLists.txt b/src/mapping/CMakeLists.txt index 9612f1880e..a83073aba8 100644 --- a/src/mapping/CMakeLists.txt +++ b/src/mapping/CMakeLists.txt @@ -17,5 +17,8 @@ TrigonometricPathVessel.cpp ZpathVessel.cpp ) ADDMODULENEEDS(${module_name} -core tools cltools reference vesselbase + core tools cltools reference vesselbase +) +ADDMODULEDEPENDENCIES(${module_name} + core tools cltools reference vesselbase ) diff --git a/src/maze/CMakeLists.txt b/src/maze/CMakeLists.txt index 921c503ff7..c8e6846c01 100644 --- a/src/maze/CMakeLists.txt +++ b/src/maze/CMakeLists.txt @@ -18,5 +18,8 @@ Steered_MD.cpp Tools.cpp ) ADDMODULENEEDS(${module_name} -core tools colvar bias + core tools colvar bias +) +ADDMODULEDEPENDENCIES(${module_name} + core tools colvar bias ) diff --git a/src/membranefusion/CMakeLists.txt b/src/membranefusion/CMakeLists.txt index aad4621322..ffc1ed5222 100644 --- a/src/membranefusion/CMakeLists.txt +++ b/src/membranefusion/CMakeLists.txt @@ -9,5 +9,8 @@ FusionPoreNucleationP.cpp MemFusionP.cpp ) ADDMODULENEEDS(${module_name} -core reference tools colvar + core reference tools colvar +) +ADDMODULEDEPENDENCIES(${module_name} + core reference tools colvar ) diff --git a/src/multicolvar/CMakeLists.txt b/src/multicolvar/CMakeLists.txt index 3067917e7e..6d90cabcdf 100644 --- a/src/multicolvar/CMakeLists.txt +++ b/src/multicolvar/CMakeLists.txt @@ -43,5 +43,8 @@ XYDistances.cpp XYTorsion.cpp ) ADDMODULENEEDS(${module_name} -core tools vesselbase gridtools + core tools vesselbase gridtools +) +ADDMODULEDEPENDENCIES(${module_name} + core tools vesselbase gridtools ) diff --git a/src/opes/CMakeLists.txt b/src/opes/CMakeLists.txt index 6d0ee479b1..c936e92bb2 100644 --- a/src/opes/CMakeLists.txt +++ b/src/opes/CMakeLists.txt @@ -15,5 +15,8 @@ OPESexpanded.cpp OPESmetad.cpp ) ADDMODULENEEDS(${module_name} -bias core tools + bias core tools +) +ADDMODULEDEPENDENCIES(${module_name} + bias core tools ) diff --git a/src/pamm/CMakeLists.txt b/src/pamm/CMakeLists.txt index ae7c6be701..ff80a3cda7 100644 --- a/src/pamm/CMakeLists.txt +++ b/src/pamm/CMakeLists.txt @@ -11,5 +11,8 @@ PAMM.cpp PammObject.cpp ) ADDMODULENEEDS(${module_name} -core tools vesselbase multicolvar adjmat + core tools vesselbase multicolvar adjmat +) +ADDMODULEDEPENDENCIES(${module_name} + core tools vesselbase multicolvar adjmat ) diff --git a/src/piv/CMakeLists.txt b/src/piv/CMakeLists.txt index 1cc333cc47..603f52ce7e 100644 --- a/src/piv/CMakeLists.txt +++ b/src/piv/CMakeLists.txt @@ -7,5 +7,8 @@ ADDMODULETOKERNEL(${module_name} PIV.cpp ) ADDMODULENEEDS(${module_name} -core tools bias colvar + core tools bias colvar +) +ADDMODULEDEPENDENCIES(${module_name} + core tools bias colvar ) diff --git a/src/pytorch/CMakeLists.txt b/src/pytorch/CMakeLists.txt index 433dde9c99..5765ba002d 100644 --- a/src/pytorch/CMakeLists.txt +++ b/src/pytorch/CMakeLists.txt @@ -7,5 +7,8 @@ ADDMODULETOKERNEL(${module_name} PytorchModel.cpp ) ADDMODULENEEDS(${module_name} -core function + core function +) +ADDMODULEDEPENDENCIES(${module_name} + core function ) diff --git a/src/reference/CMakeLists.txt b/src/reference/CMakeLists.txt index 4f832c10fe..bed9c9f420 100644 --- a/src/reference/CMakeLists.txt +++ b/src/reference/CMakeLists.txt @@ -26,5 +26,8 @@ SimpleRMSD.cpp SingleDomainRMSD.cpp ) ADDMODULENEEDS(${module_name} -core tools + core tools +) +ADDMODULEDEPENDENCIES(${module_name} + core tools ) diff --git a/src/s2cm/CMakeLists.txt b/src/s2cm/CMakeLists.txt index 36edc801c1..996e0a72c6 100644 --- a/src/s2cm/CMakeLists.txt +++ b/src/s2cm/CMakeLists.txt @@ -7,5 +7,8 @@ ADDMODULETOKERNEL(${module_name} S2ContactModel.cpp ) ADDMODULENEEDS(${module_name} -core tools colvar + core tools colvar +) +ADDMODULEDEPENDENCIES(${module_name} + core tools colvar ) diff --git a/src/sasa/CMakeLists.txt b/src/sasa/CMakeLists.txt index aa14e1aabe..dc20eaf853 100644 --- a/src/sasa/CMakeLists.txt +++ b/src/sasa/CMakeLists.txt @@ -9,5 +9,8 @@ sasa_HASEL.cpp sasa_LCPO.cpp ) ADDMODULENEEDS(${module_name} -core tools config + core tools config +) +ADDMODULEDEPENDENCIES(${module_name} + core tools config ) diff --git a/src/secondarystructure/CMakeLists.txt b/src/secondarystructure/CMakeLists.txt index 87912b4f2a..cc6086790e 100644 --- a/src/secondarystructure/CMakeLists.txt +++ b/src/secondarystructure/CMakeLists.txt @@ -10,5 +10,8 @@ ParabetaRMSD.cpp SecondaryStructureRMSD.cpp ) ADDMODULENEEDS(${module_name} -core tools reference vesselbase + core tools reference vesselbase +) +ADDMODULEDEPENDENCIES(${module_name} + core tools reference vesselbase ) diff --git a/src/setup/CMakeLists.txt b/src/setup/CMakeLists.txt index 9f3ec4c5ac..6927c9358e 100644 --- a/src/setup/CMakeLists.txt +++ b/src/setup/CMakeLists.txt @@ -9,5 +9,8 @@ Restart.cpp Units.cpp ) ADDMODULENEEDS(${module_name} -core tools + core tools +) +ADDMODULEDEPENDENCIES(${module_name} + core tools ) diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt index 173bc6f98d..cd87339c16 100644 --- a/src/tools/CMakeLists.txt +++ b/src/tools/CMakeLists.txt @@ -54,8 +54,8 @@ Units.cpp Vector.cpp ) ADDMODULENEEDS(${module_name} - core lapack lepton + core lapack lepton ) ADDMODULEDEPENDENCIES(${module_name} - core lapack lepton -) \ No newline at end of file + core lapack lepton +) diff --git a/src/vatom/CMakeLists.txt b/src/vatom/CMakeLists.txt index e3bb6f8dd1..a092e2d2a1 100644 --- a/src/vatom/CMakeLists.txt +++ b/src/vatom/CMakeLists.txt @@ -10,5 +10,8 @@ FixedAtom.cpp Ghost.cpp ) ADDMODULENEEDS(${module_name} -core tools + core tools +) +ADDMODULEDEPENDENCIES(${module_name} + core tools ) diff --git a/src/ves/CMakeLists.txt b/src/ves/CMakeLists.txt index bfc113328a..078bdc5d61 100644 --- a/src/ves/CMakeLists.txt +++ b/src/ves/CMakeLists.txt @@ -60,5 +60,8 @@ WaveletCoeffs.cpp WaveletGrid.cpp ) ADDMODULENEEDS(${module_name} -bias cltools colvar config core tools lepton + bias cltools colvar config core tools lepton +) +ADDMODULEDEPENDENCIES(${module_name} + bias cltools colvar config core tools lepton ) diff --git a/src/vesselbase/CMakeLists.txt b/src/vesselbase/CMakeLists.txt index dd7fc57ef2..4d71583a20 100644 --- a/src/vesselbase/CMakeLists.txt +++ b/src/vesselbase/CMakeLists.txt @@ -30,5 +30,8 @@ Vessel.cpp VesselRegister.cpp ) ADDMODULENEEDS(${module_name} -core tools bias analysis + core tools bias analysis +) +ADDMODULEDEPENDENCIES(${module_name} + core tools bias analysis ) From eb28dc12d9e4f696b32eeda00381409594606d3c Mon Sep 17 00:00:00 2001 From: Daniele Rapetti Date: Mon, 8 May 2023 11:13:40 +0200 Subject: [PATCH 25/40] removed circular dependencies --- src/analysis/CMakeLists.txt | 6 +++++- src/multicolvar/CMakeLists.txt | 4 ++-- src/vesselbase/CMakeLists.txt | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/analysis/CMakeLists.txt b/src/analysis/CMakeLists.txt index db5432a6ac..5da81b8b4a 100644 --- a/src/analysis/CMakeLists.txt +++ b/src/analysis/CMakeLists.txt @@ -29,5 +29,9 @@ ADDMODULENEEDS(${module_name} core tools reference vesselbase gridtools multicolvar bias ) ADDMODULEDEPENDENCIES(${module_name} - core tools reference vesselbase gridtools multicolvar bias + core tools + reference + #TODO: resolve THIS + #vesselbase gridtools multicolvar# it does actually depend on them, but it is better to avid cyclic dependencies + bias ) diff --git a/src/multicolvar/CMakeLists.txt b/src/multicolvar/CMakeLists.txt index 6d90cabcdf..05259ab85c 100644 --- a/src/multicolvar/CMakeLists.txt +++ b/src/multicolvar/CMakeLists.txt @@ -1,4 +1,3 @@ -#automatically generated CMakeLists.txt, may not work! #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "multicolvar") #Note that the macros here require this directory added as a subdir of plumed/src @@ -46,5 +45,6 @@ ADDMODULENEEDS(${module_name} core tools vesselbase gridtools ) ADDMODULEDEPENDENCIES(${module_name} - core tools vesselbase gridtools + #core tools # non need: becaue a dependency depends on them + vesselbase gridtools ) diff --git a/src/vesselbase/CMakeLists.txt b/src/vesselbase/CMakeLists.txt index 4d71583a20..6522fe7664 100644 --- a/src/vesselbase/CMakeLists.txt +++ b/src/vesselbase/CMakeLists.txt @@ -1,4 +1,3 @@ -#automatically generated CMakeLists.txt, may not work! #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "vesselbase") #Note that the macros here require this directory added as a subdir of plumed/src @@ -33,5 +32,6 @@ ADDMODULENEEDS(${module_name} core tools bias analysis ) ADDMODULEDEPENDENCIES(${module_name} - core tools bias analysis + #core tools becasue analysis depends on them + bias analysis ) From d2bc2ed94cbabf2420c4ab651d50eb5deee1ebff Mon Sep 17 00:00:00 2001 From: Daniele Rapetti Date: Mon, 8 May 2023 11:39:46 +0200 Subject: [PATCH 26/40] added target interface module config to pass options --- src/config/CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/config/CMakeLists.txt b/src/config/CMakeLists.txt index a1d84f1e74..25312da620 100644 --- a/src/config/CMakeLists.txt +++ b/src/config/CMakeLists.txt @@ -21,9 +21,15 @@ configure_file(Config.inc.in Config.inc) #TODO: verify if the version number are not set configure_file(version.h.in version.h) +add_library(config INTERFACE) + +#must be set up a target interface config wotj all the definitios add_library(Config OBJECT Config.cpp Makefile.conf.xxd) -add_library(ConfigInstall OBJECT ConfigInstall.cpp Makefile.conf.xxd) +target_link_libraries(Config INTERFACE config) target_include_directories(Config PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) + +add_library(ConfigInstall OBJECT ConfigInstall.cpp Makefile.conf.xxd) +target_link_libraries(ConfigInstall INTERFACE config) target_include_directories(ConfigInstall PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) configure_file(Makefile.conf.xxd.compiler.sh.in Makefile.conf.xxd.compiler.sh @ONLY) From f1253af2475a43d64cb35cdf6fd8a3237f906f66 Mon Sep 17 00:00:00 2001 From: Daniele Rapetti Date: Mon, 8 May 2023 12:30:20 +0200 Subject: [PATCH 27/40] dienstangled the depenedency net --- src/adjmat/CMakeLists.txt | 5 ++++- src/analysis/CMakeLists.txt | 7 +++---- src/annfunc/CMakeLists.txt | 2 +- src/bias/CMakeLists.txt | 2 +- src/cltools/CMakeLists.txt | 5 ++++- src/colvar/CMakeLists.txt | 2 +- src/core/CMakeLists.txt | 3 +++ src/crystallization/CMakeLists.txt | 2 +- src/dimred/CMakeLists.txt | 3 ++- src/drr/CMakeLists.txt | 3 ++- src/eds/CMakeLists.txt | 2 +- src/fisst/CMakeLists.txt | 2 +- src/function/CMakeLists.txt | 3 ++- src/funnel/CMakeLists.txt | 3 ++- src/generic/CMakeLists.txt | 3 ++- src/gridtools/CMakeLists.txt | 2 +- src/isdb/CMakeLists.txt | 4 +++- src/lapack/CMakeLists.txt | 2 +- src/logmfd/CMakeLists.txt | 2 +- src/manyrestraints/CMakeLists.txt | 2 +- src/mapping/CMakeLists.txt | 4 +++- src/maze/CMakeLists.txt | 3 ++- src/membranefusion/CMakeLists.txt | 3 ++- src/multicolvar/CMakeLists.txt | 3 +-- src/opes/CMakeLists.txt | 2 +- src/pamm/CMakeLists.txt | 2 +- src/piv/CMakeLists.txt | 3 ++- src/pytorch/CMakeLists.txt | 2 +- src/reference/CMakeLists.txt | 2 +- src/s2cm/CMakeLists.txt | 2 +- src/sasa/CMakeLists.txt | 3 ++- src/secondarystructure/CMakeLists.txt | 3 ++- src/setup/CMakeLists.txt | 2 +- src/tools/CMakeLists.txt | 4 +++- src/vatom/CMakeLists.txt | 2 +- src/ves/CMakeLists.txt | 5 ++++- src/vesselbase/CMakeLists.txt | 3 +-- 37 files changed, 66 insertions(+), 41 deletions(-) diff --git a/src/adjmat/CMakeLists.txt b/src/adjmat/CMakeLists.txt index a5100bbf97..7722bd74c1 100644 --- a/src/adjmat/CMakeLists.txt +++ b/src/adjmat/CMakeLists.txt @@ -31,5 +31,8 @@ ADDMODULENEEDS(${module_name} core tools vesselbase multicolvar ) ADDMODULEDEPENDENCIES(${module_name} - core tools vesselbase multicolvar + #core #tools depends on + #tools #vesselbase depends on + #vesselbase # multicolvar depends on + multicolvar ) diff --git a/src/analysis/CMakeLists.txt b/src/analysis/CMakeLists.txt index 5da81b8b4a..b78a4971e5 100644 --- a/src/analysis/CMakeLists.txt +++ b/src/analysis/CMakeLists.txt @@ -29,9 +29,8 @@ ADDMODULENEEDS(${module_name} core tools reference vesselbase gridtools multicolvar bias ) ADDMODULEDEPENDENCIES(${module_name} - core tools - reference - #TODO: resolve THIS + reference #core + #TODO: resolve THIS circular dependency: #vesselbase gridtools multicolvar# it does actually depend on them, but it is better to avid cyclic dependencies - bias + bias #tools core ) diff --git a/src/annfunc/CMakeLists.txt b/src/annfunc/CMakeLists.txt index 59afbdce88..c6ef6f4667 100644 --- a/src/annfunc/CMakeLists.txt +++ b/src/annfunc/CMakeLists.txt @@ -10,5 +10,5 @@ ADDMODULENEEDS(${module_name} core function ) ADDMODULEDEPENDENCIES(${module_name} - core function + function #reference tools core lepton ) diff --git a/src/bias/CMakeLists.txt b/src/bias/CMakeLists.txt index 6c092a19c6..c376bc0063 100644 --- a/src/bias/CMakeLists.txt +++ b/src/bias/CMakeLists.txt @@ -26,5 +26,5 @@ ADDMODULENEEDS(${module_name} core tools ) ADDMODULEDEPENDENCIES(${module_name} - core tools + tools #core ) diff --git a/src/cltools/CMakeLists.txt b/src/cltools/CMakeLists.txt index 4a9e515326..5776d1c68d 100644 --- a/src/cltools/CMakeLists.txt +++ b/src/cltools/CMakeLists.txt @@ -24,8 +24,11 @@ completion.xxd ADDMODULENEEDS(${module_name} core config tools molfile xdrfile ) -ADDMODULENEEDS(${module_name} +ADDMODULEDEPENDENCIES(${module_name} molfile + config + tools + xdrfile ) #get_target_property(t ${module_name} INCLUDE_DIRECTORIES) diff --git a/src/colvar/CMakeLists.txt b/src/colvar/CMakeLists.txt index 0c6fcb6d5e..e37ee22f7c 100644 --- a/src/colvar/CMakeLists.txt +++ b/src/colvar/CMakeLists.txt @@ -40,5 +40,5 @@ ADDMODULENEEDS(${module_name} core reference tools ) ADDMODULEDEPENDENCIES(${module_name} - core reference tools + reference #tools core ) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 5e7af6dbbd..e36318aec0 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -40,6 +40,9 @@ config tools lepton ) #ADDMODULENEEDS(${module_name} +####################################### +# TODO SOLVE THIS################## +####################################### # tools #commenting this avoids circular references error #) diff --git a/src/crystallization/CMakeLists.txt b/src/crystallization/CMakeLists.txt index e4af34fa43..833283b25f 100644 --- a/src/crystallization/CMakeLists.txt +++ b/src/crystallization/CMakeLists.txt @@ -31,5 +31,5 @@ ADDMODULENEEDS(${module_name} core tools vesselbase multicolvar ) ADDMODULEDEPENDENCIES(${module_name} - core tools vesselbase multicolvar + multicolvar #vesselbase tools core ) diff --git a/src/dimred/CMakeLists.txt b/src/dimred/CMakeLists.txt index 26b628bcbf..f35383ced8 100644 --- a/src/dimred/CMakeLists.txt +++ b/src/dimred/CMakeLists.txt @@ -22,5 +22,6 @@ ADDMODULENEEDS(${module_name} core tools reference gridtools analysis ) ADDMODULEDEPENDENCIES(${module_name} - core tools reference gridtools analysis + tools #core + gridtools #analysis reference ) diff --git a/src/drr/CMakeLists.txt b/src/drr/CMakeLists.txt index dfeb815a65..c1f69d68a8 100644 --- a/src/drr/CMakeLists.txt +++ b/src/drr/CMakeLists.txt @@ -13,5 +13,6 @@ ADDMODULENEEDS(${module_name} core tools bias cltools config ) ADDMODULEDEPENDENCIES(${module_name} - core tools bias cltools config + bias# tools core + cltools #config ) diff --git a/src/eds/CMakeLists.txt b/src/eds/CMakeLists.txt index 99155abb95..d3ef3be3b5 100644 --- a/src/eds/CMakeLists.txt +++ b/src/eds/CMakeLists.txt @@ -10,5 +10,5 @@ ADDMODULENEEDS(${module_name} core tools bias ) ADDMODULEDEPENDENCIES(${module_name} - core tools bias + bias #tools core ) diff --git a/src/fisst/CMakeLists.txt b/src/fisst/CMakeLists.txt index 7880c26ae3..d757e8e41f 100644 --- a/src/fisst/CMakeLists.txt +++ b/src/fisst/CMakeLists.txt @@ -11,5 +11,5 @@ ADDMODULENEEDS(${module_name} core tools bias ) ADDMODULEDEPENDENCIES(${module_name} - core tools bias + bias #tools core ) diff --git a/src/function/CMakeLists.txt b/src/function/CMakeLists.txt index 6fc6a2312b..95b85de145 100644 --- a/src/function/CMakeLists.txt +++ b/src/function/CMakeLists.txt @@ -21,5 +21,6 @@ ADDMODULENEEDS(${module_name} core reference tools lepton ) ADDMODULEDEPENDENCIES(${module_name} - core reference tools lepton + reference #tools core + #tools #lepton ) diff --git a/src/funnel/CMakeLists.txt b/src/funnel/CMakeLists.txt index c3692903eb..ba83b69129 100644 --- a/src/funnel/CMakeLists.txt +++ b/src/funnel/CMakeLists.txt @@ -11,5 +11,6 @@ ADDMODULENEEDS(${module_name} core tools colvar bias ) ADDMODULEDEPENDENCIES(${module_name} - core tools colvar bias + bias #tools core + colvar#tools core ) diff --git a/src/generic/CMakeLists.txt b/src/generic/CMakeLists.txt index 8b8a2dce9a..084efcb106 100644 --- a/src/generic/CMakeLists.txt +++ b/src/generic/CMakeLists.txt @@ -31,5 +31,6 @@ ADDMODULENEEDS(${module_name} core tools xdrfile ) ADDMODULEDEPENDENCIES(${module_name} - core tools xdrfile + tools #core + xdrfile ) diff --git a/src/gridtools/CMakeLists.txt b/src/gridtools/CMakeLists.txt index 8c604f8d7f..b3e7fe52b5 100644 --- a/src/gridtools/CMakeLists.txt +++ b/src/gridtools/CMakeLists.txt @@ -28,5 +28,5 @@ ADDMODULENEEDS(${module_name} core tools vesselbase ) ADDMODULEDEPENDENCIES(${module_name} - core tools vesselbase + vesselbase #tools core ) diff --git a/src/isdb/CMakeLists.txt b/src/isdb/CMakeLists.txt index cb90f78d5f..9d189a71b7 100644 --- a/src/isdb/CMakeLists.txt +++ b/src/isdb/CMakeLists.txt @@ -23,5 +23,7 @@ ADDMODULENEEDS(${module_name} bias colvar core reference tools function ) ADDMODULEDEPENDENCIES(${module_name} - bias colvar core reference tools function + bias #tools core + colvar #reference tools + function #reference ) diff --git a/src/lapack/CMakeLists.txt b/src/lapack/CMakeLists.txt index cd2bf938ca..375c32497d 100644 --- a/src/lapack/CMakeLists.txt +++ b/src/lapack/CMakeLists.txt @@ -9,7 +9,7 @@ ADDMODULENEEDS(${module_name} blas ) -ADDMODULENEEDS(${module_name} +ADDMODULEDEPENDENCIES(${module_name} blas ) diff --git a/src/logmfd/CMakeLists.txt b/src/logmfd/CMakeLists.txt index d59cddadb8..e605042784 100644 --- a/src/logmfd/CMakeLists.txt +++ b/src/logmfd/CMakeLists.txt @@ -10,5 +10,5 @@ ADDMODULENEEDS(${module_name} core tools bias ) ADDMODULEDEPENDENCIES(${module_name} - core tools bias + bias #tools core ) diff --git a/src/manyrestraints/CMakeLists.txt b/src/manyrestraints/CMakeLists.txt index 649438716e..052a6f64c3 100644 --- a/src/manyrestraints/CMakeLists.txt +++ b/src/manyrestraints/CMakeLists.txt @@ -12,5 +12,5 @@ ADDMODULENEEDS(${module_name} core tools vesselbase ) ADDMODULEDEPENDENCIES(${module_name} - core tools vesselbase + vesselbase #bias tools core ) diff --git a/src/mapping/CMakeLists.txt b/src/mapping/CMakeLists.txt index a83073aba8..bf5c55c026 100644 --- a/src/mapping/CMakeLists.txt +++ b/src/mapping/CMakeLists.txt @@ -20,5 +20,7 @@ ADDMODULENEEDS(${module_name} core tools cltools reference vesselbase ) ADDMODULEDEPENDENCIES(${module_name} - core tools cltools reference vesselbase + cltools #tools core + reference #tools core + vesselbase #tools core ) diff --git a/src/maze/CMakeLists.txt b/src/maze/CMakeLists.txt index c8e6846c01..f06af019df 100644 --- a/src/maze/CMakeLists.txt +++ b/src/maze/CMakeLists.txt @@ -21,5 +21,6 @@ ADDMODULENEEDS(${module_name} core tools colvar bias ) ADDMODULEDEPENDENCIES(${module_name} - core tools colvar bias + colvar #tools core + bias #tools core ) diff --git a/src/membranefusion/CMakeLists.txt b/src/membranefusion/CMakeLists.txt index ffc1ed5222..c97dd738fc 100644 --- a/src/membranefusion/CMakeLists.txt +++ b/src/membranefusion/CMakeLists.txt @@ -12,5 +12,6 @@ ADDMODULENEEDS(${module_name} core reference tools colvar ) ADDMODULEDEPENDENCIES(${module_name} - core reference tools colvar + reference #tools core + colvar #tools core ) diff --git a/src/multicolvar/CMakeLists.txt b/src/multicolvar/CMakeLists.txt index 05259ab85c..b3efda7305 100644 --- a/src/multicolvar/CMakeLists.txt +++ b/src/multicolvar/CMakeLists.txt @@ -45,6 +45,5 @@ ADDMODULENEEDS(${module_name} core tools vesselbase gridtools ) ADDMODULEDEPENDENCIES(${module_name} - #core tools # non need: becaue a dependency depends on them - vesselbase gridtools + gridtools #vesselbase bias tools core ) diff --git a/src/opes/CMakeLists.txt b/src/opes/CMakeLists.txt index c936e92bb2..05ebafcf32 100644 --- a/src/opes/CMakeLists.txt +++ b/src/opes/CMakeLists.txt @@ -18,5 +18,5 @@ ADDMODULENEEDS(${module_name} bias core tools ) ADDMODULEDEPENDENCIES(${module_name} - bias core tools + bias #tools core ) diff --git a/src/pamm/CMakeLists.txt b/src/pamm/CMakeLists.txt index ff80a3cda7..c97d6d0b59 100644 --- a/src/pamm/CMakeLists.txt +++ b/src/pamm/CMakeLists.txt @@ -14,5 +14,5 @@ ADDMODULENEEDS(${module_name} core tools vesselbase multicolvar adjmat ) ADDMODULEDEPENDENCIES(${module_name} - core tools vesselbase multicolvar adjmat + adjmat #multicolvar vesselbase bias tools core ) diff --git a/src/piv/CMakeLists.txt b/src/piv/CMakeLists.txt index 603f52ce7e..799c129add 100644 --- a/src/piv/CMakeLists.txt +++ b/src/piv/CMakeLists.txt @@ -10,5 +10,6 @@ ADDMODULENEEDS(${module_name} core tools bias colvar ) ADDMODULEDEPENDENCIES(${module_name} - core tools bias colvar + colvar #tools core + bias #tools core ) diff --git a/src/pytorch/CMakeLists.txt b/src/pytorch/CMakeLists.txt index 5765ba002d..c44b63b82a 100644 --- a/src/pytorch/CMakeLists.txt +++ b/src/pytorch/CMakeLists.txt @@ -10,5 +10,5 @@ ADDMODULENEEDS(${module_name} core function ) ADDMODULEDEPENDENCIES(${module_name} - core function + function #reference tools core lepton ) diff --git a/src/reference/CMakeLists.txt b/src/reference/CMakeLists.txt index bed9c9f420..fe84b6519c 100644 --- a/src/reference/CMakeLists.txt +++ b/src/reference/CMakeLists.txt @@ -29,5 +29,5 @@ ADDMODULENEEDS(${module_name} core tools ) ADDMODULEDEPENDENCIES(${module_name} - core tools + tools #core ) diff --git a/src/s2cm/CMakeLists.txt b/src/s2cm/CMakeLists.txt index 996e0a72c6..81c8f9c8a1 100644 --- a/src/s2cm/CMakeLists.txt +++ b/src/s2cm/CMakeLists.txt @@ -10,5 +10,5 @@ ADDMODULENEEDS(${module_name} core tools colvar ) ADDMODULEDEPENDENCIES(${module_name} - core tools colvar + colvar #tools core ) diff --git a/src/sasa/CMakeLists.txt b/src/sasa/CMakeLists.txt index dc20eaf853..1311a680a2 100644 --- a/src/sasa/CMakeLists.txt +++ b/src/sasa/CMakeLists.txt @@ -12,5 +12,6 @@ ADDMODULENEEDS(${module_name} core tools config ) ADDMODULEDEPENDENCIES(${module_name} - core tools config + tools #core + config ) diff --git a/src/secondarystructure/CMakeLists.txt b/src/secondarystructure/CMakeLists.txt index cc6086790e..603dd35bd2 100644 --- a/src/secondarystructure/CMakeLists.txt +++ b/src/secondarystructure/CMakeLists.txt @@ -13,5 +13,6 @@ ADDMODULENEEDS(${module_name} core tools reference vesselbase ) ADDMODULEDEPENDENCIES(${module_name} - core tools reference vesselbase + reference#tools core + vesselbase #tools core ) diff --git a/src/setup/CMakeLists.txt b/src/setup/CMakeLists.txt index 6927c9358e..957f0b0631 100644 --- a/src/setup/CMakeLists.txt +++ b/src/setup/CMakeLists.txt @@ -12,5 +12,5 @@ ADDMODULENEEDS(${module_name} core tools ) ADDMODULEDEPENDENCIES(${module_name} - core tools + tools #core ) diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt index cd87339c16..4437f08f47 100644 --- a/src/tools/CMakeLists.txt +++ b/src/tools/CMakeLists.txt @@ -57,5 +57,7 @@ ADDMODULENEEDS(${module_name} core lapack lepton ) ADDMODULEDEPENDENCIES(${module_name} - core lapack lepton + core + lapack #blas + lepton ) diff --git a/src/vatom/CMakeLists.txt b/src/vatom/CMakeLists.txt index a092e2d2a1..1db3a16f7c 100644 --- a/src/vatom/CMakeLists.txt +++ b/src/vatom/CMakeLists.txt @@ -13,5 +13,5 @@ ADDMODULENEEDS(${module_name} core tools ) ADDMODULEDEPENDENCIES(${module_name} - core tools + tools #core ) diff --git a/src/ves/CMakeLists.txt b/src/ves/CMakeLists.txt index 078bdc5d61..fc43ecad2f 100644 --- a/src/ves/CMakeLists.txt +++ b/src/ves/CMakeLists.txt @@ -63,5 +63,8 @@ ADDMODULENEEDS(${module_name} bias cltools colvar config core tools lepton ) ADDMODULEDEPENDENCIES(${module_name} - bias cltools colvar config core tools lepton + #tools #lepton + cltools #config + colvar #tools core + bias #tools core ) diff --git a/src/vesselbase/CMakeLists.txt b/src/vesselbase/CMakeLists.txt index 6522fe7664..59a1c11cad 100644 --- a/src/vesselbase/CMakeLists.txt +++ b/src/vesselbase/CMakeLists.txt @@ -32,6 +32,5 @@ ADDMODULENEEDS(${module_name} core tools bias analysis ) ADDMODULEDEPENDENCIES(${module_name} - #core tools becasue analysis depends on them - bias analysis + analysis #bias tools core ) From 63ca38eaf5c5b6f5f1a770fab2c17395232d1972 Mon Sep 17 00:00:00 2001 From: Daniele Rapetti Date: Mon, 8 May 2023 12:39:06 +0200 Subject: [PATCH 28/40] remove some other duplicated dependencies --- src/dimred/CMakeLists.txt | 4 ++-- src/membranefusion/CMakeLists.txt | 3 +-- src/secondarystructure/CMakeLists.txt | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/dimred/CMakeLists.txt b/src/dimred/CMakeLists.txt index f35383ced8..f879c423ef 100644 --- a/src/dimred/CMakeLists.txt +++ b/src/dimred/CMakeLists.txt @@ -22,6 +22,6 @@ ADDMODULENEEDS(${module_name} core tools reference gridtools analysis ) ADDMODULEDEPENDENCIES(${module_name} - tools #core - gridtools #analysis reference + #tools #core + gridtools #analysis bias reference tools core ) diff --git a/src/membranefusion/CMakeLists.txt b/src/membranefusion/CMakeLists.txt index c97dd738fc..436f4f2e57 100644 --- a/src/membranefusion/CMakeLists.txt +++ b/src/membranefusion/CMakeLists.txt @@ -12,6 +12,5 @@ ADDMODULENEEDS(${module_name} core reference tools colvar ) ADDMODULEDEPENDENCIES(${module_name} - reference #tools core - colvar #tools core + colvar #reference tools core ) diff --git a/src/secondarystructure/CMakeLists.txt b/src/secondarystructure/CMakeLists.txt index 603dd35bd2..d66e9a1d89 100644 --- a/src/secondarystructure/CMakeLists.txt +++ b/src/secondarystructure/CMakeLists.txt @@ -13,6 +13,6 @@ ADDMODULENEEDS(${module_name} core tools reference vesselbase ) ADDMODULEDEPENDENCIES(${module_name} - reference#tools core - vesselbase #tools core + #reference#tools core + vesselbase #analisys tools core reference ) From 4ac3f5c85921d51e1782c41d86882b3586199e38 Mon Sep 17 00:00:00 2001 From: Daniele Rapetti Date: Mon, 8 May 2023 23:00:47 +0200 Subject: [PATCH 29/40] some cosmetic changes --- src/CMakeLists.txt | 39 +++++++++++++++++++++++++------------- src/blas/CMakeLists.txt | 38 ++++++++++++++++++++++++++----------- src/blas/blas.h | 14 +++++++------- src/blas/def_external.h | 2 +- src/blas/def_internal.h | 2 +- src/config/CMakeLists.txt | 8 ++------ src/lapack/CMakeLists.txt | 17 +++++++++++++---- src/molfile/CMakeLists.txt | 13 ++++++++----- 8 files changed, 85 insertions(+), 48 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 31dbb2fb23..3f44e6717b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -16,9 +16,6 @@ set (PLUMED_SCRIPTS ${PLUMED_MAIN_DIR}/scripts) set (PLUMED_PATCHES ${PLUMED_MAIN_DIR}/patches) option(all_modules "Activates all modules, if on ignores the values of module_name when compiling" OFF) -option(useExternal_BLAS "enable search for external BLAS, default ON" ON) -option(useExternal_LAPACK "enable search for external LAPACK, default ON" ON) -option(useExternal_MOLFILE "enable search for external LAPACK, default OFF" OFF) set(modulesForKernel "") @@ -67,18 +64,26 @@ MACRO(ADDMODULENEEDS module_name) ENDMACRO(ADDMODULENEEDS) MACRO(ADDMODULEDEPENDENCIES module_name) - #use: ADDMODULENEEDS(module_name listOfModules) + #use: ADDMODULEDEPENDENCIES(module_name listOfModules) #adds the module on which this depends on (for compile definitions and so on) #NB you may create circular dependencies #NB this is particularly experimental if(${module_${module_name}} ) set(OTHERARGS ${ARGV}) list(REMOVE_ITEM OTHERARGS ${module_name}) - message("${module_name} is linked with ${OTHERARGS}") - target_link_libraries(${module_name} PUBLIC ${OTHERARGS}) + foreach(lib ${OTHERARGS}) + #message("${module_name} is linked with ${lib}") + target_link_libraries(${module_name} PUBLIC ${lib}) + endforeach(lib ${OTHERARGS}) endif(${module_${module_name}}) ENDMACRO(ADDMODULEDEPENDENCIES) +function(print_target_property target_name property) + get_target_property(tempvar ${target_name} ${property}) + message("${target_name} <${property}>: ${tempvar}") + unset(tempvar) +endfunction(print_target_property) + ################################################################################ #Setting up Modules ################################################################################ @@ -264,6 +269,7 @@ set_target_properties(libplumedKernel SUFFIX .${SOEXT} ) +#target_link_libraries(libplumedKernel PUBLIC ${modulesForKernel}) add_library(libplumed SHARED $) set_target_properties(libplumed @@ -287,12 +293,6 @@ target_link_libraries(libplumedWrapper ConfigInstall ) -function(print_target_property target_name property) - get_target_property(t ${target_name} ${property}) - message("${target_name} <${property}>: ${t}") - unset(t) -endfunction(print_target_property) - #print_target_property(cltools COMPILE_DEFINITIONS) #print_target_property(molfile COMPILE_DEFINITIONS) @@ -343,4 +343,17 @@ endif() #-Wduplicated-branches # warn if if / else branches have duplicated code #-Wlogical-op # warn about logical operations being used where bitwise were# probably wanted #-Wuseless-cast # warn if you perform a cast to the same type -#-Wlifetime # /// \ No newline at end of file +#-Wlifetime # /// + +# foreach(module_name blas lapack) +# print_target_property(${module_name} COMPILE_OPTIONS) +# print_target_property(${module_name} COMPILE_DEFINITIONS) +# print_target_property(${module_name} INTERFACE_COMPILE_DEFINITIONS) +# endforeach() +################################################################################ +#One can also use -DCMAKE_EXPORT_COMPILE_COMMANDS=ON in that case, such that we +#have all the commands in the file compile_commands.json without actually +#building the sources. +#-DCMAKE_EXPORT_COMPILE_COMMANDS=ON +#thanks https://stackoverflow.com/questions/2670121/using-cmake-with-gnu-make-how-can-i-see-the-exact-commands#comment112625585_2673355 +################################################################################ diff --git a/src/blas/CMakeLists.txt b/src/blas/CMakeLists.txt index 39ea16f8e5..b4f3cfb158 100644 --- a/src/blas/CMakeLists.txt +++ b/src/blas/CMakeLists.txt @@ -1,30 +1,46 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "blas") +string(TOUPPER ${module_name} externalLib) #Note that the macros here require this directory added as a subdir of plumed/src set(module_${module_name} ON CACHE INTERNAL "always active module ${module_name}") +option(useExternal_${externalLib} "enable search for external ${externalLib}, default ON" ON) ADDMODULETOKERNEL(${module_name} blas.cpp ) -ADDMODULENEEDS(${module_name} - -) +#ADDMODULENEEDS(${module_name} +# +#) #include(FortranCInterface) - -string(TOUPPER ${module_name} externalLib) if (useExternal_${externalLib}) find_package(${externalLib}) endif (useExternal_${externalLib}) if (${externalLib}_FOUND) - target_compile_definitions(${module_name} PUBLIC __PLUMED_HAS_EXTERNAL_BLAS=1) - #activate/deactivate + target_compile_definitions(${module_name} + PUBLIC + __PLUMED_HAS_EXTERNAL_BLAS=1) +################################################################################ +#activate/deactivate # (underscore) search_for=dsyevr_ ;; # (nounderscore) search_for=dsyevr ;; - target_compile_definitions(${module_name} PUBLIC F77_NO_UNDERSCORE) - target_compile_options(${module_name} PRIVATE ${BLAS_LINKER_FLAGS}) - target_link_libraries(${module_name} PUBLIC ${BLAS_LIBRARIES}) #${externalLib}::${externalLib}) +################################################################################ +# TODO +################################################################################ + if(OFF) + target_compile_definitions(${module_name} + PUBLIC + F77_NO_UNDERSCORE) + endif() + + target_link_libraries(${module_name} + PUBLIC + ${externalLib}::${externalLib}) else() set(${externalLib}_FOUND OFF) endif (${externalLib}_FOUND) -set (${externalLib}_FOUND ${externalLib}_FOUND PARENT_SCOPE) \ No newline at end of file +set (${externalLib}_FOUND ${externalLib}_FOUND PARENT_SCOPE) + +# print_target_property(${module_name} COMPILE_OPTIONS) +# print_target_property(${module_name} COMPILE_DEFINITIONS) +# print_target_property(${module_name} INTERFACE_COMPILE_DEFINITIONS) diff --git a/src/blas/blas.h b/src/blas/blas.h index e34024129d..e7049d0e6e 100644 --- a/src/blas/blas.h +++ b/src/blas/blas.h @@ -90,7 +90,7 @@ Erik Lindahl, 2008-10-07. #ifndef __PLUMED_BLAS_RETURNS_FLOAT #define __PLUMED_BLAS_RETURNS_FLOAT float -#endif +#endif //ifndef __PLUMED_BLAS_RETURNS_FLOAT #if ! defined (__PLUMED_HAS_EXTERNAL_BLAS) #include "def_internal.h" namespace PLMD{ @@ -98,14 +98,14 @@ namespace blas{ #else namespace PLMD{ namespace blas{ -} -} +}/*PLMD*/ +}/*blas*/ #include "def_external.h" extern "C"{ -#endif +#endif //! defined (__PLUMED_HAS_EXTERNAL_BLAS) #if 0 } -#endif +#endif //0 /* Double precision versions */ double @@ -245,9 +245,9 @@ int } #if ! defined (__PLUMED_HAS_EXTERNAL_BLAS) } -#endif +#endif //! defined (__PLUMED_HAS_EXTERNAL_BLAS) /*! \endcond */ #endif /* GMX_BLAS_H */ -#endif +#endif //__PLUMED_blas_blas_h diff --git a/src/blas/def_external.h b/src/blas/def_external.h index 6031e7e6e1..5a31a6c5e1 100644 --- a/src/blas/def_external.h +++ b/src/blas/def_external.h @@ -58,4 +58,4 @@ Erik Lindahl, 2008-10-07. #define plumed_blas_strmv PLUMED_BLAS_F77_FUNC(strmv,STRMV) #define plumed_blas_strsm PLUMED_BLAS_F77_FUNC(strsm,STRSM) #define plumed_blas_isamax PLUMED_BLAS_F77_FUNC(isamax,ISAMAX) -#endif +#endif //__PLUMED_blas_def_external_h diff --git a/src/blas/def_internal.h b/src/blas/def_internal.h index 240d8a5a2a..1eeb425b25 100644 --- a/src/blas/def_internal.h +++ b/src/blas/def_internal.h @@ -94,4 +94,4 @@ Erik Lindahl, 2008-10-07. #define plumed_blas_strsm PLMD::blas::PLUMED_BLAS_F77_FUNC(strsm,STRSM) /** \ingroup internal-blas */ #define plumed_blas_isamax PLMD::blas::PLUMED_BLAS_F77_FUNC(isamax,ISAMAX) -#endif +#endif //__PLUMED_blas_def_internal_h diff --git a/src/config/CMakeLists.txt b/src/config/CMakeLists.txt index 25312da620..5eee1445b1 100644 --- a/src/config/CMakeLists.txt +++ b/src/config/CMakeLists.txt @@ -40,9 +40,5 @@ add_custom_command(OUTPUT Makefile.conf.xxd COMMENT "Generationc completion.xxd" #WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) -function(print_target_property target_name property) - get_target_property(t ${target_name} ${property}) - message("${target_name} <${property}>: ${t}") - unset(t) -endfunction(print_target_property) -print_target_property(ConfigInstall INCLUDE_DIRECTORIES) + +#print_target_property(ConfigInstall INCLUDE_DIRECTORIES) diff --git a/src/lapack/CMakeLists.txt b/src/lapack/CMakeLists.txt index 375c32497d..3b1a56fb9f 100644 --- a/src/lapack/CMakeLists.txt +++ b/src/lapack/CMakeLists.txt @@ -1,7 +1,9 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "lapack") +string(TOUPPER ${module_name} externalLib) #Note that the macros here require this directory added as a subdir of plumed/src set(module_${module_name} ON CACHE INTERNAL "always active module ${module_name}") +option(useExternal_${externalLib} "enable search for external ${externalLib}, default ON" ON) ADDMODULETOKERNEL(${module_name} lapack.cpp ) @@ -13,16 +15,23 @@ ADDMODULEDEPENDENCIES(${module_name} blas ) -string(TOUPPER ${module_name} externalLib) if (useExternal_${externalLib} AND ${BLAS_FOUND}) find_package(${externalLib}) endif (useExternal_${externalLib} AND ${BLAS_FOUND}) if (${externalLib}_FOUND) - target_compile_definitions(${module_name} PUBLIC __PLUMED_HAS_EXTERNAL_LAPACK=1) + target_compile_definitions(${module_name} + PUBLIC + __PLUMED_HAS_EXTERNAL_LAPACK=1) target_compile_options(${module_name} PRIVATE ${BLAS_LINKER_FLAGS}) - target_link_libraries(${module_name} INTERFACE ${externalLib}::${externalLib}) + target_link_libraries(${module_name} + PUBLIC + ${externalLib}::${externalLib}) else() set(${externalLib}_FOUND OFF) endif (${externalLib}_FOUND) -set (${externalLib}_FOUND ${externalLib}_FOUND PARENT_SCOPE) \ No newline at end of file +set (${externalLib}_FOUND ${externalLib}_FOUND PARENT_SCOPE) + +# print_target_property(${module_name} COMPILE_OPTIONS) +# print_target_property(${module_name} COMPILE_DEFINITIONS) +# print_target_property(${module_name} INTERFACE_COMPILE_DEFINITIONS) diff --git a/src/molfile/CMakeLists.txt b/src/molfile/CMakeLists.txt index b81b986a32..a4eafdbbbb 100644 --- a/src/molfile/CMakeLists.txt +++ b/src/molfile/CMakeLists.txt @@ -1,6 +1,8 @@ #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "molfile") +string(TOUPPER ${module_name} externalLib) #Note that the macros here require this directory added as a subdir of plumed/src +option(useExternal_${module_name} "enable search for external ${module_name}, default OFF" OFF) option(module_${module_name} "activate module ${module_name}" ON) ADDMODULETOKERNEL(${module_name} crdplugin.cpp @@ -8,18 +10,19 @@ dcdplugin.cpp gromacsplugin.cpp pdbplugin.cpp ) -ADDMODULENEEDS(${module_name} -) +#ADDMODULENEEDS(${module_name} +# +#) -#The following lines should mimik the following line +#The following lines should mimic the following line #CPPFLAGS+=-DSTATIC_PLUGIN -DVMDPLUGIN=molfile_$(patsubst %.o,%,$@) target_compile_definitions(${module_name} PRIVATE STATIC_PLUGIN) get_target_property(MY_PROJECT_SOURCES ${module_name} SOURCES) foreach(sourcefile ${MY_PROJECT_SOURCES}) string(REPLACE ".cpp" "" simpleName ${sourcefile}) - - set_source_files_properties(${sourcefile} PROPERTIES COMPILE_DEFINITIONS VMDPLUGIN=molfile_${simpleName}) + set_source_files_properties(${sourcefile} + PROPERTIES COMPILE_DEFINITIONS VMDPLUGIN=molfile_${simpleName}) endforeach(sourcefile in ${MY_PROJECT_SOURCES}) From fed659ebb4d44eee909f1890b04aa97fcab44abe Mon Sep 17 00:00:00 2001 From: Daniele Rapetti Date: Tue, 9 May 2023 10:47:45 +0200 Subject: [PATCH 30/40] it compiles :D --- src/CMakeLists.txt | 5 ++--- src/bias/CMakeLists.txt | 2 +- src/core/CMakeLists.txt | 5 +++++ src/dimred/CMakeLists.txt | 2 +- src/generic/CMakeLists.txt | 2 +- src/main/CMakeLists.txt | 2 +- src/molfile/CMakeLists.txt | 2 +- src/reference/CMakeLists.txt | 2 +- src/sasa/CMakeLists.txt | 2 +- src/setup/CMakeLists.txt | 2 +- src/tools/CMakeLists.txt | 1 - src/vatom/CMakeLists.txt | 2 +- 12 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3f44e6717b..68e9837258 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -46,7 +46,6 @@ MACRO(ADDMODULETOKERNEL module_name) if(${module_${module_name}} ) set(OTHERARGS ${ARGV}) list(REMOVE_ITEM OTHERARGS ${module_name}) - add_library(${module_name} OBJECT ${OTHERARGS} ) target_include_directories(${module_name} PRIVATE ${PLUMED_SRC}) list(APPEND modulesForKernel ${module_name}) @@ -262,14 +261,14 @@ endforeach(activeModule ${modulesForKernel}) #these targets build the two libPlumedKernel.so #building the shared libraries with the collected modules -add_library(libplumedKernel SHARED ${KernelTargets}) +add_library(libplumedKernel SHARED) set_target_properties(libplumedKernel PROPERTIES LIBRARY_OUTPUT_NAME ${program_name}Kernel SUFFIX .${SOEXT} ) -#target_link_libraries(libplumedKernel PUBLIC ${modulesForKernel}) +target_link_libraries(libplumedKernel PUBLIC ${modulesForKernel}) add_library(libplumed SHARED $) set_target_properties(libplumed diff --git a/src/bias/CMakeLists.txt b/src/bias/CMakeLists.txt index c376bc0063..3835f59c02 100644 --- a/src/bias/CMakeLists.txt +++ b/src/bias/CMakeLists.txt @@ -26,5 +26,5 @@ ADDMODULENEEDS(${module_name} core tools ) ADDMODULEDEPENDENCIES(${module_name} - tools #core + core #tools ) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index e36318aec0..de22d3b76a 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -35,9 +35,14 @@ PlumedMainMap.inc PlumedMainEnum.inc GREXMap.inc GREXEnum.inc CLToolMainMap.inc CLToolMainEnum.inc ) + ADDMODULENEEDS(${module_name} config tools lepton ) +ADDMODULEDEPENDENCIES(${module_name} + tools #lepton #lapack #blas + +) #ADDMODULENEEDS(${module_name} ####################################### diff --git a/src/dimred/CMakeLists.txt b/src/dimred/CMakeLists.txt index f879c423ef..a26a19b348 100644 --- a/src/dimred/CMakeLists.txt +++ b/src/dimred/CMakeLists.txt @@ -22,6 +22,6 @@ ADDMODULENEEDS(${module_name} core tools reference gridtools analysis ) ADDMODULEDEPENDENCIES(${module_name} - #tools #core + #core #tools gridtools #analysis bias reference tools core ) diff --git a/src/generic/CMakeLists.txt b/src/generic/CMakeLists.txt index 084efcb106..c877105360 100644 --- a/src/generic/CMakeLists.txt +++ b/src/generic/CMakeLists.txt @@ -31,6 +31,6 @@ ADDMODULENEEDS(${module_name} core tools xdrfile ) ADDMODULEDEPENDENCIES(${module_name} - tools #core + core #tools xdrfile ) diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt index 480fdcb949..1b3d68cac1 100644 --- a/src/main/CMakeLists.txt +++ b/src/main/CMakeLists.txt @@ -2,7 +2,7 @@ set(module_name main) #this is not a module, this is set up to make easier the dependency interface set(module_${module_name} ON CACHE INTERNAL "always active core module ${module_name}") add_executable(plumed_bin main.cpp) -target_link_libraries(plumed_bin libplumedKernel libplumed) +target_link_libraries(plumed_bin PUBLIC libplumedKernel libplumed) set_target_properties(plumed_bin PROPERTIES RUNTIME_OUTPUT_NAME ${program_name} ) diff --git a/src/molfile/CMakeLists.txt b/src/molfile/CMakeLists.txt index a4eafdbbbb..0dce353d5c 100644 --- a/src/molfile/CMakeLists.txt +++ b/src/molfile/CMakeLists.txt @@ -27,4 +27,4 @@ foreach(sourcefile ${MY_PROJECT_SOURCES}) endforeach(sourcefile in ${MY_PROJECT_SOURCES}) #this should propagate the compile definition to the main -target_compile_definitions(${module_name} INTERFACE __PLUMED_HAS_MOLFILE_PLUGINS) \ No newline at end of file +target_compile_definitions(${module_name} PUBLIC __PLUMED_HAS_MOLFILE_PLUGINS) \ No newline at end of file diff --git a/src/reference/CMakeLists.txt b/src/reference/CMakeLists.txt index fe84b6519c..eb5341ea95 100644 --- a/src/reference/CMakeLists.txt +++ b/src/reference/CMakeLists.txt @@ -29,5 +29,5 @@ ADDMODULENEEDS(${module_name} core tools ) ADDMODULEDEPENDENCIES(${module_name} - tools #core + core #tools ) diff --git a/src/sasa/CMakeLists.txt b/src/sasa/CMakeLists.txt index 1311a680a2..bff57a060c 100644 --- a/src/sasa/CMakeLists.txt +++ b/src/sasa/CMakeLists.txt @@ -12,6 +12,6 @@ ADDMODULENEEDS(${module_name} core tools config ) ADDMODULEDEPENDENCIES(${module_name} - tools #core + core #tools config ) diff --git a/src/setup/CMakeLists.txt b/src/setup/CMakeLists.txt index 957f0b0631..ca871a713c 100644 --- a/src/setup/CMakeLists.txt +++ b/src/setup/CMakeLists.txt @@ -12,5 +12,5 @@ ADDMODULENEEDS(${module_name} core tools ) ADDMODULEDEPENDENCIES(${module_name} - tools #core + core #tools ) diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt index 4437f08f47..80efcff3d9 100644 --- a/src/tools/CMakeLists.txt +++ b/src/tools/CMakeLists.txt @@ -57,7 +57,6 @@ ADDMODULENEEDS(${module_name} core lapack lepton ) ADDMODULEDEPENDENCIES(${module_name} - core lapack #blas lepton ) diff --git a/src/vatom/CMakeLists.txt b/src/vatom/CMakeLists.txt index 1db3a16f7c..f2c071657b 100644 --- a/src/vatom/CMakeLists.txt +++ b/src/vatom/CMakeLists.txt @@ -13,5 +13,5 @@ ADDMODULENEEDS(${module_name} core tools ) ADDMODULEDEPENDENCIES(${module_name} - tools #core + core #tools ) From c2ddbfab9e4a761c59933132246775690ff395ba Mon Sep 17 00:00:00 2001 From: Daniele Rapetti Date: Tue, 9 May 2023 12:29:42 +0200 Subject: [PATCH 31/40] compiles and runs :D --- src/CMakeLists.txt | 93 +++++++++++++++++++++++--------------- src/cltools/CMakeLists.txt | 3 +- src/config/CMakeLists.txt | 28 ++++++++++-- src/core/CMakeLists.txt | 6 ++- src/tools/CMakeLists.txt | 1 + src/wrapper/CMakeLists.txt | 4 ++ 6 files changed, 91 insertions(+), 44 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 68e9837258..1785ead003 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -22,8 +22,56 @@ set(modulesForKernel "") ################################################################################ #Setting up global options ################################################################################ - +#this may be deactivated when we want to copile something more static set(CMAKE_POSITION_INDEPENDENT_CODE ON) +# --enable-basic-warnings enable basic warnings, default: yes +option(enable_warnings_basic "enable basic warnings" ON) +if(enable_warnings_basic) + if(MSVC) + add_compile_options(/W4) + else() + add_compile_options(-Wall) + endif(MSVC) +endif(enable_warnings_basic) +# --enable-fussy enable fussy warnings, default: no +option(enable_warnings_fussy "enable fussy warnings" OFF) +if(enable_warnings_fussy) + if(MSVC) + add_compile_options(/Wall) + else() + add_compile_options( + -Wall + -Wextra + -Wshadow + -Wnon-virtual-dtor + -Wold-style-cast + -Wcast-align + -Wunused + -Woverloaded-virtual + -Wpedantic + -Wconversion + -Wsign-conversion + -Wnull-dereference + -Wdouble-promotion + -Wformat=2 + -Wduplicated-cond + -Wduplicated-branches + -Wlogical-op + -Wuseless-cast + #-Wlifetime + ) + endif(MSVC) +endif(enable_warnings_fussy) +option(enable_warnings_errors "enable stop compilation on warnings" OFF) +if(enable_warnings_errors) + if(MSVC) + add_compile_options(/WX) + else() + add_compile_options(-Werror -Wfatal-errors) + endif(MSVC) +endif(enable_warnings_errors) +# --enable-fussy enable fussy warnings, default: no + ################################################################################ #Macro definitions @@ -96,6 +144,9 @@ set(execDirs main config wrapper) #these are directory with codes that may be external set(mayBeExternal blas lapack molfile) list(REMOVE_ITEM dirs ${utildirs} ${execDirs} ${mayBeExternal}) +#this is needed for making "all_modules" work +set(toggabledirs ${dirs}) +list(REMOVE_ITEM toggabledirs core tools lepton blas lapack asmjit) foreach(dir ${execDirs}) add_subdirectory(${dir}) @@ -113,9 +164,9 @@ foreach(dir ${dirs}) endforeach(dir ${dirs}) if(all_modules) message("All module will be forced ON") - foreach(dir ${dirs}) - set(module_${dir} ON) - endforeach(dir ${dirs}) + foreach(dir ${toggabledirs}) + set(module_${dir} ON CACHE BOOL "activate module ${dir}" FORCE) + endforeach(dir ${toggabledirs}) endif() #options ## options are already done @@ -185,9 +236,6 @@ endif() # default: yes # --enable-asmjit enable enable embedded asmjit, default: yes # --enable-mpi enable search for mpi, default: yes -## --enable-external-lapack -## enable search for external lapack, default: yes -## --enable-external-blas enable search for external blas, default: yes # --enable-molfile-plugins # enable use molfile_plugins, default: yes # --enable-external-molfile-plugins @@ -197,7 +245,6 @@ endif() # --enable-readdir-r enable search for readdir_r (threadsafe), default: # no # --enable-cregex enable search for C regular expression, default: yes -# --enable-dlopen enable search for dlopen, default: yes # --enable-rtld_default enable search for RTLD_DEFAULT macro, default: yes # --enable-chdir enable search for chdir function, default: yes # --enable-subprocess enable search for functions needed to manage a @@ -215,7 +262,7 @@ endif() # --enable-af_cuda enable search for arrayfire_cuda, default: no # --enable-af_cpu enable search for arrayfire_cpu, default: no # --enable-libtorch enable search for libtorch, default: no -# --disable-openmp do not use OpenMP + #for debugging purpose #foreach(dir ${dirs} ${execDirs} ${mayBeExternal}) @@ -295,34 +342,6 @@ target_link_libraries(libplumedWrapper #print_target_property(cltools COMPILE_DEFINITIONS) #print_target_property(molfile COMPILE_DEFINITIONS) -#TODO move this in a better place: -IF(${OPT_DEBUGWARNINGS}) - if(MSVC) - add_compile_options(/W4 /WX) - else() - add_compile_options( - -Wall - -Wextra - -Wshadow - -Wnon-virtual-dtor - -Wold-style-cast - -Wcast-align - -Wunused - -Woverloaded-virtual - -Wpedantic - -Wconversion - -Wsign-conversion - -Wnull-dereference - -Wdouble-promotion - -Wformat=2 - -Wduplicated-cond - -Wduplicated-branches - -Wlogical-op - -Wuseless-cast - #-Wlifetime - ) - endif() -endif() #Warnings #-Wall #-Wextra # reasonable and standard diff --git a/src/cltools/CMakeLists.txt b/src/cltools/CMakeLists.txt index 5776d1c68d..8a96a169dd 100644 --- a/src/cltools/CMakeLists.txt +++ b/src/cltools/CMakeLists.txt @@ -26,8 +26,7 @@ core config tools molfile xdrfile ) ADDMODULEDEPENDENCIES(${module_name} molfile - config - tools + core #tools #config xdrfile ) diff --git a/src/config/CMakeLists.txt b/src/config/CMakeLists.txt index 5eee1445b1..3412acbc76 100644 --- a/src/config/CMakeLists.txt +++ b/src/config/CMakeLists.txt @@ -20,16 +20,38 @@ configure_file(Config.inc.in Config.inc) #TODO: verify if the version number are not set configure_file(version.h.in version.h) - +################################################################################ +#The config interface library holds a lot of options that must be inherited by # +#everithing, more specialized options will be found in the respective modules # +# licke blas and lapack +################################################################################ add_library(config INTERFACE) +################################################################################ +# options # +################################################################################ +option(enable_dlopen "enable search for dlopen" ON) +if(enable_dlopen) + if(CMAKE_DL_LIBS) + target_link_libraries(config INTERFACE ${CMAKE_DL_LIBS}) + target_compile_definitions(config INTERFACE __PLUMED_HAS_DLOPEN) + endif(CMAKE_DL_LIBS) +endif(enable_dlopen) +# --disable-openmp do not use OpenMP +option(enable_openmp "enable search for openmp" ON) +if(enable_openmp) + find_package(OpenMP) + if(OpenMP_CXX_FOUND) + target_link_libraries(config INTERFACE OpenMP::OpenMP_CXX) + endif() +endif(enable_openmp) #must be set up a target interface config wotj all the definitios add_library(Config OBJECT Config.cpp Makefile.conf.xxd) -target_link_libraries(Config INTERFACE config) +target_link_libraries(Config PUBLIC config) target_include_directories(Config PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) add_library(ConfigInstall OBJECT ConfigInstall.cpp Makefile.conf.xxd) -target_link_libraries(ConfigInstall INTERFACE config) +target_link_libraries(ConfigInstall PUBLIC config) target_include_directories(ConfigInstall PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) configure_file(Makefile.conf.xxd.compiler.sh.in Makefile.conf.xxd.compiler.sh @ONLY) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index de22d3b76a..417ae4a84e 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -39,9 +39,11 @@ CLToolMainMap.inc CLToolMainEnum.inc ADDMODULENEEDS(${module_name} config tools lepton ) +#tools depends on more modules that define COMPILE_DEFINITIONS, so +#it is better to make core dependent of tools, and then solve the circularity +#in a second time ADDMODULEDEPENDENCIES(${module_name} - tools #lepton #lapack #blas - + tools #lepton #lapack #blas #config ) #ADDMODULENEEDS(${module_name} diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt index 80efcff3d9..d18c8e9412 100644 --- a/src/tools/CMakeLists.txt +++ b/src/tools/CMakeLists.txt @@ -59,4 +59,5 @@ ADDMODULENEEDS(${module_name} ADDMODULEDEPENDENCIES(${module_name} lapack #blas lepton + config ) diff --git a/src/wrapper/CMakeLists.txt b/src/wrapper/CMakeLists.txt index 61438a985a..7e8eca7c09 100644 --- a/src/wrapper/CMakeLists.txt +++ b/src/wrapper/CMakeLists.txt @@ -3,6 +3,10 @@ set(module_name wrapper) set(module_${module_name} ON CACHE INTERNAL "always active core module ${module_name}") add_library(PlumedStaticWrapper OBJECT PlumedStatic.cpp) add_library(PlumedWrapper OBJECT Plumed.c) +foreach(lib PlumedStaticWrapper PlumedWrapper) + target_link_libraries(${lib} config) +endforeach(lib PlumedStaticWrapper PlumedWrapper) + #add here the lib so and the lib static for Plumed.so and PlumedKernel.so #find a way to add all the activated libraries here or add them to tha main CMakeList.txt? From 7d3bd99fb541e45c4ec3cc2e38c53b4df20faa8e Mon Sep 17 00:00:00 2001 From: Daniele Rapetti Date: Tue, 9 May 2023 15:57:04 +0200 Subject: [PATCH 32/40] small tweaks in dependencies and move warning explanations --- src/CMakeLists.txt | 61 ++++++++++++++--------------------------- src/sasa/CMakeLists.txt | 3 +- 2 files changed, 21 insertions(+), 43 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1785ead003..e74bf2ffd7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -39,26 +39,26 @@ if(enable_warnings_fussy) if(MSVC) add_compile_options(/Wall) else() - add_compile_options( - -Wall - -Wextra - -Wshadow - -Wnon-virtual-dtor - -Wold-style-cast - -Wcast-align - -Wunused - -Woverloaded-virtual - -Wpedantic - -Wconversion - -Wsign-conversion - -Wnull-dereference - -Wdouble-promotion - -Wformat=2 - -Wduplicated-cond - -Wduplicated-branches - -Wlogical-op - -Wuseless-cast - #-Wlifetime + add_compile_options( + -Wall + -Wextra # reasonable and standard + -Wshadow # warn the user if a variable declaration shadows one from a# parent context + -Wnon-virtual-dtor # warn the user if a class with virtual functions has a# non-virtual destructor. + -Wold-style-cast # warn for c-style casts + -Wcast-align # warn for potential performance problem casts + -Wunused # warn on anything being unused + -Woverloaded-virtual # warn if you overload (not override) a virtual func + -Wpedantic # warn if non-standard C++ is used + -Wconversion # warn on type conversions that may lose data + -Wsign-conversion # warn on sign conversions + -Wnull-dereference # warn if a null dereference is detected + -Wdouble-promotion # warn if float is implicit promoted to double + -Wformat=2 # warn on security issues around functions that format output# (ie printf) + -Wduplicated-cond # warn if if / else chain has duplicated conditions + -Wduplicated-branches # warn if if / else branches have duplicated code + -Wlogical-op # warn about logical operations being used where bitwise were# probably wanted + -Wuseless-cast # warn if you perform a cast to the same type + -Wlifetime # /// ) endif(MSVC) endif(enable_warnings_fussy) @@ -342,27 +342,6 @@ target_link_libraries(libplumedWrapper #print_target_property(cltools COMPILE_DEFINITIONS) #print_target_property(molfile COMPILE_DEFINITIONS) -#Warnings -#-Wall -#-Wextra # reasonable and standard -#-Wshadow # warn the user if a variable declaration shadows one from a# parent context -#-Wnon-virtual-dtor # warn the user if a class with virtual functions has a# non-virtual destructor. -#-Wold-style-cast # warn for c-style casts -#-Wcast-align # warn for potential performance problem casts -#-Wunused # warn on anything being unused -#-Woverloaded-virtual # warn if you overload (not override) a virtual func -#-Wpedantic # warn if non-standard C++ is used -#-Wconversion # warn on type conversions that may lose data -#-Wsign-conversion # warn on sign conversions -#-Wnull-dereference # warn if a null dereference is detected -#-Wdouble-promotion # warn if float is implicit promoted to double -#-Wformat=2 # warn on security issues around functions that format output# (ie printf) -#-Wduplicated-cond # warn if if / else chain has duplicated conditions -#-Wduplicated-branches # warn if if / else branches have duplicated code -#-Wlogical-op # warn about logical operations being used where bitwise were# probably wanted -#-Wuseless-cast # warn if you perform a cast to the same type -#-Wlifetime # /// - # foreach(module_name blas lapack) # print_target_property(${module_name} COMPILE_OPTIONS) # print_target_property(${module_name} COMPILE_DEFINITIONS) diff --git a/src/sasa/CMakeLists.txt b/src/sasa/CMakeLists.txt index bff57a060c..71ff089cd4 100644 --- a/src/sasa/CMakeLists.txt +++ b/src/sasa/CMakeLists.txt @@ -12,6 +12,5 @@ ADDMODULENEEDS(${module_name} core tools config ) ADDMODULEDEPENDENCIES(${module_name} - core #tools - config + core #tools #config ) From 2343dd13ad8bb25cdad3ffcfffa03d87e2032211 Mon Sep 17 00:00:00 2001 From: Daniele Rapetti Date: Tue, 9 May 2023 17:21:19 +0200 Subject: [PATCH 33/40] now plumed-static compile exacly like in the original --- src/CMakeLists.txt | 21 ++++++++++++--------- src/main/CMakeLists.txt | 20 +++++++++++++++++++- src/wrapper/CMakeLists.txt | 2 +- 3 files changed, 32 insertions(+), 11 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e74bf2ffd7..ba2844f264 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -140,10 +140,10 @@ set(dirs ${alldirs})# CACHE INTERNAL FORCE) #directories that do not contain modules set(utildirs lib include maketools cmake) #these are the diretory to compile that do not have a module.type inside -set(execDirs main config wrapper) +set(execDirs config wrapper) #removed main #these are directory with codes that may be external set(mayBeExternal blas lapack molfile) -list(REMOVE_ITEM dirs ${utildirs} ${execDirs} ${mayBeExternal}) +list(REMOVE_ITEM dirs main ${utildirs} ${execDirs} ${mayBeExternal}) #this is needed for making "all_modules" work set(toggabledirs ${dirs}) list(REMOVE_ITEM toggabledirs core tools lepton blas lapack asmjit) @@ -199,8 +199,6 @@ endif() # --disable-option-checking ignore unrecognized --enable/--with options # --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) # --enable-FEATURE[=ARG] include FEATURE [ARG=yes] -## --enable-modules all/none/reset or : separated list such as -## +crystallization:-bias default: reset # --enable-libsearch enable search for libraries, default: yes # --enable-static-patch enable allow statically linking plumed, default: yes # --enable-doc enable documentation, default: yes @@ -210,8 +208,6 @@ endif() # --enable-cxx 11 or 14. To link libraries with headers that need # this C++ level. Use --enable-cxx=none to remove # -std=c++ flag -# --enable-basic-warnings enable basic warnings, default: yes -# --enable-fussy enable fussy warnings, default: no # --enable-debug-glibcxx enable enable boundary check, default: no # --enable-shared enable shared libs, default: yes # --enable-dependency-tracking @@ -314,10 +310,15 @@ set_target_properties(libplumedKernel LIBRARY_OUTPUT_NAME ${program_name}Kernel SUFFIX .${SOEXT} ) - target_link_libraries(libplumedKernel PUBLIC ${modulesForKernel}) -add_library(libplumed SHARED $) +#add_library(libplumedStatic OBJECT ${KernelTargets}) +#target_link_libraries(libplumedStatic INTERFACE ${modulesForKernel}) +# if (TARGET plumed_bin_static) + # target_link_libraries(plumed_bin_static PUBLIC ${modulesForKernel}) + #target_link_libraries(plumed_bin_static PUBLIC PlumedStaticWrapper) +# endif (TARGET plumed_bin_static) +add_library(libplumed SHARED) set_target_properties(libplumed PROPERTIES LIBRARY_OUTPUT_NAME ${program_name} @@ -328,7 +329,7 @@ target_link_libraries(libplumed ConfigInstall ) -add_library(libplumedWrapper STATIC $) +add_library(libplumedWrapper STATIC) set_target_properties(libplumedWrapper PROPERTIES LIBRARY_OUTPUT_NAME ${program_name}Wrapper @@ -339,6 +340,8 @@ target_link_libraries(libplumedWrapper ConfigInstall ) +add_subdirectory(main) + #print_target_property(cltools COMPILE_DEFINITIONS) #print_target_property(molfile COMPILE_DEFINITIONS) diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt index 1b3d68cac1..20bca30044 100644 --- a/src/main/CMakeLists.txt +++ b/src/main/CMakeLists.txt @@ -1,9 +1,27 @@ -set(module_name main) #this is not a module, this is set up to make easier the dependency interface +set(module_name main) set(module_${module_name} ON CACHE INTERNAL "always active core module ${module_name}") + +#dynamically linked plumed add_executable(plumed_bin main.cpp) target_link_libraries(plumed_bin PUBLIC libplumedKernel libplumed) set_target_properties(plumed_bin PROPERTIES RUNTIME_OUTPUT_NAME ${program_name} ) target_include_directories(plumed_bin PRIVATE ${PLUMED_SRC}) +#statically linked plumed +add_executable(plumed_bin_static main.cpp) +target_link_libraries(plumed_bin_static PUBLIC PlumedStaticWrapper) +target_link_libraries(plumed_bin_static PUBLIC ${modulesForKernel}) +target_link_libraries(plumed_bin_static PUBLIC ConfigInstall) +set_target_properties(plumed_bin_static + PROPERTIES RUNTIME_OUTPUT_NAME ${program_name}-static + ) +target_include_directories(plumed_bin_static PRIVATE ${PLUMED_SRC}) +#runtime linked plumed +# add_executable(plumed_bin_runtime main.cpp) +# target_link_libraries(plumed_bin_runtime PUBLIC libplumedWrapper libplumedStatic) +# set_target_properties(plumed_bin_runtime + # PROPERTIES RUNTIME_OUTPUT_NAME ${program_name}-runtime + # ) +# target_include_directories(plumed_bin_runtime PRIVATE ${PLUMED_SRC}) diff --git a/src/wrapper/CMakeLists.txt b/src/wrapper/CMakeLists.txt index 7e8eca7c09..a37a1b97dc 100644 --- a/src/wrapper/CMakeLists.txt +++ b/src/wrapper/CMakeLists.txt @@ -4,7 +4,7 @@ set(module_${module_name} ON CACHE INTERNAL "always active core module ${module_ add_library(PlumedStaticWrapper OBJECT PlumedStatic.cpp) add_library(PlumedWrapper OBJECT Plumed.c) foreach(lib PlumedStaticWrapper PlumedWrapper) - target_link_libraries(${lib} config) + target_link_libraries(${lib} PUBLIC config) endforeach(lib PlumedStaticWrapper PlumedWrapper) From e41baaf24190bdb5686f155a561c6c15456754e0 Mon Sep 17 00:00:00 2001 From: Daniele Rapetti Date: Wed, 10 May 2023 11:17:53 +0200 Subject: [PATCH 34/40] small rationalization of Config --- CMakeLists.txt | 11 +++++++++++ src/CMakeLists.txt | 4 ++-- src/config/CMakeLists.txt | 38 +++++++++++++++++++------------------- src/main/CMakeLists.txt | 18 ++++++++++++++---- 4 files changed, 46 insertions(+), 25 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bd48a8039b..833ca58035 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,7 @@ cmake_minimum_required(VERSION 3.20.2) + + project(Plumed2 LANGUAGES CXX) set(PLUMED_VERSION_SHORT "2.10") @@ -14,5 +16,14 @@ execute_process( set(PLUMED_VERSION_MAJOR 2) set(PLUMED_VERSION_MINOR 10) set(PLUMED_VERSION_PATCH 0) +#as now CMake is only experimental, it can be useful if you use vscode or other +#IDE that have an interface with it, but we are not still confident that it is ready +#for installation purposes +set(CMAKE_SKIP_INSTALL_RULES YES) +option(risk_accepted "CMake is experimental use at your own risk" OFF) +if(NOT risk_accepted) + message(FATAL_ERROR "You must accept the risk to use the experimental cmake compilation: -Drisk_accepted=ON") +endif(NOT risk_accepted) + add_subdirectory(src) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ba2844f264..44faffb9fb 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -326,7 +326,7 @@ set_target_properties(libplumed ) target_link_libraries(libplumed PlumedWrapper - ConfigInstall + Config ) add_library(libplumedWrapper STATIC) @@ -337,7 +337,7 @@ set_target_properties(libplumedWrapper ) target_link_libraries(libplumedWrapper PlumedWrapper - ConfigInstall + Config ) add_subdirectory(main) diff --git a/src/config/CMakeLists.txt b/src/config/CMakeLists.txt index 3412acbc76..5c77bb02f8 100644 --- a/src/config/CMakeLists.txt +++ b/src/config/CMakeLists.txt @@ -1,23 +1,28 @@ set(module_name config) #this is not a module, this is set up to make easier the dependency interface set(module_${module_name} ON CACHE INTERNAL "always active core module ${module_name}") +#set this before or maybe let only one config e +set(plumed_install_flag ON) #SOEXT is set in ./src +if(plumed_install_flag) set(ISINSTALLED "true") #must go to /lib/plumed -set(PLUMED_ROOT ${CMAKE_INSTALL_PREFIX}/${program_name}) -set (htmldir ${htmldir}) -set (includedir ${includedir}) -set (program_name ${program_name}) -set (libdir ${libdir}) -configure_file(Config.inc.in ConfigInstall.inc) - -set(ISINSTALLED "false") -set (PLUMED_ROOT ${CMAKE_SOURCE_DIR}) -set (htmldir "xxxxNAxxxx") -set (includedir "xxxxNAxxxx") -set (program_name "xxxxNAxxxx") -configure_file(Config.inc.in Config.inc) - + set(PLUMED_ROOT ${CMAKE_INSTALL_PREFIX}/${program_name}) + set (htmldir ${htmldir}) + set (includedir ${includedir}) + set (program_name ${program_name}) + set (libdir ${libdir}) + configure_file(Config.inc.in ConfigInstall.inc) + add_library(Config OBJECT ConfigInstall.cpp Makefile.conf.xxd) +else() + set(ISINSTALLED "false") + set (PLUMED_ROOT ${CMAKE_SOURCE_DIR}) + set (htmldir "xxxxNAxxxx") + set (includedir "xxxxNAxxxx") + set (program_name "xxxxNAxxxx") + configure_file(Config.inc.in Config.inc) + add_library(Config OBJECT Config.cpp Makefile.conf.xxd) +endif(plumed_install_flag) #TODO: verify if the version number are not set configure_file(version.h.in version.h) ################################################################################ @@ -45,14 +50,9 @@ if(enable_openmp) endif() endif(enable_openmp) -#must be set up a target interface config wotj all the definitios -add_library(Config OBJECT Config.cpp Makefile.conf.xxd) target_link_libraries(Config PUBLIC config) target_include_directories(Config PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) -add_library(ConfigInstall OBJECT ConfigInstall.cpp Makefile.conf.xxd) -target_link_libraries(ConfigInstall PUBLIC config) -target_include_directories(ConfigInstall PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) configure_file(Makefile.conf.xxd.compiler.sh.in Makefile.conf.xxd.compiler.sh @ONLY) configure_file(${PLUMED_MAIN_DIR}/Makefile.conf.in Makefile.cmakeMocked.conf @ONLY) diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt index 20bca30044..456f0a0de7 100644 --- a/src/main/CMakeLists.txt +++ b/src/main/CMakeLists.txt @@ -10,10 +10,15 @@ set_target_properties(plumed_bin ) target_include_directories(plumed_bin PRIVATE ${PLUMED_SRC}) #statically linked plumed -add_executable(plumed_bin_static main.cpp) -target_link_libraries(plumed_bin_static PUBLIC PlumedStaticWrapper) -target_link_libraries(plumed_bin_static PUBLIC ${modulesForKernel}) -target_link_libraries(plumed_bin_static PUBLIC ConfigInstall) +#$(PLUMED_MAIN_STATIC): $(OBJ_MAIN) $(OBJ_KERNEL) $(OBJ_WRAPPER) +add_executable(plumed_bin_static main.cpp) #$(OBJ_MAIN) +target_link_libraries(plumed_bin_static PUBLIC PlumedStaticWrapper) #$(OBJ_WRAPPER) +target_link_libraries(plumed_bin_static PUBLIC ${modulesForKernel}) #$(OBJ_KERNEL) + +target_link_libraries(plumed_bin_static PUBLIC Config) #Options and + + + set_target_properties(plumed_bin_static PROPERTIES RUNTIME_OUTPUT_NAME ${program_name}-static ) @@ -25,3 +30,8 @@ target_include_directories(plumed_bin_static PRIVATE ${PLUMED_SRC}) # PROPERTIES RUNTIME_OUTPUT_NAME ${program_name}-runtime # ) # target_include_directories(plumed_bin_runtime PRIVATE ${PLUMED_SRC}) + +#consider adding install manifest: +#install(CODE "string(REPLACE \";\" \"\\n\" MY_CMAKE_INSTALL_MANIFEST_CONTENT \"\$\{CMAKE_INSTALL_MANIFEST_FILES\}\")\n\ +# file(WRITE my_install_manifest.txt \"\$\{MY_CMAKE_INSTALL_MANIFEST_CONTENT\}\")") +#thanks https://stackoverflow.com/a/66804151 From 7ecfe58538d13f2cdd755ca6b3055d16e3b6558d Mon Sep 17 00:00:00 2001 From: Daniele Rapetti Date: Wed, 10 May 2023 12:15:51 +0200 Subject: [PATCH 35/40] It works, there are only ~80 options to implement now --- src/CMakeLists.txt | 46 ++++++++++++++------------------------ src/main/CMakeLists.txt | 37 +++++++++++++++++------------- src/wrapper/CMakeLists.txt | 6 ++--- 3 files changed, 42 insertions(+), 47 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 44faffb9fb..04ca00c60c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -304,41 +304,29 @@ endforeach(activeModule ${modulesForKernel}) #these targets build the two libPlumedKernel.so #building the shared libraries with the collected modules -add_library(libplumedKernel SHARED) -set_target_properties(libplumedKernel +add_library(sharedplumedKernel SHARED) +set_target_properties(sharedplumedKernel PROPERTIES LIBRARY_OUTPUT_NAME ${program_name}Kernel - SUFFIX .${SOEXT} + #SUFFIX .${SOEXT} #I think that cmake will set so or dlyb by itself ) -target_link_libraries(libplumedKernel PUBLIC ${modulesForKernel}) - -#add_library(libplumedStatic OBJECT ${KernelTargets}) -#target_link_libraries(libplumedStatic INTERFACE ${modulesForKernel}) -# if (TARGET plumed_bin_static) - # target_link_libraries(plumed_bin_static PUBLIC ${modulesForKernel}) - #target_link_libraries(plumed_bin_static PUBLIC PlumedStaticWrapper) -# endif (TARGET plumed_bin_static) -add_library(libplumed SHARED) -set_target_properties(libplumed - PROPERTIES - LIBRARY_OUTPUT_NAME ${program_name} - SUFFIX .${SOEXT} +target_link_libraries(sharedplumedKernel PUBLIC + ${modulesForKernel} # OBJ_KERNEL without config + Config #within OBJ_KERNEL ) -target_link_libraries(libplumed - PlumedWrapper - Config -) -add_library(libplumedWrapper STATIC) -set_target_properties(libplumedWrapper - PROPERTIES - LIBRARY_OUTPUT_NAME ${program_name}Wrapper - ARCHIVE_OUTPUT_NAME ${program_name}Wrapper +add_library(archiveplumedKernel STATIC) +set_target_properties(sharedplumedKernel + PROPERTIES + ARCHIVE_OUTPUT_NAME ${program_name} + #SUFFIX .${SOEXT} ) -target_link_libraries(libplumedWrapper - PlumedWrapper - Config -) +target_link_libraries(archiveplumedKernel PUBLIC + ${modulesForKernel} # OBJ_KERNEL without config + Config #within OBJ_KERNEL + ) +#add_library(libplumedStatic OBJECT ${KernelTargets}) +#target_link_libraries(libplumedStatic INTERFACE ${modulesForKernel}) add_subdirectory(main) diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt index 456f0a0de7..f57965455f 100644 --- a/src/main/CMakeLists.txt +++ b/src/main/CMakeLists.txt @@ -3,8 +3,12 @@ set(module_name main) set(module_${module_name} ON CACHE INTERNAL "always active core module ${module_name}") #dynamically linked plumed -add_executable(plumed_bin main.cpp) -target_link_libraries(plumed_bin PUBLIC libplumedKernel libplumed) +#$(PLUMED_MAIN_SHARED): $(OBJ_MAIN) $(OBJ_WRAPPER) $(PLUMED_KERNEL) +add_executable(plumed_bin main.cpp)#OBJ_MAIN +target_link_libraries(plumed_bin PUBLIC + sharedplumedKernel #PLUMED_KERNEL + PlumedStaticWrapper #OBJ_WRAPPER + ) set_target_properties(plumed_bin PROPERTIES RUNTIME_OUTPUT_NAME ${program_name} ) @@ -12,24 +16,27 @@ target_include_directories(plumed_bin PRIVATE ${PLUMED_SRC}) #statically linked plumed #$(PLUMED_MAIN_STATIC): $(OBJ_MAIN) $(OBJ_KERNEL) $(OBJ_WRAPPER) add_executable(plumed_bin_static main.cpp) #$(OBJ_MAIN) -target_link_libraries(plumed_bin_static PUBLIC PlumedStaticWrapper) #$(OBJ_WRAPPER) -target_link_libraries(plumed_bin_static PUBLIC ${modulesForKernel}) #$(OBJ_KERNEL) - -target_link_libraries(plumed_bin_static PUBLIC Config) #Options and - - - +target_link_libraries(plumed_bin_static PUBLIC + PlumedStaticWrapper #$(OBJ_WRAPPER) + archiveplumedKernel + #${modulesForKernel} #$(OBJ_KERNEL) + #Config #extra options (are within OBJ_KERNEL in original Makefile) +) set_target_properties(plumed_bin_static PROPERTIES RUNTIME_OUTPUT_NAME ${program_name}-static ) target_include_directories(plumed_bin_static PRIVATE ${PLUMED_SRC}) #runtime linked plumed -# add_executable(plumed_bin_runtime main.cpp) -# target_link_libraries(plumed_bin_runtime PUBLIC libplumedWrapper libplumedStatic) -# set_target_properties(plumed_bin_runtime - # PROPERTIES RUNTIME_OUTPUT_NAME ${program_name}-runtime - # ) -# target_include_directories(plumed_bin_runtime PRIVATE ${PLUMED_SRC}) +#$(PLUMED_MAIN_RUNTIME): $(OBJ_MAIN) $(OBJ_DYNAMIC_WRAPPER) +add_executable(plumed_bin_runtime main.cpp) +target_link_libraries(plumed_bin_runtime + PUBLIC + PlumedDynamicWrapper #OBJ_DYNAMIC_WRAPPER + ) +set_target_properties(plumed_bin_runtime + PROPERTIES RUNTIME_OUTPUT_NAME ${program_name}-runtime + ) +target_include_directories(plumed_bin_runtime PRIVATE ${PLUMED_SRC}) #consider adding install manifest: #install(CODE "string(REPLACE \";\" \"\\n\" MY_CMAKE_INSTALL_MANIFEST_CONTENT \"\$\{CMAKE_INSTALL_MANIFEST_FILES\}\")\n\ diff --git a/src/wrapper/CMakeLists.txt b/src/wrapper/CMakeLists.txt index a37a1b97dc..11c80110df 100644 --- a/src/wrapper/CMakeLists.txt +++ b/src/wrapper/CMakeLists.txt @@ -2,10 +2,10 @@ set(module_name wrapper) #this is not a module, this is set up to make easier the dependency interface set(module_${module_name} ON CACHE INTERNAL "always active core module ${module_name}") add_library(PlumedStaticWrapper OBJECT PlumedStatic.cpp) -add_library(PlumedWrapper OBJECT Plumed.c) -foreach(lib PlumedStaticWrapper PlumedWrapper) +add_library(PlumedDynamicWrapper OBJECT Plumed.c) +foreach(lib PlumedStaticWrapper PlumedDynamicWrapper) target_link_libraries(${lib} PUBLIC config) -endforeach(lib PlumedStaticWrapper PlumedWrapper) +endforeach(lib PlumedStaticWrapper PlumedDynamicWrapper) #add here the lib so and the lib static for Plumed.so and PlumedKernel.so From 3613643b51b4894f43872f92efc0e0ba2c933c7e Mon Sep 17 00:00:00 2001 From: Daniele Rapetti Date: Wed, 10 May 2023 16:45:22 +0200 Subject: [PATCH 36/40] F77_NO_UNDERSCORE now should activate automagically --- src/CMakeLists.txt | 5 +++-- src/blas/CMakeLists.txt | 37 ++++++++++++++++++++++++++++--------- src/main/CMakeLists.txt | 5 +++++ 3 files changed, 36 insertions(+), 11 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 04ca00c60c..3348f9a61b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.20.2) -project(Plumed2 LANGUAGES C CXX Fortran) +project(Plumed2 LANGUAGES C CXX) set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE) set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS None Debug Release RelWithDebInfo MinSizeRel) @@ -316,8 +316,9 @@ target_link_libraries(sharedplumedKernel PUBLIC ) add_library(archiveplumedKernel STATIC) -set_target_properties(sharedplumedKernel +set_target_properties(archiveplumedKernel PROPERTIES + #LIBRARY_OUTPUT_NAME ${program_name} ARCHIVE_OUTPUT_NAME ${program_name} #SUFFIX .${SOEXT} ) diff --git a/src/blas/CMakeLists.txt b/src/blas/CMakeLists.txt index b4f3cfb158..64762b9d5c 100644 --- a/src/blas/CMakeLists.txt +++ b/src/blas/CMakeLists.txt @@ -20,18 +20,37 @@ if (${externalLib}_FOUND) target_compile_definitions(${module_name} PUBLIC __PLUMED_HAS_EXTERNAL_BLAS=1) -################################################################################ -#activate/deactivate -# (underscore) search_for=dsyevr_ ;; -# (nounderscore) search_for=dsyevr ;; -################################################################################ -# TODO -################################################################################ - if(OFF) + include(CheckSourceCompiles) + #From the manual:The check is only performed once, with the result cached in + #the variable named by . Every subsequent CMake run will re-use + #this cached value rather than performing the check again, even if the + # changes. In order to force the check to be re-evaluated, the + #variable named by must be manually removed from the cache. + set(CMAKE_REQUIRED_LIBRARIES "BLAS::BLAS") + check_source_compiles(C #using C to not use extern "C" + "int main(void) { + double a,b,c,s; + srotg_(&a,&b,&c,&s); + }" + UnderscodeBlas) + check_source_compiles(C #using C to not use extern "C" + "int main(void) { + double a,b,c,s; + srotg(&a,&b,&c,&s); + }" + noUnderscodeBlas + ) + unset(CMAKE_REQUIRED_LIBRARIES) + + if(noUnderscodeBlas AND NOT UnderscodeBlas) target_compile_definitions(${module_name} PUBLIC F77_NO_UNDERSCORE) - endif() + elseif(NOT noUnderscodeBlas AND NOT UnderscodeBlas) + message(WARNING "both srtog_ and srtog are not linkable") + elseif(noUnderscodeBlas AND UnderscodeBlas) + message(WARNING "both srtog_ and srtog are linkable") + endif(noUnderscodeBlas AND NOT UnderscodeBlas) target_link_libraries(${module_name} PUBLIC diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt index f57965455f..5d6fc8d30f 100644 --- a/src/main/CMakeLists.txt +++ b/src/main/CMakeLists.txt @@ -42,3 +42,8 @@ target_include_directories(plumed_bin_runtime PRIVATE ${PLUMED_SRC}) #install(CODE "string(REPLACE \";\" \"\\n\" MY_CMAKE_INSTALL_MANIFEST_CONTENT \"\$\{CMAKE_INSTALL_MANIFEST_FILES\}\")\n\ # file(WRITE my_install_manifest.txt \"\$\{MY_CMAKE_INSTALL_MANIFEST_CONTENT\}\")") #thanks https://stackoverflow.com/a/66804151 + + +#installation +#here there is an exampe ot multiple installation positions +#https://cmake.org/cmake/help/v3.2/command/install.html#installing-targets From a11172038be2b3fb7ed10503dfc324d025e7325f Mon Sep 17 00:00:00 2001 From: Daniele Rapetti Date: Thu, 11 May 2023 09:15:56 +0200 Subject: [PATCH 37/40] changed where the cmake_module_path is --- src/CMakeLists.txt | 3 --- src/molfile/CMakeLists.txt | 3 ++- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3348f9a61b..99bbd1f2be 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -152,9 +152,6 @@ foreach(dir ${execDirs}) add_subdirectory(${dir}) endforeach(dir ${execDirs}) -message("Checking if it is possible to find external alternatives for modules:") -#needed for FindMOLFILE -set (CMAKE_MODULE_PATH ${PLUMED_SRC}/cmake) foreach(dir ${mayBeExternal}) add_subdirectory(${dir}) endforeach(dir ${mayBeExternal}) diff --git a/src/molfile/CMakeLists.txt b/src/molfile/CMakeLists.txt index 0dce353d5c..04446ce989 100644 --- a/src/molfile/CMakeLists.txt +++ b/src/molfile/CMakeLists.txt @@ -10,7 +10,8 @@ dcdplugin.cpp gromacsplugin.cpp pdbplugin.cpp ) - +# to find external molfile +list(APPEND CMAKE_MODULE_PATH "${PLUMED_SRC}/cmake") #ADDMODULENEEDS(${module_name} # #) From 7812192aca4fa739ae6e8d7af341006509eee7ea Mon Sep 17 00:00:00 2001 From: Daniele Rapetti Date: Thu, 11 May 2023 09:43:40 +0200 Subject: [PATCH 38/40] removed the message about atomatically generated files where I modified them --- src/adjmat/CMakeLists.txt | 1 - src/analysis/CMakeLists.txt | 1 - src/annfunc/CMakeLists.txt | 1 - src/asmjit/CMakeLists.txt | 1 - src/bias/CMakeLists.txt | 1 - src/colvar/CMakeLists.txt | 1 - src/crystallization/CMakeLists.txt | 1 - src/dimred/CMakeLists.txt | 1 - src/drr/CMakeLists.txt | 1 - src/eds/CMakeLists.txt | 1 - src/fisst/CMakeLists.txt | 1 - src/function/CMakeLists.txt | 1 - src/funnel/CMakeLists.txt | 1 - src/generic/CMakeLists.txt | 1 - src/gridtools/CMakeLists.txt | 1 - src/isdb/CMakeLists.txt | 1 - src/lepton/CMakeLists.txt | 1 - src/logmfd/CMakeLists.txt | 1 - src/manyrestraints/CMakeLists.txt | 1 - src/mapping/CMakeLists.txt | 1 - src/maze/CMakeLists.txt | 1 - src/membranefusion/CMakeLists.txt | 1 - src/opes/CMakeLists.txt | 1 - src/pamm/CMakeLists.txt | 1 - src/piv/CMakeLists.txt | 1 - src/pytorch/CMakeLists.txt | 1 - src/reference/CMakeLists.txt | 1 - src/s2cm/CMakeLists.txt | 1 - src/sasa/CMakeLists.txt | 1 - src/secondarystructure/CMakeLists.txt | 1 - src/setup/CMakeLists.txt | 1 - src/tools/CMakeLists.txt | 1 - src/vatom/CMakeLists.txt | 1 - src/ves/CMakeLists.txt | 1 - src/xdrfile/CMakeLists.txt | 1 - 35 files changed, 35 deletions(-) diff --git a/src/adjmat/CMakeLists.txt b/src/adjmat/CMakeLists.txt index 7722bd74c1..8ecf5caf4b 100644 --- a/src/adjmat/CMakeLists.txt +++ b/src/adjmat/CMakeLists.txt @@ -1,4 +1,3 @@ -#automatically generated CMakeLists.txt, may not work! #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "adjmat") #Note that the macros here require this directory added as a subdir of plumed/src diff --git a/src/analysis/CMakeLists.txt b/src/analysis/CMakeLists.txt index b78a4971e5..77aea99e1d 100644 --- a/src/analysis/CMakeLists.txt +++ b/src/analysis/CMakeLists.txt @@ -1,4 +1,3 @@ -#automatically generated CMakeLists.txt, may not work! #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "analysis") #Note that the macros here require this directory added as a subdir of plumed/src diff --git a/src/annfunc/CMakeLists.txt b/src/annfunc/CMakeLists.txt index c6ef6f4667..6267c04a6e 100644 --- a/src/annfunc/CMakeLists.txt +++ b/src/annfunc/CMakeLists.txt @@ -1,4 +1,3 @@ -#automatically generated CMakeLists.txt, may not work! #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "annfunc") #Note that the macros here require this directory added as a subdir of plumed/src diff --git a/src/asmjit/CMakeLists.txt b/src/asmjit/CMakeLists.txt index cd7992e303..c862d8307d 100644 --- a/src/asmjit/CMakeLists.txt +++ b/src/asmjit/CMakeLists.txt @@ -1,4 +1,3 @@ -#automatically generated CMakeLists.txt, may not work! #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "asmjit") #Note that the macros here require this directory added as a subdir of plumed/src diff --git a/src/bias/CMakeLists.txt b/src/bias/CMakeLists.txt index 3835f59c02..f5fbaeea4e 100644 --- a/src/bias/CMakeLists.txt +++ b/src/bias/CMakeLists.txt @@ -1,4 +1,3 @@ -#automatically generated CMakeLists.txt, may not work! #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "bias") #Note that the macros here require this directory added as a subdir of plumed/src diff --git a/src/colvar/CMakeLists.txt b/src/colvar/CMakeLists.txt index e37ee22f7c..8932253ff7 100644 --- a/src/colvar/CMakeLists.txt +++ b/src/colvar/CMakeLists.txt @@ -1,4 +1,3 @@ -#automatically generated CMakeLists.txt, may not work! #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "colvar") #Note that the macros here require this directory added as a subdir of plumed/src diff --git a/src/crystallization/CMakeLists.txt b/src/crystallization/CMakeLists.txt index 833283b25f..ece9070535 100644 --- a/src/crystallization/CMakeLists.txt +++ b/src/crystallization/CMakeLists.txt @@ -1,4 +1,3 @@ -#automatically generated CMakeLists.txt, may not work! #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "crystallization") #Note that the macros here require this directory added as a subdir of plumed/src diff --git a/src/dimred/CMakeLists.txt b/src/dimred/CMakeLists.txt index a26a19b348..3495bd78d3 100644 --- a/src/dimred/CMakeLists.txt +++ b/src/dimred/CMakeLists.txt @@ -1,4 +1,3 @@ -#automatically generated CMakeLists.txt, may not work! #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "dimred") #Note that the macros here require this directory added as a subdir of plumed/src diff --git a/src/drr/CMakeLists.txt b/src/drr/CMakeLists.txt index c1f69d68a8..fc3ec19df5 100644 --- a/src/drr/CMakeLists.txt +++ b/src/drr/CMakeLists.txt @@ -1,4 +1,3 @@ -#automatically generated CMakeLists.txt, may not work! #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "drr") #Note that the macros here require this directory added as a subdir of plumed/src diff --git a/src/eds/CMakeLists.txt b/src/eds/CMakeLists.txt index d3ef3be3b5..221e011a0a 100644 --- a/src/eds/CMakeLists.txt +++ b/src/eds/CMakeLists.txt @@ -1,4 +1,3 @@ -#automatically generated CMakeLists.txt, may not work! #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "eds") #Note that the macros here require this directory added as a subdir of plumed/src diff --git a/src/fisst/CMakeLists.txt b/src/fisst/CMakeLists.txt index d757e8e41f..1b806611a4 100644 --- a/src/fisst/CMakeLists.txt +++ b/src/fisst/CMakeLists.txt @@ -1,4 +1,3 @@ -#automatically generated CMakeLists.txt, may not work! #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "fisst") #Note that the macros here require this directory added as a subdir of plumed/src diff --git a/src/function/CMakeLists.txt b/src/function/CMakeLists.txt index 95b85de145..071fbe6ea0 100644 --- a/src/function/CMakeLists.txt +++ b/src/function/CMakeLists.txt @@ -1,4 +1,3 @@ -#automatically generated CMakeLists.txt, may not work! #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "function") #Note that the macros here require this directory added as a subdir of plumed/src diff --git a/src/funnel/CMakeLists.txt b/src/funnel/CMakeLists.txt index ba83b69129..deef6a0004 100644 --- a/src/funnel/CMakeLists.txt +++ b/src/funnel/CMakeLists.txt @@ -1,4 +1,3 @@ -#automatically generated CMakeLists.txt, may not work! #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "funnel") #Note that the macros here require this directory added as a subdir of plumed/src diff --git a/src/generic/CMakeLists.txt b/src/generic/CMakeLists.txt index c877105360..3268261a99 100644 --- a/src/generic/CMakeLists.txt +++ b/src/generic/CMakeLists.txt @@ -1,4 +1,3 @@ -#automatically generated CMakeLists.txt, may not work! #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "generic") #Note that the macros here require this directory added as a subdir of plumed/src diff --git a/src/gridtools/CMakeLists.txt b/src/gridtools/CMakeLists.txt index b3e7fe52b5..f4509e644b 100644 --- a/src/gridtools/CMakeLists.txt +++ b/src/gridtools/CMakeLists.txt @@ -1,4 +1,3 @@ -#automatically generated CMakeLists.txt, may not work! #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "gridtools") #Note that the macros here require this directory added as a subdir of plumed/src diff --git a/src/isdb/CMakeLists.txt b/src/isdb/CMakeLists.txt index 9d189a71b7..8c9294a0ee 100644 --- a/src/isdb/CMakeLists.txt +++ b/src/isdb/CMakeLists.txt @@ -1,4 +1,3 @@ -#automatically generated CMakeLists.txt, may not work! #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "isdb") #Note that the macros here require this directory added as a subdir of plumed/src diff --git a/src/lepton/CMakeLists.txt b/src/lepton/CMakeLists.txt index 5ac59e77d8..02ee3885e1 100644 --- a/src/lepton/CMakeLists.txt +++ b/src/lepton/CMakeLists.txt @@ -1,4 +1,3 @@ -#automatically generated CMakeLists.txt, may not work! #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "lepton") #Note that the macros here require this directory added as a subdir of plumed/src diff --git a/src/logmfd/CMakeLists.txt b/src/logmfd/CMakeLists.txt index e605042784..86114033e8 100644 --- a/src/logmfd/CMakeLists.txt +++ b/src/logmfd/CMakeLists.txt @@ -1,4 +1,3 @@ -#automatically generated CMakeLists.txt, may not work! #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "logmfd") #Note that the macros here require this directory added as a subdir of plumed/src diff --git a/src/manyrestraints/CMakeLists.txt b/src/manyrestraints/CMakeLists.txt index 052a6f64c3..dcd8c54097 100644 --- a/src/manyrestraints/CMakeLists.txt +++ b/src/manyrestraints/CMakeLists.txt @@ -1,4 +1,3 @@ -#automatically generated CMakeLists.txt, may not work! #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "manyrestraints") #Note that the macros here require this directory added as a subdir of plumed/src diff --git a/src/mapping/CMakeLists.txt b/src/mapping/CMakeLists.txt index bf5c55c026..5a173fae9e 100644 --- a/src/mapping/CMakeLists.txt +++ b/src/mapping/CMakeLists.txt @@ -1,4 +1,3 @@ -#automatically generated CMakeLists.txt, may not work! #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "mapping") #Note that the macros here require this directory added as a subdir of plumed/src diff --git a/src/maze/CMakeLists.txt b/src/maze/CMakeLists.txt index f06af019df..7c5ceaebe0 100644 --- a/src/maze/CMakeLists.txt +++ b/src/maze/CMakeLists.txt @@ -1,4 +1,3 @@ -#automatically generated CMakeLists.txt, may not work! #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "maze") #Note that the macros here require this directory added as a subdir of plumed/src diff --git a/src/membranefusion/CMakeLists.txt b/src/membranefusion/CMakeLists.txt index 436f4f2e57..dfbaf9a820 100644 --- a/src/membranefusion/CMakeLists.txt +++ b/src/membranefusion/CMakeLists.txt @@ -1,4 +1,3 @@ -#automatically generated CMakeLists.txt, may not work! #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "membranefusion") #Note that the macros here require this directory added as a subdir of plumed/src diff --git a/src/opes/CMakeLists.txt b/src/opes/CMakeLists.txt index 05ebafcf32..e91ba69ecf 100644 --- a/src/opes/CMakeLists.txt +++ b/src/opes/CMakeLists.txt @@ -1,4 +1,3 @@ -#automatically generated CMakeLists.txt, may not work! #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "opes") #Note that the macros here require this directory added as a subdir of plumed/src diff --git a/src/pamm/CMakeLists.txt b/src/pamm/CMakeLists.txt index c97d6d0b59..be8a6fe0b2 100644 --- a/src/pamm/CMakeLists.txt +++ b/src/pamm/CMakeLists.txt @@ -1,4 +1,3 @@ -#automatically generated CMakeLists.txt, may not work! #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "pamm") #Note that the macros here require this directory added as a subdir of plumed/src diff --git a/src/piv/CMakeLists.txt b/src/piv/CMakeLists.txt index 799c129add..4d5a1d87e3 100644 --- a/src/piv/CMakeLists.txt +++ b/src/piv/CMakeLists.txt @@ -1,4 +1,3 @@ -#automatically generated CMakeLists.txt, may not work! #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "piv") #Note that the macros here require this directory added as a subdir of plumed/src diff --git a/src/pytorch/CMakeLists.txt b/src/pytorch/CMakeLists.txt index c44b63b82a..c05b7ef52d 100644 --- a/src/pytorch/CMakeLists.txt +++ b/src/pytorch/CMakeLists.txt @@ -1,4 +1,3 @@ -#automatically generated CMakeLists.txt, may not work! #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "pytorch") #Note that the macros here require this directory added as a subdir of plumed/src diff --git a/src/reference/CMakeLists.txt b/src/reference/CMakeLists.txt index eb5341ea95..99ed09767d 100644 --- a/src/reference/CMakeLists.txt +++ b/src/reference/CMakeLists.txt @@ -1,4 +1,3 @@ -#automatically generated CMakeLists.txt, may not work! #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "reference") #Note that the macros here require this directory added as a subdir of plumed/src diff --git a/src/s2cm/CMakeLists.txt b/src/s2cm/CMakeLists.txt index 81c8f9c8a1..0106d72ed7 100644 --- a/src/s2cm/CMakeLists.txt +++ b/src/s2cm/CMakeLists.txt @@ -1,4 +1,3 @@ -#automatically generated CMakeLists.txt, may not work! #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "s2cm") #Note that the macros here require this directory added as a subdir of plumed/src diff --git a/src/sasa/CMakeLists.txt b/src/sasa/CMakeLists.txt index 71ff089cd4..1ef887148f 100644 --- a/src/sasa/CMakeLists.txt +++ b/src/sasa/CMakeLists.txt @@ -1,4 +1,3 @@ -#automatically generated CMakeLists.txt, may not work! #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "sasa") #Note that the macros here require this directory added as a subdir of plumed/src diff --git a/src/secondarystructure/CMakeLists.txt b/src/secondarystructure/CMakeLists.txt index d66e9a1d89..a03b05b0e2 100644 --- a/src/secondarystructure/CMakeLists.txt +++ b/src/secondarystructure/CMakeLists.txt @@ -1,4 +1,3 @@ -#automatically generated CMakeLists.txt, may not work! #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "secondarystructure") #Note that the macros here require this directory added as a subdir of plumed/src diff --git a/src/setup/CMakeLists.txt b/src/setup/CMakeLists.txt index ca871a713c..e3872afc70 100644 --- a/src/setup/CMakeLists.txt +++ b/src/setup/CMakeLists.txt @@ -1,4 +1,3 @@ -#automatically generated CMakeLists.txt, may not work! #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "setup") #Note that the macros here require this directory added as a subdir of plumed/src diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt index d18c8e9412..847b8e9b70 100644 --- a/src/tools/CMakeLists.txt +++ b/src/tools/CMakeLists.txt @@ -1,4 +1,3 @@ -#automatically generated CMakeLists.txt, may not work! #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "tools") #Note that the macros here require this directory added as a subdir of plumed/src diff --git a/src/vatom/CMakeLists.txt b/src/vatom/CMakeLists.txt index f2c071657b..a366a06394 100644 --- a/src/vatom/CMakeLists.txt +++ b/src/vatom/CMakeLists.txt @@ -1,4 +1,3 @@ -#automatically generated CMakeLists.txt, may not work! #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "vatom") #Note that the macros here require this directory added as a subdir of plumed/src diff --git a/src/ves/CMakeLists.txt b/src/ves/CMakeLists.txt index fc43ecad2f..b3d415f546 100644 --- a/src/ves/CMakeLists.txt +++ b/src/ves/CMakeLists.txt @@ -1,4 +1,3 @@ -#automatically generated CMakeLists.txt, may not work! #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "ves") #Note that the macros here require this directory added as a subdir of plumed/src diff --git a/src/xdrfile/CMakeLists.txt b/src/xdrfile/CMakeLists.txt index fbdde2a572..ec1e759de9 100644 --- a/src/xdrfile/CMakeLists.txt +++ b/src/xdrfile/CMakeLists.txt @@ -1,4 +1,3 @@ -#automatically generated CMakeLists.txt, may not work! #the variable module_name is set up as a sugar to reduce "copy-paste" errors set (module_name "xdrfile") #Note that the macros here require this directory added as a subdir of plumed/src From 922eb63477728822e0cd8d37cce3af0d1283e42b Mon Sep 17 00:00:00 2001 From: Daniele Rapetti Date: Thu, 11 May 2023 11:54:37 +0200 Subject: [PATCH 39/40] added createCMakeLists.sh to src, maybe moved --- src/createCMakeLists.sh | 63 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100755 src/createCMakeLists.sh diff --git a/src/createCMakeLists.sh b/src/createCMakeLists.sh new file mode 100755 index 0000000000..c949d02723 --- /dev/null +++ b/src/createCMakeLists.sh @@ -0,0 +1,63 @@ +#!/bin/bash +#small utilty that recurses the src folder and creates a standard CMakeListst.txt +#for modules where is not present +#thinked to be launched in repodir/src + +createCMakeLists (){ + dir=$1 + if test -f "$dir/module.type" ; then + if test -f $dir/CMakeLists.txt ;then + echo "$dir has the CMakeLists.txt" + # if grep -q "automatically generated CMakeLists.txt, if it does not work" $dir/CMakeLists.txt; then + #this update non modified CMakeLists.txt, decomment if needed + # rm -v $dir/CMakeLists.txt + # fi + else + echo "$dir" + fi + + if test ! -f $dir/CMakeLists.txt + then + ( + cd $dir ||exit + { + echo "message(WARNING \"${dir} has an automatically generated CMakeLists.txt, if it does not work modify it and remove this warning\")" + echo "#the variable module_name is set up as a sugar to reduce \"copy-paste\" errors" + echo "set (module_name \"${dir}\")" + echo "#Note that the macros here require this directory added as a subdir of plumed/src" + + if [[ $(wc -l < Makefile) -gt 4 ]]; then + echo "message (FATAL_ERROR \"\${module_name} has a non standard Makefile (more than 4 lines) you need to modify the CMakeLists.txt!\")" + fi + + case "$(cat "module.type")" in + (always) echo "set(module_\${module_name} ON CACHE INTERNAL \"always active module \${module_name}\")";; + (default-on) echo "option(module_\${module_name} \"activate module \${module_name}\" ON)" ;; + (default-off) echo "option(module_\${module_name} \"activate module \${module_name}\" OFF)" ;; + esac + echo "ADDMODULETOKERNEL(\${module_name}" + ls -1 *.cpp + echo ")" + if grep -q USE Makefile; then + echo "ADDMODULENEEDS(\${module_name}" + t=$(awk '/USE=/{print }' < Makefile) + echo -e "\t${t#USE*=}" + echo ")" + echo "ADDMODULEDEPENDENCIES(\${module_name}" + t=$(awk '/USE=/{print }' < Makefile) + echo -e "\t${t#USE*=}" + echo ")" + fi + } > CMakeLists.txt + if ! grep -q "!/CMakeLists.txt" .gitignore && [[ -f .gitignore ]]; then + echo "!/CMakeLists.txt" >>.gitignore + fi + ) + fi + fi +} + + +for dir in */; do + createCMakeLists "${dir///}" +done From 56ea9e915d6461046bc639c292cfd4578e8b3726 Mon Sep 17 00:00:00 2001 From: Daniele Rapetti Date: Thu, 18 May 2023 15:31:17 +0200 Subject: [PATCH 40/40] added zlib --- src/CMakeLists.txt | 1 - src/config/CMakeLists.txt | 11 ++++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 99bbd1f2be..c5f3940f1d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -234,7 +234,6 @@ endif() # --enable-external-molfile-plugins # enable search for external molfile_plugins, default: # yes -# --enable-zlib enable search for zlib, default: yes # --enable-readdir-r enable search for readdir_r (threadsafe), default: # no # --enable-cregex enable search for C regular expression, default: yes diff --git a/src/config/CMakeLists.txt b/src/config/CMakeLists.txt index 5c77bb02f8..be6a4c289a 100644 --- a/src/config/CMakeLists.txt +++ b/src/config/CMakeLists.txt @@ -47,9 +47,18 @@ if(enable_openmp) find_package(OpenMP) if(OpenMP_CXX_FOUND) target_link_libraries(config INTERFACE OpenMP::OpenMP_CXX) - endif() + endif(OpenMP_CXX_FOUND) endif(enable_openmp) +option(enable_zlib "enable search for zlib" ON) +if(enable_zlib) + find_package(ZLIB) + if(ZLIB_FOUND) + target_link_libraries(config INTERFACE ZLIB::ZLIB) + target_compile_definitions(config INTERFACE __PLUMED_HAS_ZLIB) + endif(ZLIB_FOUND) +endif(enable_zlib) + target_link_libraries(Config PUBLIC config) target_include_directories(Config PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})