Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
75 changes: 0 additions & 75 deletions pkgs/applications/science/misc/colmap/default.nix

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
From f3b1238483cc9bc3869c40e63a4cebf32052c624 Mon Sep 17 00:00:00 2001
From: Samuel Tam <main@usertam.dev>
Date: Sun, 2 Mar 2025 16:35:03 +0000
Subject: [PATCH] lib/PoissonRecon: fix build with clang 19

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=281867
---
src/thirdparty/PoissonRecon/Ply.h | 8 ++++----
src/thirdparty/PoissonRecon/SparseMatrix.inl | 6 ------
2 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/src/thirdparty/PoissonRecon/Ply.h b/src/thirdparty/PoissonRecon/Ply.h
index 699381ff..e5831263 100644
--- a/src/thirdparty/PoissonRecon/Ply.h
+++ b/src/thirdparty/PoissonRecon/Ply.h
@@ -301,7 +301,7 @@ public:
PlyValueVertex( void ) : value( Real(0) ) { ; }
PlyValueVertex( Point3D< Real > p , Real v ) : point(p) , value(v) { ; }
PlyValueVertex operator + ( PlyValueVertex p ) const { return PlyValueVertex( point+p.point , value+p.value ); }
- PlyValueVertex operator - ( PlyValueVertex p ) const { return PlyValueVertex( point-p.value , value-p.value ); }
+ PlyValueVertex operator - ( PlyValueVertex p ) const { return PlyValueVertex( point-p.point , value-p.value ); }
template< class _Real > PlyValueVertex operator * ( _Real s ) const { return PlyValueVertex( point*s , Real(value*s) ); }
template< class _Real > PlyValueVertex operator / ( _Real s ) const { return PlyValueVertex( point/s , Real(value/s) ); }
PlyValueVertex& operator += ( PlyValueVertex p ) { point += p.point , value += p.value ; return *this; }
@@ -340,7 +340,7 @@ public:
PlyOrientedVertex( void ) { ; }
PlyOrientedVertex( Point3D< Real > p , Point3D< Real > n ) : point(p) , normal(n) { ; }
PlyOrientedVertex operator + ( PlyOrientedVertex p ) const { return PlyOrientedVertex( point+p.point , normal+p.normal ); }
- PlyOrientedVertex operator - ( PlyOrientedVertex p ) const { return PlyOrientedVertex( point-p.value , normal-p.normal ); }
+ PlyOrientedVertex operator - ( PlyOrientedVertex p ) const { return PlyOrientedVertex( point-p.point , normal-p.normal ); }
template< class _Real > PlyOrientedVertex operator * ( _Real s ) const { return PlyOrientedVertex( point*s , normal*s ); }
template< class _Real > PlyOrientedVertex operator / ( _Real s ) const { return PlyOrientedVertex( point/s , normal/s ); }
PlyOrientedVertex& operator += ( PlyOrientedVertex p ) { point += p.point , normal += p.normal ; return *this; }
@@ -386,7 +386,7 @@ public:
}

_PlyColorVertex operator + ( _PlyColorVertex p ) const { return _PlyColorVertex( point+p.point , color+p.color ); }
- _PlyColorVertex operator - ( _PlyColorVertex p ) const { return _PlyColorVertex( point-p.value , color-p.color ); }
+ _PlyColorVertex operator - ( _PlyColorVertex p ) const { return _PlyColorVertex( point-p.point , color-p.color ); }
template< class _Real > _PlyColorVertex operator * ( _Real s ) const { return _PlyColorVertex( point*s , color*s ); }
template< class _Real > _PlyColorVertex operator / ( _Real s ) const { return _PlyColorVertex( point/s , color/s ); }
_PlyColorVertex& operator += ( _PlyColorVertex p ) { point += p.point , color += p.color ; return *this; }
@@ -455,7 +455,7 @@ public:
}

_PlyColorAndValueVertex operator + ( _PlyColorAndValueVertex p ) const { return _PlyColorAndValueVertex( point+p.point , color+p.color , value+p.value ); }
- _PlyColorAndValueVertex operator - ( _PlyColorAndValueVertex p ) const { return _PlyColorAndValueVertex( point-p.value , color-p.color , value+p.value ); }
+ _PlyColorAndValueVertex operator - ( _PlyColorAndValueVertex p ) const { return _PlyColorAndValueVertex( point-p.point , color-p.color , value+p.value ); }
template< class _Real > _PlyColorAndValueVertex operator * ( _Real s ) const { return _PlyColorAndValueVertex( point*s , color*s , value*s ); }
template< class _Real > _PlyColorAndValueVertex operator / ( _Real s ) const { return _PlyColorAndValueVertex( point/s , color/s , value/s ); }
_PlyColorAndValueVertex& operator += ( _PlyColorAndValueVertex p ) { point += p.point , color += p.color , value += p.value ; return *this; }
diff --git a/src/thirdparty/PoissonRecon/SparseMatrix.inl b/src/thirdparty/PoissonRecon/SparseMatrix.inl
index c181d827..de310538 100755
--- a/src/thirdparty/PoissonRecon/SparseMatrix.inl
+++ b/src/thirdparty/PoissonRecon/SparseMatrix.inl
@@ -192,12 +192,6 @@ void SparseMatrix< T >::SetRowSize( int row , int count )
}


