-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cmake #934
base: master
Are you sure you want to change the base?
Cmake #934
Changes from 36 commits
22fe1d6
81a9ef4
326cf0c
2a89c5e
379dfa9
ccb6300
a4ff2ef
3ba4365
ee2d521
67d09e6
177963b
e05e601
d252d1b
a043f10
b992859
1e6e3e9
7a2e49e
6d77e8e
a7302cb
f8ba2fa
f98f8f2
23e754f
8057438
b0c25d2
0aad386
eb28dc1
d2bc2ed
f1253af
63ca38e
4ac3f5c
fed659e
c2ddbfa
7d3bd99
2343dd1
e41baaf
7ecfe58
3613643
a111720
7812192
922eb63
56ea9e9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,3 +24,4 @@ makefile.dep | |
/config.* | ||
/autom4* | ||
/stamp-h | ||
build |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
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) | ||
#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) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,6 +55,7 @@ | |
!/s2cm | ||
!/pytorch | ||
!/membranefusion | ||
!CMakeLists.txt | ||
|
||
# And just ignore these files | ||
*.xxd | ||
|
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ | |
!/Makefile | ||
!/README | ||
!/module.type | ||
!/CMakeLists.txt |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#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 ${module_name}" 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 | ||
) | ||
ADDMODULENEEDS(${module_name} | ||
core tools vesselbase multicolvar | ||
) | ||
ADDMODULEDEPENDENCIES(${module_name} | ||
#core #tools depends on | ||
#tools #vesselbase depends on | ||
#vesselbase # multicolvar depends on | ||
multicolvar | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ | |
!/Makefile | ||
!/README | ||
!/module.type | ||
!/CMakeLists.txt |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#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 ${module_name}" 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 | ||
) | ||
ADDMODULENEEDS(${module_name} | ||
core tools reference vesselbase gridtools multicolvar bias | ||
) | ||
ADDMODULEDEPENDENCIES(${module_name} | ||
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 #tools core | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ core/** | |
deps/** | ||
function/** | ||
*.o | ||
!/CMakeLists.txt |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 "annfunc") | ||
#Note that the macros here require this directory added as a subdir of plumed/src | ||
option(module_${module_name} "activate module ${module_name}" OFF) | ||
ADDMODULETOKERNEL(${module_name} | ||
ANN.cpp | ||
) | ||
ADDMODULENEEDS(${module_name} | ||
core function | ||
) | ||
ADDMODULEDEPENDENCIES(${module_name} | ||
function #reference tools core lepton | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#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 ${module_name}") | ||
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 | ||
) | ||
ADDMODULENEEDS(${module_name} | ||
|
||
) | ||
ADDMODULEDEPENDENCIES(${module_name} | ||
|
||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ | |
!/Makefile | ||
!/README | ||
!/module.type | ||
!/CMakeLists.txt |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 "bias") | ||
#Note that the macros here require this directory added as a subdir of plumed/src | ||
option(module_${module_name} "activate module ${module_name}" 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 | ||
) | ||
ADDMODULENEEDS(${module_name} | ||
core tools | ||
) | ||
ADDMODULEDEPENDENCIES(${module_name} | ||
core #tools | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ | |
!/Makefile | ||
!/README | ||
!/module.type | ||
!/CMakeLists.txt |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +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} | ||
# | ||
#) | ||
|
||
#include(FortranCInterface) | ||
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 ;; | ||
################################################################################ | ||
# 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) | ||
|
||
# print_target_property(${module_name} COMPILE_OPTIONS) | ||
# print_target_property(${module_name} COMPILE_DEFINITIONS) | ||
# print_target_property(${module_name} INTERFACE_COMPILE_DEFINITIONS) |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Iximiel these changes are only for readability right? Please notice that these files are automatically generated Ideally, you could add these comments in the Another thing that I find very useful is to add comments with matching braces (see e.g. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, these changes in the source files are for readability.
You mean There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I mean #endif // } There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I mean in addition to your comment |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ | |
!/README | ||
!/module.type | ||
!/*.sh | ||
!/CMakeLists.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Iximiel are these file lists automatically generated? If so, is it possible not to include them in the repository?
Ideally, the build system will just use all the files in that directory. Can cmake do this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the base file is "automatically generated" by a homemade sh script (that I'm in doubt of including or not in the repository), but the ADDMODULEDEPENDENCIES macro arguments are them manually changed.
This because I wanted to reduce the "dependencies entanglement" and some circular dependency tree that exist if we use the list of dependencies in the "USE=" from the original Makefile (like core and tools).
I forgot to remove the lines "#automatically generated CMakeLists.txt, may not work!".