Skip to content

Commit

Permalink
Build morpheus_dfp python package via cmake
Browse files Browse the repository at this point in the history
The morpheus_dfp package is entirely python and setup.py can be used directly to
create this package. However for the sake of consistency cmake with
mopheus_utils_build_python_package is used.

Signed-off-by: Anuradha Karuppiah <[email protected]>
  • Loading branch information
AnuradhaKaruppiah committed Sep 23, 2024
1 parent d67787b commit d093166
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
2 changes: 2 additions & 0 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ if (MORPHEUS_BUILD_MORPHEUS_LLM)
add_subdirectory(morpheus_llm)
endif()

add_subdirectory(morpheus_dfp)

list(POP_BACK CMAKE_MESSAGE_CONTEXT)
46 changes: 46 additions & 0 deletions python/morpheus_dfp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# SPDX-FileCopyrightText: Copyright (c) 2021-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

list(APPEND CMAKE_MESSAGE_CONTEXT "morpheus_dfp")

# Save the root of the python for relative paths
set(MORPHEUS_DFP_PY_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/..)


# #####################################
# #### Morpheus DFP Python Setup ######
# #####################################
morpheus_utils_python_configure()

morpheus_utils_create_python_package(morpheus_dfp
PROJECT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
SOURCE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/morpheus_dfp"
)

if(MORPHEUS_PYTHON_INPLACE_BUILD)
list(APPEND extra_args "IS_INPLACE")
endif()

if(MORPHEUS_PYTHON_BUILD_WHEEL)
list(APPEND extra_args "BUILD_WHEEL")
endif()

if(MORPHEUS_PYTHON_PERFORM_INSTALL)
list(APPEND extra_args "INSTALL_WHEEL")
endif()

morpheus_utils_build_python_package(morpheus_dfp ${extra_args})

list(POP_BACK CMAKE_MESSAGE_CONTEXT)

0 comments on commit d093166

Please sign in to comment.