Skip to content

Commit

Permalink
[cmake] bumping version to 0.3.1 and adding OPENPGL_ prefix to cmake …
Browse files Browse the repository at this point in the history
…options
  • Loading branch information
sherholz-intel committed Jun 22, 2022
1 parent 7f82327 commit 21c460c
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 37 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Version History
===============

## Open PGL x.x.x
## Open PGL 0.3.1

- `Field`:
- Added `Reset()` function to reset a guiding field (e.g., when the lighting or the scene
Expand Down
12 changes: 7 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,20 @@ include(GNUInstallDirs)

## Establish project ##

project(openpgl VERSION 0.3.0 LANGUAGES C CXX)
project(openpgl VERSION 0.3.1 LANGUAGES C CXX)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake)
include(openpgl_macros)

## openpgl specific configuration ##

option(BUILD_PYTHON "Build python wrapper 'pyopenpgl'." OFF)
option(USE_OMP_THREADING "Use omp instead of tbb for threading." OFF)
option(BUILD_STATIC "Build OpenPGL as static library." OFF)
option(OPENPGL_BUILD_PYTHON "Build python wrapper 'pyopenpgl'." OFF)
option(OPENPGL_USE_OMP_THREADING "Use omp instead of tbb for threading." OFF)
option(OPENPGL_BUILD_STATIC "Build OpenPGL as static library." OFF)

option(ISA_AVX512 "Build with support for AVX512." OFF)
option(OPENPGL_ISA_AVX512 "Build with support for AVX512." OFF)

SET(OPENPGL_TBB_COMPONENT "tbb" CACHE STRING "The TBB component/library name.")

find_package(embree 3.6.1 REQUIRED)

Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Intel® Open Path Guiding Library

This is release v0.3.0 of Intel® Open PGL. For changes and new features,
This is release v0.3.1 of Intel® Open PGL. For changes and new features,
see the [changelog](CHANGELOG.md). Visit http://www.openpgl.org for more
information.

Expand Down Expand Up @@ -48,7 +48,7 @@ specification is still in flux and might change with upcoming releases.

# Version History

## Open PGL x.x.x
## Open PGL 0.3.1

