How to install latest version of openssl Mac OS X El Capitan - macos

I have used brew install openssl to download and install openssl v1.0.2f, however, it comes back saying:
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
/usr/local/etc/openssl/certs
and run
/usr/local/opt/openssl/bin/c_rehash
This formula is keg-only, which means it was not symlinked into /usr/local.
Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries
Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:
LDFLAGS: -L/usr/local/opt/openssl/lib
CPPFLAGS: -I/usr/local/opt/openssl/include
And when I do openssl version -a it always gives me:
OpenSSL 0.9.8zg 14 July 2015
built on: Jul 31 2015
platform: darwin64-x86_64-llvm
options: bn(64,64) md2(int) rc4(ptr,char) des(idx,cisc,16,int) blowfish(idx)
compiler: -arch x86_64 -fmessage-length=0 -pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -O3 -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DL_ENDIAN -DMD32_REG_T=int -DOPENSSL_NO_IDEA -DOPENSSL_PIC -DOPENSSL_THREADS -DZLIB -mmacosx-version-min=10.6
OPENSSLDIR: "/System/Library/OpenSSL"
How can I replace the old version with the new one? I've searched a lot on how to do this, but the solutions online don't seem to work for me...

Execute following commands:
brew update
brew install openssl
echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile
You will have the latest version of openssl installed and accessible from cli (command line/terminal). Since the third command will add export path to .bash_profile, the newly installed version of openssl will be accessible across system restarts.

Only
export PATH=$(brew --prefix openssl)/bin:$PATH in ~/.bash_profile
has worked for me!
Thank you mipadi.

I can't reproduce your issue running El Cap + Homebrew 1.0.x
Upgrade to Homebrew 1.0.x, which was released late in September 2016. Specific changes were made in the way openssl is linked. The project is on a more robust release schedule now that it's hit 1.0.
brew uninstall openssl
brew update && brew upgrade && brew cleanup && brew doctor
You should fix any issues raised by brew doctor before proceeding.
brew install openssl
Note: Upgrading homebrew will update all your installed packages to their latest versions.

Try creating a symlink, make sure you have openssl installed in /usr/local/include first.
ln -s /usr/local/Cellar/openssl/{version}/include/openssl /usr/local/include/openssl
More info at Openssl with El Capitan.

this command solve my problem on github CI job and virtualbox
brew install openssl#1.1
cp /usr/local/opt/openssl#1.1/lib/pkgconfig/*.pc /usr/local/lib/pkgconfig/

I reached this page when I searched for information about openssl being keg-only. I believe I have understood the reason why Homebrew is taking this action now. My solution may work for you:
Use the following command to make the new openssl command available (assuming you have adjusted PATH to put /usr/local/bin before /usr/bin):
ln -s /usr/local/opt/openssl/bin/openssl /usr/local/bin/
When compiling with openssl, follow Homebrew's advice and use
-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib
Alternatively, you can make these settings permanent by putting the following lines in your .bash_profile or .bashrc:
export CPATH=/usr/local/opt/openssl/include
export LIBRARY_PATH=/usr/local/opt/openssl/lib

This is an old question but still answering it in present-day context as many of the above answers may not work now.
The problem is that the Path is still pointing to the old version. Two solutions can be provided for resolution :
Uninstall old version of openssl package brew uninstall openssl and then reinstall the new version : brew install openssl
point the PATH to the new version of openssl.First install the new version and now(or if) you have installed the latest version, point the path to it: echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile

You can run brew link openssl to link it into /usr/local, if you don't mind the potential problem highlighted in the warning message. Otherwise, you can add the openssl bin directory to your path:
export PATH=$(brew --prefix openssl)/bin:$PATH

To replace the old version with the new one, you need to change the link for it. Type that command to terminal.
brew link --force openssl
Check the version of openssl again. It should be changed.

Related

I can't install gcc with Mojave 10.14

