selimsami / qforce

Apache License 2.0
57 stars 13 forks source link

Failed installation on Mac OS 11.5.2 #1

Closed jCodingStuff closed 3 years ago

jCodingStuff commented 3 years ago

When I try to install Q-Force via pip within a conda environment, the module readline fails to install. Has anyone encountered this problem before?

selimsami commented 3 years ago

Hi Julián,

I use it with Mac OS (10.13.6) within the conda environment without problem.

Selim

jCodingStuff commented 3 years ago

Hi Selim,

This is part of what I have in my brand new conda environment: Name Version Build Channel pip 21.2.4 py37hecd8cb5_0
python 3.9.6 h88f2d9e_1
readline 8.1 h9ed2024_0
setuptools 52.0.0 py39hecd8cb5_0

I tried to install it in my base python 3 installation and I encounter the same error.

The red text I get is veeeeery long. Here are some chunks: Beginning configuration for readline-6.2 for i386-apple-darwin20.6.0

checking whether make sets $(MAKE)... yes checking for gcc... gcc checking for C compiler default output file name... configure: error: in /private/var/folders/tb/1p97hw7s5y1gg9m78_c1s6900000gn/T/pip-install-sc70yp37/readline_fa98939649f148f993178902a7dff28d/rl/readline-lib': configure: error: C compiler cannot create executables Seeconfig.log' for more details.

clang: error: no such file or directory: 'readline/libreadline.a' clang: error: no such file or directory: 'readline/libhistory.a' error: command 'clang' failed with exit status 1

I think it may have to do with the C compiler in the new Macs. It may be worth for me to make 'gcc' the GNU C compiler and see if that fixes anything.

Julián

jCodingStuff commented 3 years ago

Good morning,

PROBLEM SOLVED!

There are problems with the default clang compiler on the new Mac operative systems.

The solution is as follows:

  1. Install Homebrew with /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  2. Install GNU gcc (C compiler) with brew install gcc
  3. cd /usr/local/bin and check what is the gcc version installed. In my case it is gcc-11.
  4. When in /usr/local/bin run the following command ln -s gcc-11 gcc (change 11 for your version) to create a symbolic link and let Terminal know that gcc stands for gcc-11
  5. Quit Terminal and reopen
  6. DONE! You can install qforce without any trouble now. For safety, check that everything is OK with which gcc and/or gcc --version.

Also, make sure that /usr/local/bin is listed above /usr/bin in the PATH variable.

Best, Julián