amkozlov / raxml-ng

RAxML Next Generation: faster, easier-to-use and more flexible
GNU Affero General Public License v3.0
385 stars 64 forks source link

Failed to install the MPI version of RAxML-NG on HPC #106

Closed wanyuac closed 3 years ago

wanyuac commented 4 years ago

I could not installed this RAxML-NG version using conda v4.8.3.

My command lines are:

cd ~/software/raxml
conda create -n raxml
conda activate raxml

# Install dependencies
conda install -c anaconda gcc_linux-64  # v7.3.0
conda install -c anaconda cmake  # v3.18.2
conda install -c conda-forge bison  # v3.4
conda install -c conda-forge flex  # v2.6.4
conda install -c anaconda gmp  # v6.1.2

# Check installed files
echo $CC
/rds/general/user/ywan1/home/anaconda3/envs/raxml/bin/x86_64-conda_cos6-linux-gnu-cc
echo $CPP
/rds/general/user/ywan1/home/anaconda3/envs/raxml/bin/x86_64-conda_cos6-linux-gnu-cpp

# Build and install the main program
wget https://github.com/amkozlov/raxml-ng/releases/download/1.0.1/raxml-ng_v1.0.1_linux_x86_64_MPI.zip

mkdir build && cd build

cmake -DUSE_MPI=ON -DCMAKE_C_COMPILER=$HOME/anaconda3/envs/raxml/bin/x86_64-conda_cos6-linux-gnu-gcc -DCMAKE_CXX_COMPILER=$HOME/anaconda3/envs/raxml/bin/x86_64-conda_cos6-linux-gnu-cpp -S=$HOME/software/raxml ..

The last command failed with the error message:

-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is unknown
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /rds/general/user/ywan1/home/anaconda3/envs/raxml/bin/x86_64-conda_cos6-linux-gnu-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: /rds/general/user/ywan1/home/anaconda3/envs/raxml/bin/x86_64-conda_cos6-linux-gnu-cpp
-- Check for working CXX compiler: /rds/general/user/ywan1/home/anaconda3/envs/raxml/bin/x86_64-conda_cos6-linux-gnu-cpp - broken
CMake Error at /rds/general/user/ywan1/home/anaconda3/envs/raxml/share/cmake-3.18/Modules/CMakeTestCXXCompiler.cmake:59 (message):
  The C++ compiler

    "/rds/general/user/ywan1/home/anaconda3/envs/raxml/bin/x86_64-conda_cos6-linux-gnu-cpp"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /rds/general/user/ywan1/home/software/raxml/build/CMakeFiles/CMakeTmp

    Run Build Command(s):/usr/bin/gmake cmTC_302cd/fast && /usr/bin/gmake  -f CMakeFiles/cmTC_302cd.dir/build.make CMakeFiles/cmTC_302cd.dir/build
    gmake[1]: Entering directory `/rds/general/user/ywan1/home/software/raxml/build/CMakeFiles/CMakeTmp'
    Building CXX object CMakeFiles/cmTC_302cd.dir/testCXXCompiler.cxx.o
    /rds/general/user/ywan1/home/anaconda3/envs/raxml/bin/x86_64-conda_cos6-linux-gnu-cpp    -o CMakeFiles/cmTC_302cd.dir/testCXXCompiler.cxx.o -c /rds/general/user/ywan1/home/software/raxml/build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
    x86_64-conda_cos6-linux-gnu-cpp: fatal error: '-c' is not a valid option to the preprocessor
    compilation terminated.
    gmake[1]: *** [CMakeFiles/cmTC_302cd.dir/testCXXCompiler.cxx.o] Error 1
    gmake[1]: Leaving directory `/rds/general/user/ywan1/home/software/raxml/build/CMakeFiles/CMakeTmp'
    gmake: *** [cmTC_302cd/fast] Error 2

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:47 (project)

-- Configuring incomplete, errors occurred!
See also "/rds/general/user/ywan1/home/software/raxml/build/CMakeFiles/CMakeOutput.log".
See also "/rds/general/user/ywan1/home/software/raxml/build/CMakeFiles/CMakeError.log".

I have also attached the output log files here: CMakeError.log CMakeOutput.log

I would appreciate it if anyone would help me to address this issue.

amkozlov commented 4 years ago

You are setting C++ compiler incorrectly, please see here:

https://stackoverflow.com/questions/3299754/cpp-c-is-not-a-valid-option-to-the-preprocessor

Also, it can be easier to build raxml-ng without using conda. Please see instructions here:

https://github.com/amkozlov/raxml-ng/wiki/Installation#mpi-enabled-version

wanyuac commented 3 years ago

Hi @amkozlov , thanks for your help. As discussed in the post from your reply, I mistook the C++ compiler for the C preprocessor cpp. After installing g++ using command line conda install -c anaconda gxx_linux-64, I ran commands:

ln -s $CC ~/anaconda3/envs/raxml/bin/gcc
ln -s $HOME/anaconda3/envs/raxml/bin/x86_64-conda_cos6-linux-gnu-g++ $HOME/anaconda3/envs/raxml/bin/g++

mkdir build && cd build

cmake -DUSE_MPI=ON -DCMAKE_C_COMPILER=$HOME/anaconda3/envs/raxml/bin/gcc -DCMAKE_CXX_COMPILER=$HOME/anaconda3/envs/raxml/bin/g++ -S=$HOME/software/raxml ..

make

Program raxml-ng was successfully built and appeared under the directory bin. This issue is hence solved. Please feel free to close this issue.

amkozlov commented 3 years ago

Great, thanks for reporting back!