PSCF v1.1
Classes | Functions
pscfpp.make Namespace Reference

Python scripts used by the PSCF makefile build system. More...

Classes

class  MakeMaker
 Class to construct makefile system for a set of source files. More...
 

Functions

def createDependencyFileCpp (processor, options, cfile, srcdir, blddir, extraDependencies='')
 Create a *.d dependency file for a C/C++ source file. More...
 
def createDependencyFileCuda (processor, options, cfile, srcdir, blddir, extraDependencies='')
 Create a *.d dependency file for a CUDA source file. More...
 
def editDepend (pfile, dfile, blddir, extraDependencies)
 Edit the dependency file created for a C/C++ file by the compiler. More...
 
def editDependLocal (pfile, dfile, blddir, srcroot, extraDependencies)
 Edit the dependency file created for a CUDA file by the compiler. More...
 

Detailed Description

Python scripts used by the PSCF makefile build system.

Function Documentation

◆ createDependencyFileCpp()

def pscfpp.make.createDependencyFileCpp (   processor,
  options,
  cfile,
  srcdir,
  blddir,
  extraDependencies = '' 
)

Create a *.d dependency file for a C/C++ source file.

This command uses a compiler executable to analyze the dependencies of a C/C++ source file in the src directory tree and creates a dependency file with an appropriate format for make in the analogous location in the bld directory tree. The function first executes a compiler command to compute dependencies and then calls python function editDepend to edit the resulting file. The most important change made during editing is the replacement of relative paths output by the g++ compiler to the absolute paths used in the PSCF build system.

Parameters
processorcompiler command to analyze dependencies (i.e., g++)
optionsstring of options passed to processor
cfilepath to source file
srcdirpath to source directory tree (SRC_DIR in makefiles)
blddirpath to bulkd directory tree (BLD_DIR in makefiles)
extraDependenciesstring of additional known dependencies

Definition at line 30 of file make.py.

References pscfpp.make.editDepend().

◆ createDependencyFileCuda()

def pscfpp.make.createDependencyFileCuda (   processor,
  options,
  cfile,
  srcdir,
  blddir,
  extraDependencies = '' 
)

Create a *.d dependency file for a CUDA source file.

This command uses a compiler executable to analyze the dependencies of a CUDA source file in the src directory tree and creates a dependency file with an appropriate format for make in the analogous location in the bld directory tree. The function first executes a compiler command to compute dependencies and then calls python function editDependLocal to edit the resulting file. The most important change made during editing is the replacement of relative paths output by the nvcc compiler to the absolute paths used in the PSCF build system.

Parameters
processorcompiler command to analyze dependencies (i.e., g++)
optionsstring of options passed to processor
cfilepath to source file
srcdirpath to source directory tree (SRC_DIR in makefiles)
blddirpath to build directory tree (BLD_DIR in makefiles)
extraDependenciesstring of additional known dependencies

Definition at line 84 of file make.py.

References pscfpp.make.editDependLocal().

◆ editDepend()

def pscfpp.make.editDepend (   pfile,
  dfile,
  blddir,
  extraDependencies 
)

Edit the dependency file created for a C/C++ file by the compiler.

This function edits the dependency file created by the g++ or compatible compiler so as to use absolute rather than relative paths, and so as to include the extraDependencies string.

Parameters
pfileinput dependency file name
dfileoutput dependency file name
blddirpath to build directory tree (BLD_DIR in makefiles)
extraDependenciesstring of additional known dependencies

Definition at line 134 of file make.py.

Referenced by pscfpp.make.createDependencyFileCpp().

◆ editDependLocal()

def pscfpp.make.editDependLocal (   pfile,
  dfile,
  blddir,
  srcroot,
  extraDependencies 
)

Edit the dependency file created for a CUDA file by the compiler.

This function edits the dependency file created by the nvcc compiler for a CUDA file so as to use absolute rather than relative paths, and so as to include the extraDependencies string.

Parameters
pfileinput dependency file name
dfileoutput dependency file name
blddirpath to build directory tree (BLD_DIR in makefiles)
srcrootpath to source directory tree (SRC_DIR in makefiles)
extraDependenciesstring of additional known dependencies

Definition at line 188 of file make.py.

Referenced by pscfpp.make.createDependencyFileCuda().