Skip to content

Commit

Permalink
Fixes the "illegal thread local variable reference to regular symbol"…
Browse files Browse the repository at this point in the history
… error on MacOS.

Signed-off-by: Tao He <sighingnow@gmail.com>
  • Loading branch information
sighingnow committed Jul 3, 2023
1 parent 8267d73 commit 264e6f4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions graphlearn/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -553,8 +553,8 @@ add_custom_command (TARGET python
COMMAND cp -f ${GL_SETUP_DIR}/version.py ${GL_PYTHON_DIR}/python/version.py
COMMAND echo "__version__ = ${VERSION}" >> ${GL_PYTHON_DIR}/python/version.py
COMMAND echo "__git_version__ = '${GIT_BRANCH}-${GIT_VERSION}'" >> ${GL_PYTHON_DIR}/python/version.py
COMMAND OPEN_KNN=${KNN_FLAG} CXX_DIALECT=${GL_CXX_DIALECT} ${GL_PYTHON_BIN} ${GL_SETUP_DIR}/setup.py build_ext --inplace
COMMAND OPEN_KNN=${KNN_FLAG} CXX_DIALECT=${GL_CXX_DIALECT} ${GL_PYTHON_BIN} ${GL_SETUP_DIR}/setup.py bdist_wheel
COMMAND OPEN_KNN=${KNN_FLAG} CXX_DIALECT=${GL_CXX_DIALECT} Protobuf_LIBRARIES=${Protobuf_LIBRARIES} ${GL_PYTHON_BIN} ${GL_SETUP_DIR}/setup.py build_ext --inplace
COMMAND OPEN_KNN=${KNN_FLAG} CXX_DIALECT=${GL_CXX_DIALECT} Protobuf_LIBRARIES=${Protobuf_LIBRARIES} ${GL_PYTHON_BIN} ${GL_SETUP_DIR}/setup.py bdist_wheel
COMMAND ${CMAKE_COMMAND} -E make_directory "${GL_BUILT_BIN_DIR}/ge_data/data"
COMMAND ${CMAKE_COMMAND} -E make_directory "${GL_BUILT_BIN_DIR}/ge_data/ckpt"
WORKING_DIRECTORY ${GL_ROOT}
Expand Down
7 changes: 7 additions & 0 deletions graphlearn/setup/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
CUT_PATH = sys.path[0]
OPEN_KNN = os.getenv('OPEN_KNN', 'CLOSE')
CXX_DIALECT = os.getenv('CXX_DIALECT', 'c++11')
Protobuf_LIBRARIES = os.getenv('Protobuf_LIBRARIES', '')

extensions = []
include_dirs = []
Expand Down Expand Up @@ -62,6 +63,12 @@
# if OPEN_KNN == 'OPEN':
# libraries.append('knn_shared')

# explicitly link against protobuf to avoid the error
# "illegal thread local variable reference to regular symbol"
if sys.platform == 'darwin':
if Protobuf_LIBRARIES:
extra_link_args.append(Protobuf_LIBRARIES)

sources = [ROOT_PATH + '/python/c/py_export.cc',
ROOT_PATH + '/python/c/py_client.cc']
if OPEN_KNN == 'OPEN':
Expand Down
2 changes: 1 addition & 1 deletion graphlearn/src/include/graph_request.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace io {
struct SideInfo;
struct EdgeValue;
struct NodeValue;
struct AttributeValue;
class AttributeValue;
} // namespace io

class UpdateRequest : public OpRequest {
Expand Down

0 comments on commit 264e6f4

Please sign in to comment.