ppmd.lib.build module

ppmd.lib.build.build_lib(lib, extensions, source_dir, CC, dst_dir, inc_dirs)
ppmd.lib.build.lib_from_file_source(base_filename, func_name, consts_dict=None, extensions=('.h', '.cpp'), cc=GCC, ['g++', ]['-fPIC', '-std=c++11', '-fopenmp', ]['-lm', ]['-O3', '-march=native', '-m64', '-fassociative-math', '-ffast-math', ]['-g', ]['-c', ]['-shared', ]__restrict__)

Compile and load a shared library from source files. :param base_filename: Base file name of source files e.g. “ABC” for “ABC.cpp, ABC.h” :param func_name: Name of function in source files to load. :param consts_dict: Dictionary of form {‘KEY’: ‘value’} that will be applied to both code sources. :param extensions: Default (‘.cpp’, ‘.h’) extensions to use with base_filename. :param cc: Compiler to use, default set to default compiler. :return: compiled loaded library.

ppmd.lib.build.simple_lib_creator(header_code, src_code, name='', extensions=('.h', '.cpp'), dst_dir=None, CC=GCC, ['g++', ]['-fPIC', '-std=c++11', '-fopenmp', ]['-lm', ]['-O3', '-march=native', '-m64', '-fassociative-math', '-ffast-math', ]['-g', ]['-c', ]['-shared', ]__restrict__, prefix='HOST', inc_dirs=('/home/travis/virtualenv/python3.7.6/lib/python3.7/site-packages/ppmd/lib', ))
ppmd.lib.build.write_header(header_src, extension='.h', dst_dir='/tmp/build')

Write the passed string as a header file in the build directory. Returns a ppmd.kernel.Header instance that can be passed to ppmd.kernel.Kernel constructors.

Parameters
  • header_src – Source code for header.

  • extension – File extension for header file, default ‘.h’.

  • dst_dir – Directory to write file into, default ppmd.runtime.BUILD_DIR.

Returns

ppmd.kernel.Header instance.