Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sarlinpe committed Dec 29, 2023
1 parent a95eee0 commit 545d7e6
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 16 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-new.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set architecture env
if: ${{ startsWith(matrix.config.os, 'macos') }}
run: |
if [[ ${{ matrix.config.arch }} == "x86_64" ]]; then
VCPKG_TARGET_TRIPLET="x64-osx"
Expand All @@ -41,20 +42,19 @@ jobs:
echo "CMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}" >> "$GITHUB_ENV"
echo "CMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}" >> "$GITHUB_ENV"
# Fix: cibuildhweel cannot interpolate env variables.
CONFIG_SETTINGS="cmake.define.CMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}"
CONFIG_SETTINGS="${CONFIG_SETTINGS} cmake.define.VCPKG_TARGET_TRIPLET=${VCPKG_TARGET_TRIPLET}"
CONFIG_SETTINGS="${CONFIG_SETTINGS} cmake.define.CMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}"
echo "CIBW_CONFIG_SETTINGS_MACOS=${CONFIG_SETTINGS}" >> "$GITHUB_ENV"
if: ${{ startsWith(matrix.config.os, 'macos') }}
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_ARCHS_MACOS: ${{ matrix.config.arch }}
- name: Archive wheels
uses: actions/upload-artifact@v3
with:
name: pycolmap-${{ matrix.config.os }}
name: pycolmap-${{ matrix.config.os }}-${{ matrix.config.arch }}
path: wheelhouse/pycolmap-*.whl

pypi-publish:
Expand Down
35 changes: 22 additions & 13 deletions package/install-colmap-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,33 @@ brew remove swiftlint
brew remove node@18

brew update
brew install \
git \
wget \
cmake \
llvm

# for lapack-reference
export CMAKE_Fortran_COMPILER=$(which gfortran-13)
export CMAKE_Fortran_COMPILER_INIT="gfortran-13"
ln -s $(which gfortran-13) "$(dirname $(which gfortran-13))/gfortran"
brew install git cmake llvm

cd ${CURRDIR}
#git clone https://github.com/microsoft/vcpkg ${VCPKG_INSTALLATION_ROOT}
git clone --branch sarlinpe/lapack-osx https://github.com/sarlinpe/vcpkg ${VCPKG_INSTALLATION_ROOT}

cd ${VCPKG_INSTALLATION_ROOT}
./bootstrap-vcpkg.sh
./vcpkg install --recurse --clean-after-build --triplet=${VCPKG_TARGET_TRIPLET} boost-algorithm boost-filesystem boost-graph boost-heap boost-program-options boost-property-map boost-property-tree boost-regex boost-system eigen3 flann freeimage metis gflags glog gtest sqlite3 ceres[lapack,suitesparse,tools]
./vcpkg install --recurse --clean-after-build --triplet=${VCPKG_TARGET_TRIPLET} \
boost-algorithm \
boost-filesystem \
boost-graph \
boost-heap \
boost-program-options \
boost-property-map \
boost-property-tree \
boost-regex \
boost-system \
ceres[lapack,suitesparse,tools] \
eigen3 \
flann \
freeimage \
metis \
gflags \
glog \
gtest \
sqlite3
./vcpkg integrate install

cd ${CURRDIR}
Expand All @@ -44,8 +53,8 @@ export ARCHFLAGS="-arch ${CIBW_ARCHS_MACOS}"
cmake .. -DGUI_ENABLED=OFF \
-DCUDA_ENABLED=OFF \
-DCGAL_ENABLED=OFF \
-DCMAKE_TOOLCHAIN_FILE="${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" \
-DCMAKE_TOOLCHAIN_FILE="${CMAKE_TOOLCHAIN_FILE}" \
-DVCPKG_TARGET_TRIPLET=${VCPKG_TARGET_TRIPLET} \
-DCMAKE_OSX_ARCHITECTURES=${CIBW_ARCHS_MACOS} \
-DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES} \
`if [[ ${CIBW_ARCHS_MACOS} == "arm64" ]]; then echo "-DSIMD_ENABLED=OFF"; fi`
make -j ${NUM_LOGICAL_CPUS} install

0 comments on commit 545d7e6

Please sign in to comment.