Skip to content
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

gproshan v4.0 new version coming: updating GUI, new features, ray tracing #14

Open
wants to merge 1,206 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
1206 commits
Select commit Hold shift + click to select a range
62ae64d
rt_embree: update to embree4
larc Mar 13, 2023
556f762
github actions install embree4
larc Mar 13, 2023
1df63e4
Update build.yml
larc Mar 13, 2023
035ba94
Update build.yml
larc Mar 13, 2023
edd7750
Update build.yml
larc Mar 13, 2023
57ef5ea
Update build.yml
larc Mar 13, 2023
0a9e756
Update build.yml
larc Mar 13, 2023
9fce4fc
update gproshanConfig.cmake.in
larc Mar 21, 2023
2debbf1
update imgui 1.89.4
larc Mar 21, 2023
aa51f6d
app_viewer: cleaning log messages
larc Mar 27, 2023
2d530a4
points: add sampling 4points function
larc Mar 27, 2023
2340033
points: update sampling 4points
larc Mar 27, 2023
e86c939
che_pcd (io): adding pcd reader and writer
larc Mar 30, 2023
dfacb3c
rt_embree: fix select vertex in a point cloud
larc Mar 31, 2023
c680487
app_viewer: creating point cloud from 4points samples function
larc Mar 31, 2023
a36edf6
Update build.yml
larc Apr 18, 2023
8bf6aca
Update build.yml
larc Apr 18, 2023
0f69bd4
Update build.yml
larc Apr 18, 2023
914b9b0
Update build.yml
larc Apr 18, 2023
2bd94e2
Merge branch 'dev' into alpha
larc Apr 19, 2023
b2ac921
update to OptiX 7.7
larc Apr 20, 2023
3eb8114
Merge branch 'alpha' into dev
larc Apr 20, 2023
0e73460
Update README.md
larc Apr 20, 2023
f870382
Merge branch 'dev' into alpha
larc Apr 20, 2023
d533547
viewer: implementing shadow mapping, adding depth shader
larc Apr 25, 2023
b7efc22
viewer: added uniform method to shader class
larc Apr 25, 2023
c6be97f
Merge branch 'dev' into alpha
larc May 15, 2023
9a23e9e
viewer: undo triangles shader line
larc May 15, 2023
50478ff
che_ply: loading normals
larc May 15, 2023
ed532e2
che_ply: fix normal loading
larc May 15, 2023
ec8b540
rt_embree: render point cloud as unoriented disk
larc May 16, 2023
ed617f9
raytracing: renaming source files
larc May 17, 2023
3e67e91
che_img: loading rgb images, and depth images
larc May 21, 2023
6d34db5
geometry: minor updates
larc May 23, 2023
5b015cc
update gitignore
larc May 23, 2023
4793185
fix .gitignore
larc May 23, 2023
bd3524b
che_ptx: display image in debug
larc May 25, 2023
59cf2c2
optix: input ptx file
larc Jul 4, 2023
e15d6ca
optix: adding void pointer in optix_params
larc Jul 5, 2023
33665ce
update imgui v1.89.7
larc Jul 10, 2023
9a06c14
Merge branch 'dev' into alpha
larc Jul 17, 2023
24f607b
Update build.yml
larc Jul 17, 2023
348ec9d
Merge branch 'dev' into alpha
larc Jul 17, 2023
5015651
scanner: fix room scanner orientation y axis
larc Jul 24, 2023
6e1d051
scanner: fix orientation
larc Jul 26, 2023
3547c39
cleaning up warnings adding TODOs
larc Jul 27, 2023
b6e4df0
knn: add grid knn class
larc Jul 27, 2023
da5b110
knn: grid knn query
larc Jul 27, 2023
1acd192
geometry: updating vec class
larc Aug 2, 2023
d3c7efe
vec: add comma operator for concat a scalar
larc Aug 2, 2023
a4bdcd4
scanner: cleaning up
larc Aug 2, 2023
bd1e460
Merge branch 'dev' into alpha
larc Aug 3, 2023
f1d4bb9
using optix 8
larc Aug 24, 2023
61118ee
pointcloud: adding UI menu
larc Sep 6, 2023
cfbf944
viewer: selected mesh label
larc Sep 6, 2023
95ce151
viewer: fix meshes selected label
larc Sep 6, 2023
a96b203
Merge branch 'dev' into alpha
larc Sep 7, 2023
60e5628
viewer: transparent bg selected mesh label
larc Sep 7, 2023
ace1d4e
knn: using flann to implement k3tree
larc Sep 19, 2023
dc74b13
viewer: computing knn for selected vertices
larc Sep 19, 2023
004693f
fix github workflows
larc Sep 19, 2023
352be42
viewer: recording timeframe
larc Sep 20, 2023
afbc3e3
viewer: saving frametimes
larc Sep 20, 2023
8e1d44a
viewer: save gproshan history
larc Sep 20, 2023
cea80ac
viewer: saving history and frametime
larc Sep 21, 2023
3cc8157
knn: remove kdtree, resolved #23
larc Sep 21, 2023
8a93e54
Merge branch 'dev' into alpha
larc Sep 21, 2023
637a878
pointcloud: update k3tree knn access methods
larc Sep 21, 2023
89edb18
Update build.yml
larc Sep 21, 2023
8476f9f
Merge branch 'dev' into alpha
larc Sep 21, 2023
e567b0c
Update build.yml
larc Sep 21, 2023
cbe5e11
Merge branch 'dev' into alpha
larc Sep 21, 2023
3ce3b68
viewer: save rt built times
larc Sep 27, 2023
91e3e9d
viewer: method for update status message
larc Oct 5, 2023
a2025b7
viewer: update default window size
larc Oct 9, 2023
57eaa1a
viewer: updating blinn phon shading
larc Oct 11, 2023
0a86944
viewer: updating shading default values
larc Oct 11, 2023
d786d46
viewer: adding light struct
larc Oct 11, 2023
213de8f
viewer: adding struct light to shader
larc Oct 11, 2023
798dc17
viewer: add imgui light inputs
larc Oct 11, 2023
e407b9e
Merge branch 'dev' into alpha
larc Oct 11, 2023
d7b6bdd
viewer: update optix lights and shading
larc Oct 11, 2023
960db02
Merge branch 'dev' into alpha
larc Oct 11, 2023
a991de7
fix gproshanConfig.cmake.in
larc Oct 12, 2023
a2be6a2
Merge branch 'dev' into alpha
larc Oct 12, 2023
47c3055
g++-13 CImg warnings
larc Oct 17, 2023
9da0074
Merge branch 'dev' into alpha
larc Oct 17, 2023
d6068dc
fix debug CImg error
larc Oct 18, 2023
25d1267
Merge branch 'dev' into alpha
larc Oct 18, 2023
1cbfbbb
fix clang warnings: AppleClang 15
larc Oct 24, 2023
9250e10
mesh: move load mesh to che static method
larc Oct 25, 2023
3e63deb
util: adding partitions iterator
larc Oct 26, 2023
3f2d381
util: partitions iterator cuda
larc Oct 26, 2023
1767039
update cmake and install dependencies
larc Nov 1, 2023
859831f
Merge branch 'dev' into alpha
larc Nov 1, 2023
f426d87
che: ply ascii reader fix normal
larc Nov 6, 2023
2eca24f
che: update ply reader ascii
larc Nov 6, 2023
adea8a3
scenes: update scanner and rt const methods
larc Nov 6, 2023
b58d315
che: update merge method
larc Nov 6, 2023
15c56c6
Merge branch 'dev' into alpha
larc Nov 6, 2023
82fc290
che: fix ambigous rgb_t constructor
larc Nov 8, 2023
64a45a6
util: update partitions iterator/class
larc Nov 9, 2023
d36b95c
vec: update division methods
larc Nov 9, 2023
e3e325b
rt: update near ray parameter
larc Nov 9, 2023
1a4cc0c
che_ply: saving normals
larc Nov 10, 2023
b9844d8
rt: fix ray intersection pc
larc Nov 10, 2023
1d31eae
scenes: normalize scanner dist
larc Nov 11, 2023
eb04e79
viewer: maximize window
larc Nov 16, 2023
cb5d967
Merge branch 'dev' into alpha
larc Nov 16, 2023
4a98cd9
viewer: maximize with set windows size
larc Nov 16, 2023
94e4828
Merge branch 'dev' into alpha
larc Nov 16, 2023
21e3154
viewer: pop mesh
larc Nov 19, 2023
c60d1fd
viewer: delete selected mesh
larc Nov 19, 2023
083210a
viewer: refactoring add_process, menu/submenu entries
larc Nov 19, 2023
5dbdfd9
Merge branch 'dev' into alpha
larc Nov 19, 2023
6ba2ffa
viewer: fix callback keyboard glfw
larc Nov 19, 2023
288c63b
Merge branch 'dev' into alpha
larc Nov 19, 2023
d043dd2
rt: intersect get flat normal
larc Nov 21, 2023
5b9fe5f
viewer: refactoring menus
larc Nov 26, 2023
28627a2
viewer: refactoring menu items
larc Nov 26, 2023
0ccfc87
viewer: context menu mesh
larc Nov 26, 2023
2435bd0
viewer: mesh context menu added render/mesh options
larc Nov 26, 2023
8fbd63e
viewer: adding removed meshes history
larc Nov 26, 2023
1af6886
Merge branch 'dev' into alpha
larc Nov 27, 2023
517f6ed
viewer: fix width mesh context menu
larc Nov 27, 2023
00b2bc3
std: using size(container) instead of .size()
larc Nov 27, 2023
a9f9fa0
std: using size(container) instead of .size()
larc Nov 27, 2023
b34005e
std: using size(container) instead of .size()
larc Nov 27, 2023
79dd1e6
Merge branch 'dev' into alpha
larc Nov 27, 2023
181d17c
std: fix bug in action build Debug
larc Nov 27, 2023
6ec3ac2
viewer: add title arg constructor
larc Nov 27, 2023
cec473c
Merge branch 'dev' into alpha
larc Nov 27, 2023
01365b7
gproshan now using c++20
larc Nov 28, 2023
1d48a0e
geometry: using ivec2 for 2d convex hull
larc Nov 28, 2023
1c6728e
std: using std::ranges::sort
larc Nov 29, 2023
5d28857
viewer: organizing menu items
larc Nov 29, 2023
f2483df
Merge branch 'dev' into alpha
larc Nov 29, 2023
4bf6522
viewer: minor updates
larc Nov 29, 2023
3f454db
Merge branch 'dev' into alpha
larc Nov 29, 2023
d3fd16c
raytracing: mirror rays optix
larc Dec 1, 2023
b9ef88a
raytracing: fix miss rays, adding depth path tracing
larc Dec 1, 2023
19016ad
scenes: fix getting material texture in shading rt/gl
larc Dec 3, 2023
076b94b
scenes: fix specular texture one channel
larc Dec 3, 2023
60d39a7
rt: random samples
larc Dec 3, 2023
c99de39
rt: refactoring render params
larc Dec 3, 2023
2f3c1bf
rt: updating render params structure
larc Dec 3, 2023
0b8c9ef
rt: adding n_samples to render params optix
larc Dec 3, 2023
1d20eae
rt_optix: using payload_2 for random seed
larc Dec 3, 2023
38b3dc2
rt: scattered diffuse
larc Dec 4, 2023
e845e7e
rt: implementing a simple path tracer
larc Dec 4, 2023
bd34a99
Merge branch 'dev' into alpha
larc Dec 4, 2023
4d3c20d
rt: diffuse scatter default
larc Dec 4, 2023
89f1c68
Merge branch 'dev' into alpha
larc Dec 4, 2023
1363c59
util: adding access to partitions sorted pointer
larc Dec 4, 2023
6a4af7b
rt: embree path tracer implementation structure
larc Dec 7, 2023
5cb4ab6
rt: embree simple path tracer
larc Dec 7, 2023
78e6c22
gproshan: using const index_t instead of const index_t &
larc Dec 7, 2023
1d7a585
gproshan: using const real_t instead of const real_t &
larc Dec 7, 2023
82e8f81
gproshan: update rgb_t access methods
larc Dec 7, 2023
f1b79de
gproshan: cleaning up const &
larc Dec 7, 2023
7a1573a
Merge branch 'dev' into alpha
larc Dec 7, 2023
5fc627d
gproshan: minor updates
larc Dec 8, 2023
c9e683f
Merge branch 'dev' into alpha
larc Dec 8, 2023
b1f5fed
rt_embree: adding point cloud options params
larc Jan 9, 2024
accd707
rt_embree: varying radius knn based
larc Jan 10, 2024
b8db78d
Merge branch 'dev' into alpha
larc Jan 10, 2024
3e10b23
update imgui v1.90.1
larc Jan 15, 2024
7eb4512
Merge branch 'dev' into alpha
larc Jan 16, 2024
e266dba
che_xyz: loading colors and extra value as heatmap
larc Jan 22, 2024
1132f82
raytracing: closes hit vertex utils function added
larc Jan 23, 2024
8e09bf2
scenes: scanner save heatmap
larc Jan 23, 2024
2d0c822
Merge branch 'dev' into alpha
larc Jan 23, 2024
8dcd09d
che: accessing heatmap_scale member
larc Jan 23, 2024
d4a6246
Merge branch 'dev' into alpha
larc Jan 23, 2024
29bb9e9
rt_optix: using payload for accumulating hit distant
larc Jan 30, 2024
8efb1d1
rt_embree: accumulating hit distant variable and minor updates
larc Jan 30, 2024
c93b165
Merge branch 'dev' into alpha
larc Jan 30, 2024
32f3eba
updated imgui v1.90.4
larc Feb 26, 2024
c292e5c
knn: add median distant pairwise of pointcloud
larc Feb 26, 2024
623fbfe
Merge branch 'dev' into alpha
larc Feb 26, 2024
ff82958
knn: add k3tree constructor raw pointer query
larc Feb 28, 2024
8ff4bdb
knn: added mean of median knn distants
larc Mar 5, 2024
ce7e197
knn: options to compute a radius for all points cover surface
larc Mar 5, 2024
8edb76a
knn: adding different ways to compute radius knn/embree application
larc Mar 5, 2024
334a153
knn: options knn radius per point embree
larc Mar 6, 2024
06900de
embree: knn mean fix bug
larc Mar 6, 2024
8518c1f
knn: uncomment radius variations
larc Mar 6, 2024
1755bcf
Merge branch 'dev' into alpha
larc Mar 8, 2024
5bd0b22
rt_embree: get pc data from tracer
larc Mar 13, 2024
b612b38
remove CGAL dependency
larc Mar 16, 2024
ce7d85b
update github workflow and CHANGELOG
larc Mar 16, 2024
1dcaf87
geodesics: fix #19, use std::abs float/double issue
larc Mar 17, 2024
4877ac7
geodesics: update ptp cpu
larc Mar 18, 2024
5bb647c
geodesics: #15 passing custom user function, useful for testing for e…
larc Mar 18, 2024
9655f2d
geodesics: #15 cleaning up extra sources
larc Mar 18, 2024
67650af
geodesics: remove/move test source
larc Mar 19, 2024
fd85b53
update gproshan config file
larc Mar 19, 2024
65578f7
gproshan v4.0
larc Mar 19, 2024
5ab234b
Merge branch 'dev' into alpha
larc Mar 19, 2024
ee38444
laplacian: implemented as template functions
larc Mar 19, 2024
bee62d3
geodesics: heat method fix float/double mix, it requires double preci…
larc Mar 19, 2024
5c4a8fe
geodesics: debugging heat method
larc Mar 19, 2024
c221bc3
geodesics: fix #8 heat method, requires double precision
larc Mar 20, 2024
75107e3
che: adding che_cuda
larc Mar 21, 2024
f1df3ca
che: fix che_cuda when no cuda compiler
larc Mar 21, 2024
97f217d
che: using che_cuda optix, update scenes trigs
larc Mar 21, 2024
de069b7
che: const on public members
larc Mar 21, 2024
6ce951f
che: fix using access methods
larc Mar 21, 2024
5b1f990
che: cuda access methods implementation and iterator
larc Mar 21, 2024
f66b611
vec: update value access methods
larc Mar 21, 2024
c3b269f
embree: render pointcloud hit param
larc Mar 21, 2024
93c3c8d
quaternion: peding upgrade, removed toMatrix
larc Mar 21, 2024
0f367f4
Merge branch 'dev' into alpha
larc Mar 21, 2024
33f15cb
rt: update shading, utils.h
larc Mar 22, 2024
529a360
descriptor: WKS, HKS and GPS with double precision needed
larc Mar 22, 2024
01ddf64
Update build.yml
larc Mar 22, 2024
d85eb90
Update build.yml
larc Mar 22, 2024
e7a8e0f
Update README.md
larc Mar 22, 2024
33ae698
Update build.yml
larc Mar 22, 2024
07d63a2
Update build.yml
larc Mar 22, 2024
e18561a
Merge remote-tracking branch 'dev/larc-patch-1' into dev
larc Mar 22, 2024
0ad97c7
features: WKS update, fix max eigval
larc Mar 22, 2024
9a95a18
gproshan: compiling with AppleClang 15.0
larc Mar 23, 2024
471d461
cimg: warning null destination pointer snprintf
larc Mar 23, 2024
f3fa1f9
cimg: warning null destination pointer snprintf
larc Mar 23, 2024
5d3ac2b
cleaning up include_arma.h
larc Mar 23, 2024
0d2f56e
gproshan update install external cmake files
larc Mar 24, 2024
5371c78
geodesics: update cholmod heat method implementation
larc Mar 24, 2024
fccd82a
update README
larc Mar 24, 2024
0100f16
Merge branch 'dev' into alpha
larc Mar 25, 2024
602888d
float: updating float operations as default for loading and rendering…
larc Mar 25, 2024
f518e58
Merge branch 'dev' into alpha
larc Mar 25, 2024
10d3c6a
geodesics: update heat method gpu
larc Mar 26, 2024
c1a70bd
viewer: check window creation
larc Mar 26, 2024
4640dca
mesh: adding toplesets class
larc Mar 27, 2024
2574e39
geodesics: added toplesets and coalescence structs
larc Mar 27, 2024
79cfd5e
scenes: fix scene number of triangles
larc Mar 27, 2024
477f08f
Merge branch 'dev' into alpha
larc Mar 27, 2024
6feaefc
rt: avoiding float operations ptx optix
larc Jul 17, 2024
8d7ae3a
viewer: frame minor updates
larc Jul 23, 2024
7b6e249
rt_optix: splitting module
larc Aug 5, 2024
42567c1
Merge branch 'dev' of github.com:larc/gproshan_dev into dev
larc Aug 5, 2024
2b04080
rt: errors optix render
larc Aug 5, 2024
d699d76
rt: fix optix, renaming optix params
larc Aug 6, 2024
72efe30
update imgui v1.91.0
larc Aug 17, 2024
81c3c58
Merge branch 'dev' into alpha
larc Aug 17, 2024
22fb92c
Update build.yml
larc Aug 21, 2024
74b63d0
Merge branch 'dev' into alpha
larc Aug 21, 2024
b916825
viewer: add merge action to the list of removed meshes (merge with th…
larc Sep 10, 2024
a269880
Merge branch 'dev' into alpha
larc Sep 10, 2024
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
71 changes: 71 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Build

on: [push]

env:
CUDA_BIN: /usr/local/cuda/bin

jobs:
build:
name: ${{ matrix.os }} (${{ matrix.config }}) ${{ matrix.cuda }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
config: [Release, Debug]
cuda: [cuda, '']

steps:
- uses: actions/checkout@v2

- name: Install Dependencies
run: |
sudo apt remove --purge cmake
sudo snap install cmake --classic
sudo apt update
sudo apt install \
libarmadillo-dev \
libeigen3-dev \
libcgal-dev \
libsuitesparse-dev \
libopenblas-dev \
libglew-dev \
libglfw3-dev \
libglm-dev \
cimg-dev

- name: Install Cuda
if: matrix.cuda == 'cuda'
run: |
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin
sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/7fa2af80.pub
sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /"
sudo apt update
sudo apt -y install cuda

- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: cmake -E make_directory ${{runner.workspace}}/build

- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: bash
working-directory: ${{runner.workspace}}/build
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: |
export PATH=${CUDA_BIN}:${PATH}
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.config }}

