Overview
OmniView is built with Go 1.24 and uses CGO for Oracle ODPI-C integration. This guide covers everything you need to build the project from source.Prerequisites
Required Software
Before building OmniView, ensure you have the following installed:Go 1.24+
Go programming language with CGO support enabled
Oracle Instant Client
Version 23.7 or later with SDK package
C Compiler
GCC (Linux/macOS) or MinGW-w64 (Windows)
Git
For cloning the repository
Platform-Specific Requirements
- Linux
- macOS
- Windows
Oracle Instant Client Setup
OmniView requires Oracle Instant Client with the SDK package.Cloning the Repository
Clone the OmniView repository from your source control:Installing Dependencies
OmniView uses Go modules for dependency management. Install all dependencies:What does make install do?
What does make install do?
The
make install target runs:go mod download- Downloads all Go dependenciesgo mod tidy- Cleans up unused dependencies
Key Dependencies
Fromgo.mod:
Building the Project
Standard Build
Build the complete project with a single command:Build process output
Build process output
- Checks and builds the ODPI-C library (if needed)
- Sets CGO compiler and linker flags
- Compiles the Go application
- Links the CGO modules (
dequeue_ops.c)
Building with Version Number
Specify a version during build:internal/app.Version using Go build flags.
Build Output
Successful build produces:omniview(oromniview.exeon Windows) - Main executablethird_party/odpi/lib/libodpi.dylib(macOS) orodpi.dll(Windows) - ODPI library
Running Tests
Run the test suite:Development Workflow
Quick Development Cycle
- Make changes to source code
- Format code:
make fmt - Lint code:
make lint - Build and run:
make run
Common Development Commands
Format Code
go fmtLint Code
go vet to check for issuesClean Build
Debug CGO
Build and Run
Build and immediately run the application:- Builds the project (including dependencies)
- Executes the binary with appropriate platform handling
Debugging CGO Compilation
If you encounter CGO issues, use the debug target:- CGO compiler flags being used
- CGO linker flags being used
- Detailed GCC/Clang compilation steps
- Which files are being compiled by CGO
Example check-cgo output
Example check-cgo output
Cleaning Build Artifacts
Remove all build artifacts and caches:- Compiled ODPI object files (
third_party/odpi/build/) - ODPI source files (if any)
- Binary executables (
omniview,omniview.exe) - Database files (
*.db) - Go build cache
Troubleshooting
CGO Compiler Not Found
Oracle Instant Client Not Found
Go Version Mismatch
ODPI Build Fails
If the ODPI library fails to build, try building it separately:- Oracle Instant Client SDK is installed
INSTANT_CLIENT_DIRpoints to the correct location- SDK include files exist at
$INSTANT_CLIENT_DIR/sdk/include
Next Steps
Makefile Reference
Learn about all available make targets
CGO Integration
Deep dive into CGO and ODPI-C integration