-
-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] configure failing on Mac with bogus missing zlib message #880
Comments
|
Setting the CONDA_BUILD_SYSROOT is not a workaround, it is needed by conda, see Anaconda compiler tools. Missing that causes configure failure. The fact that that it exits at zlib is just a coincidence and not relevant. The use of conda for a prepackaged binary for distribution is a quite particular case, which leads to challenges with compiling extensions. Here's what happens: you configure and build on a machine with a particular SDK This may be circumvented using Brief test of removing sysroot from Platform.make (after GRASS build and installation, but before distribution) with: #!/bin/bash
FILE="/Applications/GRASS-7.9.app/Contents/Resources/include/Make/Platform.make"
sed -i .bak 's|-isysroot /Users/cmbarton/SDKs/MacOSX10.14.sdk||g' $FILEseems to work, but should be tested thoroughly. (Not tested without Xcode). |
|
Here is some additional info on this issue from offline emails and from some additional tests.
The only thing that has changed lately, is that now CC is configurable, before it was static (“gcc”, with your previous patch "clang”). This in itself may, somehow indirect lead to the requirement of CONDA_BUILD_SYSROOT, I don’t know. I do know that a configurable CC is the way it should have been from start.
Setting a hard path to "--with-macosx-sdk=“ will lead to setting -isysroot in Platform.make. So, for as long as you have built in this way, compiling extensions was probably broken for other users. Deleting sysroot (pre-distribution) from that file may be the solution for this.
I understand you perfectly and support your goal. Presently, conda is the best (only) way for this aims.
This may be a more general way to set CONDA_BUILD_SYSROOT=$(xcrun --show-sdk-path) which with 10.15 (and probably back a few versions) will resolve to: I haven’t been able to figure out actual differences/advantages with using only MACOSX_DEPLOYMENT_TARGET vs. and/or setting -isysroot. But if MACOSX_DEPLOYMENT_TARGET only is enough, that may be the way to go. I would suggest, now for a start, to keep the 10.14 SDK and CONDA_BUILD_SYSROOT as is, and apply my little sysroot delete script before distribution. |
So with some tests, even though this should be possible, it doesn't seem to work.
For GRASS 7.9, we need to set both CONDA_BUILD_SYSROOT and configure argument --with-macosx-sdk= for setting -isysroot in Platform.make. Leaving either out will cause either configuration or make to fail.
Pointing CONDA_BUILD_SYSROOT to the folders inside the app causes configure to fail
This works. It means that anyone wanting to compile an extension with g.extension must also install Apple's Xcode. Something I wanted to avoid but don't currently see how we can.
MACOSX_DEPLOYMENT_TARGET is not enough. We must also set CONDA_BUILD_SYSROOT and --with-macosx-sdk= for both configure and build to work in GRASS 7.9 on the Mac. Probably need to do this generically (as above) on 7.8 too. If Xcode is installed, then extensions will compile properly.
deleting -isysroot in the distribution causes compiling extensions to fail. So there is no point in doing this. |
This worked for me with the binary. Please elaborate. |
|
I can delete -isroot in 3 of the 4 places without apparent effects (though I'm only testing with 2 extensions: r.fill.gap and r.geomorphon). But if I delete it in the "CFLAGS =" line, it causes compilation to fail with the following error in the console: This error is the same whether I set the path to the SDK in Xcode or to my local one. The error for r.geomorphon is a bit different, but these errors might be misleading and simply a result of not being able to find a viable SKD. |
|
Yeah, deleting -isysroot isn't working for me either, I now learned after double checking. Must have done something wrong, sorry. But an SDK is needed for compiling extensions. There are no more system header files in |
|
Compiling extension on mac (using the binary) is an old issue, see https://gis.stackexchange.com/questions/325204/error-installing-r-stream-extension-grass-gis-on-macos. |
I think this is the best way to go. Is there a way to make this generic, without a hard coded path along the lines of $(xcrun --show-sdk-path)? |
I'm working on the issue, but in the meantime I would say a hardcoded path to Command Line Tools Please, take a look and test https://github.com/nilason/grass-conda, which I just put up. It's a step to formalise building Grass.app with conda, based on your instructions on grasswiki. I have 100 per cent reproductivity, but can always be improved. Creating a dmg, is still on the todo-list. @cmbarton and everyone else: if you have suggestions, issues, feel free to address them there. I believe this issue can be closed as it is not a GRASS GIS issue, but a packaging issue. |
|
This is a good way forward. IMHO, packaging GRASS is a GRASS issue. This has been a very big issue for the Mac for quite awhile, and attention to it by the GRASS community has made it much better. |
|
Is this still an issue? I believe it's not. |
|
No longer an issue. Closing |
|
clang: error: no such file or directory: 'zlib' |
Describe the bug
A recent change in GRASS master caused it to report being unable to find zlib, even though zlib and its includes are present in the path for compiling. This happens when I'm creating a Mac binary in an environment created with Anaconda. It is not clear what is really missing or needs to have a path set in configure.
A workaround compiles by adding the following before configure runs
But this causes problems with compiling GRASS extensions later. So I need to know what 7.9 is now looking for (that it is not looking for in 7.8.4) that is causing this problem.
Here is the last part of the terminal output before configure bombs.
I'm attaching also the configure log and my configure script.
config.log
configure79.sh.zip
System description (please complete the following information):
Operating System: Mac OSX 10.15.6
GRASS GIS version 7.9
version=7.9.dev
date=2020
revision=64527a73f
build_date=2020-08-05
build_platform=x86_64-apple-darwin19.6.0
build_off_t_size=8
The text was updated successfully, but these errors were encountered: