kermitt2 / pdfalto

PDF to XML ALTO file converter
GNU General Public License v2.0
213 stars 68 forks source link

Building for Apple Silicon failed due to missing directories (with manual fix) #159

Open rdmpage opened 1 year ago

rdmpage commented 1 year ago

I built the https://github.com/kermitt2/pdfalto/tree/feature/support-mac-arm branch on my MacBook Pro M1. I encountered the usual Mac problems listed in the README, which were fixed by doing:

export C_INCLUDE_PATH=/usr/local/include
export CPLUS_INCLUDE_PATH=/usr/local/include

following https://github.com/kermitt2/pdfalto/issues/135#issuecomment-990053813

I ran ./install_deps.sh but then I got the following error:

cp: directory libs/image/zlib/mac/arm64 does not exist

I then manually added arm64 to each libs/*/mac directory and then ./install_deps.sh worked and I could finally build the pdfalto binary (yay!).

I suspect there's an easy fix to ensure that the arm64 directories are created before attempting to store the library files in those directories.

justinlittman commented 2 weeks ago

Specifically on my MacBook Pro M2:

brew install cmake
brew install automake
brew install wget
git clone https://github.com/kermitt2/pdfalto.git
cd pdfalto
git submodule update --init --recursive
mkdir libs/freetype/mac/arm64
mkdir libs/icu/mac/arm64
mkdir libs/libxml/mac/arm64
mkdir libs/image/png/mac/arm64
mkdir libs/image/zlib/mac/arm64
./install_deps.sh
export C_INCLUDE_PATH=/opt/homebrew/include
export CPLUS_INCLUDE_PATH=/opt/homebrew/include
cmake .
make