Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: use onecc on ubuntu 24.04 #14514

Closed
wants to merge 2 commits into from
Closed
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
2 changes: 2 additions & 0 deletions compiler/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ endif()

if(${ONE_UBUNTU_CODENAME} STREQUAL "bionic")
set(ONE_UBUNTU_CODENAME_BIONIC TRUE)
elseif(${ONE_UBUNTU_CODENAME} STREQUAL "noble")
set(ONE_UBUNTU_CODENAME_NOBLE TRUE)
endif()

# TODO Validate the argument of "requires"
Expand Down
55 changes: 40 additions & 15 deletions compiler/one-cmds/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,43 @@
# Ubuntu18.04; explictly installed python3.8 (default is python3.6)
# Ubuntu20.04; default python3.8
# Ubuntu22.04; default python3.10
# Ubuntu24.04; explicitly installed python3.8 (default is python3.12)
# refer https://github.com/Samsung/ONE/issues/9962
find_package(PythonInterp 3.8 QUIET)
find_package(PythonLibs 3.8 QUIET)

if(NOT ${PYTHONINTERP_FOUND})
message(STATUS "Build one-cmds: FALSE (Python3 is missing)")
return()
endif()

if(${PYTHON_VERSION_MINOR} LESS 8)
message(STATUS "Build one-cmds: FALSE (You need to install Python version higher than 3.8)")
return()
if(CMAKE_VERSION VERSION_LESS 3.12)
find_package(PythonInterp 3.8 QUIET)
find_package(PythonLibs 3.8 QUIET)

if(NOT ${PYTHONINTERP_FOUND})
message(STATUS "Build one-cmds: FALSE (Python3 is missing)")
return()
endif()

if(${PYTHON_VERSION_MINOR} LESS 8)
message(STATUS "Build one-cmds: FALSE (You need to install Python version higher than 3.8)")
return()
endif()
else()
find_package(Python 3.8 EXACT COMPONENTS Interpreter QUIET)
if(NOT Python_FOUND)
find_package(Python 3.8 COMPONENTS Interpreter QUIET)
endif()

# tensorflow 2.12.1 supports Python 3.8 ~ 3.11
if(Python_VERSION VERSION_GREATER_EQUAL 3.12)
message(STATUS "Build one-cmds: FALSE (Python version 3.12 or higher is not supported yet)")
return()
endif()
if(Python_VERSION VERSION_LESS 3.8)
message(STATUS "Build one-cmds: FAILED (Install Python version 3.8 or 3.10)")
return()
endif()

if(NOT Python_Interpreter_FOUND)
message(STATUS "Build one-cmds: FAILED (Python3 is missing)")
return()
endif()

set(PYTHON_EXECUTABLE ${Python_EXECUTABLE})
endif()

# NOTE these files should not have extensions.
Expand Down Expand Up @@ -42,13 +67,13 @@ if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "aarch64")
# and install build/../one-prepare-venv file
list(APPEND ONE_COMMAND_FILES one-prepare-venv.aarch64)
else(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "aarch64")
if(ONE_UBUNTU_CODENAME_BIONIC)
if(ONE_UBUNTU_CODENAME_BIONIC OR ONE_UBUNTU_CODENAME_NOBLE)
# NOTE copy one-prepare-venv.u1804 as build/../one-prepare-venv
# and install build/../one-prepare-venv file
list(APPEND ONE_COMMAND_FILES one-prepare-venv.u1804)
else(ONE_UBUNTU_CODENAME_BIONIC)
else(ONE_UBUNTU_CODENAME_BIONIC OR ONE_UBUNTU_CODENAME_NOBLE)
list(APPEND ONE_COMMAND_FILES one-prepare-venv)
endif(ONE_UBUNTU_CODENAME_BIONIC)
endif(ONE_UBUNTU_CODENAME_BIONIC OR ONE_UBUNTU_CODENAME_NOBLE)
endif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "aarch64")

# pytorch importer is an experimental feature, it is not used in default configuration
Expand Down Expand Up @@ -78,7 +103,7 @@ foreach(ONE_COMMAND IN ITEMS ${ONE_COMMAND_FILES})
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
DESTINATION bin)

endforeach(ONE_COMMAND)

set(ONE_UTILITY_FILES
Expand Down