brewing M2 on an M1 Macbook Air

937 views
Skip to first unread message

David Eisenbud

unread,
Jun 20, 2021, 9:15:06 AM6/20/21
to Google
I tried to use the brew formula (after installing brew etc) on my new Macbook Air, and it failed; the last few lines of output are:

unsigned long long, unsigned long long) in libomp.a(kmp_barrier.cpp.o)

ld: symbol(s) not found for architecture arm64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

make[1]: *** [csdp] Error 1

make: *** [all] Error 2



Any help appreciated!

thanks

David
--
David Eisenbud, Director, 
Mathematical Sciences Research Institute
and Professor of Mathematics, 
University of California, Berkeley

Mahrud Sayrafi

unread,
Jun 20, 2021, 9:59:54 AM6/20/21
to maca...@googlegroups.com
Hi,

Thomas Kahle was able to build M2 from source on M1 using the commands here, but your error seems to be occurring while building a bottle for csdp, which probably will happen with those instructions also.

Could you try running:
 
brew install --verbose --keep-tmp --build-bottle macaulay2/tap/csdp

and seeing if the same error occurs? If it does, it would be great if you could open an issue here with the output log so I can keep track of various brew related issues.

I hope someone can build bottles on M1 and upload them manually, then installing M2 on M1 will be much easier.

Best,
Mahrud

--
You received this message because you are subscribed to the Google Groups "Macaulay2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to macaulay2+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/macaulay2/CAB11DuMuuFedJ2vQMxBp7HWquTiFu_ymV5vGrcrsnNe0LgtwWw%40mail.gmail.com.

Frank Moore

unread,
Jun 20, 2021, 10:44:48 AM6/20/21
to Macaulay2
Mahrud,

If you are willing to walk me through the steps to build bottles on M1, I can help with that.

Best,
Frank



--
Dr. W. Frank Moore
Associate Professor
Department of Mathematics and Statistics
Wake Forest University

email: moo...@wfu.edu

Mahrud Sayrafi

unread,
Jun 20, 2021, 12:22:44 PM6/20/21
to maca...@googlegroups.com
Hi Frank,

Sure! Were you able to build M2 at all? I know there's an issue open about the errors with GMP you were running into. Let me know when would be a good time for a call.

Mahrud

David Eisenbud

unread,
Jun 20, 2021, 12:32:07 PM6/20/21
to Google
I tried the formula you proposed to build csdp and got an error, now in the issues too:

CMAKE_PREFIX_PATH: /opt/homebrew

CMAKE_INCLUDE_PATH: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers

CMAKE_LIBRARY_PATH: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries

PKG_CONFIG_LIBDIR: /usr/lib/pkgconfig:/opt/homebrew/Library/Homebrew/os/mac/pkgconfig/11

HOMEBREW_GIT: git

HOMEBREW_SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk

ACLOCAL_PATH: /opt/homebrew/share/aclocal

PATH: /opt/homebrew/Library/Homebrew/shims/mac/super:/usr/bin:/bin:/usr/sbin:/sbin


Error: macaulay2/tap/csdp 6.2.0 did not build

Cordially,

David
--
David Eisenbud, Director, 
Mathematical Sciences Research Institute
and Professor of Mathematics, 
University of California, Berkeley

Irena Swanson

unread,
Jun 20, 2021, 3:43:14 PM6/20/21
to Macaulay2
I ran into a problem running both brew install Macaulay2 and brew install git from my Mac OSX Catalina.  I googled the latter, and some web page said to do the following (literally):

sudo chown -R $(whoami):admin /usr/local/* \
&& sudo chmod -R g+rwx /usr/local/*

after which I ran brew install git and brew install Macaulay2 with no problems.   (And I don't understand the fix, but it works.)

In related news/repetition, when I run M2 from the Terminal, I still cannot type many letters, one of them being "a", which means that I cannot define ideals, so I have to run M2 as "M2 --no-readline".  However, this command then does not allow me to use the arrow to go back up to repeat a previous command.   Is there another way to repeat a previous command in M2 run from the terminal?

Irena

Mahrud Sayrafi

unread,
Jun 23, 2021, 5:01:57 PM6/23/21
to maca...@googlegroups.com
In case anybody else is having similar problems on M1 macbooks, the issue seems to be the bottled version of libomp for those systems. A workaround is available here.

Mahrud

--
You received this message because you are subscribed to the Google Groups "Macaulay2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to macaulay2+...@googlegroups.com.

Youngsu

unread,
Oct 12, 2021, 2:40:10 PM10/12/21
to Macaulay2
Hi Mahrud,

I am experiencing an error with the Csdp package. All other dependencies in the list (brew deps --1 --include-build macaulay2/tap/M2) were installed fine. The last few lines of the error message are below. The trick of reinstalling libomp did not work in my case. Could you take a look at my case? I am with an iMac with M1. 

```
==> make CC=clang ${OpenMP_C_FLAGS} ${CFLAGS} LDLIBS=${OpenMP_C_LDLIBS} LIBS=-L../lib -lsdp ${LA_LIBRARIES} -lm
/Library/Developer/CommandLineTools/usr/bin/make -C lib libsdp.a
clang -Xpreprocessor -fopenmp -I/opt/homebrew/opt/libomp/include -ansi -Wall -DUSEOPENMP -DSETNUMTHREADS -DUSESIGTERM -DUSEGETTIME -I../include -ansi -Wall -DUSEOPENMP -DSETNUMTHREADS -DUSESIGTERM -DUSEGETTIME -I../include -c -o readprob.o readprob.c
clang -Xpreprocessor -fopenmp -I/opt/homebrew/opt/libomp/include -ansi -Wall -DUSEOPENMP -DSETNUMTHREADS -DUSESIGTERM -DUSEGETTIME -I../include -ansi -Wall -DUSEOPENMP -DSETNUMTHREADS -DUSESIGTERM -DUSEGETTIME -I../include -c -o sdp.o sdp.c
clang -Xpreprocessor -fopenmp -I/opt/homebrew/opt/libomp/include -ansi -Wall -DUSEOPENMP -DSETNUMTHREADS -DUSESIGTERM -DUSEGETTIME -I../include -ansi -Wall -DUSEOPENMP -DSETNUMTHREADS -DUSESIGTERM -DUSEGETTIME -I../include -c -o op_o.o op_o.c
clang -Xpreprocessor -fopenmp -I/opt/homebrew/opt/libomp/include -ansi -Wall -DUSEOPENMP -DSETNUMTHREADS -DUSESIGTERM -DUSEGETTIME -I../include -ansi -Wall -DUSEOPENMP -DSETNUMTHREADS -DUSESIGTERM -DUSEGETTIME -I../include -c -o psd_feas.o psd_feas.c
clang -Xpreprocessor -fopenmp -I/opt/homebrew/opt/libomp/include -ansi -Wall -DUSEOPENMP -DSETNUMTHREADS -DUSESIGTERM -DUSEGETTIME -I../include -ansi -Wall -DUSEOPENMP -DSETNUMTHREADS -DUSESIGTERM -DUSEGETTIME -I../include -c -o op_a.o op_a.c
clang -Xpreprocessor -fopenmp -I/opt/homebrew/opt/libomp/include -ansi -Wall -DUSEOPENMP -DSETNUMTHREADS -DUSESIGTERM -DUSEGETTIME -I../include -ansi -Wall -DUSEOPENMP -DSETNUMTHREADS -DUSESIGTERM -DUSEGETTIME -I../include -c -o op_at.o op_at.c
clang -Xpreprocessor -fopenmp -I/opt/homebrew/opt/libomp/include -ansi -Wall -DUSEOPENMP -DSETNUMTHREADS -DUSESIGTERM -DUSEGETTIME -I../include -ansi -Wall -DUSEOPENMP -DSETNUMTHREADS -DUSESIGTERM -DUSEGETTIME -I../include -c -o Fnorm.o Fnorm.c
clang -Xpreprocessor -fopenmp -I/opt/homebrew/opt/libomp/include -ansi -Wall -DUSEOPENMP -DSETNUMTHREADS -DUSESIGTERM -DUSEGETTIME -I../include -ansi -Wall -DUSEOPENMP -DSETNUMTHREADS -DUSESIGTERM -DUSEGETTIME -I../include -c -o calc_pobj.o calc_pobj.c
clang -Xpreprocessor -fopenmp -I/opt/homebrew/opt/libomp/include -ansi -Wall -DUSEOPENMP -DSETNUMTHREADS -DUSESIGTERM -DUSEGETTIME -I../include -ansi -Wall -DUSEOPENMP -DSETNUMTHREADS -DUSESIGTERM -DUSEGETTIME -I../include -c -o calc_dobj.o calc_dobj.c
In file included from op_o.c:15:
/opt/homebrew/opt/libomp/include/omp.h:484:12: error: unknown type name 'inline'
static inline int omp_is_initial_device(void) { return 1; }
^
1 error generated.
make[1]: *** [op_o.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [all] Error 2
==> Temporary files retained at:
/private/tmp/csdp-20211012-65444-152d5ie
```

I also ran into an error when compiling from the source. I used gmake with gcc-11.

```

gcc-11 -fopenmp -ansi -Wall -DUSEOPENMP -DSETNUMTHREADS -DUSESIGTERM -DUSEGETTIME -I../include -I/Users/006501270/git_local_files/M2/M2/include -I/Users/006501270/git_local_files/M2/M2/include -I/Users/006501270/git_local_files/M2/M2/usr-host/include  -I/Users/006501270/git_local_files/M2/M2/submodules/mathicgb/src -I/Users/006501270/git_local_files/M2/M2/include -I/Users/006501270/git_local_files/M2/M2/include -I/Users/006501270/git_local_files/M2/M2/usr-host/include  -I/Users/006501270/git_local_files/M2/M2/submodules/mathicgb/src -I/Users/006501270/git_local_files/M2/M2/include -I/Users/006501270/git_local_files/M2/M2/include -I/Users/006501270/git_local_files/M2/M2/usr-host/include  -I/Users/006501270/git_local_files/M2/M2/submodules/mathicgb/src -I/opt/homebrew/include -I/opt/homebrew/opt/openssl@3/include -I/opt/homebrew/opt/openblas/include -I/opt/homebrew/Cellar/gmp/6.2.1_1/include -I/opt/homebrew/opt/llvm/include -DSING_NDEBUG -DOM_NDEBUG -I/opt/homebrew/Cellar/factory/4.2.0_2/include -I/opt/homebrew/opt/flint/include/ -isystem /opt/homebrew/Cellar/libatomic_ops/7.6.12/include -isystem /opt/homebrew/Cellar/bdw-gc/8.0.6/include -I/opt/homebrew/include -I/opt/homebrew/opt/openssl@3/include -I/opt/homebrew/opt/openblas/include -I/opt/homebrew/Cellar/gmp/6.2.1_1/include -I/opt/homebrew/opt/llvm/include -DNDEBUG -I/opt/homebrew/Cellar/givaro/4.1.1_4/include -I/opt/homebrew/opt/gmp/include -I/opt/homebrew/Cellar/eigen/3.4.0_1/include/eigen3  -DBOOST_STACKTRACE_LINK -DSING_NDEBUG -DOM_NDEBUG -I/opt/homebrew/Cellar/factory/4.2.0_2/include -I/opt/homebrew/opt/flint/include/ -isystem /opt/homebrew/Cellar/libatomic_ops/7.6.12/include -isystem /opt/homebrew/Cellar/bdw-gc/8.0.6/include -I/opt/homebrew/include -I/opt/homebrew/opt/openssl@3/include -I/opt/homebrew/opt/openblas/include -I/opt/homebrew/Cellar/gmp/6.2.1_1/include -I/opt/homebrew/opt/llvm/include -DNDEBUG -I/opt/homebrew/Cellar/givaro/4.1.1_4/include -I/opt/homebrew/opt/gmp/include -I/opt/homebrew/Cellar/eigen/3.4.0_1/include/eigen3  -DBOOST_STACKTRACE_LINK -DSING_NDEBUG -DOM_NDEBUG -I/opt/homebrew/Cellar/factory/4.2.0_2/include -I/opt/homebrew/opt/flint/include/ -isystem /opt/homebrew/Cellar/libatomic_ops/7.6.12/include -isystem /opt/homebrew/Cellar/bdw-gc/8.0.6/include -I/opt/homebrew/include -I/opt/homebrew/opt/openssl@3/include -I/opt/homebrew/opt/openblas/include -I/opt/homebrew/Cellar/gmp/6.2.1_1/include -I/opt/homebrew/opt/llvm/include -DNDEBUG -I/opt/homebrew/Cellar/givaro/4.1.1_4/include -I/opt/homebrew/opt/gmp/include -I/opt/homebrew/Cellar/eigen/3.4.0_1/include/eigen3  -DBOOST_STACKTRACE_LINK  -c -o op_o.o op_o.c

In file included from op_o.c:15:

/opt/homebrew/include/omp.h:6:1: error: C++ style comments are not allowed in ISO C90

    6 | //===----------------------------------------------------------------------===//

      | ^

/opt/homebrew/include/omp.h:6:1: note: (this will be reported only once per input file)

In file included from op_o.c:15:

/opt/homebrew/include/omp.h:360:61: warning: missing terminating ' character

  360 |     // On Windows cl and icl do not support 64-bit enum, let's use integer then.

      |                                                             ^

/opt/homebrew/include/omp.h:455:61: warning: missing terminating ' character

  455 |     // On Windows cl and icl do not support 64-bit enum, let's use integer then.

      |                                                             ^

gmake[4]: *** [<builtin>: op_o.o] Error 1

gmake[4]: Leaving directory '/Users/006501270/git_local_files/M2/M2/libraries/csdp/build/Csdp-6.2.0/lib'

gmake[3]: *** [Makefile:25: all] Error 2

gmake[3]: Leaving directory '/Users/006501270/git_local_files/M2/M2/libraries/csdp/build/Csdp-6.2.0'

gmake[2]: *** [../Makefile.library:178: .compiled-6.2.0] Error 2

gmake[2]: Leaving directory '/Users/006501270/git_local_files/M2/M2/libraries/csdp'

gmake[1]: *** [Makefile:7: all-in-csdp] Error 2

gmake[1]: Leaving directory '/Users/006501270/git_local_files/M2/M2/libraries'

gmake: *** [GNUmakefile:221: all-in-libraries] Error 2

gmake: Leaving directory '/Users/006501270/git_local_files/M2/M2'

```


Thank you,
Youngsu

Mahrud Sayrafi

unread,
Oct 14, 2021, 11:23:55 PM10/14/21
to maca...@googlegroups.com
Hi Youngsu,

Seems to be the same problem as #103. Let's discuss it there instead, because I think others are running into the same issue.

Best,
Mahrud

Youngsu Kim

unread,
Oct 15, 2021, 12:55:48 AM10/15/21
to maca...@googlegroups.com
Hi Mahrud, 

Thank you for your reply. Certainly! 

Thank you,
Youngsu

You received this message because you are subscribed to a topic in the Google Groups "Macaulay2" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/macaulay2/4Dz1-kMZNLg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to macaulay2+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/macaulay2/CAA3cHpuqTNaC0m-dOneZa_3%3DNjTAq0tRW3Bp_PG4rkcbk67mFw%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages