Skip to content

Commit bf1c559

Browse files
authored
Merge pull request #72 from alicevision/dev/cleaning
[cmake] cleaning and preparing release
2 parents 3e624d2 + f49263d commit bf1c559

32 files changed

+618
-223
lines changed

.clang-format

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
BasedOnStyle: Mozilla
3+
AlignTrailingComments: true
4+
AllowAllParametersOfDeclarationOnNextLine: true
5+
AllowShortBlocksOnASingleLine: true
6+
AllowShortCaseLabelsOnASingleLine: true
7+
AllowShortFunctionsOnASingleLine: All
8+
AllowShortIfStatementsOnASingleLine: false
9+
AllowShortLoopsOnASingleLine: false
10+
AlwaysBreakAfterReturnType: None
11+
AlwaysBreakAfterDefinitionReturnType: None
12+
AlwaysBreakTemplateDeclarations: true
13+
BinPackArguments: false
14+
BinPackParameters: false
15+
BreakBeforeBraces: Custom
16+
BraceWrapping:
17+
AfterClass: true
18+
AfterControlStatement: true
19+
AfterEnum: true
20+
AfterFunction: true
21+
AfterNamespace: false
22+
AfterObjCDeclaration: false
23+
AfterStruct: true
24+
AfterUnion: true
25+
AfterExternBlock: true
26+
BeforeCatch: true
27+
BeforeElse: true
28+
IndentBraces: false
29+
SplitEmptyFunction: false
30+
SplitEmptyRecord: false
31+
SplitEmptyNamespace: false
32+
BreakBeforeInheritanceComma: false
33+
ColumnLimit: 120
34+
CompactNamespaces: false
35+
ConstructorInitializerAllOnOneLineOrOnePerLine: false
36+
Cpp11BracedListStyle: true
37+
DerivePointerAlignment: false
38+
IndentCaseLabels: true
39+
IndentWidth: 4
40+
KeepEmptyLinesAtTheStartOfBlocks: false
41+
Language: Cpp
42+
PointerAlignment: Left
43+
ReflowComments: true
44+
SpaceBeforeAssignmentOperators: true
45+
SpaceBeforeParens: Never
46+
SpaceInEmptyParentheses: false
47+
SpacesInContainerLiterals: false
48+
SpacesInParentheses: false
49+
SpacesInSquareBrackets: false
50+
Standard: Cpp11
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: "[bug]"
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Log**
27+
If applicable, copy paste the relevant log output (please embed the text in a markdown code tag "\`\`\`" )
28+
29+
**Desktop (please complete the following and other pertinent information):**
30+
- OS: [e.g. win 10, osx, ]
31+
- PopSift version: please specify if you are using a release version or your own build
32+
- Binary version (if applicable) [e.g. 2019.1]
33+
- Commit reference (if applicable) [e.g. 08ddbe2]
34+
35+
**Additional context**
36+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: "[request]"
5+
labels: feature request
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
name: Question or help needed
3+
about: Ask question or for help for issues not related to program failures (e.g. "where I can find this feature", "my image is not recognized", "which parameter setting shall I use" etc...)
4+
title: "[question]"
5+
labels: type:question
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the problem**
11+
A clear and concise description of what the problem is.
12+
13+
**Screenshots**
14+
If applicable, add screenshots to help explain your problem.
15+
16+
**Dataset**
17+
If applicable, add a link or *few* images to help better understand where the problem may come from.
18+
19+
**Log**
20+
If applicable, copy paste the relevant log output (please embed the text in a markdown code tag "\`\`\`" )
21+
22+
**Desktop (please complete the following and other pertinent information):**
23+
- OS: [e.g. win 10, osx, ]
24+
- PopSift version: please specify if you are using a release version or your own build
25+
- Binary version (if applicable) [e.g. 2019.1]
26+
- Commit reference (if applicable) [e.g. 08ddbe2]
27+
28+
**Additional context**
29+
Add any other context about the problem here.

.github/pull_request_template.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<!-- Checklist before submission:
2+
3+
- I have read the [contribution guidelines](../CONTRIBUTING.md).
4+
- I have updated the documentation, if applicable.
5+
- I have ensured that the change is tested somewhere.
6+
- I have followed the prevailing code style (for history readability and limit conflicts for maintainance).
7+
8+
-->
9+
## Description
10+
11+
12+
13+
## Features list
14+
15+
<!--
16+
- [ ] Feature one. Fix #XXX
17+
- [ ] Improve something else
18+
- [ ] Connect to #3 (to declare link to issues without closing it when the PR is merged).
19+
- [X] Add "X" when it is done.
20+
-->
21+
22+
23+
## Implementation remarks
24+
25+
26+
<!--
27+
Explain main implementation choices.
28+
It is also the right place to ask for feedback and help when you hesitate on the implementation.
29+
-->

