Skip to content

Commit

Permalink
Merge pull request #29 from gcherchi/predicates-update
Browse files Browse the repository at this point in the history
Predicates update
  • Loading branch information
gcherchi authored Dec 15, 2023
2 parents 0ce2f88 + 3db8c06 commit 67d77b4
Show file tree
Hide file tree
Showing 211 changed files with 46,473 additions and 4 deletions.
51 changes: 48 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
cmake_minimum_required(VERSION 3.21)

# Set the target architecture.
# All modern x86/x64 processors support AVX2.
# Older x86/x64 processors may support SSE2 but not AVX2.
# Very old x86/x64 processors, or non x86/x64
# processors, do not support any of the two.
set(ENABLE_SSE2 True)
set(ENABLE_AVX2 True)


# specify the C++ standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)

# set the project name
Expand All @@ -11,19 +20,20 @@ set(TBB_TEST OFF CACHE BOOL " " FORCE)
set(TBB_EXAMPLES OFF CACHE BOOL " " FORCE)
add_subdirectory(arrangements/external/oneTBB)


# add the executable
add_executable(${PROJECT_NAME} main.cpp)

target_include_directories(${PROJECT_NAME} PUBLIC
./
code/
arrangements/code/
arrangements/external/Indirect_Predicates/include/
)

set(cinolib_DIR ${PROJECT_SOURCE_DIR}/arrangements/external/Cinolib)
set(CINOLIB_USES_OPENGL_GLFW_IMGUI ON)
set(CINOLIB_USES_SHEWCHUK_PREDICATES ON)
set(CINOLIB_USES_INDIRECT_PREDICATES ON)

find_package(cinolib REQUIRED)

Expand All @@ -40,6 +50,7 @@ target_include_directories(${PROJECT_NAME}_rotation PUBLIC
./
code/
arrangements/code/
arrangements/external/Indirect_Predicates/include/
)

target_link_libraries(${PROJECT_NAME}_rotation cinolib)
Expand All @@ -54,6 +65,7 @@ target_include_directories(${PROJECT_NAME}_arap PUBLIC
./
code/
arrangements/code/
arrangements/external/Indirect_Predicates/include/
)

target_link_libraries(${PROJECT_NAME}_arap cinolib)
Expand All @@ -68,6 +80,7 @@ target_include_directories(${PROJECT_NAME}_stencil PUBLIC
./
code/
arrangements/code/
arrangements/external/Indirect_Predicates/include/
)

target_link_libraries(${PROJECT_NAME}_stencil cinolib)
Expand All @@ -83,10 +96,42 @@ target_include_directories(${PROJECT_NAME}_inputcheck PUBLIC
./
code/
arrangements/code/
)
arrangements/external/Indirect_Predicates/include/
)

target_link_libraries(${PROJECT_NAME}_inputcheck cinolib)
target_link_libraries(${PROJECT_NAME}_inputcheck tbb)
target_compile_definitions(${PROJECT_NAME}_inputcheck PUBLIC TBB_PARALLEL=1)
target_include_directories(${PROJECT_NAME}_inputcheck PUBLIC ${PROJECT_SOURCE_DIR}/arrangements/external/abseil-cpp/)
target_include_directories(${PROJECT_NAME}_inputcheck PUBLIC ${PROJECT_SOURCE_DIR}/arrangements/external/oneTBB/)

# Compiler-specific options
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# grant IEEE 754 compliance
target_compile_options(${PROJECT_NAME} PUBLIC "/fp:strict")
# use intrinsic functions
target_compile_options(${PROJECT_NAME} PUBLIC "/Oi")
# set target architecture
if(ENABLE_AVX2)
target_compile_options(${PROJECT_NAME} PUBLIC "/arch:AVX2")
elseif(ENABLE_SSE2)
target_compile_options(${PROJECT_NAME} PUBLIC "/arch:SSE2")
endif()
# reserve enough stack size
target_link_options(${PROJECT_NAME} PUBLIC "/STACK:8421376")
# turn off annoying warnings
target_compile_options(${PROJECT_NAME} PUBLIC "/D _CRT_SECURE_NO_WARNINGS")
else()
# set standard optimization level
target_compile_options(${PROJECT_NAME} PUBLIC -O2)
# reserve enough stack size
target_compile_options(${PROJECT_NAME} PUBLIC -Wl,-z,stacksize=8421376)
# grant IEEE 754 compliance
target_compile_options(${PROJECT_NAME} PUBLIC -frounding-math)
# set target architecture
if(ENABLE_AVX2)
target_compile_options(${PROJECT_NAME} PUBLIC "-mavx2")
elseif(ENABLE_SSE2)
target_compile_options(${PROJECT_NAME} PUBLIC "-msse2")
endif()
endif()
2 changes: 1 addition & 1 deletion arrangements/code/tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#ifndef TREE_H
#define TREE_H

#include "predicates/indirect_predicates.h"
#include "indirect_predicates.h"
#include <vector>

typedef unsigned int uint;
Expand Down
60 changes: 60 additions & 0 deletions arrangements/external/Indirect_Predicates/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
cmake_minimum_required(VERSION 3.10)

# Set the target architecture.
# All modern x86/x64 processors support AVX2.
# Older x86/x64 processors may support SSE2 but not AVX2.
# Very old x86/x64 processors, or non x86/x64
# processors, do not support any of the two.
set(ENABLE_SSE2 True)
set(ENABLE_AVX2 True)

#####################

# set the project name
project(indirectPredicates)

# specify the C++ standard
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)

# add the executable
add_executable(${PROJECT_NAME}
test.cpp
)

# Compiler-specific options
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# grant IEEE 754 compliance
target_compile_options(${PROJECT_NAME} PUBLIC "/fp:strict")
# use intrinsic functions
target_compile_options(${PROJECT_NAME} PUBLIC "/Oi")
# set target architecture
if(ENABLE_AVX2)
target_compile_options(${PROJECT_NAME} PUBLIC "/arch:AVX2")
elseif(ENABLE_SSE2)
target_compile_options(${PROJECT_NAME} PUBLIC "/arch:SSE2")
endif()
# reserve enough stack size
target_link_options(${PROJECT_NAME} PUBLIC "/STACK:8421376")
# turn off annoying warnings
target_compile_options(${PROJECT_NAME} PUBLIC "/D _CRT_SECURE_NO_WARNINGS")
else()
# set standard optimization level
target_compile_options(${PROJECT_NAME} PUBLIC -O2)
# reserve enough stack size
target_compile_options(${PROJECT_NAME} PUBLIC -Wl,-z,stacksize=8421376)
# grant IEEE 754 compliance
target_compile_options(${PROJECT_NAME} PUBLIC -frounding-math)
# set target architecture
if(ENABLE_AVX2)
target_compile_options(${PROJECT_NAME} PUBLIC "-mavx2")
elseif(ENABLE_SSE2)
target_compile_options(${PROJECT_NAME} PUBLIC "-msse2")
endif()
endif()

# Public include directory
target_include_directories(${PROJECT_NAME} PUBLIC
.
include
)
Loading

0 comments on commit 67d77b4

Please sign in to comment.