Commit c6c2e156 by Tianqi Chen

[CMAKE] Update cmake to support OSX/Linux (#228)

parent 510105fc
......@@ -43,10 +43,10 @@ if(MSVC)
endif(${flag_var} MATCHES "/MD")
endforeach(flag_var)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
find_library(TVM_LIB tvm
find_library(TVM_LIB tvm
HINTS ${CMAKE_CURRENT_SOURCE_DIR}/../tvm/build/Release
HINTS ${CMAKE_CURRENT_SOURCE_DIR}/tvm/build/Release)
message(STATUS "Build with TVM libary: " ${TVM_LIB})
HINTS ${CMAKE_CURRENT_SOURCE_DIR}/tvm/build/Release)
message(STATUS "Build with TVM libary: " ${TVM_LIB})
list(APPEND NNVM_COMPILER_LINKER_LIBS ${TVM_LIB})
else(MSVC)
include(CheckCXXCompilerFlag)
......@@ -55,6 +55,11 @@ else(MSVC)
set(CMAKE_CXX_FLAGS ${CMAKE_C_FLAGS})
endif(MSVC)
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -undefined dynamic_lookup")
endif()
mxnet_source_group("Include\\c_api" GLOB "src/c_api/*.h")
mxnet_source_group("Include\\core" GLOB "src/core/*.h")
mxnet_source_group("Include\\pass" GLOB "src/pass/*.h")
......
......@@ -30,6 +30,7 @@ def find_lib_path():
api_path = os.path.join(base_path, '../../lib/')
cmake_build_path = os.path.join(base_path, '../../build/Release/')
cmake_build_path = os.path.join(base_path, '../../build/')
dll_path = [base_path, api_path, cmake_build_path]
if sys.platform.startswith('linux') and os.environ.get('LD_LIBRARY_PATH', None):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment