Skip to content
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

Compilation fails with Clang 12.0.5 on Apple M1 #510

Open
afloers opened this issue Jul 12, 2021 · 2 comments
Open

Compilation fails with Clang 12.0.5 on Apple M1 #510

afloers opened this issue Jul 12, 2021 · 2 comments

Comments

@afloers
Copy link

afloers commented Jul 12, 2021

Hello,

When I run ./configure on my M1 MacBook I get the following error (from the config.log):

configure:2619: checking whether the C compiler works
configure:2641: gcc -I/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/include -L/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/lib -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/afloers/Software/anaconda3/include -D_FORTIFY_SOURCE=2 -mmacosx-version-min=10.9 -isystem /Users/afloers/Software/anaconda3/include -Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs -Wl,-rpath,/Users/afloers/Software/anaconda3/lib -L/Users/afloers/Software/anaconda3/lib conftest.c >&5
clang: error: the clang compiler does not support '-march=core2'

I guess the problem is with the -march=core2.

The command that I used to run ./configure was
$ ./configure --enable-cpic=clang --enable-fpic=clang --with-cfortran=clang
The version of the compiler is
$ clang --version
Apple clang version 12.0.5 (clang-1205.0.22.9)
Target: arm64-apple-darwin20.5.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

What do I have to do to run configure on my machine?

Best regards,
Andreas

@afloers
Copy link
Author

afloers commented Jul 12, 2021

Here is the full config.log:

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by configure, which was
generated by GNU Autoconf 2.69. Invocation command line was

$ ./configure --enable-cpic=clang --enable-fpic=clang --with-cfortran=clang

---------

Platform.

---------

hostname = Andreass-MacBook-Pro.local
uname -m = arm64
uname -r = 20.5.0
uname -s = Darwin
uname -v = Darwin Kernel Version 20.5.0: Sat May 8 05:10:31 PDT 2021; root:xnu-7195.121.3~9/RELEASE_ARM64_T8101

/usr/bin/uname -p = arm
/bin/uname -X = unknown

/bin/arch = unknown
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo = Mach kernel version:
Darwin Kernel Version 20.5.0: Sat May 8 05:10:31 PDT 2021; root:xnu-7195.121.3~9/RELEASE_ARM64_T8101
Kernel configured for up to 8 processors.
8 processors are physically available.
8 processors are logically available.
Processor type: arm64e (ARM64E)
Processors active: 0 1 2 3 4 5 6 7
Primary memory available: 16.00 gigabytes
Default processor set: 463 tasks, 2919 threads, 8 processors
Load average: 3.07, Mach factor: 5.21
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown

PATH: /Users/afloers/Software/anaconda3/bin
PATH: /Users/afloers/Software/anaconda3/condabin
PATH: /opt/homebrew/bin
PATH: /opt/homebrew/sbin
PATH: /usr/local/bin
PATH: /usr/bin
PATH: /bin
PATH: /usr/sbin
PATH: /sbin
PATH: /opt/X11/bin

-----------

Core tests.

-----------

