From c188266376848bb72ada7f8d52b8da4d4254f28c Mon Sep 17 00:00:00 2001 From: Asad Mehboob Ali <86931093+Asadali242@users.noreply.github.com> Date: Tue, 13 Aug 2024 05:43:04 -0400 Subject: [PATCH 1/2] Add complete installation guide for COLMAP and GLOMAP on macOS --- docs/INSTALL_MAC.md | 150 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 docs/INSTALL_MAC.md diff --git a/docs/INSTALL_MAC.md b/docs/INSTALL_MAC.md new file mode 100644 index 00000000..cbde7596 --- /dev/null +++ b/docs/INSTALL_MAC.md @@ -0,0 +1,150 @@ +**Hello, it took me hours of troubleshooting to successfully build COLMAP and GLOMAP on my Mac. To save others from the same hassle, I've compiled this comprehensive installation guide. I hope this guide helps you get up and running smoothly, so you can focus on using these powerful tools without the headaches I encountered.** + +## Installing the COLMAP: + +*1. Open the Terminal and install the brew dependancies:* +brew install +cmake +ninja +boost +eigen +flann +libomp \ #(Install Libomp as well) +freeimage +metis +glog +googletest +ceres-solver +qt@5 +glew +cgal +sqlite3 + +*2. Clone the COLMAP repository:* +git clone https://github.com/colmap/colmap.git +cd colmap + +*3. Ensure Qt5 is in your PATH:* +export PATH="/opt/homebrew/opt/qt@5/bin:$PATH" + +*4. Create a build directory:* +mkdir build +cd build + +*5. After installing, link Qt5 to make sure it’s accessible:* +brew link qt@5 --force + +*6. Run CMake with the specific paths for ARM Mac(M1 and above):* +cmake .. -GNinja -DCMAKE_PREFIX_PATH="/opt/homebrew/opt/flann;/opt/homebrew/opt/metis;/opt/homebrew/opt/suite-sparse;/opt/homebrew/opt/qt@5;/opt/homebrew/opt/freeimage" + +*7. Build and install COLMAP:* +ninja +sudo ninja install + +*8. Confirm COLMAP installation by running:* +colmap -h +colmap gui + +**This is the first part and will install Colmap on your device.** + + + +## Installing the GLOMAP: + +*1. Clone the GitHub repository:* +git clone https://github.com/colmap/glomap +cd glomap + +*2. Create a build directory:* +mkdir build +cd build + +*3. Export Environment Variables Again:* +export PATH="/opt/homebrew/opt/qt@5/bin:$PATH" +export LDFLAGS="-L/opt/homebrew/opt/libomp/lib" +export CPPFLAGS="-I/opt/homebrew/opt/libomp/include" +export CMAKE_PREFIX_PATH="/opt/homebrew/opt/qt@5;/opt/homebrew/opt/libomp" +export PKG_CONFIG_PATH="/opt/homebrew/opt/qt@5/lib/pkgconfig" + +*4. Run the CMake Command:* +cmake -DCMAKE_PREFIX_PATH="/opt/homebrew/Cellar/qt@5/5.15.13_1;/opt/homebrew/opt/libomp" +-DOpenMP_C_FLAGS="-Xclang -fopenmp" +-DOpenMP_C_LIB_NAMES="libomp" +-DOpenMP_CXX_FLAGS="-Xclang -fopenmp" +-DOpenMP_CXX_LIB_NAMES="libomp" +-DOpenMP_C_INCLUDE_DIRS="/opt/homebrew/opt/libomp/include" +-DOpenMP_CXX_INCLUDE_DIRS="/opt/homebrew/opt/libomp/include" +-DOpenMP_libomp_LIBRARY=/opt/homebrew/opt/libomp/lib/libomp.dylib +-DOpenMP_INCLUDE_DIR=/opt/homebrew/opt/libomp/include +.. -GNinja + +*5. Build the Project:* +ninja + +**NOTE: If at this point, there are build errors related to ‘cholmod.h’ or ‘omp.h’, clean the build and then re-run the make with the following commands:** +cmake -DCMAKE_PREFIX_PATH="/opt/homebrew/Cellar/qt@5/5.15.13_1;/opt/homebrew/opt/libomp" +-DOpenMP_C_FLAGS="-Xclang -fopenmp -I/opt/homebrew/opt/libomp/include" +-DOpenMP_C_LIB_NAMES="libomp" +-DOpenMP_CXX_FLAGS="-Xclang -fopenmp -I/opt/homebrew/opt/libomp/include" +-DOpenMP_CXX_LIB_NAMES="libomp" +-DOpenMP_libomp_LIBRARY=/opt/homebrew/opt/libomp/lib/libomp.dylib +.. -GNinja + +**After the build is successful:** + +*6. Install the Built Project:* +sudo ninja install + +*7. Test the Installation:* +glomap -h + +**It should display something like:** +GLOMAP -- Global Structure-from-Motion +Usage: +glomap mapper --database_path DATABASE --output_path +MODEL +glomap mapper_resume --input_path MODEL_INPUT --output_path MODEL_OUTPUT +Available commands: +help +mapper +mapper_resume + + +## Testing with the end-to-end examples provided: + +*1. Open the end-to-end example database link provided:* +https://lpanaf.github.io/eccv24_glomap/ + +*2. Download one of the datasets provided and extract the zip file.* + +*3. Create a new directory named ‘data’ in the root directory ‘glomap’.* + +*4. Place the extracted dataset in the directory ‘data’.* + +*5. Now navigate back to the project directory ‘glomap’.* + +**NOTE: Following commands are assuming the dataset to be south-building:** + +*6. Extract Features with COLMAP:* +colmap feature_extractor +--image_path ./data/south-building/images +--database_path ./data/south-building/database.db + +*7. Match Features with COLMAP:* +colmap exhaustive_matcher +--database_path ./data/south-building/database.db + +*8. Run GLOMAP Mapper:* +glomap mapper +--database_path ./data/south-building/database.db +--image_path ./data/south-building/images +--output_path ./output/south-building/sparse + +**This should generate a new directory named ‘output’ in the project directory.** + +*9. Visualize the Results:* +colmap gui +--database_path ./data/south-building/database.db +--image_path ./data/south-building/images +--import_path ./output/south-building/sparse/0 + From 1c0cafa559dc6d415117084cab217c03b55d8a4f Mon Sep 17 00:00:00 2001 From: Linfei Pan <36349740+lpanaf@users.noreply.github.com> Date: Tue, 13 Aug 2024 14:41:48 +0200 Subject: [PATCH 2/2] Update INSTALL_MAC.md --- docs/INSTALL_MAC.md | 127 +++++++++++++++++++++++++++++--------------- 1 file changed, 85 insertions(+), 42 deletions(-) diff --git a/docs/INSTALL_MAC.md b/docs/INSTALL_MAC.md index cbde7596..638f5743 100644 --- a/docs/INSTALL_MAC.md +++ b/docs/INSTALL_MAC.md @@ -1,49 +1,67 @@ -**Hello, it took me hours of troubleshooting to successfully build COLMAP and GLOMAP on my Mac. To save others from the same hassle, I've compiled this comprehensive installation guide. I hope this guide helps you get up and running smoothly, so you can focus on using these powerful tools without the headaches I encountered.** +We would like to thank [Asadali242](https://github.com/Asadali242) for providing the installation guide for MAC. +Leave your comments at [Issue #62](https://github.com/colmap/glomap/issues/62) if you encounter any problems. ## Installing the COLMAP: -*1. Open the Terminal and install the brew dependancies:* -brew install -cmake -ninja -boost -eigen -flann +*1. Open the Terminal and install the brew dependencies:* +``` +brew install \ +cmake \ +ninja \ +boost \ +eigen \ +flann \ libomp \ #(Install Libomp as well) -freeimage -metis -glog -googletest -ceres-solver -qt@5 -glew -cgal +freeimage \ +metis \ +glog \ +googletest \ +ceres-solver \ +qt@5 \ +glew \ +cgal \ sqlite3 +``` *2. Clone the COLMAP repository:* +``` git clone https://github.com/colmap/colmap.git cd colmap +``` *3. Ensure Qt5 is in your PATH:* +``` export PATH="/opt/homebrew/opt/qt@5/bin:$PATH" +``` *4. Create a build directory:* +``` mkdir build cd build +``` *5. After installing, link Qt5 to make sure it’s accessible:* +``` brew link qt@5 --force +``` *6. Run CMake with the specific paths for ARM Mac(M1 and above):* -cmake .. -GNinja -DCMAKE_PREFIX_PATH="/opt/homebrew/opt/flann;/opt/homebrew/opt/metis;/opt/homebrew/opt/suite-sparse;/opt/homebrew/opt/qt@5;/opt/homebrew/opt/freeimage" +``` +cmake .. -GNinja \ + -DCMAKE_PREFIX_PATH="/opt/homebrew/opt/flann;/opt/homebrew/opt/metis;/opt/homebrew/opt/suite-sparse;/opt/homebrew/opt/qt@5;/opt/homebrew/opt/freeimage" +``` *7. Build and install COLMAP:* +``` ninja sudo ninja install +``` *8. Confirm COLMAP installation by running:* +``` colmap -h colmap gui +``` **This is the first part and will install Colmap on your device.** @@ -52,53 +70,70 @@ colmap gui ## Installing the GLOMAP: *1. Clone the GitHub repository:* +``` git clone https://github.com/colmap/glomap cd glomap +``` *2. Create a build directory:* +``` mkdir build cd build +``` *3. Export Environment Variables Again:* +``` export PATH="/opt/homebrew/opt/qt@5/bin:$PATH" export LDFLAGS="-L/opt/homebrew/opt/libomp/lib" export CPPFLAGS="-I/opt/homebrew/opt/libomp/include" export CMAKE_PREFIX_PATH="/opt/homebrew/opt/qt@5;/opt/homebrew/opt/libomp" export PKG_CONFIG_PATH="/opt/homebrew/opt/qt@5/lib/pkgconfig" +``` *4. Run the CMake Command:* -cmake -DCMAKE_PREFIX_PATH="/opt/homebrew/Cellar/qt@5/5.15.13_1;/opt/homebrew/opt/libomp" --DOpenMP_C_FLAGS="-Xclang -fopenmp" --DOpenMP_C_LIB_NAMES="libomp" --DOpenMP_CXX_FLAGS="-Xclang -fopenmp" --DOpenMP_CXX_LIB_NAMES="libomp" --DOpenMP_C_INCLUDE_DIRS="/opt/homebrew/opt/libomp/include" --DOpenMP_CXX_INCLUDE_DIRS="/opt/homebrew/opt/libomp/include" --DOpenMP_libomp_LIBRARY=/opt/homebrew/opt/libomp/lib/libomp.dylib --DOpenMP_INCLUDE_DIR=/opt/homebrew/opt/libomp/include +``` +cmake -DCMAKE_PREFIX_PATH="/opt/homebrew/Cellar/qt@5/5.15.13_1;/opt/homebrew/opt/libomp" \ +-DOpenMP_C_FLAGS="-Xclang -fopenmp" \ +-DOpenMP_C_LIB_NAMES="libomp" \ +-DOpenMP_CXX_FLAGS="-Xclang -fopenmp" \ +-DOpenMP_CXX_LIB_NAMES="libomp" \ +-DOpenMP_C_INCLUDE_DIRS="/opt/homebrew/opt/libomp/include" \ +-DOpenMP_CXX_INCLUDE_DIRS="/opt/homebrew/opt/libomp/include" \ +-DOpenMP_libomp_LIBRARY=/opt/homebrew/opt/libomp/lib/libomp.dylib \ +-DOpenMP_INCLUDE_DIR=/opt/homebrew/opt/libomp/include \ .. -GNinja +``` *5. Build the Project:* +``` ninja +``` **NOTE: If at this point, there are build errors related to ‘cholmod.h’ or ‘omp.h’, clean the build and then re-run the make with the following commands:** -cmake -DCMAKE_PREFIX_PATH="/opt/homebrew/Cellar/qt@5/5.15.13_1;/opt/homebrew/opt/libomp" --DOpenMP_C_FLAGS="-Xclang -fopenmp -I/opt/homebrew/opt/libomp/include" --DOpenMP_C_LIB_NAMES="libomp" --DOpenMP_CXX_FLAGS="-Xclang -fopenmp -I/opt/homebrew/opt/libomp/include" --DOpenMP_CXX_LIB_NAMES="libomp" --DOpenMP_libomp_LIBRARY=/opt/homebrew/opt/libomp/lib/libomp.dylib +``` +cmake -DCMAKE_PREFIX_PATH="/opt/homebrew/Cellar/qt@5/5.15.13_1;/opt/homebrew/opt/libomp" \ +-DOpenMP_C_FLAGS="-Xclang -fopenmp -I/opt/homebrew/opt/libomp/include" \ +-DOpenMP_C_LIB_NAMES="libomp" \ +-DOpenMP_CXX_FLAGS="-Xclang -fopenmp -I/opt/homebrew/opt/libomp/include" \ +-DOpenMP_CXX_LIB_NAMES="libomp" \ +-DOpenMP_libomp_LIBRARY=/opt/homebrew/opt/libomp/lib/libomp.dylib \ .. -GNinja +``` **After the build is successful:** *6. Install the Built Project:* +``` sudo ninja install +``` *7. Test the Installation:* +``` glomap -h +``` **It should display something like:** +``` GLOMAP -- Global Structure-from-Motion Usage: glomap mapper --database_path DATABASE --output_path @@ -108,6 +143,7 @@ Available commands: help mapper mapper_resume +``` ## Testing with the end-to-end examples provided: @@ -126,25 +162,32 @@ https://lpanaf.github.io/eccv24_glomap/ **NOTE: Following commands are assuming the dataset to be south-building:** *6. Extract Features with COLMAP:* -colmap feature_extractor ---image_path ./data/south-building/images +``` +colmap feature_extractor \ +--image_path ./data/south-building/images \ --database_path ./data/south-building/database.db +``` *7. Match Features with COLMAP:* -colmap exhaustive_matcher +``` +colmap exhaustive_matcher \ --database_path ./data/south-building/database.db +``` *8. Run GLOMAP Mapper:* -glomap mapper ---database_path ./data/south-building/database.db ---image_path ./data/south-building/images +``` +glomap mapper \ +--database_path ./data/south-building/database.db \ +--image_path ./data/south-building/images \ --output_path ./output/south-building/sparse +``` **This should generate a new directory named ‘output’ in the project directory.** *9. Visualize the Results:* -colmap gui ---database_path ./data/south-building/database.db ---image_path ./data/south-building/images +``` +colmap gui \ +--database_path ./data/south-building/database.db \ +--image_path ./data/south-building/images \ --import_path ./output/south-building/sparse/0 - +```