- `Field`:
- Added `Reset()` function to reset a guiding field (e.g., when
Expand Down Expand Up @@ -219,16 +219,16 @@ Configure the Open PGL build using:
- `CMAKE_INSTALL_PREFIX` will be the root directory where
everything gets installed.

- `BUILD_STATIC` if Open PGL should be built as a static or shared
library (default `OFF`).
- `OPENPGL_BUILD_STATIC` if Open PGL should be built as a static
or shared library (default `OFF`).

- `ISA_AVX512` if Open PGL is compiled with AVX-512 support
(default `OFF`).
- `OPENPGL_ISA_AVX512` if Open PGL is compiled with AVX-512
support (default `OFF`).

- `embree_DIR` location of the Embree CMake configuration file
(e.g., \[embree\_install\]/lib/cmake/embree-3.6.1).

- `TBB_ROOT` location of the TBB installation.
- `OPENPGL_TBB_ROOT` location of the TBB installation.

Build and install Open PGL using:

Expand All @@ -249,7 +249,7 @@ To make CMake aware of Open PGL’s CMake configuration scripts the
`openpgl_DIR` has to be set to their location during configuration:

``` bash
cmake -Dopenpgl_DIR=[openpgl_install]/lib/cmake/openpgl-0.3.0 ..
cmake -Dopenpgl_DIR=[openpgl_install]/lib/cmake/openpgl-0.3.1 ..
```

After that, adding OpenPGL to a CMake project/target is done by first
Expand Down
6 changes: 3 additions & 3 deletions doc/compilation.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ Configure the Open PGL build using:

- `CMAKE_INSTALL_PREFIX` will be the root directory where everything gets installed.

- `BUILD_STATIC` if Open PGL should be built as a static or shared library (default `OFF`).
- `OPENPGL_BUILD_STATIC` if Open PGL should be built as a static or shared library (default `OFF`).

- `ISA_AVX512` if Open PGL is compiled with AVX-512 support (default `OFF`).
- `OPENPGL_ISA_AVX512` if Open PGL is compiled with AVX-512 support (default `OFF`).

- `embree_DIR` location of the Embree CMake configuration file
(e.g., [embree_install]/lib/cmake/embree-3.6.1).

- `TBB_ROOT` location of the TBB installation.
- `OPENPGL_TBB_ROOT` location of the TBB installation.

Build and install Open PGL using:

Expand Down
14 changes: 7 additions & 7 deletions gitlab/.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ stages:
.job_template: &base_build_job
stage: build
script:
- gitlab/build.sh -G Ninja -D BUILD_PYTHON=OFF
- gitlab/build.sh -G Ninja -D OPENPGL_BUILD_PYTHON=OFF
artifacts:
paths:
- build/install
Expand Down Expand Up @@ -46,38 +46,38 @@ build-centos7:
<<: *build_job_docker
image: $DOCKER_REGISTRY/ospray/docker-images:centos7
script:
- gitlab/build.sh -D BUILD_PYTHON=OFF
- gitlab/build.sh -D OPENPGL_BUILD_PYTHON=OFF

build-centos8:
<<: *build_job_docker
image: $DOCKER_REGISTRY/ospray/docker-images:centos8
script:
- gitlab/build.sh -G Ninja -D BUILD_PYTHON=OFF
- gitlab/build.sh -G Ninja -D OPENPGL_BUILD_PYTHON=OFF

build-ubuntu16.04:
<<: *build_job_docker
image: $DOCKER_REGISTRY/ospray/docker-images:ubuntu16.04
script:
- gitlab/build.sh -G Ninja -D BUILD_PYTHON=OFF
- gitlab/build.sh -G Ninja -D OPENPGL_BUILD_PYTHON=OFF
allow_failure: true

build-ubuntu18.04:
<<: *build_job_docker
image: $DOCKER_REGISTRY/ospray/docker-images:ubuntu18.04
script:
- gitlab/build.sh -G Ninja -D BUILD_PYTHON=OFF
- gitlab/build.sh -G Ninja -D OPENPGL_BUILD_PYTHON=OFF

build-ubuntu20.04:
<<: *build_job_docker
image: $DOCKER_REGISTRY/ospray/docker-images:ubuntu20.04
script:
- gitlab/build.sh -G Ninja -D BUILD_PYTHON=OFF
- gitlab/build.sh -G Ninja -D OPENPGL_BUILD_PYTHON=OFF

build-arch:
<<: *build_job_docker
image: $DOCKER_REGISTRY/ospray/docker-images:arch
script:
- gitlab/build.sh -D BUILD_PYTHON=OFF
- gitlab/build.sh -D OPENPGL_BUILD_PYTHON=OFF

build-macOS:
<<: *base_build_job
Expand Down
20 changes: 13 additions & 7 deletions openpgl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
set(DEVICE_SRC api/deviceCPU4.cpp
api/deviceCPU8.cpp)

if(ISA_AVX512)
if(OPENPGL_ISA_AVX512)
set(DEVICE_SRC ${DEVICE_SRC} api/deviceCPU16.cpp)
endif()

Expand All @@ -18,7 +18,7 @@ set(OPENPGL_SRC
../third-party/embreeSrc/common/simd/sse.cpp
)

if(BUILD_STATIC)
if(OPENPGL_BUILD_STATIC)
add_library(${PROJECT_NAME} STATIC
${OPENPGL_SRC}
)
Expand Down Expand Up @@ -52,15 +52,15 @@ else()
set(OPENPGL_RELEASE_OPTIONS -O3 -Wall -msse2 -msse4.1)
set_source_files_properties(api/deviceCPU4.cpp PROPERTIES COMPILE_FLAGS "-msse2 -msse4.1")
set_source_files_properties(api/deviceCPU8.cpp PROPERTIES COMPILE_FLAGS "-msse2 -msse4.1 -mf16c -mavx2 -mfma -mlzcnt -mbmi -mbmi2")
if(ISA_AVX512)
if(OPENPGL_ISA_AVX512)
set_source_files_properties(api/deviceCPU16.cpp PROPERTIES COMPILE_FLAGS "-msse2 -msse4.1 -mavx512f -mavx512dq -mavx512cd -mavx512bw -mavx512vl -mf16c -mavx2 -mfma -mlzcnt -mbmi -mbmi2")
endif()
#set(OPENPGL_RELEASE_OPTIONS ${OPENPGL_RELEASE_OPTIONS} -fno-strict-aliasing -Wno-padded -ftree-vectorize -mfpmath=sse -funsafe-math-optimizations -fno-rounding-math -fno-signaling-nans -fno-math-errno -fomit-frame-pointer )
#set(OPENPGL_RELEASE_OPTIONS ${OPENPGL_RELEASE_OPTIONS} -fno-strict-aliasing -Wno-padded -ftree-vectorize -mfpmath=sse)
endif()


if(USE_OMP_THREADING)
if(OPENPGL_USE_OMP_THREADING)
set(OPENPGL_RELEASE_OPTIONS -fopenmp)
endif()

Expand All @@ -69,13 +69,19 @@ target_compile_options(${PROJECT_NAME} PUBLIC "$<$<CONFIG:RELEASE>:${OPENPGL_REL
# CMAKE 3.8 feature
#target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_11)

if(USE_OMP_THREADING)
if(OPENPGL_USE_OMP_THREADING)
add_compile_definitions(OPENPGL_USE_OMP_THREADING)
endif()

#add_compile_options()

FIND_PACKAGE(TBB REQUIRED tbb)
if (NOT ${OPENPGL_TBB_ROOT} STREQUAL "")
set(TBB_FIND_PACKAGE_OPTION "NO_DEFAULT_PATH")
set(TBB_ROOT ${OPENPGL_TBB_ROOT})
list(APPEND CMAKE_PREFIX_PATH ${OPENPGL_TBB_ROOT})
endif()

FIND_PACKAGE(TBB REQUIRED ${OPENPGL_TBB_COMPONENT})

FIND_PACKAGE(embree 3.6 REQUIRED)

Expand All @@ -100,7 +106,7 @@ target_include_directories(${PROJECT_NAME}
)

target_link_libraries(${PROJECT_NAME} PRIVATE embree)
target_link_libraries(${PROJECT_NAME} PRIVATE TBB::tbb)
target_link_libraries(${PROJECT_NAME} PRIVATE TBB::${OPENPGL_TBB_COMPONENT})

## Configure OpenPGL installation ##

Expand Down
12 changes: 6 additions & 6 deletions superbuild/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ if (NOT BUILD_DEPENDENCIES_ONLY)

set(OPENPGL_ARGS
-DCMAKE_PREFIX_PATH:PATH=${CMAKE_PREFIX_PATH}
-DBUILD_PYTHON=OFF
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
Expand All @@ -181,17 +180,19 @@ if (NOT BUILD_DEPENDENCIES_ONLY)
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
-DCMAKE_INSTALL_DOCDIR=${CMAKE_INSTALL_DOCDIR}
-DCMAKE_INSTALL_BINDIR=${CMAKE_INSTALL_BINDIR}
-DOPENPGL_BUILD_PYTHON=OFF
)

if(BUILD_STATIC)
set(OPENPGL_ARGS ${OPENPGL_ARGS}
-DBUILD_STATIC=${BUILD_STATIC}
-DOPENPGL_BUILD_STATIC=${BUILD_STATIC}
)
endif()

if(TBB_ROOT)
if(OPENPGL_TBB_ROOT)
set(OPENPGL_ARGS ${OPENPGL_ARGS}
-DTBB_ROOT=${TBB_ROOT}
-DTBB_ROOT=${OPENPGL_TBB_ROOT}
-DOPENPGL_TBB_ROOT=${OPENPGL_TBB_ROOT}
)
endif()

Expand All @@ -204,9 +205,8 @@ if (NOT BUILD_DEPENDENCIES_ONLY)
LIST_SEPARATOR | # CMAKE_PREFIX_PATH uses alternate separator.
CMAKE_ARGS
${OPENPGL_ARGS}
#$<$<BOOL:${BUILD_ISPC}>:-DISPC_EXECUTABLE=${ISPC_PATH}>
BUILD_COMMAND ${DEFAULT_BUILD_COMMAND}
BUILD_ALWAYS OFF
BUILD_ALWAYS ON
)

ExternalProject_Add_StepDependencies(openpgl
Expand Down

0 comments on commit 21c460c

Please sign in to comment.