-template<class T>
-void SparseMatrix<T>::SetZero()
-{
- Resize(this->m_N, this->m_M);
-}
-
template<class T>
SparseMatrix<T> SparseMatrix<T>::operator * (const T& V) const
{
--
2.47.1

116 changes: 116 additions & 0 deletions pkgs/by-name/co/colmap/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
{
lib,
fetchFromGitHub,
fetchpatch,
gitUpdater,
cmake,
boost,
ceres-solver,
eigen,
freeimage,
glog,
libGLU,
glew,
flann,
cgal,
gmp,
mpfr,
poselib,
lz4,
autoAddDriverRunpath,
config,
stdenv,
qt5,
xorg,
cudaSupport ? config.cudaSupport,
cudaCapabilities ? cudaPackages.cudaFlags.cudaCapabilities,
cudaPackages,
}:

assert cudaSupport -> cudaPackages != { };

let
boost_static = boost.override { enableStatic = true; };
stdenv' = if cudaSupport then cudaPackages.backendStdenv else stdenv;

# TODO: migrate to redist packages
inherit (cudaPackages) cudatoolkit;
in
stdenv'.mkDerivation rec {
version = "3.11.1";
pname = "colmap";
src = fetchFromGitHub {
owner = "colmap";
repo = "colmap";
rev = version;
hash = "sha256-xtA0lEAq38/AHI3C9FhvjV5JPfVawrFr1fga4J1pi/0=";
};

patches = [
./0001-lib-PoissonRecon-fix-build-with-clang-19.patch
];

cmakeFlags =
[
(lib.cmakeBool "FETCH_POSELIB" false)
]
++ lib.optionals cudaSupport [
(lib.cmakeBool "CUDA_ENABLED" true)
(lib.cmakeFeature "CMAKE_CUDA_ARCHITECTURES" (
lib.strings.concatStringsSep ";" (map cudaPackages.cudaFlags.dropDot cudaCapabilities)
))
];

buildInputs =
[
boost_static
ceres-solver
eigen
freeimage
glog
libGLU
glew
qt5.qtbase
flann
lz4
cgal
gmp
mpfr
xorg.libSM
poselib
]
++ lib.optionals cudaSupport [
cudatoolkit
cudaPackages.cuda_cudart.static
];

nativeBuildInputs =
[
cmake
qt5.wrapQtAppsHook
]
++ lib.optionals cudaSupport [
autoAddDriverRunpath
];

enableParallelBuilding = true;
enableParallelInstalling = true;

passthru.updateScript = gitUpdater { };

meta = with lib; {
description = "COLMAP - Structure-From-Motion and Multi-View Stereo pipeline";
longDescription = ''
COLMAP is a general-purpose Structure-from-Motion (SfM) and Multi-View Stereo (MVS) pipeline
with a graphical and command-line interface.
'';
mainProgram = "colmap";
homepage = "https://colmap.github.io/index.html";
license = licenses.bsd3;
platforms = platforms.unix;
maintainers = with maintainers; [
lebastr
usertam
];
};
}
42 changes: 42 additions & 0 deletions pkgs/by-name/po/poselib/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
lib,
stdenv,
fetchFromGitHub,
gitUpdater,
cmake,
eigen,
pkg-config,
}:

stdenv.mkDerivation (final: {
pname = "poselib";
version = "2.0.4";

src = fetchFromGitHub {
owner = "PoseLib";
repo = "PoseLib";
rev = "v${final.version}";
hash = "sha256-5cd0k53kqggJCzz3ajPcUeBIi5KuvBUG7SQKsHBWIdU=";
};

buildInputs = [ eigen ];

nativeBuildInputs = [
cmake
pkg-config
];

enableParallelBuilding = true;
enableParallelInstalling = true;

passthru.updateScript = gitUpdater { rev-prefix = "v"; };

meta = with lib; {
description = "A collection of minimal solvers for camera pose estimation";
homepage = "https://github.com/PoseLib/PoseLib";
changelog = "https://github.com/PoseLib/PoseLib/releases/tag/v${final.version}";
license = licenses.bsd3;
platforms = platforms.unix;
maintainers = with maintainers; [ usertam ];
};
})
1 change: 0 additions & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5577,7 +5577,6 @@ with pkgs;
inherit (llvmPackages) lld stdenv;
};

colmap = libsForQt5.callPackage ../applications/science/misc/colmap { inherit (config) cudaSupport; };
colmapWithCuda = colmap.override { cudaSupport = true; };

opensplatWithCuda = opensplat.override { cudaSupport = true; };
Expand Down