Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Revert "Dynamic Library Loading Support" #15755

Merged
merged 6 commits into from
Aug 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,6 @@ if(UNIX)
add_library(mxnet SHARED ${DUMMY_SOURCE})
target_link_libraries(mxnet PRIVATE ${BEGIN_WHOLE_ARCHIVE} $<TARGET_FILE:mxnet_static> ${END_WHOLE_ARCHIVE})
target_link_libraries(mxnet PRIVATE mxnet_static)
target_link_libraries(mxnet_static PUBLIC ${CMAKE_DL_LIBS})
set_target_properties(mxnet_static PROPERTIES OUTPUT_NAME mxnet)
else()
add_library(mxnet SHARED ${SOURCE})
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ else
CFLAGS += -O3 -DNDEBUG=1
endif
CFLAGS += -I$(TPARTYDIR)/mshadow/ -I$(TPARTYDIR)/dmlc-core/include -fPIC -I$(NNVM_PATH)/include -I$(DLPACK_PATH)/include -I$(TPARTYDIR)/tvm/include -Iinclude $(MSHADOW_CFLAGS)
LDFLAGS = -pthread -ldl $(MSHADOW_LDFLAGS) $(DMLC_LDFLAGS)
LDFLAGS = -pthread $(MSHADOW_LDFLAGS) $(DMLC_LDFLAGS)

ifeq ($(ENABLE_TESTCOVERAGE), 1)
CFLAGS += --coverage
Expand Down
31 changes: 0 additions & 31 deletions example/lib_api/Makefile

This file was deleted.

78 changes: 0 additions & 78 deletions example/lib_api/libtest.cc

This file was deleted.

37 changes: 0 additions & 37 deletions example/lib_api/mylib.cc

This file was deleted.

31 changes: 0 additions & 31 deletions example/lib_api/test.py

This file was deleted.

7 changes: 0 additions & 7 deletions include/mxnet/c_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,6 @@ MXNET_DLL const char *MXGetLastError();
// Part 0: Global State setups
//-------------------------------------

/*!
* \brief Load library dynamically
* \param path to the library .so file
* \return 0 when success, -1 when failure happens.
*/
MXNET_DLL int MXLoadLib(const char *path);

/*!
* \brief Get list of features supported on the runtime
* \param libFeature pointer to array of LibFeature
Expand Down
50 changes: 0 additions & 50 deletions include/mxnet/lib_api.h

This file was deleted.

1 change: 0 additions & 1 deletion python/mxnet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
from .base import MXNetError
from .util import is_np_shape, set_np_shape, np_shape, use_np_shape
from . import base
from . import library
from . import contrib
from . import ndarray
from . import ndarray as nd
Expand Down
2 changes: 1 addition & 1 deletion python/mxnet/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def __repr__(self):


class MXNetError(Exception):
"""Error that will be thrown by all mxnet functions."""
"""Error that will be throwed by all mxnet functions."""
pass


Expand Down
49 changes: 0 additions & 49 deletions python/mxnet/library.py

This file was deleted.

15 changes: 0 additions & 15 deletions src/c_api/c_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,11 @@
#include "mxnet/storage.h"
#include "mxnet/libinfo.h"
#include "mxnet/imperative.h"
#include "mxnet/lib_api.h"
#include "./c_api_common.h"
#include "../operator/custom/custom-inl.h"
#include "../operator/tensor/matrix_op-inl.h"
#include "../operator/tvmop/op_module.h"
#include "../common/utils.h"
#include "../common/library.h"

using namespace mxnet;

Expand Down Expand Up @@ -92,19 +90,6 @@ inline int MXAPIGetFunctionRegInfo(const FunRegType *e,

// NOTE: return value is added in API_END

// Loads library and initializes it
int MXLoadLib(const char *path) {
API_BEGIN();
void *lib = load_lib(path);
if (!lib)
LOG(FATAL) << "Unable to load library";

initialize_t initialize = get_func<initialize_t>(lib, const_cast<char*>(MXLIB_INITIALIZE_STR));
if (!initialize(static_cast<int>(MXNET_VERSION)))
LOG(FATAL) << "Library failed to initialize";
API_END();
}

int MXLibInfoFeatures(const struct LibFeature **lib_features, size_t *size) {
using namespace features;
API_BEGIN();
Expand Down
Loading