Coder Social home page Coder Social logo

macOS support about libscapi HOT 10 CLOSED

cryptobiu avatar cryptobiu commented on September 13, 2024
macOS support

from libscapi.

Comments (10)

fabrice102 avatar fabrice102 commented on September 13, 2024

After pull request #31, tests (in the folder https://github.com/cryptobiu/libscapi/tree/master/test) are now passing.

Remark: Some care should be taken on macOS with openssl. If installed with homebrew, it might be necessary to set LIBRARY_PATH=/usr/local/opt/openssl/lib:$LIBRARY_PATH.

from libscapi.

fabrice102 avatar fabrice102 commented on September 13, 2024

After pull request #35 and #36, libscapi_samples seems to behave the same way on macOS and on a fresh Ubuntu 16.04 VM, except for OTExtensionBristol (which needs to be disabled - see above) and for Yao (because of issue #37).

Note: on macOS, the library rt does not exist and the flag -lrt should be removed. Furthermore, the flag -lboost_thread might need to changed to -lboost_thread-mt.

from libscapi.

liorko87 avatar liorko87 commented on September 13, 2024

@fabrice102 Thank you for your work!
I will review your PR and submit them to the new branch Mac OS x

from libscapi.

RahulRachuri avatar RahulRachuri commented on September 13, 2024

Hey,

While compiling libOTe, I ran into this error.
/Users/rahul/Downloads/libscapi-master/build/libOTe/cryptoTools/cryptoTools/Crypto/AES.h:4:10: fatal error: 'openssl/evp.h' file not found

I am running macOS High Sierra 10.13.3. I have openssl installed on my system. Does someone know a fix for this?

from libscapi.

fabrice102 avatar fabrice102 commented on September 13, 2024

You need to install openssl with HomeBrew for example (brew install openssl), and then to modify accordingly the environment variables CPLUS_INCLUDE_PATH, ...

Concretely, you can add the following to ~/.bashrc, ~/.zshrc, or equivalent and restart your shell:

# openssl (for CMAKE)
export OPENSSL_ROOT_DIR=/usr/local/opt/openssl
# and when CMAKE is not used...
export C_INCLUDE_PATH=$OPENSSL_ROOT_DIR/include:$C_INCLUDE_PATH
export CPLUS_INCLUDE_PATH=$OPENSSL_ROOT_DIR/include:$CPLUS_INCLUDE_PATH
export LD_LIBRARY_PATH=$OPENSSL_ROOT_DIR/lib:$LD_LIBRARY_PATH
export LIBRARY_PATH=$OPENSSL_ROOT_DIR/lib:$LIBRARY_PATH

Note: If you are compiling other softwares that uses openssl with CMake, you should unset LD_LIBRARY_PATH and LIBRARY_PATH when compiling them, to avoid having issues with rpath and System Integrity Protection (e.g., when debugging these softwares using gdb).

from libscapi.

RahulRachuri avatar RahulRachuri commented on September 13, 2024

Thanks, that worked! But then there is an error with boost,

/Users/rahul/Downloads/libscapi-master/build/libOTe/cryptoTools/cryptoTools/Network/Channel.h:354:22: fatal error: use of class template 'boost::asio::strand' requires template arguments boost::asio::strand mSendStrand, mRecvStrand;

I am using boost 1.66.0 (the latest version). I think this might be a problem with the latest version of boost.

from libscapi.

fabrice102 avatar fabrice102 commented on September 13, 2024

Try to use an older version of boost (1.65.0 or 1.60.0).

from libscapi.

RahulRachuri avatar RahulRachuri commented on September 13, 2024

Thanks, I am on 1.60.0 right now. That error is resolved but,

ld: warning: directory not found for option '-L/Users/rahul/libscapi/install/lib' ld: library not found for -lboost_thread clang: fatal error: linker command failed with exit code 1 (use -v to see invocation)

This is what it throws after compiling 45% of libOTe. I think the fix is to change lboost_thread to lboost_thread-mt for Mac, but I'm not sure all the places where this change has to be made.

from libscapi.

fabrice102 avatar fabrice102 commented on September 13, 2024

The build system changed since last time I compiled libscapi. I guess that now you should change boost_thread in boost_thread-mt inside CMakeLists.txt.

from libscapi.

RahulRachuri avatar RahulRachuri commented on September 13, 2024

I changed it to boost_thread-mt in the CMakeLists.txt files and then there was a linker error for which I changed line 6 in CMakeLists.txt file in libOTe/cryptoTools/frontend_cryptoTools to
link_directories($ENV{HOME}/Downloads/libscapi-master/install/lib/)

But then it igonres the file with this error -

ld: warning: ld: warning: ld: warning: ignoring file /Users/rahul/Downloads/libscapi-master/install/lib/libcrypto.a, file was built for archive which is not the architecture being linked (x86_64): /Users/rahul/Downloads/libscapi-master/install/lib/libcrypto.aignoring file /Users/rahul/Downloads/libscapi-master/install/lib/libssl.a, file was built for archive which is not the architecture being linked (x86_64): /Users/rahul/Downloads/libscapi-master/install/lib/libssl.aignoring file ../thirdparty/linux/miracl/miracl/source/libmiracl.a, file was built for archive which is not the architecture being linked (x86_64): ../thirdparty/linux/miracl/miracl/source/libmiracl.a

from libscapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.