Skip to content

Add sdl flags #1109

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

Merged
merged 4 commits into from
Mar 13, 2023
Merged
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: 1 addition & 1 deletion conda-recipe/bld.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set "LIB=%BUILD_PREFIX%\Library\lib;%BUILD_PREFIX%\compiler\lib;%LIB%"
set "INCLUDE=%BUILD_PREFIX%\include;%INCLUDE%"

"%PYTHON%" setup.py clean --all
set "SKBUILD_ARGS=-G Ninja -- -DCMAKE_C_COMPILER:PATH=icx -DCMAKE_CXX_COMPILER:PATH=icx"
set "SKBUILD_ARGS=-G Ninja -- -DCMAKE_C_COMPILER:PATH=icx -DCMAKE_CXX_COMPILER:PATH=icx -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON"

FOR %%V IN (14.0.0 14 15.0.0 15 16.0.0 16) DO @(
REM set DIR_HINT if directory exists
Expand Down
2 changes: 1 addition & 1 deletion conda-recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if [ -e "_skbuild" ]; then
${PYTHON} setup.py clean --all
fi
export CMAKE_GENERATOR="Ninja"
SKBUILD_ARGS="-- -DCMAKE_C_COMPILER:PATH=icx -DCMAKE_CXX_COMPILER:PATH=icpx"
SKBUILD_ARGS="-- -DCMAKE_C_COMPILER:PATH=icx -DCMAKE_CXX_COMPILER:PATH=icpx -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON"
echo "${PYTHON} setup.py install ${SKBUILD_ARGS}"

if [ -n "${WHEELS_OUTPUT_FOLDER}" ]; then
Expand Down
13 changes: 9 additions & 4 deletions dpctl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,17 @@ if(WIN32)
"-Wmissing-declarations "
"-Wno-unused-parameter "
)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Ox ${WARNING_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Ox ${WARNING_FLAGS}")
string(CONCAT SDL_FLAGS
"/GS "
"/DynamicBase "
)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Ox ${WARNING_FLAGS} ${SDL_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Ox ${WARNING_FLAGS} ${SDL_FLAGS}")
set(CMAKE_C_FLAGS_DEBUG
"${CMAKE_C_FLAGS_DEBUG} ${WARNING_FLAGS} -O0 -g1 -DDEBUG"
"${CMAKE_C_FLAGS_DEBUG} ${WARNING_FLAGS} ${SDL_FLAGS} -O0 -g1 -DDEBUG"
)
set(CMAKE_CXX_FLAGS_DEBUG
"${CMAKE_CXX_FLAGS_DEBUG} ${WARNING_FLAGS} -O0 -g1 -DDEBUG"
"${CMAKE_CXX_FLAGS_DEBUG} ${WARNING_FLAGS} ${SDL_FLAGS} -O0 -g1 -DDEBUG"
)
set(DPCTL_LDFLAGS "/NXCompat;/DynamicBase")
elseif(UNIX)
Expand All @@ -44,6 +48,7 @@ elseif(UNIX)
"-Wformat-security "
"-fno-strict-overflow "
"-fno-delete-null-pointer-checks "
"-fwrapv "
)
string(CONCAT CFLAGS
"${WARNING_FLAGS}"
Expand Down
2 changes: 2 additions & 0 deletions dpctl/tensor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,7 @@ target_include_directories(${python_module_name}
${CMAKE_CURRENT_SOURCE_DIR}/libtensor/include
${CMAKE_CURRENT_SOURCE_DIR}/libtensor/source/
)
set(_linker_options "LINKER:${DPCTL_LDFLAGS}")
target_link_options(${python_module_name} PRIVATE ${_linker_options})
add_dependencies(${python_module_name} _dpctl4pybind11_deps)
install(TARGETS ${python_module_name} DESTINATION "dpctl/tensor")
9 changes: 7 additions & 2 deletions libsyclinterface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,12 @@ if(WIN32)
"-Wuninitialized "
"-Wmissing-declarations "
)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS}")
string(CONCAT SDL_FLAGS
"/GS "
"/DynamicBase "
)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS} ${SDL_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS} ${SDL_FLAGS}")
set(CMAKE_C_FLAGS_DEBUG
"${CMAKE_C_FLAGS_DEBUG} ${WARNING_FLAGS} -O0 -ggdb3 -DDEBUG"
)
Expand All @@ -139,6 +143,7 @@ elseif(UNIX)
"-Wformat-security "
"-fno-strict-overflow "
"-fno-delete-null-pointer-checks "
"-fwrapv "
)
string(CONCAT CFLAGS
"${WARNING_FLAGS}"
Expand Down
12 changes: 12 additions & 0 deletions scripts/build_locally.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def run(
compiler_root=None,
cmake_executable=None,
use_glog=False,
verbose=False,
cmake_opts="",
):
build_system = None
Expand Down Expand Up @@ -58,6 +59,10 @@ def run(
"-DDPCTL_ENABLE_L0_PROGRAM_CREATION=" + ("ON" if level_zero else "OFF"),
"-DDPCTL_ENABLE_GLOG:BOOL=" + ("ON" if use_glog else "OFF"),
]
if verbose:
cmake_args += [
"-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON",
]
if cmake_opts:
cmake_args += cmake_opts.split()
subprocess.check_call(
Expand Down Expand Up @@ -113,6 +118,12 @@ def run(
dest="glog",
action="store_true",
)
driver.add_argument(
"--verbose",
help="Build using vebose makefile mode",
dest="verbose",
action="store_true",
)
driver.add_argument(
"--cmake-opts",
help="DPCTLSyclInterface uses Google logger",
Expand Down Expand Up @@ -173,5 +184,6 @@ def run(
compiler_root=args.compiler_root,
cmake_executable=args.cmake_executable,
use_glog=args.glog,
verbose=args.verbose,
cmake_opts=args.cmake_opts,
)