Need to install Watchman version 4.9.0 on a mac - macos

These instructions at https://facebook.github.io/watchman/docs/install.html do not work for mac osx:
$ git clone https://github.com/facebook/watchman.git
$ cd watchman
$ git checkout v4.9.0
$ ./autogen.sh
$ ./configure
$ make
$ sudo make install
./autogen.sh...
The error:
pkg-config appears to be missing (not available to autoconf tools)
please install the pkg-config package for your system.
The reason I suspect is that not all the same linux packages are available on a mac. How can I get this working on a mac?

// autoconf#2.7
brew uninstall autoconf
brew install autoconf#2.6.9
//pass
./autogen.sh
Just run ./autogen.sh

Related

Error installing mysql-python: library not found for -lssl

I'm having trouble installing mysql-python. Created a new virtualenv and when installing mysql-python... here's the error message:
(env)$ pip install mysql-python
Collecting mysql-python
...
clang -bundle -undefined dynamic_lookup -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk build/temp.macosx-10.12-x86_64-2.7/_mysql.o -L/usr /local/Cellar/mysql/5.7.16/lib -lmysqlclient -lssl -lcrypto -o build/lib.macosx-10.12-x86_64-2.7/_mysql.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
Using homebrew, I have installed:
libressl
openssl
openssl#1.1
mysql
Already tried to brew link but brew refuses to do so.
The OS is MacOS Sierra.
Can anyone help? Thanks!
You can set ssl library path explicitly.
LDFLAGS=-L/usr/local/opt/openssl/lib pip install mysqlclient
I tried updating Xcode's CLT, uninstalling mysql, checking mysql_config, etc., but had no luck.
I found that running brew info openssl shows:
...
For compilers to find openssl you may need to set:
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
...
Running those two commands, followed by pip install, worked for me (in my case when installing mysqlclient).
Solved it with these steps:
brew uninstall mysql
brew install mysql-connector-c
pip install mysql-python
brew unlink mysql-connector-c
brew install mysql
Found the answer here https://stackoverflow.com/a/25920020/576192
Not sure if this is the right way, but this is how I managed to solve it.
I'm able to fix the error by running:
pip install -r requirements.txt --global-option=build_ext --global-option="-I/usr/local/opt/openssl/include" --global-option="-L/usr/local/opt/openssl/lib"
I was finally able to fix it by
xcode-select --install
I was sure I had already done that... but obviously I hadn't. Definitely worth a shot!
For me on mac, running this command solved the issue
LDFLAGS=-L/usr/local/opt/openssl/lib pip install mysqlclient
Actually we need to set ssl library path to get this issue fixed.
Worked for me by doing this
$ brew uninstall mysql
$ brew install mysql-connector-c
$ brew unlink mysql-connector-c
$ brew install mysql
$ pip install mysql-python
Which is a slightly altered version of the recipe above (note: pip install at the end!)
If you want to install mysql-python, I suggest you to install mysqlclient instead. The authors of these two modules are the same. By far, the authors all turn to keep maintaining mysqlclient. mysqlclient supports both Python 2 and Python 3. And you can use the same codes like mysql-python. Blew is my installation solution for you.
$ brew info openssl
$ brew unlink mysql-connector-c
$ brew install mysql
$ brew link --overwrite mysql-connector-c
$ pip install mysqlclient
If there is an error before pip install mysqlclient. Please fix it according to methane's answer.
And run pip install mysqlclient again.
Or download and install .dmg from the MySQL dev site: https://dev.mysql.com/downloads/file/?id=467834
For those of you who are installing MySQL v5.7 with Brew
Uninstall mysql-connector-c
$ brew uninstall mysql-connector-c
Install specific version, very likely you need to uninstall other installed versions
$ brew install mysql#5.7
You will need to add it to the PATH, since this is 'keg-only' formulae, this is printed after it is installed
$ echo 'export PATH="/usr/local/opt/mysql#5.7/bin:$PATH"' >> ~/.zshrc
Replace ~/.zshrc with the appropriate file.
Install mysql-connector-c
$ brew install mysql-connector-c
Check it is installed properly
$ which mysql
# /usr/local/opt/mysql#5.7/bin/mysql
$ mysql_config
# Usage: /usr/local/opt/mysql#5.7/bin/mysql_config [OPTIONS]
Compiler: Clang 10.0.0.10001145
Options:
--cflags [-I/usr/local/opt/mysql#5.7/include/mysql ]
--cxxflags [-I/usr/local/opt/mysql#5.7/include/mysql ]
--include [-I/usr/local/opt/mysql#5.7/include/mysql]
--libs [-L/usr/local/opt/mysql#5.7/lib -lmysqlclient -lssl -lcrypto]
--libs_r [-L/usr/local/opt/mysql#5.7/lib -lmysqlclient -lssl -lcrypto]
--plugindir [/usr/local/opt/mysql#5.7/lib/plugin]
--socket [/tmp/mysql.sock]
--port [0]
--version [5.7.24]
--libmysqld-libs [-L/usr/local/opt/mysql#5.7/lib -lmysqld -lssl -lcrypto]
--variable=VAR VAR is one of:
pkgincludedir [/usr/local/opt/mysql#5.7/include/mysql]
pkglibdir [/usr/local/opt/mysql#5.7/lib]
plugindir [/usr/local/opt/mysql#5.7/lib/plugin]
Now install mysqlclient
$ pip install mysqlclient

ejabberd installation issue for mac

I am installing ejabberd by using source code. I have take the clone from git : https://github.com/processone/ejabberd.git. and followed steps:
Git: brew install git
Erlang /OTP: brew install erlang
Autoconf: brew install autoconf
Automake: brew install automake
Openssl: brew install openssl
Expat: brew install expat
Libyaml: brew install libyaml
Libiconv: brew install libiconv
Sqlite: brew install sqlite
chmod +x autogen.sh
./autogen.sh
export LDFLAGS="-L/usr/local/opt/openssl/lib -L/usr/local/lib -L/usr/local/opt/expat/lib"
export CFLAGS="-I/usr/local/opt/openssl/include/ -I/usr/local/include -I/usr/local/opt/expat/include"
export CPPFLAGS="-I/usr/local/opt/openssl/include/ -I/usr/local/include -I/usr/local/opt/expat/include"
./configure --prefix=$HOME/my-ejabberd --enable-mysql
make
above command is working correctly. but "sudo make install" have the problem.
Configuration files
/usr/bin/install -c -d -m 750 -g pravin //etc/ejabberd
install: pravin: Invalid argument
make: *** [install] Error 67
Please help me.
Thanks in advance.
just brew install ejabberd for current release or brew install ejabberd --HEAD to install current git master HEAD

Trouble installing m2crypto with pip on OS X / macOS

pip install m2crypto
Generates the following output:
building 'M2Crypto.__m2crypto' extension
swigging SWIG/_m2crypto.i to SWIG/_m2crypto_wrap.c
swig -python -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/usr/include -I/usr/include/openssl -includeall -modern -o SWIG/_m2crypto_wrap.c SWIG/_m2crypto.i
SWIG/_m2crypto.i:30: Error: Unable to find 'openssl/opensslv.h'
SWIG/_m2crypto.i:33: Error: Unable to find 'openssl/safestack.h'
SWIG/_evp.i:12: Error: Unable to find 'openssl/opensslconf.h'
SWIG/_ec.i:7: Error: Unable to find 'openssl/opensslconf.h'
error: command 'swig' failed with exit status 1
I've run:
brew install swig
I wanted a nicer way without installing manually and using only Homebrew (which also does not link openssl by default). Also using pip was a requirement. This seems to work with newest m2crypto 0.22.5. I also tested it once with m2crypto 0.22.3 and seems also to work. The OpenSSL version here is 1.0.2d:
brew install openssl
brew install swig
Finally install m2crypto on macOS in your Bash. It is a long command but it changes SWIG and clang environment variables only during pip install so that m2crypto will get all OpenSSL requirements:
env LDFLAGS="-L$(brew --prefix openssl)/lib" \
CFLAGS="-I$(brew --prefix openssl)/include" \
SWIG_FEATURES="-cpperraswarn -includeall -I$(brew --prefix openssl)/include" \
pip install m2crypto
btw. the last command also works if you use e.g. a requirements.txt.
Update:
Additional also the command for fish shell users...
env LDFLAGS="-L"(brew --prefix openssl)"/lib" \
CFLAGS="-I"(brew --prefix openssl)"/include" \
SWIG_FEATURES="-cpperraswarn -includeall -I"(brew --prefix openssl)"/include" \
pip install m2crypto
thanks to therealmarv env flags i was able to get this to work with the macports version of openssl/swig, this is what i did:
sudo port install openssl
sudo port install swig
sudo port install swig-python
then use therealmarv lines but replace "$(brew --prefix openssl)" with the dir from macports which should be "/opt/local"
sudo env LDFLAGS="-L/opt/local/lib" \
CFLAGS="-I/opt/local/include" \
SWIG_FEATURES="-cpperraswarn -includeall -I/opt/local/include" \
pip install M2Crypto
I just went through a lot of pain getting this working in El Capitan. Here is what I had to do:
Install OpenSSL (you have to use an older version, m2crypto will not compile otherwise)
curl -O https://www.openssl.org/source/openssl-0.9.8zg.tar.gz
tar -xvzf openssl-0.9.8zg.tar.gz
cd openssl-0.9.8zg
./Configure --prefix=/usr/local darwin64-x86_64-cc
make && make test
sudo make install
Install m2crypto
git clone https://github.com/martinpaljak/M2Crypto.git
cd M2Crypto
python setup.py build build_ext --openssl=/usr/local
sudo python setup.py install build_ext --openssl=/usr/local
AFAIK it is installed... I still have to do some testing though.
Got exact same issue on Ubuntu 18.04 LTS, while trying to execute
pip install M2Crypto==0.24.0
Did the following to get rid of it:
sudo apt-get install swig
sudo apt-get install libssl1.0-dev
This fixed my problem (Python 2.7):
export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python2.7/site-packages
macos v10.15.6
m2crypto v0.35.6
pip v20
Solution by therealmarv works,
If the program does not take effect, you can try to upgrade your brew packages. Before the solution.
brew update # update homebrew self
brew upgrade # upgrade all
sudo apt-get install python-m2crypto

No such keg: /usr/local/Cellar/git

I have been struggling with this for a few hours. I am on a Mac using Yosemite. I had homebrew installed, and was using git just fine. I tried doing $git add -i and I got this error:
Can't locate Git.pm in #INC (#INC contains:
So I followed the instructions here:
Can't locate Git.pm in #INC
$brew uninstall git worked fine, but after I tried to $brew install git I've been stuck in a terrible cycle.
% brew install git
Error: git-git already installed
To install this version, first `brew unlink git'
% brew unlink git
Error: No such keg: /usr/local/Cellar/git
% brew link git
Error: No such keg: /usr/local/Cellar/git
% git --version
git version 1.9.3 (Apple Git-50)
% brew upgrade git
==> Upgrading 1 outdated package, with result:
git 2.2.2
Error: /usr/local/Library/LinkedKegs/git is not a valid keg
% brew install git
Error: git-git already installed
To install this version, first `brew unlink git'
%
I just want to get homebrew & git back to normal and linked to the correct repo again. I'm really rough around the edges at this stuff, so any help would be greatly appreciated!
Give another go at force removing the brewed version of git
brew uninstall --force git
Then cleanup any older versions and clear the brew cache
brew cleanup -s git
Remove any dead symlinks
brew cleanup --prune-prefix
Then try reinstalling git
brew install git
If that doesn't work, I'd remove that installation of Homebrew altogether and reinstall it. If you haven't placed anything else in your brew --prefix directory (/usr/local by default), you can simply rm -rf $(brew --prefix). Otherwise the Homebrew wiki recommends using a script at https://gist.github.com/mxcl/1173223#file-uninstall_homebrew-sh
Had a similar issue while installing "Lua" in OS X using homebrew. I guess it could be useful for other users facing similar issue in homebrew.
On running the command:
$ brew install lua
The command returned an error:
Error: /usr/local/opt/lua is not a valid keg
(in general the error can be of /usr/local/opt/ is not a valid keg
FIXED it by deleting the file/directory it is referring to, i.e., deleting the "/usr/local/opt/lua" file.
root-user # rm -rf /usr/local/opt/lua
And then running the brew install command returned success.
Os X Mojave 10.14 has:
Error: The Command Line Tools header package must be installed on
Mojave.
Solution. Go to
/Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
location and install the package manually. And brew will start working and we can run:
brew uninstall --force git
brew cleanup -s git
brew cleanup --prune-prefix
brew install git

How do I install libksba on mac osx?

According to rvm requirements, "For Ruby 1.9.3: Install libksba # If using Homebrew, 'brew install libksba'"
I am completely new and am not familiar with terminal commands. How can I install libksba without using homebrew?
Please help!!!
I just installed libksba and its dependency libgpg-error from source and I can assure you that installing Homebrew and then installing libksba is much more straightforward. With Homebrew, you'll spend far less time dealing with terminal commands and the likelihood of success is considerably higher. It is popular for a reason.
For the benefit of future visitors, here are instructions to compile and install libgpg-error and libksba from source via bash without Homebrew:
cd /usr/local/src
curl -O ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-1.9.tar.gz
tar -xvf libgpg-error-1.9.tar.gz
cd libgpg-error-1.9/
./configure
make
make install
cd ..
curl -O ftp://ftp.gnupg.org/gcrypt/libksba/libksba-1.2.0.tar.bz2
tar -xvf libksba-1.2.0.tar.bz2
cd libksba-1.2.0/
./configure
make
make install
you need to install the command line tools of xcode. Then you don't need to install libksba.
http://blog.salientdigital.com/2012/05/16/how-to-fix-no-acceptable-c-compiler-found-in-path-on-mac-os-x-lion/
Best,
Olli

Resources