potfit wiki

open source force-matching

User Tools

Site Tools


compiling:waf

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
compiling:waf [2018/09/16 10:18] danielcompiling:waf [2018/09/16 10:21] (current) – removed daniel
Line 1: Line 1:
-~~NOTOC~~ 
-====== Compiling potfit ====== 
----- 
- 
-//potfit// uses the [[https://waf.io/|waf]] build system, which is fast, easy to use and very flexible. It is written in Python and requires a Python runtime to be available on the system.  
- 
-The old [[compiling:make|Makefile-based build system]] is still available for compatibility reasons. It may not support all features and will be removed at some point. 
- 
-===== Basics ===== 
- 
-The //potfit// source tree contains the waf binary in its root folder. It is used for all build related operations like configuration, building and cleanup. It provides an exhaustive help page when called with the --help argument: 
-<code>./waf --help</code> 
- 
-Building potfit is split up into two stages: first a configuration stage and then a build stage. The configuration stage checks if all requirements for a building a binary with the requested options is possible and the build stage then invokes the compiler to create the binary. 
- 
-=== 1. Configuration === 
- 
-The configuration uses the ''configure'' command from waf: 
- 
-<code>./waf configure <additional arguments></code> 
- 
-A minimal configuration needs to specify at least the interaction (-i) and maybe the potential model (-m): 
- 
-<code>./waf configure -i pair -m apot</code> 
- 
-After the configuration stage is complete a summary of selected options will be shown: 
-<code> 
-potfit has been configured with the following options: 
-potential model      = apot 
-interaction          = pair 
-math library         = mkl 
-</code> 
- 
-=== 2. Build === 
- 
-The build process can be start with the ''build'' command from waf: 
- 
-<code>./waf build</code> 
- 
-Since ''build'' is the default command it can also be omitted for brevity. 
- 
-Once the build process is complete, there will be a line indicating the name of the created binary: 
- 
-<code> 
----> Successfully moved potfit_apot_pair_mkl to bin/ folder <--- 
-</code> 
- 
-===== Setting options ===== 
- 
-Special options when compiling //potfit// can be set using the ''--enable-'' command line options during the configure stage. All available options are listed in the ''--help'' page from waf. 
- 
-To enable support from stress, provide the ''--enable-stress'' option like this: 
- 
-<code>./waf configure -i pair -m apot --enable-stress</code> 
- 
-All enabled options will also be listed on the summary of the configuration stage: 
- 
-<code> 
-potfit has been configured with the following options: 
-potential model      = apot 
-interaction          = pair 
-math library         = mkl 
-options              = stress 
-</code> 
- 
-===== Advanced options ===== 
- 
-Most issues with the waf build systems can be resolved using the information provided on the ''--help'' page. 
-Here are some common issues and their recommended solution: 
- 
-=== Setting MKL path === 
- 
-The default path for the MKL libraries is ''/opt/intel/mkl''. If your installation resides in a different location you can use the ''--math-lib-base-dir'' option like this: 
- 
-<code>./waf configure -i pair -m apot --math-lib-base-dir=/my/custom/location</code> 
- 
-=== Setting compiler === 
- 
-By default waf will search for the following compilers (in the same order as provided here): 
-  * Intel Compiler Collection 
-  * Clang 
-  * GCC 
-To select a particular compiler use the ''--check-c-compiler'' option like this: 
- 
-<code>./waf configure -i pair -m apot --check-c-compiler=clang</code> 
- 
-Waf will search for the compiler in the default paths. 
- 
-Additionally it is possible to use the ''CC'' environment variable to override the compiler during the configuration phase of waf. 
- 
-=== Setting debug options === 
- 
-Depending on the selected compiler the following debug options are available: 
- 
-  * ''--debug'' Adds debug information to the potfit binary for debugging potfit 
-  * ''--asan'' Enable the [[https://github.com/google/sanitizers/wiki/AddressSanitizer|address sanitizer]] 
-  * ''--profile'' Add profiling information to the //potfit// binary 
- 
-===== Troubleshooting ===== 
- 
-When waf encounters an error there is usually a message which provides detailed information about the command which failed. If this is not the case it is possible to enable more logging by adding ''-v'' to the command line: 
- 
-<code>./waf configure -i pair -m apot -v</code> 
- 
-Logging can be increased even further by adding additional ''-v'' arguments. 
- 
-===== Developer guide ===== 
- 
-A short introduction to extending the waf build system for //potfit// is available [[compiling:devel|here]]. 
  
compiling/waf.1537085895.txt.gz · Last modified: 2018/09/16 10:18 by daniel