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

Build issues in Mac OS X #91

Closed
deevashwer opened this issue Sep 20, 2018 · 12 comments
Closed

Build issues in Mac OS X #91

deevashwer opened this issue Sep 20, 2018 · 12 comments

Comments

@deevashwer
Copy link

I ran the cmake .. command successfully.
On running the make command, I saw the following error messages:

[ 52%] Built target miracl
[ 53%] Building CXX object extern/ENCRYPTO_utils/CMakeFiles/encrypto_utils.dir/src/ENCRYPTO_utils/channel.cpp.o
In file included from /Users/deevashwer/ABY/extern/ENCRYPTO_utils/src/ENCRYPTO_utils/channel.cpp:3:
/Users/deevashwer/ABY/extern/ENCRYPTO_utils/src/ENCRYPTO_utils/typedefs.h:71:16: warning: left side of operator converted from negative value to unsigned: -1 to 18446744073709551615
#elif (MAX_INT == 0xFFFFFFFFFFFFFFFF)
       ~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~
In file included from /Users/deevashwer/ABY/extern/ENCRYPTO_utils/src/ENCRYPTO_utils/channel.cpp:4:
/Users/deevashwer/ABY/extern/ENCRYPTO_utils/src/ENCRYPTO_utils/rcvthread.h:58:46: error: implicit instantiation of undefined template 'std::__1::array<RcvThread::rcv_task, 256>'
        std::array<rcv_task, MAX_NUM_COMM_CHANNELS> listeners;
                                                    ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__tuple:223:64: note: template is declared here
template <class _Tp, size_t _Size> struct _LIBCPP_TEMPLATE_VIS array;
                                                               ^
1 warning and 1 error generated.
make[2]: *** [extern/ENCRYPTO_utils/CMakeFiles/encrypto_utils.dir/src/ENCRYPTO_utils/channel.cpp.o] Error 1
make[1]: *** [extern/ENCRYPTO_utils/CMakeFiles/encrypto_utils.dir/all] Error 2
make: *** [all] Error 2

Can someone suggest any changes to Makefile that will resolve this issue?

@lenerd
Copy link
Collaborator

lenerd commented Sep 21, 2018

Hi,
I think, there might be an #include <array> missing in rcvthread.h of ENCRYPTO_utils. Can you try to add this and tell me if it is sufficient?

@deevashwer
Copy link
Author

I added the include statement, and it solved the particular issue, but some new errors popped up later.

[ 67%] Building CXX object extern/ENCRYPTO_utils/CMakeFiles/encrypto_utils.dir/src/ENCRYPTO_utils/socket.cpp.o
/Users/deevashwer/ABY/extern/ENCRYPTO_utils/src/ENCRYPTO_utils/socket.cpp:98:22: error:
      use of undeclared identifier 'SOL_TCP'
        setsockopt(m_hSock, SOL_TCP, TCP_NODELAY, &one, sizeof(one));
                            ^
/Users/deevashwer/ABY/extern/ENCRYPTO_utils/src/ENCRYPTO_utils/socket.cpp:154:23: error:
      use of undeclared identifier 'SOL_TCP'
                setsockopt(m_hSock, SOL_TCP, TCP_NODELAY, &on, sizeof(on));
                                    ^
/Users/deevashwer/ABY/extern/ENCRYPTO_utils/src/ENCRYPTO_utils/socket.cpp:232:22: error:
      use of undeclared identifier 'SOL_TCP'
        setsockopt(m_hSock, SOL_TCP, TCP_NODELAY, &one, sizeof(one));
                            ^
3 errors generated.
make[2]: *** [extern/ENCRYPTO_utils/CMakeFiles/encrypto_utils.dir/src/ENCRYPTO_utils/socket.cpp.o] Error 1
make[1]: *** [extern/ENCRYPTO_utils/CMakeFiles/encrypto_utils.dir/all] Error 2
make: *** [all] Error 2

@dd23
Copy link
Member

dd23 commented Sep 21, 2018

I have no idea about MacOS, but it seems that it somehow does not define SOL_TCP.

What I found through a quick Google search was this workaround:
unbit/uwsgi@b608eb1
Maybe you can try that.

Unfortunately we have no possibility to test ABY on MacOS, so this is rather hard to debug from our side.

@deevashwer
Copy link
Author

The major problem I'm facing is that OS X doesn't yet support "filesystem".
Is there a version of ABY that doesn't use "filesystem" or "experimental/filesystem"?

@lenerd
Copy link
Collaborator

lenerd commented Sep 24, 2018

You could just use ABY before commit dafae66.

@dd23
Copy link
Member

dd23 commented Sep 24, 2018

Or alternatively, you could install gcc8, which comes with support for the filesystem library.
The older version, gcc7 should support experimental/filesystem.
There are already modifications that introduce experimental/filesystem as alternative in 11c4986 from #87

@deevashwer
Copy link
Author

I tried doing that. The problem is that I had some linking issues since the GMP that I have installed was compiled with clang.
I would try installing GMP again with gcc8, if some older version of the repository is not compatible.

@deevashwer
Copy link
Author

Having tried both the alternatives, I am stuck at this error:

Undefined symbols for architecture x86_64:
  "operator<<(std::basic_ostream<char, std::char_traits<char> >&, __mpz_struct const*)", referenced from:
      gmp_num::print()     in libencrypto_utils.a(gmp-pk-crypto.cpp.o)
      gmp_fe::print()     in libencrypto_utils.a(gmp-pk-crypto.cpp.o)
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make[2]: *** [bin/abytest] Error 1
make[1]: *** [src/test/CMakeFiles/abytest.dir/all] Error 2
make: *** [all] Error 2

@lenerd
Copy link
Collaborator

lenerd commented Sep 26, 2018

@deevashwer
Copy link
Author

Yes. It is enabled. cmake was able to locate the gmpyxx.dylib as well.

@deevashwer
Copy link
Author

I managed to install a previous version of the library.
I started testing the executables in the bin directory.
Some of them are producing the wrong output, for example, abyfloat_test with the following error:

Error: Unable to open circuit file circ/fp_nostatus_add_64.aby

and bench_operations with the following error:

Base OTs:	307.504
Op	1-bit 	8-bit 	16-bit 	32-bit 	64-bit
-----------------------------------------------
xorbool	Error:
	SERVER xorbool: values[0]: a = 1, b = 0, c = 0, verify = 1
0.492	Error:
	SERVER xorbool: values[0]: a = 11, b = 129, c = 115, verify = 138
0.299	Error:
	SERVER xorbool: values[0]: a = 54107, b = 16332, c = 13689, verify = 60567
0.432	Error:
	SERVER xorbool: values[0]: a = 1369386343, b = 1442420057, c = 1627993385, verify = 73840702
0.554	Error:
	SERVER xorbool: values[0]: a = 8411653348977072720, b = 8393851400082055007, c = 4088000364449807099, verify = 54255707705214223
1.884
andbool	1.313	Error:
	SERVER andbool: values[0]: a = 73, b = 222, c = 2, verify = 72
2.536	Error:
	SERVER andbool: values[0]: a = 59011, b = 1462, c = 57480, verify = 1154
1.164	Error:
	SERVER andbool: values[0]: a = 415494907, b = 110661036, c = 3095429220, verify = 8421544
1.955	Error:
	SERVER andbool: values[0]: a = 683731951929815735, b = 7020979943732265666, c = 9030190103564968500, verify = 102747189977825922
3.348

@lenerd
Copy link
Collaborator

lenerd commented Sep 26, 2018

For the missing circuit files see #83 .

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

3 participants