cryptobiu / libscapi

Comprehensive Open Source Library for Secure Multiparty Computation
MIT License
180 stars 66 forks source link

Building SCAPI without root #34

Closed lenerd closed 6 years ago

lenerd commented 7 years ago

Hello,

during the build of libscapi by calling make the following error occurs.

Install the project...
-- Install configuration: ""
CMake Error at cmake_install.cmake:36 (file):
  file cannot create directory: /usr/local/include/relic.  Maybe need
  administrative privileges.

make[1]: *** [Makefile:107: install] Error 1
make[1]: Leaving directory '/path/to/libscapi/build/EMP/relic'
make: *** [makefile:71: prepare-emp] Error 2

Of course, running sudo make would allow to create the directory under /usr/local. But, for once, I hesitate to compile with root permissions and I would like to avoid installing it globally on my system. Then, on other systems I might not have sufficient permissions.

The problem to solve seems to be to put the relic header somewhere, where they can be found by the other libraries. This should be possible without installing this stuff globally.

I have currently a limited overview of the build process and would like to ask if anyone has worked on this problem already?

fabrice102 commented 7 years ago

Please see #10. I am currently using sudo on Ubuntu. But I agree that this is not optimal. You can try to use https://github.com/fabrice102/libscapi/tree/make-no-sudo instead of https://github.com/cryptobiu/libscapi. It is the branch corresponding to pull request #19. I have just tested it on macOS. Please tell me if that does work for you.

fabrice102 commented 7 years ago

You can replace sudo ldconfig ~/boost_1_60_0/stage/lib/ ~/libscapi/install/lib/ by adding export LD_LIBRARY_PATH=$HOME/boost_1_60_0/stage/lib:$HOME/libscapi/install/lib:$LD_LIBRARY_PATH in ~/.bashrc, ~/.zshrc, or a similar file (and by opening a new shell).

lenerd commented 7 years ago

Thank you,

unfortunately it did not work out of the box for me. The relic headers and library were not found. With these modifications I was able to build the EMP libraries on my system (I also did remove -I${HOME}/boost_1_60_0 from the Makefile).

However, the OpenSSL version stopped me from completing the build. I will continue later with the other SCAPI branch as explained here an old OpenSSL version.

fabrice102 commented 7 years ago

Yes indeed, you need to do that. I actually did pull requests to update emp: #20, #21, #29. I forgot it was necessary.

lenerd commented 7 years ago

So, with a few adjustments for my Arch Linux system I have got a compiling source tree.

@fabrice102 Thanks for your help and your PRs.

abarak-biu commented 6 years ago

This has been resolved. You can build the latest master version without root