Open verhovsky opened 1 year ago
I was able to build OpenMVS locally on my M1 Mac with these instructions: https://github.com/cdcseacave/openMVS/issues/921#issuecomment-1495914351
Trying to get it to work through homebrew is harder, I fixed the import errors with ChatGTP + GPT4's help
https://github.com/verhovsky/homebrew-core/commit/710a03f3f066683e56ec75ffd5a510f313ebcb03
https://github.com/verhovsky/homebrew-core/tree/openmvs
now I get this error:
WriteAuxiliaryFile /tmp/openmvs-20230404-8079-j3zhl3/openMVS-2.1.0/build/build/InterfaceCOLMAP.build/Release/Objects-normal/arm64/InterfaceCOLMAP.LinkFileList (in target 'InterfaceCOLMAP' from project 'OpenMVS')
cd /tmp/openmvs-20230404-8079-j3zhl3/openMVS-2.1.0
write-file /tmp/openmvs-20230404-8079-j3zhl3/openMVS-2.1.0/build/build/InterfaceCOLMAP.build/Release/Objects-normal/arm64/InterfaceCOLMAP.LinkFileList
Ld /tmp/openmvs-20230404-8079-j3zhl3/openMVS-2.1.0/build/bin/Release/InterfaceCOLMAP normal (in target 'InterfaceCOLMAP' from project 'OpenMVS')
cd /tmp/openmvs-20230404-8079-j3zhl3/openMVS-2.1.0
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -target arm64-apple-macos13.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk -L/tmp/openmvs-20230404-8079-j3zhl3/openMVS-2.1.0/build/EagerLinkingTBDs -L/tmp/openmvs-20230404-8079-j3zhl3/openMVS-2.1.0/build/bin/Release -L/opt/homebrew/lib/Release -L/opt/homebrew/lib -F/tmp/openmvs-20230404-8079-j3zhl3/openMVS-2.1.0/build/EagerLinkingTBDs -F/tmp/openmvs-20230404-8079-j3zhl3/openMVS-2.1.0/build/bin/Release -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.sdk/System/Library/Frameworks -filelist /tmp/openmvs-20230404-8079-j3zhl3/openMVS-2.1.0/build/build/InterfaceCOLMAP.build/Release/Objects-normal/arm64/InterfaceCOLMAP.LinkFileList -Xlinker -rpath -Xlinker /opt/homebrew/lib -stdlib\=libc++ -stdlib\=libc++ -Wl,-search_paths_first -Wl,-headerpad_max_install_names /tmp/openmvs-20230404-8079-j3zhl3/openMVS-2.1.0/build/lib/Release/libMVS.a /tmp/openmvs-20230404-8079-j3zhl3/openMVS-2.1.0/build/lib/Release/libMath.a /tmp/openmvs-20230404-8079-j3zhl3/openMVS-2.1.0/build/lib/Release/libIO.a /tmp/openmvs-20230404-8079-j3zhl3/openMVS-2.1.0/build/lib/Release/libCommon.a /opt/homebrew/lib/libboost_iostreams-mt.dylib /opt/homebrew/lib/libboost_program_options-mt.dylib /opt/homebrew/lib/libboost_system-mt.dylib /opt/homebrew/lib/libboost_serialization-mt.dylib /opt/homebrew/lib/libopencv_gapi.4.7.0.dylib /opt/homebrew/lib/libopencv_stitching.4.7.0.dylib /opt/homebrew/lib/libopencv_alphamat.4.7.0.dylib /opt/homebrew/lib/libopencv_aruco.4.7.0.dylib /opt/homebrew/lib/libopencv_barcode.4.7.0.dylib /opt/homebrew/lib/libopencv_bgsegm.4.7.0.dylib /opt/homebrew/lib/libopencv_bioinspired.4.7.0.dylib /opt/homebrew/lib/libopencv_ccalib.4.7.0.dylib /opt/homebrew/lib/libopencv_dnn_objdetect.4.7.0.dylib /opt/homebrew/lib/libopencv_dnn_superres.4.7.0.dylib /opt/homebrew/lib/libopencv_dpm.4.7.0.dylib /opt/homebrew/lib/libopencv_face.4.7.0.dylib /opt/homebrew/lib/libopencv_freetype.4.7.0.dylib /opt/homebrew/lib/libopencv_fuzzy.4.7.0.dylib /opt/homebrew/lib/libopencv_hfs.4.7.0.dylib /opt/homebrew/lib/libopencv_img_hash.4.7.0.dylib /opt/homebrew/lib/libopencv_intensity_transform.4.7.0.dylib /opt/homebrew/lib/libopencv_line_descriptor.4.7.0.dylib /opt/homebrew/lib/libopencv_mcc.4.7.0.dylib /opt/homebrew/lib/libopencv_quality.4.7.0.dylib /opt/homebrew/lib/libopencv_rapid.4.7.0.dylib /opt/homebrew/lib/libopencv_reg.4.7.0.dylib /opt/homebrew/lib/libopencv_rgbd.4.7.0.dylib /opt/homebrew/lib/libopencv_saliency.4.7.0.dylib /opt/homebrew/lib/libopencv_sfm.4.7.0.dylib /opt/homebrew/lib/libopencv_stereo.4.7.0.dylib /opt/homebrew/lib/libopencv_structured_light.4.7.0.dylib /opt/homebrew/lib/libopencv_phase_unwrapping.4.7.0.dylib /opt/homebrew/lib/libopencv_superres.4.7.0.dylib /opt/homebrew/lib/libopencv_optflow.4.7.0.dylib /opt/homebrew/lib/libopencv_surface_matching.4.7.0.dylib /opt/homebrew/lib/libopencv_tracking.4.7.0.dylib /opt/homebrew/lib/libopencv_highgui.4.7.0.dylib /opt/homebrew/lib/libopencv_datasets.4.7.0.dylib /opt/homebrew/lib/libopencv_plot.4.7.0.dylib /opt/homebrew/lib/libopencv_text.4.7.0.dylib /opt/homebrew/lib/libopencv_videostab.4.7.0.dylib /opt/homebrew/lib/libopencv_videoio.4.7.0.dylib /opt/homebrew/lib/libopencv_viz.4.7.0.dylib /opt/homebrew/lib/libopencv_wechat_qrcode.4.7.0.dylib /opt/homebrew/lib/libopencv_xfeatures2d.4.7.0.dylib /opt/homebrew/lib/libopencv_ml.4.7.0.dylib /opt/homebrew/lib/libopencv_shape.4.7.0.dylib /opt/homebrew/lib/libopencv_ximgproc.4.7.0.dylib /opt/homebrew/lib/libopencv_video.4.7.0.dylib /opt/homebrew/lib/libopencv_xobjdetect.4.7.0.dylib /opt/homebrew/lib/libopencv_imgcodecs.4.7.0.dylib /opt/homebrew/lib/libopencv_objdetect.4.7.0.dylib /opt/homebrew/lib/libopencv_calib3d.4.7.0.dylib /opt/homebrew/lib/libopencv_dnn.4.7.0.dylib /opt/homebrew/lib/libopencv_features2d.4.7.0.dylib /opt/homebrew/lib/libopencv_flann.4.7.0.dylib /opt/homebrew/lib/libopencv_xphoto.4.7.0.dylib /opt/homebrew/lib/libopencv_photo.4.7.0.dylib /opt/homebrew/lib/libopencv_imgproc.4.7.0.dylib /opt/homebrew/lib/libopencv_core.4.7.0.dylib /opt/homebrew/lib/libpng.dylib /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.sdk/usr/lib/libz.tbd /opt/homebrew/lib/libjpeg.dylib /opt/homebrew/lib/libtiff.dylib /opt/homebrew/lib/libgmpxx.dylib /opt/homebrew/lib/libmpfr.dylib /opt/homebrew/lib/libgmp.dylib -Xlinker -no_adhoc_codesign -Xlinker -dependency_info -Xlinker /tmp/openmvs-20230404-8079-j3zhl3/openMVS-2.1.0/build/build/InterfaceCOLMAP.build/Release/Objects-normal/arm64/InterfaceCOLMAP_dependency_info.dat -o /tmp/openmvs-20230404-8079-j3zhl3/openMVS-2.1.0/build/bin/Release/InterfaceCOLMAP
ld: warning: directory not found for option '-L/opt/homebrew/lib/Release'
Undefined symbols for architecture arm64:
"___kmpc_critical", referenced from:
_.omp_outlined. in libMVS.a(Scene.o)
_.omp_outlined. in libIO.a(OBJ.o)
"___kmpc_dispatch_init_4", referenced from:
_.omp_outlined..68 in libMVS.a(Scene.o)
_.omp_outlined..534 in libMVS.a(Mesh.o)
"___kmpc_dispatch_next_4", referenced from:
_.omp_outlined..68 in libMVS.a(Scene.o)
_.omp_outlined..534 in libMVS.a(Mesh.o)
"___kmpc_end_critical", referenced from:
_.omp_outlined. in libMVS.a(Scene.o)
_.omp_outlined. in libIO.a(OBJ.o)
"___kmpc_flush", referenced from:
_.omp_outlined..68 in libMVS.a(Scene.o)
"___kmpc_for_static_fini", referenced from:
_.omp_outlined. in libMVS.a(Scene.o)
_.omp_outlined. in libIO.a(OBJ.o)
"___kmpc_for_static_init_4", referenced from:
_.omp_outlined. in libIO.a(OBJ.o)
"___kmpc_for_static_init_8", referenced from:
_.omp_outlined. in libMVS.a(Scene.o)
"___kmpc_fork_call", referenced from:
MVS::Scene::SampleMeshWithVisibility(unsigned int) in libMVS.a(Scene.o)
MVS::Scene::ExportMeshToDepthMaps(SEACAVE::String const&) in libMVS.a(Scene.o)
void Eigen::internal::parallelize_gemm<true, Eigen::internal::gemm_functor<double, long, Eigen::internal::general_matrix_matrix_product<long, double, 0, false, double, 1, false, 1, 1>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Transpose<Eigen::Matrix<double, -1, -1, 0, -1, -1> const>, Eigen::Matrix<double, -1, -1, 1, -1, -1>, Eigen::internal::gemm_blocking_space<1, double, double, -1, -1, 3, 1, false> >, long>(Eigen::internal::gemm_functor<double, long, Eigen::internal::general_matrix_matrix_product<long, double, 0, false, double, 1, false, 1, 1>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Transpose<Eigen::Matrix<double, -1, -1, 0, -1, -1> const>, Eigen::Matrix<double, -1, -1, 1, -1, -1>, Eigen::internal::gemm_blocking_space<1, double, double, -1, -1, 3, 1, false> > const&, long, long, long, bool) in libMVS.a(Mesh.o)
MVS::Mesh::TransferTexture(MVS::Mesh&, unsigned int) in libMVS.a(Mesh.o)
SEACAVE::ObjModel::MaterialLib::Save(SEACAVE::String const&, bool) const in libIO.a(OBJ.o)
"___kmpc_global_thread_num", referenced from:
void Eigen::internal::parallelize_gemm<true, Eigen::internal::gemm_functor<double, long, Eigen::internal::general_matrix_matrix_product<long, double, 0, false, double, 1, false, 1, 1>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Transpose<Eigen::Matrix<double, -1, -1, 0, -1, -1> const>, Eigen::Matrix<double, -1, -1, 1, -1, -1>, Eigen::internal::gemm_blocking_space<1, double, double, -1, -1, 3, 1, false> >, long>(Eigen::internal::gemm_functor<double, long, Eigen::internal::general_matrix_matrix_product<long, double, 0, false, double, 1, false, 1, 1>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Transpose<Eigen::Matrix<double, -1, -1, 0, -1, -1> const>, Eigen::Matrix<double, -1, -1, 1, -1, -1>, Eigen::internal::gemm_blocking_space<1, double, double, -1, -1, 3, 1, false> > const&, long, long, long, bool) in libMVS.a(Mesh.o)
"___kmpc_push_num_threads", referenced from:
void Eigen::internal::parallelize_gemm<true, Eigen::internal::gemm_functor<double, long, Eigen::internal::general_matrix_matrix_product<long, double, 0, false, double, 1, false, 1, 1>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Transpose<Eigen::Matrix<double, -1, -1, 0, -1, -1> const>, Eigen::Matrix<double, -1, -1, 1, -1, -1>, Eigen::internal::gemm_blocking_space<1, double, double, -1, -1, 3, 1, false> >, long>(Eigen::internal::gemm_functor<double, long, Eigen::internal::general_matrix_matrix_product<long, double, 0, false, double, 1, false, 1, 1>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Transpose<Eigen::Matrix<double, -1, -1, 0, -1, -1> const>, Eigen::Matrix<double, -1, -1, 1, -1, -1>, Eigen::internal::gemm_blocking_space<1, double, double, -1, -1, 3, 1, false> > const&, long, long, long, bool) in libMVS.a(Mesh.o)
"_omp_get_max_threads", referenced from:
void Eigen::internal::parallelize_gemm<true, Eigen::internal::gemm_functor<double, long, Eigen::internal::general_matrix_matrix_product<long, double, 0, false, double, 1, false, 1, 1>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Transpose<Eigen::Matrix<double, -1, -1, 0, -1, -1> const>, Eigen::Matrix<double, -1, -1, 1, -1, -1>, Eigen::internal::gemm_blocking_space<1, double, double, -1, -1, 3, 1, false> >, long>(Eigen::internal::gemm_functor<double, long, Eigen::internal::general_matrix_matrix_product<long, double, 0, false, double, 1, false, 1, 1>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Transpose<Eigen::Matrix<double, -1, -1, 0, -1, -1> const>, Eigen::Matrix<double, -1, -1, 1, -1, -1>, Eigen::internal::gemm_blocking_space<1, double, double, -1, -1, 3, 1, false> > const&, long, long, long, bool) in libMVS.a(Mesh.o)
void Eigen::internal::generic_product_impl<Eigen::CwiseBinaryOp<Eigen::internal::scalar_product_op<double, double>, Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op<double>, Eigen::Matrix<double, 3, -1, 1, 3, -1> const> const, Eigen::Matrix<double, 3, -1, 1, 3, -1> const>, Eigen::Transpose<Eigen::Matrix<double, 3, -1, 1, 3, -1> const>, Eigen::DenseShape, Eigen::DenseShape, 8>::scaleAndAddTo<Eigen::Matrix<double, 3, 3, 0, 3, 3> >(Eigen::Matrix<double, 3, 3, 0, 3, 3>&, Eigen::CwiseBinaryOp<Eigen::internal::scalar_product_op<double, double>, Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op<double>, Eigen::Matrix<double, 3, -1, 1, 3, -1> const> const, Eigen::Matrix<double, 3, -1, 1, 3, -1> const> const&, Eigen::Transpose<Eigen::Matrix<double, 3, -1, 1, 3, -1> const> const&, double const&) in libMath.a(SimilarityTransform.o)
"_omp_get_num_threads", referenced from:
void Eigen::internal::parallelize_gemm<true, Eigen::internal::gemm_functor<double, long, Eigen::internal::general_matrix_matrix_product<long, double, 0, false, double, 1, false, 1, 1>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Transpose<Eigen::Matrix<double, -1, -1, 0, -1, -1> const>, Eigen::Matrix<double, -1, -1, 1, -1, -1>, Eigen::internal::gemm_blocking_space<1, double, double, -1, -1, 3, 1, false> >, long>(Eigen::internal::gemm_functor<double, long, Eigen::internal::general_matrix_matrix_product<long, double, 0, false, double, 1, false, 1, 1>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Transpose<Eigen::Matrix<double, -1, -1, 0, -1, -1> const>, Eigen::Matrix<double, -1, -1, 1, -1, -1>, Eigen::internal::gemm_blocking_space<1, double, double, -1, -1, 3, 1, false> > const&, long, long, long, bool) in libMVS.a(Mesh.o)
_.omp_outlined. in libMVS.a(Mesh.o)
Eigen::internal::general_matrix_matrix_product<long, double, 0, false, double, 1, false, 0, 1>::run(long, long, long, double const*, long, double const*, long, double*, long, long, double, Eigen::internal::level3_blocking<double, double>&, Eigen::internal::GemmParallelInfo<long>*) in libMVS.a(Mesh.o)
Eigen::internal::general_matrix_matrix_product<long, double, 1, false, double, 0, false, 0, 1>::run(long, long, long, double const*, long, double const*, long, double*, long, long, double, Eigen::internal::level3_blocking<double, double>&, Eigen::internal::GemmParallelInfo<long>*) in libMath.a(SimilarityTransform.o)
"_omp_get_thread_num", referenced from:
_.omp_outlined. in libMVS.a(Mesh.o)
Eigen::internal::general_matrix_matrix_product<long, double, 0, false, double, 1, false, 0, 1>::run(long, long, long, double const*, long, double const*, long, double*, long, long, double, Eigen::internal::level3_blocking<double, double>&, Eigen::internal::GemmParallelInfo<long>*) in libMVS.a(Mesh.o)
Eigen::internal::general_matrix_matrix_product<long, double, 1, false, double, 0, false, 0, 1>::run(long, long, long, double const*, long, double const*, long, double*, long, long, double, Eigen::internal::level3_blocking<double, double>&, Eigen::internal::GemmParallelInfo<long>*) in libMath.a(SimilarityTransform.o)
"_omp_set_num_threads", referenced from:
_main in InterfaceCOLMAP.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
note: Run script build phase 'Generate CMakeFiles/ALL_BUILD' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'ALL_BUILD' from project 'OpenMVS')
** BUILD FAILED **
The following build commands failed:
Ld /tmp/openmvs-20230404-8079-j3zhl3/openMVS-2.1.0/build/bin/Release/InterfaceCOLMAP normal (in target 'InterfaceCOLMAP' from project 'OpenMVS')
(1 failure)
/usr/bin/env /opt/homebrew/Library/Homebrew/shims/shared/git --version
/usr/bin/env /opt/homebrew/Library/Homebrew/shims/shared/curl --version
/opt/homebrew/Library/Homebrew/ignorable.rb:29:in `block in raise'
BuildError: Failed executing: xcodebuild -configuration Release SYMROOT=build -arch arm64
I tried adding openMVS to Homebrew
https://github.com/verhovsky/homebrew-core/commit/9e469ca2288a6ea5791cd890750ae943d0c95ce9
but I couldn't figure out the last step, how to get it to run
xcodebuild
, I get this error after runningbrew install --build-from-source --debug --verbose openmvs
with the changes in that commit:I'm leaving a link here to my attempt in case someone wants to finish it.
std_cmake_args
can be found here.