User Tools

Site Tools


dev:makefile

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dev:makefile [2014/03/14 11:31] – [Packages] oschuettdev:makefile [2020/08/21 10:15] (current) – external edit 127.0.0.1
Line 3: Line 3:
 The CP2K Makefile automatically adopts to changes of the code base. The CP2K Makefile automatically adopts to changes of the code base.
  
-To add a file to the source tree, just create it. The Makefile will automatically discover it, compile it, and link it.+To add a file to the source tree, just create it. The Makefile will automatically discover it, compile it, and link it. Consequently, files that do not belong into the CP2K libraries must end on an ignored suffix.
  
- +The file discovery is based on a simple suffix naming convention: 
-The file discovery is based on a simple naming convention: +  * **.F files** are Fortran files. They are compiled into an object. They should contain either a ''MODULE'' or a ''PROGRAM''.
-  * **.F files** are Fortran files. They are compiled into an object. They must contain either a ''MODULE'' or a ''PROGRAM''.+
   * **.f90 files** are included Fortran files. They are **not** compiled into an object.   * **.f90 files** are included Fortran files. They are **not** compiled into an object.
   * **.c files** are C-files. They are compiled into an object.   * **.c files** are C-files. They are compiled into an object.
Line 13: Line 12:
   * **.h files** are C-header files. They are included by .c or .cu files. They are **not** compiled into an object.   * **.h files** are C-header files. They are included by .c or .cu files. They are **not** compiled into an object.
  
-===== Packages ===== +Furthermore, the code base is structured into [[packages]].
-The code base is structured into directoriesEvery directory has to contain a file called ''PACKAGE'' . A typical ''PACKAGE'' looks like this: +
-<code python> +
-+
-"description": "Smart process pinning", +
-"requires": ("../common", "../dbcsr", "../machine",+
-+
-</code>+
  
-The entry ''requires''  list all the directories on which the code in the current directory may depend upon. This means, modules in the current directory may only use modules from the listed directories. The requirements between directories must **not** have cycles.+===== Compiling Multiple Versions =====
  
-===== Compiling Multiple Version ===== +The Makefile allows to compile multiple versions of all build targets in parallel: 
-The Makefile allows to compile multiple version in parallel:+<code> 
 +$ make ARCH=Linux-x86-64-gfortran VERSION="sopt sdbg popt pdbg" 
 +</code> 
 +building only the main CP2K binary can be done as 
 <code> <code>
-$ make ARCH=Linux-x86-64-gfortran VERSION="sopt sdb popt pdbg"+$ make ARCH=Linux-x86-64-gfortran VERSION="sopt sdbg popt pdbg" cp2k
 </code> </code>
  
dev/makefile.1394796680.txt.gz · Last modified: 2020/08/21 10:14 (external edit)