0

I am unable to install Mongooseim (latest) from the source code.

Using:

MongooseIM 3.2.0 (source code)
Mac OS 10.14.2 
Erlang: 21.2

Issue: While compiling Mongooseim from the source code, my logs are stuck on linking fast_tls.so and execution stopped. See screenshot below. I am sure something is wrong with openssl.

Solution tried:

  1. I have installed openssl and exported all flags but still the same issue.
  2. I have tried to install fast_tls from the source code. But that also failed on openssl. see screenshot
  3. Output of openssl verion

//terminal ouput

$ openssl version -a
OpenSSL 1.0.2q  20 Nov 2018
built on: reproducible build, date unspecified
platform: darwin64-x86_64-cc
options:  bn(64,64) rc4(ptr,int) des(idx,cisc,16,int) idea(int) blowfish(idx) 
compiler: clang -I. -I.. -I../include  -fPIC -fno-common -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -arch x86_64 -O3 -DL_ENDIAN -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_ASM
OPENSSLDIR: "/usr/local/etc/openssl"

//Screenshots

enter image description here

enter image description here

Shubham1164
  • 357
  • 6
  • 16
  • 1
    What is the output of `which openssl`? – l'L'l Feb 14 '19 at 06:38
  • `$which openssl` /usr/local/opt/openssl/bin/openssl – Shubham1164 Feb 14 '19 at 07:04
  • Is it something related to keychain certificates, because I have deleted some certificates there which I feel not needed – Shubham1164 Feb 14 '19 at 08:29
  • 1
    Next you'll want to do `otool -L /usr/local/opt/openssl/bin/openssl`, then post the output; that command tells you where the library is located. Once that is done then you'll direct the compiler to that location perhaps using `--openssldir=` or `LD_LIBRARY_PATH`. – l'L'l Feb 14 '19 at 16:59
  • `/usr/local/opt/openssl/bin/openssl: /usr/local/Cellar/openssl/1.0.2q/lib/libssl.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/local/Cellar/openssl/1.0.2q/lib/libcrypto.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.200.5)` – Shubham1164 Feb 14 '19 at 17:02
  • I have reinstall MAC OS for this issue. :( – Shubham1164 Feb 14 '19 at 17:03
  • After reinstall I am getting this below error: fatal error: 'openssl/err.h' file not found – Shubham1164 Feb 14 '19 at 17:03
  • Why would you need to reinstall `macOS`? That seems extreme. Try using the following command before running the `./configure` command: `export LD_LIBRARY_PATH="/usr/local/Cellar/openssl/1.0.2q/lib/:$LD_LIBRARY_PATH"` – l'L'l Feb 14 '19 at 17:05
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/188437/discussion-between-shubham1164-and-lll). – Shubham1164 Feb 14 '19 at 17:06

1 Answers1

0

I guess this page regarding building ejabberd on MacOS should help: https://docs.ejabberd.im/developer/install-osx/#installation

You need to install openSSL from homebrew and then properly set up your environment variables:

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"
Mickaël Rémond
  • 9,035
  • 1
  • 24
  • 44