babelouest / rhonabwy

Javascript Object Signing and Encryption (JOSE) library - JWK, JWKS, JWS, JWE and JWT
https://babelouest.github.io/rhonabwy/
GNU Lesser General Public License v2.1
45 stars 21 forks source link

Build of rnbyc failed on Mac #31

Open f-lombardo opened 1 year ago

f-lombardo commented 1 year ago

Hello,

I'm trying to compile rnbyc on Mac, bu I get this error: 'gnutls/abstract.h' file not found. I installed gnutls and I tried to add the -I flag to compilation:

CFLAGS+=-Wall -Werror -Wextra -Wconversion -I$(RHONABWY_INCLUDE) -I/opt/homebrew/Cellar/gnutls/3.8.0/include $(ADDITIONALFLAGS) $(CPPFLAGS)

Could you help me in spotting what I am doing wrong?

Thanks in advance.

babelouest commented 1 year ago

Hello,

I'm sorry I'm not familiar with the MacOS build environment, so I wouldn't know what's wrong. I know it's possible since other have succeeded.

But when you say rnbyc build fails, does the rhonabwy library build succeed before that?

You can also try to use the Makefile instead of the cmake script, to see if the result is different?

f-lombardo commented 1 year ago

Hi Nicolas,

thank you for your answer.

I was experiencing problems probabilly because I wasn't compiling the tool properly. I think that the correct process is:

$ cd <yder_source>
$ mkdir build
$ cd build
$ cmake ..
$ make && sudo make install

Is it true? Moreover, it would be useful to have a list of prerequisites for compilation. Anyway, after installing Gmp, Jansson, Orcania and Yder, I still have this error:

In file included from [...]rhonabwy/src/jwe.c:47:
/opt/homebrew/Cellar/nettle/3.9.1/include/nettle/bignum.h:50:11: fatal error: 'gmp.h' file not found
# include <gmp.h>
          ^~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/rhonabwy.dir/src/jwe.c.o] Error 1
make[1]: *** [CMakeFiles/rhonabwy.dir/all] Error 2
make: *** [all] Error 2
babelouest commented 1 year ago

I'm not sure what you mean by after installing GMP, but the error you have with gmp.h is probably because you didn't install nettle properly, or you must specify nettle location somewhere to build rhonabwy.