Skip to content

Commit 55cf983

Browse files
MPankninclaude
andcommitted
Initial commit: Migrated MSc thesis project to modern C++17/CMake
This represents a complete modernization of the 2012 MSc thesis project "GPU-Accelerated Volumetric Occlusion Classification for Seismic Data". Migration highlights: - Upgraded from Visual Studio 2010 to CMake build system - Modernized from C++03 to C++17 standard - Added cross-platform support (Linux, macOS, Windows) - Updated CUDA support from 4.0 to 11/12 with modern architectures - Removed all legacy Windows-specific code - Added comprehensive documentation (README, quickstart, architecture) - Configured GitHub Actions CI/CD for automated builds - Fixed C++17 compatibility issues (const reference parameters) Project structure: - src/viewer/ - Interactive 3D visualization GUI (wxWidgets + OSG) - src/cuda/ - GPU-accelerated occlusion kernels - src/clustering/ - K-means clustering library - src/cli/ - Command-line tools - data/ - Sample datasets, shaders, 81 color tables - docs/ - Architecture documentation Key features: - Real-time GPU ray-casting volume rendering - Novel occlusion-based transfer function classification - Interactive histogram editing and feature extraction - SEG-Y seismic data format support - Transfer function presets and export/import Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
0 parents  commit 55cf983

File tree

193 files changed

+20579
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

193 files changed

+20579
-0
lines changed

.github/workflows/build.yml

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build-linux:
11+
name: Linux Build
12+
runs-on: ubuntu-22.04
13+
strategy:
14+
matrix:
15+
build_type: [Release, Debug]
16+
include_cuda: [ON, OFF]
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Install Dependencies
22+
run: |
23+
sudo apt-get update
24+
sudo apt-get install -y \
25+
build-essential \
26+
cmake \
27+
libwxgtk3.0-gtk3-dev \
28+
libopenscenegraph-dev \
29+
libgl1-mesa-dev
30+
31+
- name: Install CUDA Toolkit
32+
if: matrix.include_cuda == 'ON'
33+
uses: Jimver/cuda-toolkit@v0.2.14
34+
with:
35+
cuda: '12.3.0'
36+
37+
- name: Configure CMake
38+
run: |
39+
cmake -B build \
40+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
41+
-DBUILD_CUDA=${{ matrix.include_cuda }} \
42+
-DBUILD_VIEWER=ON \
43+
-DBUILD_CLI=ON
44+
45+
- name: Build
46+
run: cmake --build build --config ${{ matrix.build_type }} -j$(nproc)
47+
48+
- name: Upload Artifacts
49+
uses: actions/upload-artifact@v4
50+
with:
51+
name: linux-${{ matrix.build_type }}-cuda-${{ matrix.include_cuda }}
52+
path: build/bin/
53+
54+
build-macos:
55+
name: macOS Build
56+
runs-on: macos-14
57+
strategy:
58+
matrix:
59+
build_type: [Release, Debug]
60+
61+
steps:
62+
- uses: actions/checkout@v4
63+
64+
- name: Install Dependencies
65+
run: |
66+
brew install cmake wxwidgets open-scene-graph
67+
68+
- name: Configure CMake
69+
run: |
70+
cmake -B build \
71+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
72+
-DBUILD_CUDA=OFF \
73+
-DBUILD_VIEWER=ON \
74+
-DBUILD_CLI=OFF
75+
76+
- name: Build
77+
run: cmake --build build --config ${{ matrix.build_type }} -j$(sysctl -n hw.ncpu)
78+
79+
- name: Upload Artifacts
80+
uses: actions/upload-artifact@v4
81+
with:
82+
name: macos-${{ matrix.build_type }}
83+
path: build/bin/
84+
85+
build-windows:
86+
name: Windows Build
87+
runs-on: windows-2022
88+
strategy:
89+
matrix:
90+
build_type: [Release, Debug]
91+
92+
steps:
93+
- uses: actions/checkout@v4
94+
95+
- name: Setup vcpkg
96+
uses: lukka/run-vcpkg@v11
97+
with:
98+
vcpkgGitCommitId: 'master'
99+
100+
- name: Install Dependencies
101+
run: |
102+
vcpkg install wxwidgets openscenegraph --triplet x64-windows
103+
104+
- name: Install CUDA Toolkit
105+
uses: Jimver/cuda-toolkit@v0.2.14
106+
with:
107+
cuda: '12.3.0'
108+
109+
- name: Configure CMake
110+
run: |
111+
cmake -B build `
112+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} `
113+
-DCMAKE_TOOLCHAIN_FILE=$env:VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake `
114+
-DBUILD_CUDA=ON `
115+
-DBUILD_VIEWER=ON `
116+
-DBUILD_CLI=ON
117+
118+
- name: Build
119+
run: cmake --build build --config ${{ matrix.build_type }}
120+
121+
- name: Upload Artifacts
122+
uses: actions/upload-artifact@v4
123+
with:
124+
name: windows-${{ matrix.build_type }}
125+
path: build/bin/

.gitignore

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# Build directories
2+
build/
3+
build-*/
4+
cmake-build-*/
5+
out/
6+
bin/
7+
lib/
8+
*.dir/
9+
10+
# CMake
11+
CMakeCache.txt
12+
CMakeFiles/
13+
cmake_install.cmake
14+
CTestTestfile.cmake
15+
compile_commands.json
16+
*.cmake
17+
!CMakeLists.txt
18+
!cmake/*.cmake
19+
20+
# IDE files
21+
.vscode/
22+
.idea/
23+
*.swp
24+
*.swo
25+
*~
26+
.DS_Store
27+
*.user
28+
*.suo
29+
*.sdf
30+
*.opensdf
31+
*.vcxproj.user
32+
.vs/
33+
34+
# Compiled Object files
35+
*.o
36+
*.obj
37+
*.ko
38+
*.elf
39+
*.ilk
40+
*.map
41+
*.exp
42+
*.gch
43+
*.pch
44+
*.la
45+
*.lo
46+
47+
# Compiled Dynamic libraries
48+
*.so
49+
*.dylib
50+
*.dll
51+
52+
# Compiled Static libraries
53+
*.lai
54+
*.a
55+
*.lib
56+
57+
# Executables
58+
*.exe
59+
*.out
60+
*.app
61+
*.i*86
62+
*.x86_64
63+
*.hex
64+
65+
# CUDA
66+
*.i
67+
*.ii
68+
*.gpu
69+
*.ptx
70+
*.cubin
71+
*.fatbin
72+
73+
# Large data files (keep small samples only)
74+
*.sgy
75+
*.segy
76+
*.vol
77+
data/temp/
78+
data/cache/
79+
80+
# Temporary files
81+
temp/
82+
tmp/
83+
*.tmp
84+
*.log
85+
*.pid
86+
87+
# macOS
88+
.DS_Store
89+
.AppleDouble
90+
.LSOverride
91+
._*
92+
93+
# Linux
94+
*~
95+
.fuse_hidden*
96+
.directory
97+
.Trash-*
98+
99+
# Windows
100+
Thumbs.db
101+
ehthumbs.db
102+
Desktop.ini
103+
$RECYCLE.BIN/
104+
105+
# Backup files
106+
*.bak
107+
*.backup
108+
*~
109+
110+
# Package manager
111+
vcpkg_installed/
112+
conan/
113+
.conan/

CMakeLists.txt

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
cmake_minimum_required(VERSION 3.20)
2+
3+
project(SeismicOcclusionEditor
4+
VERSION 1.0.0
5+
DESCRIPTION "GPU-Accelerated Volumetric Occlusion Classification for Seismic Data"
6+
LANGUAGES CXX)
7+
8+
# Project options
9+
option(BUILD_VIEWER "Build the interactive viewer application" ON)
10+
option(BUILD_CUDA "Build CUDA-accelerated occlusion generation (requires NVIDIA GPU)" ON)
11+
option(BUILD_CLI "Build command-line tools" ON)
12+
option(BUILD_TESTS "Build unit tests" OFF)
13+
option(BUILD_DOCS "Build documentation" OFF)
14+
15+
# Modern C++ standard
16+
set(CMAKE_CXX_STANDARD 17)
17+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
18+
set(CMAKE_CXX_EXTENSIONS OFF)
19+
20+
# Export compile commands for IDEs
21+
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
22+
23+
# Add cmake modules
24+
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
25+
26+
# Output directories
27+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
28+
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
29+
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
30+
31+
# Platform-specific settings
32+
if(APPLE)
33+
set(CMAKE_MACOSX_RPATH ON)
34+
set(CMAKE_INSTALL_RPATH "@executable_path/../lib")
35+
elseif(UNIX)
36+
set(CMAKE_INSTALL_RPATH "$ORIGIN/../lib")
37+
endif()
38+
39+
# Dependencies
40+
find_package(OpenGL REQUIRED)
41+
42+
if(BUILD_VIEWER)
43+
find_package(wxWidgets COMPONENTS core base gl QUIET)
44+
find_package(OpenSceneGraph COMPONENTS osg osgDB osgGA osgViewer osgVolume osgText QUIET)
45+
46+
if(NOT wxWidgets_FOUND)
47+
message(WARNING "wxWidgets not found. Viewer will not be built.")
48+
message(STATUS "Install via: brew install wxwidgets (macOS) or apt install libwxgtk3.0-gtk3-dev (Linux)")
49+
set(BUILD_VIEWER OFF)
50+
endif()
51+
52+
if(NOT OpenSceneGraph_FOUND)
53+
message(WARNING "OpenSceneGraph not found. Viewer will not be built.")
54+
message(STATUS "Install via: brew install open-scene-graph (macOS) or apt install libopenscenegraph-dev (Linux)")
55+
set(BUILD_VIEWER OFF)
56+
endif()
57+
endif()
58+
59+
if(BUILD_CUDA)
60+
include(CheckLanguage)
61+
check_language(CUDA)
62+
63+
if(CMAKE_CUDA_COMPILER)
64+
enable_language(CUDA)
65+
set(CMAKE_CUDA_STANDARD 17)
66+
set(CMAKE_CUDA_STANDARD_REQUIRED ON)
67+
68+
# Modern CUDA architectures (adjust based on target GPUs)
69+
if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES)
70+
# Common modern architectures: Pascal, Volta, Turing, Ampere, Ada Lovelace, Hopper
71+
set(CMAKE_CUDA_ARCHITECTURES 60 70 75 80 86 89 90)
72+
endif()
73+
74+
message(STATUS "CUDA support enabled - CUDA ${CMAKE_CUDA_COMPILER_VERSION}")
75+
message(STATUS "Target CUDA architectures: ${CMAKE_CUDA_ARCHITECTURES}")
76+
else()
77+
message(WARNING "CUDA compiler not found. CUDA features will be disabled.")
78+
message(STATUS "This is expected on macOS. Full functionality requires Linux/Windows with NVIDIA GPU.")
79+
set(BUILD_CUDA OFF)
80+
endif()
81+
endif()
82+
83+
# Compiler warnings
84+
if(MSVC)
85+
add_compile_options(/W4 /WX-)
86+
else()
87+
add_compile_options(-Wall -Wextra -Wpedantic)
88+
endif()
89+
90+
# Core libraries
91+
add_subdirectory(src/common)
92+
add_subdirectory(src/clustering)
93+
94+
if(BUILD_CUDA)
95+
add_subdirectory(src/cuda)
96+
endif()
97+
98+
if(BUILD_VIEWER)
99+
add_subdirectory(src/viewer)
100+
endif()
101+
102+
if(BUILD_CLI)
103+
add_subdirectory(src/cli)
104+
endif()
105+
106+
# Installation
107+
install(DIRECTORY data/
108+
DESTINATION share/seismic-occlusion-editor/data
109+
PATTERN "*.sgy" EXCLUDE
110+
PATTERN "*.vol" EXCLUDE
111+
PATTERN "*.raw" EXCLUDE)
112+
113+
# Print configuration summary
114+
message(STATUS "")
115+
message(STATUS "========================================")
116+
message(STATUS "Seismic Occlusion Editor Configuration")
117+
message(STATUS "========================================")
118+
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
119+
message(STATUS "C++ standard: C++${CMAKE_CXX_STANDARD}")
120+
if(BUILD_CUDA)
121+
message(STATUS "CUDA standard: CUDA ${CMAKE_CUDA_STANDARD}")
122+
message(STATUS "CUDA compiler: ${CMAKE_CUDA_COMPILER}")
123+
endif()
124+
message(STATUS "")
125+
message(STATUS "Components:")
126+
message(STATUS " Viewer: ${BUILD_VIEWER}")
127+
message(STATUS " CUDA: ${BUILD_CUDA}")
128+
message(STATUS " CLI tools: ${BUILD_CLI}")
129+
message(STATUS " Tests: ${BUILD_TESTS}")
130+
message(STATUS " Documentation: ${BUILD_DOCS}")
131+
message(STATUS "========================================")
132+
message(STATUS "")

0 commit comments

Comments
 (0)