veg / hyphy

HyPhy: Hypothesis testing using Phylogenies
http://www.hyphy.org
Other
200 stars 68 forks source link

Cmake compiler error #1650

Closed joana-morais closed 7 months ago

joana-morais commented 9 months ago

When I try to run cmake . during Hyphy installing, I receive the following error:

-- The C compiler identification is unknown -- The CXX compiler identification is unknown CMake Error at CMakeLists.txt:3 (project): The CMAKE_C_COMPILER:

/usr/local/bin/cc

What can I do to fix it?

spond commented 9 months ago

Dear @joana-morais,

Your system probably does not have a compiler installed that CMake can recognize. What operating system are you using?

Best, Sergei

joana-morais commented 9 months ago

I'm using MacOS M1.

spond commented 9 months ago

Dear @joana-morais,

By default, Mac OS X does not ship with developer tools. My suggestion would be to do the following

  1. Install homebrew from https://brew.sh
  2. Use it to install gcc via brew install gcc
  3. (Optional) Install openmpi (to complie HYPHYMPI if desired) via brew insall openmpi

Confirm that you can run gcc-xx and g++-xx (xx is the major version number, curently 13) from the command line. By default brew will place them in /opt/homebrew/bin

Then, finally, run the following command from the hyphy source directory.

CC=gcc-13 CXX=g++-13 cmake ./
make 
sudo make install

Best, Sergei

github-actions[bot] commented 7 months ago

Stale issue message