Building on M1 Mac

79 views
Skip to first unread message

Victor Miller

unread,
Aug 30, 2022, 6:50:22 PM8/30/22
to relic-discuss
I have an M1 macbook.  I'm trying to build relic but after doing cmake and make I get a lot of compiler errors saying that WSIZE is undefined.  Sure enough, when I look at the generated relic_conf.h, it has the line

#define WSIZE

(but no value!).

I'm using 3.24.1

Diego F. Aranha

unread,
Aug 31, 2022, 3:56:06 AM8/31/22
to relic-...@googlegroups.com
Hi Victor,

Nice to have you around here! :)

Thanks for the notification! Can you describe the steps you took for me to reproduce?
I never tried to build nor have access to the Apple M1, but can get an Amazon instance and check what is going on.

Best,
--
Diego F. Aranha
Associate Professor at Computer Science Aarhus University, Denmark

Åbogade 34, Building 5335 (Office 318 at Nygaard)
8200 Aarhus N, Denmark





--

---
You received this message because you are subscribed to the Google Groups "relic-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to relic-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/relic-discuss/539ab7a5-c67e-4123-885e-869c4dc6fbbcn%40googlegroups.com.

Diego F. Aranha

unread,
Sep 29, 2022, 5:32:40 PM9/29/22
to relic-...@googlegroups.com
Hi Victor,

I just spent some time porting RELIC to the Apple M1 on an Amazon instance and it works now.

The library can be built and it's functional, at least for the default configuration.
I'm still working on the cycle counter for benchmarks, however.

Victor Miller

unread,
Sep 29, 2022, 7:45:30 PM9/29/22
to relic-...@googlegroups.com
Hi Diego, I hadn’t tried this for a while.  With the new update of Xcode it now builds.  I found that the earlier one, for some reason, did not accept the gcc option —march=native

You received this message because you are subscribed to a topic in the Google Groups "relic-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/relic-discuss/GSOJ2JblI4Q/unsubscribe.
To unsubscribe from this group and all its topics, send an email to relic-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/relic-discuss/CAK2GZbGVyjFZy5bGpPzXtCMqbt_LrQcPT1ySFJ25%3DVvMgSiTYw%40mail.gmail.com.

Komal Kumari

unread,
Oct 13, 2022, 7:53:15 PM10/13/22
to relic-discuss
Hi All,

I am trying to build relic on MAC OSx (12.5.1, M1 MAX chip) but  I am getting a lot of errors when running make command. Below are the steps I followed:

  1. Downloaded relic-0.6.0 tar file and unzipped.
  2. mkdir -p relic-target
  3. cd relic-target
  4. cmake -DMULTI=OPENMP ../relic-0.6.0
  5. make
Step 5 gives me a huge number of errors:

[  0%] Built target arith_objs

[  1%] Building C object src/CMakeFiles/relic.dir/relic_err.c.o

In file included from /Users/komal/Desktop/Research/relic-0.6.0/src/relic_err.c:37:

In file included from /Users/komal/Desktop/Research/relic-0.6.0/include/relic_core.h:44:

In file included from /Users/komal/Desktop/Research/relic-0.6.0/include/relic_err.h:43:

In file included from /Users/komal/Desktop/Research/relic-0.6.0/include/relic_util.h:39:

In file included from /Users/komal/Desktop/Research/relic-0.6.0/include/relic_arch.h:39:

/Users/komal/Desktop/Research/relic-0.6.0/include/relic_types.h:43:32: error: invalid token at start of a preprocessor expression

#if defined(_MSC_VER) && WSIZE == 64

                               ^

/Users/komal/Desktop/Research/relic-0.6.0/include/relic_types.h:59:5: error: expected value in expression

#if RLC_DIG == 8

    ^

/Users/komal/Desktop/Research/relic-0.6.0/include/relic_types.h:54:25: note: expanded from macro 'RLC_DIG'

#define RLC_DIG                 (WSIZE)

                                      ^

/Users/komal/Desktop/Research/relic-0.6.0/include/relic_types.h:61:7: error: expected value in expression

#elif RLC_DIG == 16

      ^

/Users/komal/Desktop/Research/relic-0.6.0/include/relic_types.h:54:25: note: expanded from macro 'RLC_DIG'

#define RLC_DIG                 (WSIZE)


Could you please help me out here?

Thanks & Regards,

Komal Kumari


Diego F. Aranha

unread,
Oct 14, 2022, 2:45:28 AM10/14/22
to relic-...@googlegroups.com
Hi Komai,

Can you please try with latest version of the repository and report back?
It has specific fixes for Macs.

Komal Kumari

unread,
Oct 14, 2022, 7:59:32 AM10/14/22
to relic-discuss
Hi Diego,

Thank you for the response.
I am running the latest version of relic which is 0.6.0. Which version are you referring to ?

Thanks & Regards,
Komal Kumari

Komal Kumari

unread,
Oct 14, 2022, 8:50:02 AM10/14/22
to relic-discuss
Hi Diego,

I took the clone of the repo master branch and repeated the steps mentioned earlier. I am getting the below error now:

Command :    make

[  0%] Built target arith_objs

[  1%] Building C object src/CMakeFiles/relic.dir/relic_err.c.o

In file included from /Users/komal/Desktop/Research/relic/src/relic_err.c:37:

In file included from /Users/komal/Desktop/Research/relic/include/relic_core.h:485:

/Users/komal/Desktop/Research/relic/include/relic_multi.h:42:10: fatal error: 'omp.h' file not found

#include <omp.h>

         ^~~~~~~

1 error generated.

make[2]: *** [src/CMakeFiles/relic.dir/relic_err.c.o] Error 1

make[1]: *** [src/CMakeFiles/relic.dir/all] Error 2

make: *** [all] Error 2


Thanks & Regards,
Komal Kumari

Diego F. Aranha

unread,
Oct 14, 2022, 4:06:10 PM10/14/22
to relic-...@googlegroups.com
Hi Komai,

You need to install OpenMP to have the corresponding headers. I don't know what is the best way to do that on an ARM Mac, but there are online threads for you to look at:

Reply all
Reply to author
Forward
0 new messages