Skip to content

Commit

Permalink
generate d4py version in gen_daal4py
Browse files Browse the repository at this point in the history
  • Loading branch information
fschlimb committed Sep 20, 2018
1 parent 94efb81 commit 337f98e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion gen.py
Expand Up @@ -19,4 +19,4 @@
argParser.add_argument('--wall', default=False, action='store_true', help="Emit all warnings")

args = argParser.parse_args()
gen_daal4py(args.daalroot, args.outdir,args.wall)
gen_daal4py(args.daalroot, args.outdir, "v_develop", args.wall)
7 changes: 6 additions & 1 deletion generator/gen_daal4py.py
Expand Up @@ -863,7 +863,7 @@ def hlapi(self, algo_patterns):
###############################################################################
###############################################################################

def gen_daal4py(daalroot, outdir, warn_all=False):
def gen_daal4py(daalroot, outdir, version, warn_all=False):
global no_warn
if warn_all:
no_warn = {}
Expand Down Expand Up @@ -896,3 +896,8 @@ def gen_daal4py(daalroot, outdir, warn_all=False):
f.write(cpp_cpp)
with open(jp(outdir, 'daal4py_cy.pyx'), 'w') as f:
f.write(pyx_file)
f.write('cdef extern from "daal.h":\n')
f.write(' cdef const long long INTEL_DAAL_VERSION\n')
f.write(' cdef const long long __INTEL_DAAL_BUILD_DATE\n\n')
f.write('__version__ = "{}"\n'.format(version))
f.write('__daal_version__ = "{}_{}".format(INTEL_DAAL_VERSION, __INTEL_DAAL_BUILD_DATE)\n')
6 changes: 0 additions & 6 deletions generator/wrapper_gen.py
Expand Up @@ -114,12 +114,6 @@ def __dealloc__(self):
T* dynamicPointerPtrCast[T,U](U*)
cdef const char * D4P_VERSION
cdef const long long INTEL_DAAL_VERSION
cdef const long long __INTEL_DAAL_BUILD_DATE
__version__ = '{}'.format(D4P_VERSION)
__daal_version__ = '{}_{}'.format(INTEL_DAAL_VERSION, __INTEL_DAAL_BUILD_DATE)
NAN64 = NaN64
NAN32 = NaN32
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -160,7 +160,7 @@ def gen_pyx(odir):
odir = os.path.abspath(odir)
if not os.path.isdir(odir):
os.mkdir(odir)
gen_daal4py(daal_root, odir)
gen_daal4py(daal_root, odir, d4p_version)

gen_pyx(os.path.abspath('./build'))

Expand Down

0 comments on commit 337f98e

Please sign in to comment.