- name: Build
working-directory: ${{runner.workspace}}/build
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . --config ${{ matrix.config }}

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ tmp/*
*.user
.vscode/*
.DS_Store

src/.vscode/settings.json
28 changes: 0 additions & 28 deletions .travis.yml

This file was deleted.

11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Version History
---------------

### gproshan 3.0.0
- Upgraded version of the sparse mesh coding with feature aware sampling module and published paper reference.
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review the other updates and changes.

- Updated save mesh with options for file types, normals, and point-cloud.
- Added render option using [Embree](https://www.embree.org/) ray tracing.
- Implemented the loading and rendering of point-clouds.
- Added heatmap viewer options and loading vertex color from a file.
- New user interface implemented with [ImGui](https://github.com/ocornut/imgui).
- Viewer upgraded using GLEW, GLFW, and GLM.
114 changes: 77 additions & 37 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,77 +1,117 @@
cmake_minimum_required(VERSION 3.12)
cmake_minimum_required(VERSION 3.18)

project(gproshan VERSION 2.0 LANGUAGES CXX)
project(gproshan VERSION 3.0)

list(APPEND CMAKE_MODULE_PATH "${gproshan_SOURCE_DIR}/cmake")

find_package(CUDA 10.1)
if(CUDA_FOUND)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(CUDAToolkit 11)
if(CUDAToolkit_FOUND)
enable_language(CUDA)
endif(CUDA_FOUND)
set(CMAKE_CUDA_STANDARD 17)
set(CMAKE_CUDA_STANDARD_REQUIRED ON)

add_definitions(-DGPROSHAN_CUDA)
include_directories(${CUDAToolkit_INCLUDE_DIRS})

find_package(OptiX 7.1)
if(OptiX_INCLUDE)
set(CUDA_HOST_COMPILER ${CMAKE_CUDA_HOST_COMPILER})
add_definitions(-DGPROSHAN_OPTIX)
include_directories(${OptiX_INCLUDE})
endif(OptiX_INCLUDE)
endif(CUDAToolkit_FOUND)


find_package(embree 3.10)
if(embree_FOUND)
add_definitions(-DGPROSHAN_EMBREE)
include_directories(${embree_INCLUDE_DIRS})
endif(embree_FOUND)


find_package(Threads REQUIRED)
find_package(OpenMP REQUIRED)
find_package(OpenGL REQUIRED)
find_package(GLEW REQUIRED)
find_package(GLUT REQUIRED)
find_package(GLEW 2 REQUIRED)
find_package(glfw3 3 REQUIRED)
find_package(glm REQUIRED)
find_package(X11 REQUIRED)
find_package(Armadillo REQUIRED)
find_package(CGAL REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(SuiteSparse REQUIRED)
find_package(Boost COMPONENTS thread system)

if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()

set(CMAKE_CXX_FLAGS "-fopenmp -Wall -Wno-unused-result")
set(CMAKE_CUDA_FLAGS "-Xcompiler -fopenmp")

set(THREADS_PREFER_PTHREAD_FLAG ON)

add_definitions(${EIGEN3_DEFINITIONS})

# ARMA warning ARMA_ALLOW_FAKE_GCC with g++-9
add_definitions(-DARMA_ALLOW_FAKE_GCC)

if(CUDA_FOUND)
add_definitions(-DGPROSHAN_CUDA)
include_directories(${CUDA_INCLUDE_DIRS})
endif(CUDA_FOUND)

include_directories(${OPENGL_INCLUDE_DIR})
include_directories(${GLEW_INCLUDE_DIRS})
include_directories(${GLUT_INCLUDE_DIR})
include_directories(${GLFW3_INCLUDE_DIRS})
include_directories(${X11_INCLUDE_DIR})
include_directories(${AMADILLO_INCLUDE_DIR})
include_directories(${EIGEN3_INCLUDE_DIR})
include_directories(${SuiteSparse_INCLUDE_DIRS})
include_directories(${CGAL_INCLUDE_DIRS})

include_directories(${gproshan_SOURCE_DIR}/include)
include_directories(${gproshan_SOURCE_DIR}/include/viewer)
include_directories(${gproshan_SOURCE_DIR}/include/mdict)
include_directories(${gproshan_SOURCE_DIR}/include/cuda)
include_directories(${gproshan_SOURCE_DIR}/imgui)

FILE(GLOB_RECURSE imgui_sources ${gproshan_SOURCE_DIR}/imgui/*.cpp)
add_library(imgui STATIC ${imgui_sources})

set(ptx_code "")
if(OptiX_INCLUDE)
cuda_compile_ptx(ptx_files "${gproshan_SOURCE_DIR}/src/raytracing/rt_optix.cu")
list(GET ptx_files 0 ptx_file)
set(ptx_code ptx_code.c)
add_custom_command( OUTPUT ${ptx_code}
COMMAND bin2c --const --padd 0 --type char --name ptx_code ${ptx_file} > ${ptx_code}
DEPENDS ${ptx_file}
)
endif(OptiX_INCLUDE)

FILE(GLOB_RECURSE cpp_sources ${gproshan_SOURCE_DIR}/src/*.cpp)
add_library(gproshan_cpp STATIC ${cpp_sources})
add_library(gproshan_cpp STATIC ${cpp_sources} ${ptx_code})

target_link_libraries(gproshan_cpp ${OpenMP_CXX_LIBRARIES})
target_link_libraries(gproshan_cpp ${OPENGL_LIBRARIES})
target_link_libraries(gproshan_cpp ${GLEW_LIBRARIES})
target_link_libraries(gproshan_cpp ${GLUT_LIBRARIES})
target_compile_options(gproshan_cpp PRIVATE -Wall -Wno-unused-result)

target_link_libraries(gproshan_cpp OpenMP::OpenMP_CXX)
target_link_libraries(gproshan_cpp OpenGL::GL)
target_link_libraries(gproshan_cpp GLEW::GLEW)
target_link_libraries(gproshan_cpp glfw)
target_link_libraries(gproshan_cpp ${X11_X11_LIB})
target_link_libraries(gproshan_cpp ${ARMADILLO_LIBRARIES})
target_link_libraries(gproshan_cpp CGAL::CGAL)
target_link_libraries(gproshan_cpp ${SuiteSparse_LIBRARIES})
target_link_libraries(gproshan_cpp CGAL::CGAL)
target_link_libraries(gproshan_cpp ${OptiX_LIBRARY})
target_link_libraries(gproshan_cpp imgui)

if(CUDA_FOUND)
if(embree_FOUND)
target_link_libraries(gproshan_cpp embree)
endif(embree_FOUND)

if(CUDAToolkit_FOUND)
FILE(GLOB_RECURSE cu_sources ${gproshan_SOURCE_DIR}/src/*.cu)
add_library(gproshan_cu STATIC ${cu_sources})
target_compile_options(gproshan_cu PRIVATE -Xcompiler -fopenmp)
set_target_properties(gproshan_cu PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
set_property(TARGET gproshan_cu PROPERTY CUDA_ARCHITECTURES 52 53 60 61 62 70 72 75 80)

target_link_libraries(gproshan_cu gproshan_cpp)
target_link_libraries(gproshan_cu ${CUDA_LIBRARIES} ${CUDA_cublas_LIBRARY} ${CUDA_cusolver_LIBRARY} ${CUDA_cusparse_LIBRARY})
endif(CUDA_FOUND)
target_link_libraries(gproshan_cu CUDA::cudart)
target_link_libraries(gproshan_cu CUDA::cublas)
target_link_libraries(gproshan_cu CUDA::cusolver)
target_link_libraries(gproshan_cu CUDA::cusparse)
endif(CUDAToolkit_FOUND)

add_executable(gproshan gproshan.cpp)
add_executable(test_geodesics test_geodesics.cpp)
Expand All @@ -81,11 +121,11 @@ target_link_libraries(gproshan gproshan_cpp)
target_link_libraries(test_geodesics gproshan_cpp)
target_link_libraries(test_image_denoising gproshan_cpp)

if(CUDA_FOUND)
if(CUDAToolkit_FOUND)
target_link_libraries(gproshan gproshan_cu)
target_link_libraries(test_geodesics gproshan_cu)
target_link_libraries(test_image_denoising gproshan_cu)
endif(CUDA_FOUND)
endif(CUDAToolkit_FOUND)

file(MAKE_DIRECTORY tmp)

Loading