Skip to content

Commit

Permalink
fix: add CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS
Browse files Browse the repository at this point in the history
  • Loading branch information
CameronNg committed Jun 18, 2024
1 parent 0651936 commit e46d825
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
1 change: 0 additions & 1 deletion cpp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ all:
# Build the Cortex engine
build-deps:
ifeq ($(OS),Windows_NT)
@powershell -Command "Get-WmiObject win32_operatingsystem | select osarchitecture;"
@powershell -Command "cd tensorrt_llm/cortex.tensorrt-llm; cmake -S ./third-party -B ./build_deps/third-party -DCMAKE_BUILD_TYPE=Release -DCMAKE_OBJECT_PATH_MAX=500; cmake --build ./build_deps/third-party --config Release -j8;"
else
@cd tensorrt_llm/cortex.tensorrt-llm && cmake -S ./third-party -B ./build_deps/third-party -DCMAKE_BUILD_TYPE=Release -DCMAKE_OBJECT_PATH_MAX=500 && make -C ./build_deps/third-party -j 10 && rm -rf ./build_deps/third-party;
Expand Down
10 changes: 4 additions & 6 deletions cpp/tensorrt_llm/cortex.tensorrt-llm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# C++17
# engine init
include(CheckIncludeFileCXX)

check_include_file_cxx(any HAS_ANY)
check_include_file_cxx(string_view HAS_STRING_VIEW)
check_include_file_cxx(coroutine HAS_COROUTINE)
Expand All @@ -29,10 +28,10 @@ else()
set(CMAKE_CXX_STANDARD 14)
endif()


set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
SET(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)

set(CMAKE_PREFIX_PATH ${CMAKE_CURRENT_SOURCE_DIR}/build_deps/_install)

message(STATUS "Current Source Directory CORTEX: ${CMAKE_CURRENT_SOURCE_DIR}")
Expand Down Expand Up @@ -65,6 +64,8 @@ endif()
message(STATUS "SentencePiece library dirs: ${SENTENCEPIECE_LIBRARY_DIRS}")
message(STATUS "SentencePiece header dirs: ${SENTENCEPIECE_INCLUDE_DIRS}")

add_library(engine SHARED src/tensorrt-llm_engine.cc)

include_directories(${PROJECT_SOURCE_DIR}/include ${SENTENCEPIECE_INCLUDE_DIRS})

link_directories(${SENTENCEPIECE_LIBRARY_DIRS})
Expand All @@ -76,9 +77,6 @@ add_custom_target(engine_proj)
set(CXXOPTS_SRC_DIR ${PROJECT_SOURCE_DIR}/../3rdparty/cxxopts)
add_subdirectory(${CXXOPTS_SRC_DIR} ${CMAKE_CURRENT_BINARY_DIR}/cxxopts)

# main
# add_executable(engine main.cc)
add_library(engine SHARED src/tensorrt-llm_engine.cc)
target_link_libraries(
engine PUBLIC ${SHARED_TARGET} nvinfer_plugin_tensorrt_llm cxxopts::cxxopts sentencepiece PRIVATE ${JSONCPP} ${TRANTOR} ${CMAKE_THREAD_LIBS_INIT} )

Expand Down

0 comments on commit e46d825

Please sign in to comment.