mapnik / python-mapnik

Python bindings for mapnik
GNU Lesser General Public License v2.1
160 stars 91 forks source link

MacOS SDK 10.13. Compiling with an SDK that doesn't seem to exist #167

Open winsento opened 6 years ago

winsento commented 6 years ago

MacOS Sierra 10.12.6 (16G1036)

MASON_BUILD=true python setup.py install
...
building 'mapnik._mapnik' extension
Compiling with an SDK that doesn't seem to exist: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk
Please check your Xcode installation
ls -la /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/
MacOSX.sdk
MacOSX10.13.sdk -> MacOSX.sdk
xcrun --sdk macosx --show-sdk-version
10.13

I think need to update mason version here, because for SDK version 10.12 the MacOSX10.12.sdk is a symlink to MacOSX.sdk

Look here https://github.com/mapbox/mason/blob/master/mason.sh#L51-L55

cateseale commented 6 years ago

I'm getting the same thing on High Sierra 10.13.2 (17C88) - it's looking for MacOSX10.12.sdk and finding 10.13?

Compiling with an SDK that doesn't seem to exist: 
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk

xcrun --sdk macosx --show-sdk-version
10.13

I was mislead at first I think as further down I get the error

/Users/cate/miniconda3/include/boost/config/detail/posix_features.hpp:18:15: fatal error: 
  'unistd.h' file not found
tjwebb commented 6 years ago

Same issue, any thoughts from the maintainers?

ngunhaSO commented 6 years ago

Same issue here, the steps that I did was: export BOOST_PYTHON_LIB="boost_python" export MASON_BUILD=true python3 setup.py build

Then in the end, I received this error: "/Downloads/python-mapnik/mason_packages/.link/include/boost/config/posix_features.hpp:18:15: fatal error: 'unistd.h' file not found"

Juesto commented 6 years ago

Obtain XCode 8.3.3 and use that or copy the sdk from it and rename the other one or find a os x sdk archive to get it.

martinmiglio commented 5 years ago

I have the same issue as @cateseale but with macosx sdk version 10.14. Looks like its a problem with xcode.

martinmiglio commented 5 years ago

I found the issue by backtracking through lots of code. There's quite a few (like 30) hardcoded references to MacOSX10.12.sdk requiring that specific xcode sdk. Two work arounds and a possible fix for the python-mapnik team:

The easy way: Find and replace all hardcoded references to MacOSX10.12.sdk with MacOSX.sdk. All of the replacements should be in python-mapnik/mason-packages. Recently(?), Apple decided to stop naming their SDKs with versions but rather name them MacOSX.sdk and include an alias with the version name for compatibility.

Also the easy way: Get yourself a copy of MacOSX10.12.sdk and put it in the same folder as your other SDKs

Possible fix for the team: DON'T HARDCODE VERSIONED NAMES! While it actually looks to be a problem with mason, the python-mapnik guys shouldn't have included it without checking.