def build_libraries(self, libraries): customize_compiler(self.compiler) try: self.compiler.compiler_so.remove("-Wstrict-prototypes") except (AttributeError, ValueError): pass build_clib.build_libraries(self, libraries)
def build_libraries(self, libraries): # Build libraries that have no 'sources' key, accumulating the output # from pkg-config. for lib_name, build_info in libraries: if 'sources' not in build_info: for key, value in self.build_library(lib_name, **build_info).items(): if key in self.build_args: self.build_args[key].extend(value) else: self.build_args[key] = value # Use parent method to build libraries that have a 'sources' key. build_clib.build_libraries(self, ((lib_name, build_info) for lib_name, build_info in libraries if 'sources' in build_info))
def build_libraries(self, libraries): for lib_name, build_info in libraries: ldconf = build_info.pop('ldconf', None) if 'sources' not in build_info: for key, value in self.build_library(lib_name, **build_info).items(): if key in self.build_args: self.build_args[key].extend(value) else: self.build_args[key] = value if ldconf and os.access(ldconf['conf'], os.W_OK): with open(ldconf['conf'], 'w') as f: f.write(ldconf['path']) cmd = ['ldconfig'] check_call(cmd) build_clib.build_libraries(self, ((lib_name, build_info) for lib_name, build_info in libraries if 'sources' in build_info))
def build_libraries(self, libraries): clib_not_qmake = [] for (lib_name, build_info) in libraries: if build_info['qmake']: log.info("building '%s' library", lib_name) # init try_initialize_compiler(self.compiler) makedirs(self.build_temp) # qmake sources = os.path.abspath(build_info['sources'][0]) check_call(["qmake", sources], cwd=self.build_temp) # make make = "nmake" if self.compiler.compiler_type == 'msvc' else "make" # FIXME check_call([make], cwd=self.build_temp) else: clib_not_qmake.append((lib_name, build_info)) build_clib.build_libraries(self, clib_not_qmake)
def build_libraries(self, libraries): for lib_name, build_info in libraries: ldconf = build_info.pop('ldconf', None) if 'sources' not in build_info: for key, value in self.build_library(lib_name, **build_info).items(): if key in self.build_args: self.build_args[key].extend(value) else: self.build_args[key] = value if ldconf and os.access(ldconf['conf'], os.W_OK): with open(ldconf['conf'], 'w') as f: f.write(ldconf['path']) cmd = ['ldconfig'] check_call(cmd) build_clib.build_libraries( self, ((lib_name, build_info) for lib_name, build_info in libraries if 'sources' in build_info))
def build_libraries(self, libraries): self.compiler.src_extensions.append('.cu') arch = self.distribution.cuda_gpu_arch arch_arg = ["-arch=%s" % arch] if arch else [] # args = ["nvcc", "--device-c", "--ptxas-options=-v", "-c", args = [ "nvcc", "--device-c", "-c", "--compiler-options", ','.join([ '"%s"' % s if ('-Wp' in s) or ('-Wl' in s) else s for s in self.compiler.compiler_so[1:] ]) ] + arch_arg self.compiler.set_executables(compiler_so=args) # args = ["nvcc", "--device-c", "--ptxas-options=-v", "-c", "-Xptxas", "-v" args = [ "nvcc", "--device-c", "-c", "-Xptxas", "-v", "--compiler-options", ','.join([ '"%s"' % s if ('-Wp' in s) or ('-Wl' in s) else s for s in self.compiler.compiler_so[1:] ]) ] + arch_arg self.compiler.set_executables(compiler_cxx=args) args = ([ 'nvcc', "--lib", "--compiler-options", ','.join( self.compiler.archiver[1:]) ] + arch_arg + ["--output-file"]) # --output-file should be last one self.compiler.set_executables(archiver=args) sources = self.get_source_files() deps = sum([lib[1].get('depends', []) for lib in self.libraries], []) if not self.force: for name in self.get_library_names(): target = self.compiler.library_filename( name, output_dir=self.build_clib) if newer_group(sources + deps, target, 'newer'): break else: log.debug("skipping nvcc compiler (up-to-date)") return return build_clib.build_libraries(self, libraries)
def build_libraries(self, libraries): if old_msvc(self.compiler): for lib_name, build_info in libraries: build_info['include_dirs'].append('lib/primesieve/src/msvc_compat') print(build_info) build_clib.build_libraries(self, libraries)