SINGA-143 The compilation cannot detect libsingagpu.so file Add LIBTOOL environment parameters in configure.ac. Edit some parameters in Makefile.am.
Project: http://git-wip-us.apache.org/repos/asf/incubator-singa/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-singa/commit/8d4953a2 Tree: http://git-wip-us.apache.org/repos/asf/incubator-singa/tree/8d4953a2 Diff: http://git-wip-us.apache.org/repos/asf/incubator-singa/diff/8d4953a2 Branch: refs/heads/master Commit: 8d4953a2a601bc1a6ae78f44f65fbbe2967687aa Parents: c1444b7 Author: xiezl <[email protected]> Authored: Mon Feb 1 13:57:23 2016 +0800 Committer: xiezl <[email protected]> Committed: Mon Feb 1 14:06:31 2016 +0800 ---------------------------------------------------------------------- Makefile.am | 6 +- configure.ac | 6 +- tool/python/singa/driver.py | 122 --------------------------------------- 3 files changed, 8 insertions(+), 126 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/8d4953a2/Makefile.am ---------------------------------------------------------------------- diff --git a/Makefile.am b/Makefile.am index dd97844..55c45e1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,6 +2,7 @@ ACLOCAL_AMFLAGS = -I config AUTOMAKE_OPTIONS = foreign subdir-objects #AM_CPPFLAGS = -I$(top_srcdir)/src +#AM_LDFLAGS = $(LD_FLAGS) MSHADOW_FLAGS = -DMSHADOW_USE_CUDA=0 -DMSHADOW_USE_CBLAS=1 -DMSHADOW_USE_MKL=0 DEFAULT_FLAGS = -Wall -pthread -fPIC -std=c++11 -Wno-unknown-pragmas \ @@ -179,7 +180,7 @@ endif if DCUDA libsinga_la_SOURCES += $(CUDA_SRCS) $(CUDA_HDRS) libsinga_la_CXXFLAGS += $(CUDA_CFLAGS) -libsinga_la_LDFLAGS += $(CUDA_LDFLAGS) $(CUDA_LIBS) -lsingagpu +libsinga_la_LDFLAGS += $(CUDA_LDFLAGS) $(CUDA_LIBS) -L./ -lsingagpu -Wl,-rpath=. libsinga_la_LIBADD = libsingagpu.so endif @@ -298,6 +299,7 @@ clean-local: rm -rf src/utils/math_kernel.o rm -rf rat_check rm -rf tool/python/pb2 + rm -rf libsingagpu.so # Add scrips for py driver installation all-local: @@ -325,7 +327,7 @@ rat: # Generate gpu libs for singa libsingagpu.so: $(CUDA_OBJS) - $(NVCC) -o libsingagpu.so -shared -Xcompiler -fPIC $(CUDA_OBJS) $(CUDA_CFLAGS) $(CUDA_LDFLAGS) $(CUDA_LIBS) -I$(top_srcdir)/include -std=c++11 -G + $(NVCC) -o libsingagpu.so -shared -Xcompiler -fPIC $(CUDA_OBJS) $(CUDA_CFLAGS) $(CUDA_LDFLAGS) $(CUDA_LIBS) -I$(top_srcdir)/include -std=c++11 -G # Create python class files install-pyLTLIBRARIES: $(py_LTLIBRARIES) http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/8d4953a2/configure.ac ---------------------------------------------------------------------- diff --git a/configure.ac b/configure.ac index c7f1877..41ff510 100644 --- a/configure.ac +++ b/configure.ac @@ -68,11 +68,12 @@ if test x"$cudaval" = x"yes"; then CUDA_LDFLAGS="-L$cuda_prefix/lib64 -L$cuda_prefix/lib" CUDA_LIBS="-lcublas -lcudart -lcurand" LIBS="$LIBS $CUDA_LIBS" - LDFLAGS="$LDFLAGS $CUDA_LDFLAGS" + LDFLAGS="$LDFLAGS $CUDA_LDFLAGS -L./" + LIBTOOL='LD_LIBRARY_PATH=$(PWD) $(SHELL) $(top_builddir)/libtool' NVCC="nvcc" DEBUG="-DUSE_GPU" AC_DEFINE(DCUDA,[1],[Defined if CUDA should be used]) - AC_CHECK_LIB([cuda], [main], [], [ + AC_CHECK_LIB([cublas], [main], [], [ AC_MSG_ERROR([unable to find cuda library]) ]) AC_CHECK_LIB([cudart], [main], [], [ @@ -88,6 +89,7 @@ else NVCC="" DEBUG="-DCPU_ONLY" fi +AC_SUBST(LIBTOOL) AC_SUBST(NVCC) AC_SUBST(CUDA_LDFLAGS) AC_SUBST(CUDA_LIBS) http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/8d4953a2/tool/python/singa/driver.py ---------------------------------------------------------------------- diff --git a/tool/python/singa/driver.py b/tool/python/singa/driver.py deleted file mode 100644 index d203923..0000000 --- a/tool/python/singa/driver.py +++ /dev/null @@ -1,122 +0,0 @@ -# This file was automatically generated by SWIG (http://www.swig.org). -# Version 2.0.11 -# -# Do not make changes to this file unless you know what you are doing--modify -# the SWIG interface file instead. - - - - - -from sys import version_info -if version_info >= (2,6,0): - def swig_import_helper(): - from os.path import dirname - import imp - fp = None - try: - fp, pathname, description = imp.find_module('_driver', [dirname(__file__)]) - except ImportError: - import _driver - return _driver - if fp is not None: - try: - _mod = imp.load_module('_driver', fp, pathname, description) - finally: - fp.close() - return _mod - _driver = swig_import_helper() - del swig_import_helper -else: - import _driver -del version_info -try: - _swig_property = property -except NameError: - pass # Python < 2.2 doesn't have 'property'. -def _swig_setattr_nondynamic(self,class_type,name,value,static=1): - if (name == "thisown"): return self.this.own(value) - if (name == "this"): - if type(value).__name__ == 'SwigPyObject': - self.__dict__[name] = value - return - method = class_type.__swig_setmethods__.get(name,None) - if method: return method(self,value) - if (not static): - self.__dict__[name] = value - else: - raise AttributeError("You cannot add attributes to %s" % self) - -def _swig_setattr(self,class_type,name,value): - return _swig_setattr_nondynamic(self,class_type,name,value,0) - -def _swig_getattr(self,class_type,name): - if (name == "thisown"): return self.this.own() - method = class_type.__swig_getmethods__.get(name,None) - if method: return method(self) - raise AttributeError(name) - -def _swig_repr(self): - try: strthis = "proxy of " + self.this.__repr__() - except: strthis = "" - return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) - -try: - _object = object - _newclass = 1 -except AttributeError: - class _object : pass - _newclass = 0 - - -class SwigPyIterator(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, SwigPyIterator, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, SwigPyIterator, name) - def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined - class is abstract") - __repr__ = _swig_repr - __swig_destroy__ = _driver.delete_SwigPyIterator - __del__ = lambda self : None; - def value(self): return _driver.SwigPyIterator_value(self) - def incr(self, n=1): return _driver.SwigPyIterator_incr(self, n) - def decr(self, n=1): return _driver.SwigPyIterator_decr(self, n) - def distance(self, *args): return _driver.SwigPyIterator_distance(self, *args) - def equal(self, *args): return _driver.SwigPyIterator_equal(self, *args) - def copy(self): return _driver.SwigPyIterator_copy(self) - def next(self): return _driver.SwigPyIterator_next(self) - def __next__(self): return _driver.SwigPyIterator___next__(self) - def previous(self): return _driver.SwigPyIterator_previous(self) - def advance(self, *args): return _driver.SwigPyIterator_advance(self, *args) - def __eq__(self, *args): return _driver.SwigPyIterator___eq__(self, *args) - def __ne__(self, *args): return _driver.SwigPyIterator___ne__(self, *args) - def __iadd__(self, *args): return _driver.SwigPyIterator___iadd__(self, *args) - def __isub__(self, *args): return _driver.SwigPyIterator___isub__(self, *args) - def __add__(self, *args): return _driver.SwigPyIterator___add__(self, *args) - def __sub__(self, *args): return _driver.SwigPyIterator___sub__(self, *args) - def __iter__(self): return self -SwigPyIterator_swigregister = _driver.SwigPyIterator_swigregister -SwigPyIterator_swigregister(SwigPyIterator) - -class Driver(_object): - __swig_setmethods__ = {} - __setattr__ = lambda self, name, value: _swig_setattr(self, Driver, name, value) - __swig_getmethods__ = {} - __getattr__ = lambda self, name: _swig_getattr(self, Driver, name) - __repr__ = _swig_repr - def Train(self, *args): return _driver.Driver_Train(self, *args) - def Init(self, *args): return _driver.Driver_Init(self, *args) - def InitLog(self, *args): return _driver.Driver_InitLog(self, *args) - def Test(self, *args): return _driver.Driver_Test(self, *args) - def __init__(self): - this = _driver.new_Driver() - try: self.this.append(this) - except: self.this = this - __swig_destroy__ = _driver.delete_Driver - __del__ = lambda self : None; -Driver_swigregister = _driver.Driver_swigregister -Driver_swigregister(Driver) - -# This file is compatible with both classic and new-style classes. - -
