Closed GMS103 closed 1 year ago
The missing header is part of the perl C api, which is either not found or not installed. I think apple has announced to remove perl from the OS at some point, maybe this is the case with monterey. If installed it should be at
/Library/Developer/CommandLineTools/SDKs/MacOSX12.<X>.sdk/System/Library/Perl/<Y>/darwin-thread-multi-2level/CORE
where <X>
is the os version and <Y>
the perl version.
Anyway, already on catalina and big sur polymake did not properly compile with the system perl, so the formula uses the one of brew. I have added monterey to the list, probably that fixes it. I can't test on monterey, so I forgot to update this in the formula. If perl is installed with brew the header should be at
/usr/local/lib/perl5/<Y>/darwin-thread-multi-2level/CORE
(on intel).
The above comment isn't quite correct for M1 macs, homebrew puts the header at /opt/homebrew/lib/perl5/<Y>/darwin-thread-multi-2level/CORE
. I'm still getting a missing extern.h error and trying to figure out how to tell whatever compiler brew install apaffenholz/polymake/polymake
calls to look there for the headers.
I can't repreduce this on an M2 mac, but I think it was due to using the system perl for monterey instead of the brew perl. This should be fixed in the new version.
For what it's worth, I just saw this today. This is with OS X 14.0 (Sonoma) on a Mac Studio (M1 Max) and lots of homebrew packages, including perl
. The file /opt/homebrew/lib/perl5/5.38/darwin-thread-multi-2level/CORE/EXTERN.h
is present. (Actually it's a symlink, but it points to a valid file.) When ran brew upgrade
, I got the message
Last 15 lines from /Users/jpalmier/Library/Logs/Homebrew/polymake/46.make:
t_intrc (INTERRUPT) found in tchars
t_lnextc (QUOTENEXT) found in ltchars
t_quitc (QUIT) found in tchars
t_rprntc (REPRINT) found in ltchars
t_startc (START) found in tchars
t_stopc (STOP) found in tchars
t_suspc (SUSPEND) found in ltchars
t_werasc (ERASEWORD) found in ltchars
Writing sgtty section of cchars.h... Done.
cc -c -g -pipe -DPERL_USE_SAFE_PUTENV -Wno-error=implicit-function-declaration -Os -DVERSION=\"2.38\" -DXS_VERSION=\"2.38\" "-I/System/Library/Perl/5.34/darwin-thread-multi-2level/CORE" ReadKey.c
ReadKey.xs:4:10: fatal error: 'EXTERN.h' file not found
#include "EXTERN.h"
^~~~~~~~~~
1 error generated.
make: *** [ReadKey.o] Error 1
For what it's worth:
% which perl
/opt/homebrew/bin/perl
and also
% ls /System/Library/Perl/5.34/darwin-thread-multi-2level/CORE
libperl.dylib
No EXTERN.h in that directory, but it is present in /Library/Developer/CommandLineTools/SDKs/MacOSX14.0.sdk/System/Library/Perl/5.34/darwin-thread-multi-2level/CORE/
.
This is, unfortunately, a mix of several issues.
You are using the perl version of brew, which is version 5.38, and not the system one, which is version 5.34. So the EXTERN.h you found won't work, even if it would be found.
I don't know why the EXTERN.h of the brew perl version is not found, maybe the path changed. This may have to do with several big changes in the new perl version (but I don't have a fully configured Mac with OS 14 at hand, so I can't check). Yet, fixing this won't help, as polymake is not compatible with perl versions 5.38 and later. It also never will be.
Using the polymake formula may still work if the system perl version is used instead, as polymake is compatible with perl 5.34. The problem with the different path for EXTERN.h also existed in some older versions of Mac OS, where we fixed the search path in the formula explicitely. I can extend this workaround to Mac OS 14 (line 580 in the formula need an additional || MacOS.version == :sonoma
). No guarantee though that this will work.
You can also install perlbrew first, use this to install an older version of perl (e.g. 5.36), switch to this version in a terminal, and install polymake using brew in the same terminal. Running polymake in a terminal then always requires to switch to this perl version first.
You can also try the new jll binaries of polymake available at: https://polymake.org/doku.php/install/jll
Andreas
This will hopefully be fixed with the new version.
On an M1 Mac with macOS 12.1, after doing
cd /usr/local ; ln -s /opt/homebrew/lib
, the commandbrew install apaffenholz/polymake/polymake
fails as follows. (Notice that on an M1 Mac with macOS 11.6.2 it works.)