.github/stale.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Number of days of inactivity before an issue becomes stale
2+
daysUntilStale: 120
3+
# Number of days of inactivity before a stale issue is closed
4+
daysUntilClose: 7
5+
# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
6+
exemptLabels:
7+
- "do not close"
8+
9+
# Set to true to ignore issues in a project (defaults to false)
10+
exemptProjects: true
11+
12+
# Set to true to ignore issues in a milestone (defaults to false)
13+
exemptMilestones: true
14+
15+
# Set to true to ignore issues with an assignee (defaults to false)
16+
exemptAssignees: true
17+
18+
# Label to use when marking an issue as stale
19+
staleLabel: stale
20+
# Comment to post when marking an issue as stale. Set to `false` to disable
21+
markComment: >
22+
This issue has been automatically marked as stale because it has not had
23+
recent activity. It will be closed if no further activity occurs. Thank you
24+
for your contributions.
25+
# Comment to post when closing a stale issue. Set to `false` to disable
26+
closeComment: >
27+
This issue is closed due to inactivity. Feel free to re-open if new information
28+
is available.

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ env:
3434
- POPSIFT_APP_INSTALL=${POPSIFT_APP_BUILD}/install
3535
# CMAKE
3636
# - CMAKE_URL="https://cmake.org/files/v3.6/cmake-3.6.1-Linux-x86_64.tar.gz"
37-
- CMAKE_URL="https://cmake.org/files/v3.4/cmake-3.4.1-Linux-x86_64.tar.gz"
37+
- CMAKE_URL="https://cmake.org/files/v3.13/cmake-3.13.5-Linux-x86_64.tar.gz"
3838
- CMAKE_ROOT=${TRAVIS_BUILD_DIR}/cmake
3939
- CMAKE_SOURCE=${CMAKE_ROOT}/source
4040
- CMAKE_INSTALL=${CMAKE_ROOT}/install

CHANGES.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# PopSift Changelog
2+
3+
All notable changes to this project are documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
### Added
11+
12+
### Changed
13+
14+
### Fixed
15+
16+
### Removed
17+
18+
## [1.0.0] - YYYY-MM-DD
19+
20+
- Support for cuda 9 and 10
21+
- Support for RTX architecture
22+
- Optional grid filtering

CMakeLists.txt

Lines changed: 62 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
# CMake below 3.4 does not work with CUDA separable compilation at all
2-
cmake_minimum_required(VERSION 3.4)
2+
cmake_minimum_required(VERSION 3.12)
33

4-
project(PopSift VERSION 1.0.0)
4+
project(PopSift VERSION 1.0.0 LANGUAGES CXX)
5+
6+
# Set build path as a folder named as the platform (linux, windows, darwin...) plus the processor type
7+
set(EXECUTABLE_OUTPUT_PATH "${PROJECT_BINARY_DIR}/${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
8+
set(LIBRARY_OUTPUT_PATH "${PROJECT_BINARY_DIR}/${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
9+
10+
option(PopSift_BUILD_EXAMPLES "Build PopSift applications." ON)
11+
option(PopSift_USE_NVTX_PROFILING "Use CUDA NVTX for profiling." OFF)
12+
option(PopSift_ERRCHK_AFTER_KERNEL "Synchronize and check CUDA error after every kernel." OFF)
13+
option(PopSift_USE_POSITION_INDEPENDENT_CODE "Generate position independent code." ON)
14+
option(PopSift_USE_GRID_FILTER "Switch off grid filtering to massively reduce compile time while debugging other things." ON)
15+
option(PopSift_USE_NORMF "The __normf function computes Euclidian distance on large arrays. Fast but stability is uncertain." OFF)
16+
option(PopSift_USE_TEST_CMD "Add testing step for functional verification" OFF)
17+
option(PopSift_BOOST_USE_STATIC_LIBS "Link with static Boost libraries" OFF)
18+
option(PopSift_NVCC_WARNINGS "Switch on several additional warning for CUDA nvcc" OFF)
19+
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
520

6-
OPTION(PopSift_BUILD_EXAMPLES "Build PopSift applications." ON)
7-
OPTION(PopSift_USE_NVTX_PROFILING "Use CUDA NVTX for profiling." OFF)
8-
OPTION(PopSift_ERRCHK_AFTER_KERNEL "Synchronize and check CUDA error after every kernel." OFF)
9-
OPTION(PopSift_USE_POSITION_INDEPENDENT_CODE "Generate position independent code." ON)
10-
OPTION(PopSift_USE_GRID_FILTER "Switch off grid filtering to massively reduce compile time while debugging other things." ON)
11-
OPTION(PopSift_USE_NORMF "The __normf function computes Euclidian distance on large arrays. Fast but stability is uncertain." OFF)
12-
OPTION(PopSift_USE_TEST_CMD "Add testing step for functional verification" OFF)
13-
OPTION(PopSift_BOOST_USE_STATIC_LIBS "Link with static Boost libraries" OFF)
14-
OPTION(PopSift_NVCC_WARNINGS "Switch on several additional warning for CUDA nvcc" OFF)
1521

1622
if(PopSift_BOOST_USE_STATIC_LIBS)
1723
set(Boost_USE_STATIC_LIBS ON)
@@ -31,15 +37,24 @@ else()
3137
message(STATUS "Building in ${CMAKE_BUILD_TYPE} configuration")
3238
endif()
3339

34-
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
35-
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3")
40+
# for some reason this line is necessary to propagate the standard to nvcc
3641
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
3742
set(CMAKE_CXX_STANDARD 11)
3843
set(CMAKE_CXX_STANDARD_REQUIRED ON)
44+
set(CMAKE_CUDA_STANDARD 11)
45+
set(CMAKE_CUDA_STANDARD_REQUIRED ON)
46+
47+
# ==============================================================================
48+
# GNUInstallDirs CMake module
49+
# - Define GNU standard installation directories
50+
# - Provides install directory variables as defined by the GNU Coding Standards.
51+
# ==============================================================================
52+
include(GNUInstallDirs)
3953

40-
# set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -G")
41-
# set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -G")
4254

55+
#################
56+
# BOOST
57+
#################
4358
find_package(Boost 1.53.0 REQUIRED COMPONENTS system thread)
4459
if(WIN32)
4560
add_definitions("-DBOOST_ALL_NO_LIB")
@@ -62,6 +77,9 @@ else()
6277
set(CUDA_USE_STATIC_CUDA_RUNTIME ON)
6378
endif()
6479

80+
###################
81+
# CUDA
82+
###################
6583
find_package(CUDA 7.0 REQUIRED)
6684

6785
if(NOT CUDA_FOUND)
@@ -145,9 +163,9 @@ if( ( CUDA_VERSION VERSION_EQUAL "7.5" ) OR ( CUDA_VERSION VERSION_GREATER "7.5"
145163
endif()
146164

147165
if(PopSift_USE_NORMF AND CUDA_VERSION VERSION_GREATER "7.4")
148-
set(HAVE_NORMF 1)
166+
set(PopSift_HAVE_NORMF 1)
149167
else()
150-
set(HAVE_NORMF 0)
168+
set(PopSift_HAVE_NORMF 0)
151169
endif()
152170

153171
if( ( CUDA_VERSION VERSION_EQUAL "9.0" ) OR ( CUDA_VERSION VERSION_GREATER "9.0") )
@@ -169,7 +187,9 @@ cuda_find_library_local_first(CUDA_CUDADEVRT_LIBRARY cudadevrt "\"cudadevrt\" li
169187
if(PopSift_USE_NVTX_PROFILING)
170188
# library required for NVTX profiling of the CPU
171189
cuda_find_library_local_first(CUDA_NVTX_LIBRARY nvToolsExt "NVTX library")
172-
add_definitions(-DUSE_NVTX)
190+
set(PopSift_USE_NVTX 1)
191+
else()
192+
set(PopSift_USE_NVTX 0)
173193
endif()
174194

175195
add_subdirectory(src)
@@ -184,5 +204,27 @@ CONFIGURE_FILE(
184204
"${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake"
185205
IMMEDIATE @ONLY)
186206
ADD_CUSTOM_TARGET(uninstall
187-
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake")
188-
207+
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake")
208+
209+
210+
######################################
211+
# SUMMARY
212+
######################################
213+
message("\n")
214+
message("******************************************")
215+
message("Building configuration:\n")
216+
message(STATUS "PopSift version: " ${PROJECT_VERSION})
217+
message(STATUS "Build type: " ${CMAKE_BUILD_TYPE})
218+
message(STATUS "Build Shared libs: " ${BUILD_SHARED_LIBS})
219+
message(STATUS "Build examples: " ${PopSift_BUILD_EXAMPLES})
220+
message(STATUS "Generate position independent code: " ${PopSift_USE_POSITION_INDEPENDENT_CODE})
221+
message(STATUS "Use CUDA NVTX for profiling: " ${PopSift_USE_NVTX_PROFILING})
222+
message(STATUS "Synchronize and check CUDA error after every kernel: " ${PopSift_ERRCHK_AFTER_KERNEL})
223+
message(STATUS "Grid filtering: " ${PopSift_USE_GRID_FILTER})
224+
message(STATUS "Testing step: " ${PopSift_USE_TEST_CMD})
225+
message(STATUS "Link with static Boost libraries: " ${PopSift_BOOST_USE_STATIC_LIBS})
226+
message(STATUS "Additional warning for CUDA nvcc: " ${PopSift_NVCC_WARNINGS})
227+
message(STATUS "Compiling for CUDA CCs: ${PopSift_CUDA_CC_LIST}")
228+
message(STATUS "Install path: " ${CMAKE_INSTALL_PREFIX})
229+
message("\n******************************************")
230+
message("\n")

0 commit comments

Comments
 (0)