configure:2206: checking build system type
configure:2220: result: arm-apple-darwin20.5.0
configure:2240: checking host system type
configure:2253: result: arm-apple-darwin20.5.0
configure:2323: checking for gcc
configure:2350: result: gcc -I/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/include -L/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/lib
configure:2579: checking for C compiler version
configure:2588: gcc -I/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/include -L/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/lib --version >&5
Apple clang version 12.0.5 (clang-1205.0.22.9)
Target: arm64-apple-darwin20.5.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
configure:2599: $? = 0
configure:2588: gcc -I/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/include -L/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/lib -v >&5
Apple clang version 12.0.5 (clang-1205.0.22.9)
Target: arm64-apple-darwin20.5.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
clang: warning: argument unused during compilation: '-I /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/include' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-L/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/lib' [-Wunused-command-line-argument]
configure:2599: $? = 0
configure:2588: gcc -I/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/include -L/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/lib -V >&5
clang: error: argument to '-V' is missing (expected 1 value)
clang: error: no input files
configure:2599: $? = 1
configure:2588: gcc -I/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/include -L/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/lib -qversion >&5
clang: error: unknown argument '-qversion'; did you mean '--version'?
clang: error: no input files
configure:2599: $? = 1
configure:2619: checking whether the C compiler works
configure:2641: gcc -I/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/include -L/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/lib -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/afloers/Software/anaconda3/include -D_FORTIFY_SOURCE=2 -mmacosx-version-min=10.9 -isystem /Users/afloers/Software/anaconda3/include -Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs -Wl,-rpath,/Users/afloers/Software/anaconda3/lib -L/Users/afloers/Software/anaconda3/lib conftest.c >&5
clang: error: the clang compiler does not support '-march=core2'
configure:2645: $? = 1
configure:2683: result: no
configure: failed program was:
| /* confdefs.h /
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /
end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:2688: error: in /Users/afloers/Software/fac-1.1.4': configure:2690: error: C compiler cannot create executables See config.log' for more details

----------------

Cache variables.

----------------

CONDA_BACKUP_ac_cv_func_malloc_0_nonnull=yes
CONDA_BACKUP_ac_cv_func_realloc_0_nonnull=yes
ac_cv_build=arm-apple-darwin20.5.0
ac_cv_env_CC_set=set
ac_cv_env_CC_value='gcc -I/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/include -L/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/lib'
ac_cv_env_CFLAGS_set=set
ac_cv_env_CFLAGS_value='-march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/afloers/Software/anaconda3/include'
ac_cv_env_CPPFLAGS_set=set
ac_cv_env_CPPFLAGS_value='-D_FORTIFY_SOURCE=2 -mmacosx-version-min=10.9 -isystem /Users/afloers/Software/anaconda3/include'
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_F77_set=
ac_cv_env_F77_value=
ac_cv_env_FFLAGS_set=
ac_cv_env_FFLAGS_value=
ac_cv_env_LDFLAGS_set=set
ac_cv_env_LDFLAGS_value='-Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs -Wl,-rpath,/Users/afloers/Software/anaconda3/lib -L/Users/afloers/Software/anaconda3/lib'
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_host=arm-apple-darwin20.5.0
ac_cv_prog_ac_ct_CC='gcc -I/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/include -L/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/lib'

-----------------

Output variables.

-----------------

CC='gcc -I/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/include -L/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/lib'
CFLAGS='-march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/afloers/Software/anaconda3/include'
CPP=''
CPPFLAGS='-D_FORTIFY_SOURCE=2 -mmacosx-version-min=10.9 -isystem /Users/afloers/Software/anaconda3/include'
DEFS=''
ECHO_C='\c'
ECHO_N=''
ECHO_T=''
EGREP=''
EXEEXT=''
F77=''
FFLAGS=''
FFLAGSNO=''
FLIBS=''
GREP=''
INSTALL_DATA=''
INSTALL_PROGRAM=''
INSTALL_SCRIPT=''
LDFLAGS='-Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs -Wl,-rpath,/Users/afloers/Software/anaconda3/lib -L/Users/afloers/Software/anaconda3/lib'
LIBOBJS=''
LIBS=''
LTLIBOBJS=''
OBJEXT=''
PACKAGE_BUGREPORT=''
PACKAGE_NAME=''
PACKAGE_STRING=''
PACKAGE_TARNAME=''
PACKAGE_URL=''
PACKAGE_VERSION=''
PATH_SEPARATOR=':'
PYTHON=''
RANLIB='/Users/afloers/Software/anaconda3/bin/x86_64-apple-darwin13.4.0-ranlib'
SET_MAKE=''
SHELL='/bin/sh'
TOPDIR='/Users/afloers/Software/fac-1.1.4'
ac_ct_CC='gcc -I/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/include -L/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/lib'
ac_ct_F77=''
bindir='${exec_prefix}/bin'
build='arm-apple-darwin20.5.0'
build_alias=''
build_cpu='arm'
build_os='darwin20.5.0'
build_vendor='apple'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE}'
dvidir='${docdir}'
exec_prefix='NONE'
host='arm-apple-darwin20.5.0'
host_alias=''
host_cpu='arm'
host_os='darwin20.5.0'
host_vendor='apple'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='NONE'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''

-----------

confdefs.h.

-----------

/* confdefs.h */
#define PACKAGE_NAME ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#define PACKAGE_STRING ""
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""

configure: exit 77

@mfgu
Copy link
Collaborator

mfgu commented Jul 20, 2021

this will have to wait until I can get hands on a M1 mac. in the mean time, you might try to use gcc and gfortran from macport instead of apples compilers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants