def gen_pyx(odir): gtr_files = glob.glob(jp(os.path.abspath('generator'), '*')) + ['./setup.py'] src_files = [ os.path.abspath('build/daal4py_cpp.h'), os.path.abspath('build/daal4py_cpp.cpp'), os.path.abspath('build/daal4py_cy.pyx') ] if all(os.path.isfile(x) for x in src_files): src_files.sort(key=lambda x: os.path.getmtime(x)) gtr_files.sort(key=lambda x: os.path.getmtime(x), reverse=True) if os.path.getmtime(src_files[0]) > os.path.getmtime(gtr_files[0]): print('Generated files are all newer than generator code.' 'Skipping code generation') return from generator.gen_daal4py import gen_daal4py odir = os.path.abspath(odir) if not os.path.isdir(odir): os.mkdir(odir) gen_daal4py(dal_root, odir, d4p_version, no_dist=no_dist, no_stream=no_stream)
def gen_pyx(odir): odir = os.path.abspath(odir) if not os.path.isdir(odir): os.mkdir(odir) gen_daal4py(daal_root, odir, d4p_version, no_dist=no_dist, no_stream=no_stream)
# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. #=============================================================================== from generator.gen_daal4py import gen_daal4py if __name__ == "__main__": import argparse global no_warn description = """A tool to create cython interface files for HLAPI of oneDAL (aka daal4py). Extracting necessary data and creating internal data structures. See parse.py for details about C++ parsing. See wrappers.py for necessary configuration that can not be auto-extracted. See wrapper_gen.py for code generation (cython and C++). """ argParser = argparse.ArgumentParser(prog="gen_daal4py.py", description=description, formatter_class=argparse.ArgumentDefaultsHelpFormatter) argParser.add_argument('--daalroot', required=True, help="DAAL root directory (reads include dir in there)") argParser.add_argument('--outdir', default='build', help="Output directory to store wrapper files to") argParser.add_argument('--wall', default=False, action='store_true', help="Emit all warnings") args = argParser.parse_args() gen_daal4py(args.daalroot, args.outdir, "v_develop", args.wall)
def gen_pyx(odir): odir = os.path.abspath(odir) if not os.path.isdir(odir): os.mkdir(odir) gen_daal4py(daal_root, odir, d4p_version)