I try to install a fortran compiler on my Mojave system thanks to the command
brew install gcc
Unfortunately, I have this error message
The directory that should contain system headers does not exist:
/usr/include
I found out that I had to install the latest update of the Command Line Tools, which I did and update Xcode to 10.1 but the error remains the same.
I tried to update brew but it said
Error: /usr/local must be writable!
and brew doctor said that my version of Xcode is outdated although I just updated to the 10.1 version
So... any help is appreciated.
Thanks everybody
Zhiv
I found very detailed instructions for compiling GCC by "Paul" at https://solarianprogrammer.com/2017/05/21/compiling-gcc-macos/
In particular this step will address your problem:
macOS Mojave changed the location of the system headers, this broke
the GCC 8 build process. In order to build GCC install the required
header files in the old location:
cd /Library/Developer/CommandLineTools/Packages/
open .
Update the permissions using:
sudo chown -R /usr/local/* /usr/local/.git; brew update

Home brew failing on “command ‘gcc’ failed with exit status 1″ error

I want to get started with geodjango and for this I have to install gdal. I am using MacOS 10.8.3
In order to do so with brew as advised in the geodjango documentation but I get the following error :
$brew install gdal
==> Downloading http://download.osgeo.org/gdal/1.10.0/gdal-1.10.0.tar.gz
Already downloaded: /Library/Caches/Homebrew/gdal-1.10.0.tar.gz
==> ./configure --prefix=/usr/local/Cellar/gdal/1.10.0 --mandir=/usr/local/Cellar/gdal/1.10.0/share/man --with-local=/usr/local/Cellar/gdal/1.10.0 --with-threads --with-libtool -
==> make
==> make install
==> /Users/Lucas/.virtualenvs/geotest/bin/python setup.py install --prefix=/usr/local/Cellar/gdal/1.10.0 --record=installed.txt --single-version-externally-managed
gcc-4.2 -bundle -undefined dynamic_lookup -g -L/usr/local/opt/sqlite/lib -lsqlite3 -I/usr/local/opt/sqlite/include -arch x86_64 build/temp.macosx-10.6-intel-2.7/extensions/gdalconst_wrap.o -L../../.libs -L../../ -L/private/tmp/gdal-gOux/gdal-1.10.0/lib -lgdal -o build/lib.macosx-10.6-intel-2.7/osgeo/_gdalconst.so
Your Xcode and or CLT are mis-configured. Try some or all of the following:
xcodebuild -license
sudo xcode-select -switch /path/to/Xcode.app
error: command 'gcc-4.2' failed with exit status 1
READ THIS: https://github.com/mxcl/homebrew/wiki/troubleshooting
These open issues may also help:
https://github.com/mxcl/homebrew/issues/19845
https://github.com/mxcl/homebrew/issues/20373
https://github.com/mxcl/homebrew/pull/20457
As advised, I did :
xcodebuild -license
and agreed to the licence, then :
sudo xcode-select -switch /Applications/Xcode.app
I also checked the issues but none of them was helpfull.
I have Xcode 4.6.3 installed and have brewed lots of other formulaes in the past without any problem.
When I run brew doctor, I get :
$brew doctor
Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.
Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:
/Library/Frameworks/Python.framework/Versions/2.7/bin/python-config
/Library/Frameworks/Python.framework/Versions/2.7/bin/python2-config
/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7-config
/Applications/Postgres.app/Contents/MacOS/bin/gdal-config
/Applications/Postgres.app/Contents/MacOS/bin/geos-config
/Applications/Postgres.app/Contents/MacOS/bin/uuid-config
/Applications/Postgres.app/Contents/MacOS/bin/xml2-config
I don't want to remove postgres.app from my path as it is necessary for the CLI of postgres.app configuration as explained here : http://postgresapp.com/documentation#toc_1
About the python from library, I tried to remove them using :
PATH=$(echo $PATH |sed 's/\/Library\/Frameworks\/Python.framework\/Versions\/2.7\/bin//')
as advised here :https://www.linuxquestions.org/questions/linux-newbie-8/how-to-remove-directory-from-%24path-483463/. But it did not removed anything from the path.
So here I am not installing gdal ...
I found a workaround on SO, I can't find the original post but similar info is given on this one : Installing Scipy on Mac OS X Lion 10.7.5
So I added the following lines to my .bashrc and I then managed to brew install gdal.
export CC=gcc
export CXX=g++
Be aware that this did not solved my problem entirely as I still have config issue with geodjango, but at least I have gdal installed.

gfortran/gcc4.8 on Mac OS X 10.8.3

I am having trouble re-installing gfortran on my mac after upgrading to mountain lion.
I have:
Downloaded the latest version of XCode and installed command line tools.
I tried running gfortran but it is not available in gcc4.2 so...
I downloaded the latest version of fink and fink commander.
I downloaded gcc4.8 through fink and the install was performed successfully.
Now I am stuck, the gfortran command still does not work (command not found), there is also no gcc-4.8 or gfortran-4.8 in usr/bin and so I cannot rename gcc. If I run gcc-4.8 I also get "command not found".
I have spent hours on these sites but still cannot solve the problem, can anyone help me?
If you have installed fink in the default location then the gcc/gfortran/g++ packages should be be found in
/sw/bin
and called
/sw/bin/gcc-fsf-4.8
/sw/bin/gfortran-fsf-4.8
/sw/bin/g++-fsf-4.8
Create a bash script, SelectGCC-4.8.sh, with the following:
sudo cd /usr/local/bin
sudo rm cc gcc c++ g++
sudo ln -s /sw/bin/gcc-fsf-4.8 cc
sudo ln -s /sw/bin/gcc-fsf-4.8 gcc
sudo ln -s /sw/bin/c++-fsf-4.8 c++
sudo ln -s /sw/bin/g++-fsf-4.8 g++
NOTE: only the first sudo will ask for your password

Updating OpenSSL version on OSX

Currently on OSX 10.7 Lion openssl 0.9.8r is installed. This build is from Feb 2011 and I want to update it to the newest version. I can't use the autoupdate because I need the enable-cms option so I built it from the source, run ./Configure darwin64-x86_64-ccand ./config enable-cms --openssldir=~/usr/local/ssl.
Then I made "make" and "make install" without any errors but there is still the old version installed.
> openssl version
OpenSSL 0.9.8r 8 Feb 2011
What am I doing wrong? Maybe it's the folder? I only guessed that the ssl folder in /usr/local/ must be the default open ssl installation directory from Mac OSX?
Okay, I found a solution.
Before starting:
download sources
unpack sources
go into the unpacked source directory
The prefix has to be set on the /usr/ folder.
sudo ./configure --prefix=/usr/ darwin64-x86_64-cc enable-cms
sudo make
sudo make install
Note: To perform just a normal update you can drop the enable-cms option.
brew version (installed in '/usr/local/opt/openssl/bin') has such support for me.
https://formulae.brew.sh/formula/openssl#1.1

How do I compile jzmq for ZeroMQ on OSX?

Trying to follow the directions from: http://github.com/zeromq/jzmq
I installed pkg-config using Homebrew and then I run the following commands:
./autogen.sh
./configure
The configure fails with:
checking how to hardcode library paths into programs... immediate
./configure: line 15263: syntax error near unexpected token `newline'
./configure: line 15263: ` PKG_CHECK_MODULES('
A better solution is:
eval `brew --config | grep HOMEBREW_PREFIX | sed 's/: /=/'`
sudo bash -c 'echo '$HOMEBREW_PREFIX/share/aclocal' >> `aclocal --print-ac-dir`/dirlist'
This will allow the version of aclocal that ships with OSX to find any macros installed by homebrew packages.
With homebrew, the key is the warning message:
~/code/foss/java/jzmq$ brew install pkg-config
==> Downloading http://pkg-config.freedesktop.org/releases/pkg-config-0.25.tar.gz
==> ./configure --disable-debug --prefix=/usr/local/Cellar/pkg-config/0.25 --with-pc-path=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:/usr/X11/lib/pkgconfig
==> make install
Warning: m4 macros were installed to "share/aclocal".
Homebrew does not append "/usr/local/share/aclocal"
to "/usr/share/aclocal/dirlist". If an autoconf script you use
requires these m4 macros, you'll need to add this path manually.
==> Summary
/usr/local/Cellar/pkg-config/0.25: 8 files, 232K, built in 19 seconds
If you look at /usr/local/Cellar/pkg-config/0.25/share/aclocal/, you will see:
$ ls /usr/local/Cellar/pkg-config/0.25/share/aclocal/
pkg.m4
You need to append /usr/local/Cellar/pkg-config/0.25/share/aclocal/ to /usr/share/aclocal/dirlist,like this:
$ cat /usr/share/aclocal/dirlist
/usr/local/share/aclocal
/usr/local/Cellar/pkg-config/0.25/share/aclocal/
And then re-run autogen and the other steps.
I made a simple list about jzmq building for MacOS.
Install brew
https://brew.sh
Install tools for jzmq building
brew install autoconf
brew install automake
brew install libtool
brew install pkg-config
brew install zeromq#3.2
Download jzmq source
https://github.com/zeromq/jzmq source download to ~/somewhere/jzmq
Add symbolic link to /usr/local/include
cd /usr/local/include
ln -s /usr/local/Cellar/zeromq\#3.2/3.2.5/include/zmq.h
ln -s /usr/local/Cellar/zeromq\#3.2/3.2.5/include/zmq_utils.h
Add symbolic linke to /usr/local/lib
cd /usr/local/lib
ln -s /usr/local/Cellar/zeromq\#3.2/3.2.5/lib/libzmq.3.dylib
ln -s /usr/local/Cellar/zeromq\#3.2/3.2.5/lib/libzmq.a
ln -s /usr/local/Cellar/zeromq\#3.2/3.2.5/lib/libmq.dylib
ln -s /usr/local/Cellar/zeromq\#3.2/3.2.5/lib/pkgconfig/
Build jzmq-jni
cd ~/somewhere/jzmq
cd jzmq-jni
./autogen.sh
./configure
make
make install
Add option to VM options
VM options -Djava.library.path=/usr/local/lib
From the zeromq mailing list:
Building 0MQ from the development
trunk on a UNIX style OS (Linux, OS X)
requires that pkg-config
(http://pkg-config.freedesktop.org/wiki/)
be installed. A regular source build
of 0MQ does not require pkg-config.
On Mac OS X, pkg-config does not come
with the system, so when you try to do
./configure you may see errors like:
./configure: line 23913: syntax error near unexpected token `GLIB,'
./configure: line 23913: `PKG_CHECK_MODULES(GLIB, glib-2.0 gthread-2.0)'
To resolve this, you need to install
the latest pkg-config:
tar xzf pkg-config-0.25.tar.gz
cd pkg-config-0.25
./configure --prefix=/usr/local/pkg-config-0.25 --datarootdir=/usr/share
make
sudo make install
Then you will need to put
/usr/local/pkg-config-0.25/bin on your
$PATH. It is important to include the
"--datarootdir=/usr/share" option,
which will install the pkg.m4 file in
/usr/share/aclocal, where aclocal will
be able to find it.
Then you can build 0MQ:
cd zeromq2
./autogen.sh # must do this again after installing pkg-config
./configure # add other options here
make
sudo make install
Edited to reflect latest pkg-config version (0.25).
I came here with the same question, and I don't feel this is answered. I also installed ZeroMQ and pkg-config via Homebrew. /usr/local/share/aclocal/pkg.m4 exists and comes from pkg-config 0.25. It seems that Homebrew has satisfied the requirements listed but it still fails.
Trying to compile jzmq on Mac OS X, proved to be a bit of a headache. I followed the instructions above. I was still getting following error
syntax error near unexpected token
`PKG_CHECK_MODULES
The instructions above tell you to copy the pkgk.m4 file into /usr/share/aclocal, but your directory might be different. Basically you need the dir that automake searches for macro definitions.
The _PKG_CHECK_MODULES_ macro is defined in the pkg.m4 file. This file must be installed in the appropriate directory, which is searched by automake. Somehow automake is installed twice on my OS X, one in /usr and another in /Developer/usr. Make sure you know which one it's using. Just do which automake. If yours in is /Developer/usr, then copy the pkg.m4 file to /Developer/usr/share/aclocal.
For me, the problem was that I didn't have pkg-config installed.
On Osx Mountain Lion I don't have the dirlist file as Phil Calçado said, but a simple symlink from /usr/local/Cellar/pkg-config/[version]/share/aclocal/pkg.m4 to /usr/share/aclocal made the trick and now jzmq build fine.

Resources