Skip to content

Commit 21c460c

Browse files
[cmake] bumping version to 0.3.1 and adding OPENPGL_ prefix to cmake options
1 parent 7f82327 commit 21c460c

File tree

7 files changed

+45
-37
lines changed

7 files changed

+45
-37
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Version History
22
===============
33

4-
## Open PGL x.x.x
4+
## Open PGL 0.3.1
55

66
- `Field`:
77
- Added `Reset()` function to reset a guiding field (e.g., when the lighting or the scene

CMakeLists.txt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,20 @@ include(GNUInstallDirs)
2121

2222
## Establish project ##
2323

24-
project(openpgl VERSION 0.3.0 LANGUAGES C CXX)
24+
project(openpgl VERSION 0.3.1 LANGUAGES C CXX)
2525

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

2929
## openpgl specific configuration ##
3030

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

35-
option(ISA_AVX512 "Build with support for AVX512." OFF)
35+
option(OPENPGL_ISA_AVX512 "Build with support for AVX512." OFF)
36+
37+
SET(OPENPGL_TBB_COMPONENT "tbb" CACHE STRING "The TBB component/library name.")
3638

3739
find_package(embree 3.6.1 REQUIRED)
3840

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Intel® Open Path Guiding Library
22

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

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

4949
# Version History
5050

51-
## Open PGL x.x.x
51+
## Open PGL 0.3.1
5252

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

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

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

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

231-
- `TBB_ROOT` location of the TBB installation.
231+
- `OPENPGL_TBB_ROOT` location of the TBB installation.
232232

233233
Build and install Open PGL using:
234234

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

251251
``` bash
252-
cmake -Dopenpgl_DIR=[openpgl_install]/lib/cmake/openpgl-0.3.0 ..
252+
cmake -Dopenpgl_DIR=[openpgl_install]/lib/cmake/openpgl-0.3.1 ..
253253
```
254254

255255
After that, adding OpenPGL to a CMake project/target is done by first

doc/compilation.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,14 @@ Configure the Open PGL build using:
7979

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

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

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

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

89-
- `TBB_ROOT` location of the TBB installation.
89+
- `OPENPGL_TBB_ROOT` location of the TBB installation.
9090

9191
Build and install Open PGL using:
9292

gitlab/.gitlab-ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ stages:
1717
.job_template: &base_build_job
1818
stage: build
1919
script:
20-
- gitlab/build.sh -G Ninja -D BUILD_PYTHON=OFF
20+
- gitlab/build.sh -G Ninja -D OPENPGL_BUILD_PYTHON=OFF
2121
artifacts:
2222
paths:
2323
- build/install
@@ -46,38 +46,38 @@ build-centos7:
4646
<<: *build_job_docker
4747
image: $DOCKER_REGISTRY/ospray/docker-images:centos7
4848
script:
49-
- gitlab/build.sh -D BUILD_PYTHON=OFF
49+
- gitlab/build.sh -D OPENPGL_BUILD_PYTHON=OFF
5050

5151
build-centos8:
5252
<<: *build_job_docker
5353
image: $DOCKER_REGISTRY/ospray/docker-images:centos8
5454
script:
55-
- gitlab/build.sh -G Ninja -D BUILD_PYTHON=OFF
55+
- gitlab/build.sh -G Ninja -D OPENPGL_BUILD_PYTHON=OFF
5656

5757
build-ubuntu16.04:
5858
<<: *build_job_docker
5959
image: $DOCKER_REGISTRY/ospray/docker-images:ubuntu16.04
6060
script:
61-
- gitlab/build.sh -G Ninja -D BUILD_PYTHON=OFF
61+
- gitlab/build.sh -G Ninja -D OPENPGL_BUILD_PYTHON=OFF
6262
allow_failure: true
6363

6464
build-ubuntu18.04:
6565
<<: *build_job_docker
6666
image: $DOCKER_REGISTRY/ospray/docker-images:ubuntu18.04
6767
script:
68-
- gitlab/build.sh -G Ninja -D BUILD_PYTHON=OFF
68+
- gitlab/build.sh -G Ninja -D OPENPGL_BUILD_PYTHON=OFF
6969

7070
build-ubuntu20.04:
7171
<<: *build_job_docker
7272
image: $DOCKER_REGISTRY/ospray/docker-images:ubuntu20.04
7373
script:
74-
- gitlab/build.sh -G Ninja -D BUILD_PYTHON=OFF
74+
- gitlab/build.sh -G Ninja -D OPENPGL_BUILD_PYTHON=OFF
7575

7676
build-arch:
7777
<<: *build_job_docker
7878
image: $DOCKER_REGISTRY/ospray/docker-images:arch
7979
script:
80-
- gitlab/build.sh -D BUILD_PYTHON=OFF
80+
- gitlab/build.sh -D OPENPGL_BUILD_PYTHON=OFF
8181

8282
build-macOS:
8383
<<: *base_build_job

openpgl/CMakeLists.txt

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
set(DEVICE_SRC api/deviceCPU4.cpp
66
api/deviceCPU8.cpp)
77

8-
if(ISA_AVX512)
8+
if(OPENPGL_ISA_AVX512)
99
set(DEVICE_SRC ${DEVICE_SRC} api/deviceCPU16.cpp)
1010
endif()
1111

@@ -18,7 +18,7 @@ set(OPENPGL_SRC
1818
../third-party/embreeSrc/common/simd/sse.cpp
1919
)
2020

21-
if(BUILD_STATIC)
21+
if(OPENPGL_BUILD_STATIC)
2222
add_library(${PROJECT_NAME} STATIC
2323
${OPENPGL_SRC}
2424
)
@@ -52,15 +52,15 @@ else()
5252
set(OPENPGL_RELEASE_OPTIONS -O3 -Wall -msse2 -msse4.1)
5353
set_source_files_properties(api/deviceCPU4.cpp PROPERTIES COMPILE_FLAGS "-msse2 -msse4.1")
5454
set_source_files_properties(api/deviceCPU8.cpp PROPERTIES COMPILE_FLAGS "-msse2 -msse4.1 -mf16c -mavx2 -mfma -mlzcnt -mbmi -mbmi2")
55-
if(ISA_AVX512)
55+
if(OPENPGL_ISA_AVX512)
5656
set_source_files_properties(api/deviceCPU16.cpp PROPERTIES COMPILE_FLAGS "-msse2 -msse4.1 -mavx512f -mavx512dq -mavx512cd -mavx512bw -mavx512vl -mf16c -mavx2 -mfma -mlzcnt -mbmi -mbmi2")
5757
endif()
5858
#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 )
5959
#set(OPENPGL_RELEASE_OPTIONS ${OPENPGL_RELEASE_OPTIONS} -fno-strict-aliasing -Wno-padded -ftree-vectorize -mfpmath=sse)
6060
endif()
6161

6262

63-
if(USE_OMP_THREADING)
63+
if(OPENPGL_USE_OMP_THREADING)
6464
set(OPENPGL_RELEASE_OPTIONS -fopenmp)
6565
endif()
6666

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

72-
if(USE_OMP_THREADING)
72+
if(OPENPGL_USE_OMP_THREADING)
7373
add_compile_definitions(OPENPGL_USE_OMP_THREADING)
7474
endif()
7575

7676
#add_compile_options()
7777

78-
FIND_PACKAGE(TBB REQUIRED tbb)
78+
if (NOT ${OPENPGL_TBB_ROOT} STREQUAL "")
79+
set(TBB_FIND_PACKAGE_OPTION "NO_DEFAULT_PATH")
80+
set(TBB_ROOT ${OPENPGL_TBB_ROOT})
81+
list(APPEND CMAKE_PREFIX_PATH ${OPENPGL_TBB_ROOT})
82+
endif()
83+
84+
FIND_PACKAGE(TBB REQUIRED ${OPENPGL_TBB_COMPONENT})
7985

8086
FIND_PACKAGE(embree 3.6 REQUIRED)
8187

@@ -100,7 +106,7 @@ target_include_directories(${PROJECT_NAME}
100106
)
101107

102108
target_link_libraries(${PROJECT_NAME} PRIVATE embree)
103-
target_link_libraries(${PROJECT_NAME} PRIVATE TBB::tbb)
109+
target_link_libraries(${PROJECT_NAME} PRIVATE TBB::${OPENPGL_TBB_COMPONENT})
104110

105111
## Configure OpenPGL installation ##
106112

superbuild/CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ if (NOT BUILD_DEPENDENCIES_ONLY)
172172

173173
set(OPENPGL_ARGS
174174
-DCMAKE_PREFIX_PATH:PATH=${CMAKE_PREFIX_PATH}
175-
-DBUILD_PYTHON=OFF
176175
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
177176
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
178177
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
@@ -181,17 +180,19 @@ if (NOT BUILD_DEPENDENCIES_ONLY)
181180
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
182181
-DCMAKE_INSTALL_DOCDIR=${CMAKE_INSTALL_DOCDIR}
183182
-DCMAKE_INSTALL_BINDIR=${CMAKE_INSTALL_BINDIR}
183+
-DOPENPGL_BUILD_PYTHON=OFF
184184
)
185185

186186
if(BUILD_STATIC)
187187
set(OPENPGL_ARGS ${OPENPGL_ARGS}
188-
-DBUILD_STATIC=${BUILD_STATIC}
188+
-DOPENPGL_BUILD_STATIC=${BUILD_STATIC}
189189
)
190190
endif()
191191

192-
if(TBB_ROOT)
192+
if(OPENPGL_TBB_ROOT)
193193
set(OPENPGL_ARGS ${OPENPGL_ARGS}
194-
-DTBB_ROOT=${TBB_ROOT}
194+
-DTBB_ROOT=${OPENPGL_TBB_ROOT}
195+
-DOPENPGL_TBB_ROOT=${OPENPGL_TBB_ROOT}
195196
)
196197
endif()
197198

@@ -204,9 +205,8 @@ if (NOT BUILD_DEPENDENCIES_ONLY)
204205
LIST_SEPARATOR | # CMAKE_PREFIX_PATH uses alternate separator.
205206
CMAKE_ARGS
206207
${OPENPGL_ARGS}
207-
#$<$<BOOL:${BUILD_ISPC}>:-DISPC_EXECUTABLE=${ISPC_PATH}>
208208
BUILD_COMMAND ${DEFAULT_BUILD_COMMAND}
209-
BUILD_ALWAYS OFF
209+
BUILD_ALWAYS ON
210210
)
211211

212212
ExternalProject_Add_StepDependencies(openpgl

0 commit comments

Comments
 (0)