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

Problems building on macOS Sierra #215

Closed
popaaaandrei opened this Issue Aug 3, 2017 · 12 comments

Comments

Projects
None yet
3 participants
@popaaaandrei

popaaaandrei commented Aug 3, 2017

Hello,

I am constantly getting this output on make install on macOS Sierra.

build/obj/themis/secure_session_utils.o [OK]
-n compile 
build/obj/themis/sym_enc_message.o [OK]
-n compile 
build/obj/themis/themis.o      [OK]
-n link 
themis_static                  [OK]
-n link 
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: can't open file: build/libsoter.dylib (No such file or directory)
make: *** [soter_shared] Error 1

It seems that it cannot build the dylib, although there are no errors reported before and the static library is build successfully.
Any thoughts?
Thank you!

@vixentael

This comment has been minimized.

Member

vixentael commented Aug 14, 2017

hi @popaaaandrei

can you please try building latest master branch or consider using Themis from cocoapods?

@vixentael vixentael self-assigned this Aug 14, 2017

@popaaaandrei

This comment has been minimized.

popaaaandrei commented Aug 14, 2017

Thank you @vixentael

  • I am trying to use Swift Package Manager, Cocoapods is not a good fit for me.
  • I am always using the latest master branch, but I suspect that it has to do with the OpenSSL installation, which I performed using brew. Do you recommend a different way of installing OpenSSL on MacOS?
openssl: stable 1.0.2k (bottled) [keg-only]
SSL/TLS cryptography library
https://openssl.org/
/usr/local/Cellar/openssl/1.0.2k (1,704 files, 12.1MB)
@vixentael

This comment has been minimized.

Member

vixentael commented Aug 31, 2017

Hi @popaaaandrei

Have you succeed in building Themis for macOS? Sorry I was busy playing with dynamic frameworks.

I found this post regarding installing OpenSSL on Mac
https://solitum.net/openssl-os-x-el-capitan-and-brew/

@vixentael

This comment has been minimized.

Member

vixentael commented Sep 11, 2017

Hi @popaaaandrei!

I have great news for you :)

I know why you have experienced difficulties with building Themis on MacOS: because brew installs OpenSSL to custom path. Instead of asking all MacOS users to indicate path-to-openssl-lib manually, we've updated Makefile to find this custom path and to use it (#224).

Please try building Themis from release_0.9.5 branch https://github.com/cossacklabs/themis/tree/release_0.9.5

It should be as easy as

$ brew install openssl
$ make install

If you confirm that it works fine, we will merge this change into master!
If this doesn't fix your problem, please re-open an issue and provide more details :)

Thank you!

@popaaaandrei

This comment has been minimized.

popaaaandrei commented Sep 11, 2017

Still doesn't work for me, and it's not openssl-related. But I am using a virtual machine with Ubuntu that seems to be working so I solved my issue by abandoning macOS :)

make install log attached

bash-3.2$ brew list openssl
/usr/local/Cellar/openssl/1.0.2l/.bottle/etc/ (8 files)
/usr/local/Cellar/openssl/1.0.2l/bin/c_rehash
/usr/local/Cellar/openssl/1.0.2l/bin/openssl
/usr/local/Cellar/openssl/1.0.2l/include/openssl/ (75 files)
/usr/local/Cellar/openssl/1.0.2l/lib/libcrypto.1.0.0.dylib
/usr/local/Cellar/openssl/1.0.2l/lib/libssl.1.0.0.dylib
/usr/local/Cellar/openssl/1.0.2l/lib/engines/ (12 files)
/usr/local/Cellar/openssl/1.0.2l/lib/pkgconfig/ (3 files)
/usr/local/Cellar/openssl/1.0.2l/lib/ (4 other files)
/usr/local/Cellar/openssl/1.0.2l/share/man/ (1597 files)
@popaaaandrei

This comment has been minimized.

popaaaandrei commented Sep 11, 2017

UPDATE, it works now, I needed to log out completely from the user account and log in as administrator. The previous attempt was using su <administrator> with [sudo] make install. Ubuntu doesn't have these problems :)

Thank you kindly @vixentael for your efforts!

@vixentael

This comment has been minimized.

Member

vixentael commented Sep 11, 2017

Really happy that it works! ☀️

@mobrio

This comment has been minimized.

mobrio commented Sep 11, 2017

For the future ... while (possibly?) not as popular as Homebrew, there is also https://www.macports.org which of course has its own different view about locations typically /opt/local/lib and /opt/local/include

Should the issue arise, rather than replicating the approach taken for Homebrew perhaps https://en.wikipedia.org/wiki/Pkg-config might be a way to go, iy's available for Homebrew, Macports and the rest. Both openssl and libressl offer pkg-config support and the usage is short and sweet:

Mac-2:~ cjh$ pkg-config --cflags openssl | cut -c 3-
/opt/local/include
Mac-2:~ cjh$ pkg-config --libs-only-L openssl | cut -c 3-
/opt/local/lib

@vixentael

This comment has been minimized.

Member

vixentael commented Sep 11, 2017

Good point, thank you!

@popaaaandrei

This comment has been minimized.

popaaaandrei commented Sep 16, 2017

Also, another thing is that themis on macOS is being deployed in /usr/local and not directly on /usr so we need to pass that to the build command: swift build -Xswiftc -I/usr/local/include/ -Xcc -I/usr/local/include/

@vixentael

This comment has been minimized.

Member

vixentael commented Sep 18, 2017

@popaaaandrei are you referring to this issue?
#198

Can you please describe your use case. If I understand correctly, you're building Themis, then using it in your Swift MacOS app, right? How do you import Themis lib into your app?

@popaaaandrei

This comment has been minimized.

popaaaandrei commented Sep 18, 2017

I am working on 2 server-side apps in Swift using Vapor framework on Ubuntu 16.10 (I will try 16.04 LTS as well). Everything works well.

But because I am confortable I want to do the development in XCode with autocomplete and all the symbols loaded. Thus the need to make the same tree compile on macOS as well. Swift Package Manager handles the importing (+ C modulemap) in both cases. On macOS I still haven't manage to compile the project, it still has problems with finding all the headers.

Thank you for your consideration, the issue is not urgent or important.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment