diff --git a/pkgs/by-name/co/colmap/0001-lib-PoissonRecon-fix-build-with-clang-19.patch b/pkgs/by-name/co/colmap/0001-lib-PoissonRecon-fix-build-with-clang-19.patch deleted file mode 100644 index cd12547ab82f..000000000000 --- a/pkgs/by-name/co/colmap/0001-lib-PoissonRecon-fix-build-with-clang-19.patch +++ /dev/null @@ -1,71 +0,0 @@ -From f3b1238483cc9bc3869c40e63a4cebf32052c624 Mon Sep 17 00:00:00 2001 -From: Samuel Tam -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 --void SparseMatrix::SetZero() --{ -- Resize(this->m_N, this->m_M); --} -- - template - SparseMatrix SparseMatrix::operator * (const T& V) const - { --- -2.47.1 - diff --git a/pkgs/by-name/co/colmap/package.nix b/pkgs/by-name/co/colmap/package.nix index 107a59b5445d..18f17a3ae551 100644 --- a/pkgs/by-name/co/colmap/package.nix +++ b/pkgs/by-name/co/colmap/package.nix @@ -25,76 +25,75 @@ cudaSupport ? config.cudaSupport, cudaCapabilities ? cudaPackages.flags.cudaCapabilities, cudaPackages, + faiss, + llvmPackages, + gtest, }: 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"; + version = "3.12.5"; pname = "colmap"; src = fetchFromGitHub { owner = "colmap"; repo = "colmap"; rev = version; - hash = "sha256-xtA0lEAq38/AHI3C9FhvjV5JPfVawrFr1fga4J1pi/0="; + hash = "sha256-ngmEYCLeCh5pSNmXItV3siY6/DupEHK+dYZ56LWZbhg="; }; - patches = [ - ./0001-lib-PoissonRecon-fix-build-with-clang-19.patch + cmakeFlags = [ + (lib.cmakeBool "DOWNLOAD_ENABLED" false) + (lib.cmakeBool "UNINSTALL_ENABLED" false) + (lib.cmakeBool "FETCH_POSELIB" false) + (lib.cmakeBool "FETCH_FAISS" false) + (lib.cmakeBool "TESTS_ENABLED" true) + ] + ++ lib.optionals cudaSupport [ + (lib.cmakeBool "CUDA_ENABLED" cudaSupport) + (lib.cmakeFeature "CMAKE_CUDA_ARCHITECTURES" ( + lib.strings.concatStringsSep ";" (map cudaPackages.flags.dropDots cudaCapabilities) + )) ]; - 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.dropDots cudaCapabilities) - )) - ]; + buildInputs = [ + boost + ceres-solver + eigen + freeimage + glog + libGLU + glew + qt5.qtbase + flann + lz4 + cgal + gmp + mpfr + xorg.libSM + poselib + faiss + ] + ++ lib.optionals cudaSupport [ + cudatoolkit + cudaPackages.cuda_cudart.static + ] + ++ lib.optional stdenv'.cc.isClang llvmPackages.openmp; - 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; + nativeBuildInputs = [ + cmake + qt5.wrapQtAppsHook + gtest + ] + ++ lib.optionals cudaSupport [ + autoAddDriverRunpath + ]; passthru.updateScript = gitUpdater { }; @@ -113,4 +112,4 @@ stdenv'.mkDerivation rec { usertam ]; }; -} \ No newline at end of file +}