4

I'm trying to install saltstack on OS X 10.8 using Xcode v 5.0 with installed dev. tools, following this tutorial.

The installation with pip install salt gives me the following error:

clang -fno-strict-aliasing -fno-common -dynamic -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64 -g -O2 -DNDEBUG -g -O3 -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/usr/include -I/Users/TK/.virtualenvs/cattapp/build/M2Crypto/SWIG -c SWIG/_m2crypto_wrap.c -o build/temp.macosx-10.6-intel-2.7/SWIG/_m2crypto_wrap.o -DTHREADING

clang -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -isysroot /Developer/SDKs/MacOSX10.6.sdk -g build/temp.macosx-10.6-intel-2.7/SWIG/_m2crypto_wrap.o -L/usr/lib -lssl -lcrypto -o build/lib.macosx-10.6-intel-2.7/M2Crypto/__m2crypto.so

ld: library not found for -lssl

clang: error: linker command failed with exit code 1 (use -v to see invocation)

error: command 'clang' failed with exit status 1

----------------------------------------
Command /Users/TK/.virtualenvs/cattapp/bin/python -c "import setuptools;__file__='/Users/TK/.virtualenvs/venv/build/M2Crypto/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-kUuPr8-record/install-record.txt --install-headers /Users/TK/.virtualenvs/venv/bin/../include/site/python2.7 failed with error code 1 in /Users/TK/.virtualenvs/venv/build/M2Crypto
Exception information:
Traceback (most recent call last):
  File "/Users/TK/.virtualenvs/venv/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/basecommand.py", line 104, in main
    status = self.run(options, args)
  File "/Users/TK/.virtualenvs/venv/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/commands/install.py", line 250, in run
    requirement_set.install(install_options, global_options)
  File "/Users/TK/.virtualenvs/venv/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/req.py", line 1133, in install
    requirement.install(install_options, global_options)
  File "/Users/TK/.virtualenvs/venv/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/req.py", line 577, in install
    cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
  File "/Users/TK/.virtualenvs/venv/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/__init__.py", line 256, in call_subprocess
    % (command_desc, proc.returncode, cwd))
InstallationError: Command /Users/TK/.virtualenvs/cattapp/bin/python -c "import setuptools;__file__='/Users/TK/.virtualenvs/venv/build/M2Crypto/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-kUuPr8-record/install-record.txt --install-headers /Users/TK/.virtualenvs/venv/bin/../include/site/python2.7 failed with error code 1 in /Users/TK/.virtualenvs/venv/build/M2Crypto

Obivously the lssl library could not be found. Any idea how to install it or what went wrong?

Johannes Weiss
  • 52,533
  • 16
  • 102
  • 136
Thomas Kremmel
  • 14,575
  • 26
  • 108
  • 177

1 Answers1

3

It's the ssl library that cannot be found.

Install libssl then try again.

koan
  • 3,596
  • 2
  • 25
  • 35
  • How can I install it? Searching for mac os install libssl brings up openssl which is already installed on my mac. – Thomas Kremmel Oct 29 '13 at 08:35
  • Where is it installed ? Because clang is given the option `-L/usr/lib`, that means it is looking in `/usr/lib` for it. I would bet it's actually in either `/usr/local/lib` or `/opt/local/lib`. – koan Oct 29 '13 at 08:45
  • It's actually in cd `/usr/local/ssl/bin/`, after I installed the latest version of it following: http://techscienceinterest.blogspot.co.at/2010/12/compiling-openssl-on-mac-os-x-snow.html. I created now a symlink to openssh in `/usr/lib` with this command: `ln -s /usr/local/ssl/bin/openssl openssl` . Unfortunately still getting the same error. – Thomas Kremmel Oct 29 '13 at 09:00
  • You didn't include the link to the tutorial you are using at the top of your question. The link you created would not work, you need to link to the directory that contains either `libssl.a` or `libssl.dylib`. Better yet, change that `-L` parameter to search the correct location of your ssl library. – koan Oct 29 '13 at 09:44
  • That -L parameter is not set by me. It's set when installing M2Crypto via pip. However I managed to install M2Crypto directly using the .egg. So I just solved the issue with M2Crypto. Anyhow - now I get the error "src/MD2.c:30:10: fatal error: 'string.h' file not found". For me it seems as this SaltStack installation procedure on Mac OS is a mess regarding the saltstack dependencies. At least I have some serious trouble with pycrypto and m2cryto. – Thomas Kremmel Oct 29 '13 at 09:48
  • So.. I decided to install salt on Debian and it took my roughly 2 minutes. On the bottom line: I had no luck with salt on Mac, but it works like a charm on debian. – Thomas Kremmel Oct 29 '13 at 10:17
  • 11
    Anyone coming across this when trying to install psycopg2 on macOS Sierara, my answer here may help: http://stackoverflow.com/a/39244687/1444152 – sas Aug 31 '16 at 12:28