veg / hyphy

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

Installation issues relating to gcc version #755

Closed mshakya closed 6 years ago

mshakya commented 6 years ago

Hi all, I am trying to install the hyphy-2.3.11 in a linux machine with CentOS Linux release 7.1.1503 but it fails with the error:

CMake Error at CMakeLists.txt:105 (message):
  Require at least gcc-4.9

The default gcc for that machine is indeed lower than 4.9, but I loaded another gcc version in my environment, made sure that thats what gcc was calling and it still failed with the same error. I tried it with gcc version 5.1.0 (GCC) and 6.2.0.

Is it possible that cmake or in hyphy, the path of gcc is hardcoded to /usr/bin/gcc?

Thank you Migun

spond commented 6 years ago

Dear @mshakya,

Try

$rm -rf CMakeCache* CMakeFiles/
$CC=/path/to/gcc CXX=/path/to/g++ cmake ./
$make 

Best, Sergei

mshakya commented 6 years ago

Hi Sergei,

It seems like the cmake step worked:

$ CC=/opt/apps/gcc-6.2.0/bin/gcc CXX=/opt/apps/gcc-6.2.0/bin/g++ cmake -DINSTALL_PREFIX=~/thirdParty/hyphy-2.3.11
-- The C compiler identification is GNU 6.2.0
-- The CXX compiler identification is GNU 6.2.0
-- Check for working C compiler: /opt/apps/gcc-6.2.0/bin/gcc
-- Check for working C compiler: /opt/apps/gcc-6.2.0/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /opt/apps/gcc-6.2.0/bin/g++
-- Check for working CXX compiler: /opt/apps/gcc-6.2.0/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test HAVE_AVX_EXTENSIONS
-- Performing Test HAVE_AVX_EXTENSIONS - Failed
-- Performing Test HAVE_SSE3_EXTENSIONS
-- Performing Test HAVE_SSE3_EXTENSIONS - Success
Set compiler flags to -fsigned-char -O3 -std=c++14 -msse3 
CMake Warning (dev) at /users/thirdParty/miniconda/share/cmake-3.9/Modules/FindOpenMP.cmake:200 (if):
  Policy CMP0054 is not set: Only interpret if() arguments as variables or
  keywords when unquoted.  Run "cmake --help-policy CMP0054" for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.

  Quoted variables like "c" will no longer be dereferenced when the policy is
  set to NEW.  Since the policy is not set the OLD behavior will be used.
Call Stack (most recent call first):
  /users/thirdParty/miniconda/share/cmake-3.9/Modules/FindOpenMP.cmake:324 (_OPENMP_GET_FLAGS)
  CMakeLists.txt:182 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found OpenMP_C: -fopenmp (found version "4.5") 
-- Found OpenMP_CXX: -fopenmp (found version "4.5") 
-- Found CURL: /users/thirdParty/miniconda/lib/libcurl.so (found version "7.52.1") 
-- Found PythonInterp: /users/thirdParty/miniconda/bin/python (found version "2.7.12") 
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Could NOT find OpenCL (missing: OPENCL_LIBRARIES OPENCL_INCLUDE_DIR) 
-- Could NOT find MPI_C (missing: MPI_C_LIBRARIES MPI_C_INCLUDE_PATH) 
-- Could NOT find MPI_CXX (missing: MPI_CXX_LIBRARIES MPI_CXX_INCLUDE_PATH) 
-- Configuring done
-- Generating done
-- Build files have been written to:/users/thirdParty/hyphy-2.3.11

However, the make step fell at the end:

$ make
Scanning dependencies of target HYPHYMP
[  3%] Building CXX object CMakeFiles/HYPHYMP.dir/src/core/_hyExecutionContext.cpp.o
[  6%] Building CXX object CMakeFiles/HYPHYMP.dir/src/core/alignment.cpp.o
[  6%] Building CXX object CMakeFiles/HYPHYMP.dir/src/core/avllist.cpp.o
[  9%] Building CXX object CMakeFiles/HYPHYMP.dir/src/core/avllistx.cpp.o
[  9%] Building CXX object CMakeFiles/HYPHYMP.dir/src/core/avllistxl.cpp.o
[ 12%] Building CXX object CMakeFiles/HYPHYMP.dir/src/core/avllistxl_iterator.cpp.o
[ 15%] Building CXX object CMakeFiles/HYPHYMP.dir/src/core/baseobj.cpp.o
[ 15%] Building CXX object CMakeFiles/HYPHYMP.dir/src/core/batchlan.cpp.o
[ 18%] Building CXX object CMakeFiles/HYPHYMP.dir/src/core/batchlan2.cpp.o
[ 18%] Building CXX object CMakeFiles/HYPHYMP.dir/src/core/batchlanhelpers.cpp.o
[ 21%] Building CXX object CMakeFiles/HYPHYMP.dir/src/core/batchlanruntime.cpp.o
[ 25%] Building CXX object CMakeFiles/HYPHYMP.dir/src/core/calcnode.cpp.o
[ 25%] Building CXX object CMakeFiles/HYPHYMP.dir/src/core/calcnode2.cpp.o
[ 28%] Building CXX object CMakeFiles/HYPHYMP.dir/src/core/category.cpp.o
[ 31%] Building CXX object CMakeFiles/HYPHYMP.dir/src/core/constant.cpp.o
[ 31%] Building CXX object CMakeFiles/HYPHYMP.dir/src/core/error.cpp.o
[ 34%] Building CXX object CMakeFiles/HYPHYMP.dir/src/core/fisher_exact.cpp.o
[ 34%] Building CXX object CMakeFiles/HYPHYMP.dir/src/core/formula.cpp.o
[ 37%] Building CXX object CMakeFiles/HYPHYMP.dir/src/core/fstring.cpp.o
[ 40%] Building CXX object CMakeFiles/HYPHYMP.dir/src/core/global_object_lists.cpp.o
[ 40%] Building CXX object CMakeFiles/HYPHYMP.dir/src/core/hbl_env.cpp.o
[ 43%] Building CXX object CMakeFiles/HYPHYMP.dir/src/core/likefunc.cpp.o
[ 43%] Building CXX object CMakeFiles/HYPHYMP.dir/src/core/likefunc2.cpp.o
[ 46%] Building CXX object CMakeFiles/HYPHYMP.dir/src/core/likefuncocl.cpp.o
[ 50%] Building CXX object CMakeFiles/HYPHYMP.dir/src/core/list.cpp.o
[ 50%] Building CXX object CMakeFiles/HYPHYMP.dir/src/core/mathobj.cpp.o
[ 53%] Building CXX object CMakeFiles/HYPHYMP.dir/src/core/matrix.cpp.o
[ 53%] Building CXX object CMakeFiles/HYPHYMP.dir/src/core/nexus.cpp.o
[ 56%] Building CXX object CMakeFiles/HYPHYMP.dir/src/core/operation.cpp.o
[ 59%] Building CXX object CMakeFiles/HYPHYMP.dir/src/core/parser.cpp.o
[ 59%] Building CXX object CMakeFiles/HYPHYMP.dir/src/core/parser2.cpp.o
[ 62%] Building CXX object CMakeFiles/HYPHYMP.dir/src/core/polynoml.cpp.o
[ 62%] Building CXX object CMakeFiles/HYPHYMP.dir/src/core/regex.cpp.o
[ 65%] Building CXX object CMakeFiles/HYPHYMP.dir/src/core/sequence.cpp.o
[ 68%] Building CXX object CMakeFiles/HYPHYMP.dir/src/core/simplelist.cpp.o
[ 68%] Building CXX object CMakeFiles/HYPHYMP.dir/src/core/site.cpp.o
[ 71%] Building CXX object CMakeFiles/HYPHYMP.dir/src/core/stack.cpp.o
[ 75%] Building CXX object CMakeFiles/HYPHYMP.dir/src/core/string_file_wrapper.cpp.o
[ 75%] Building CXX object CMakeFiles/HYPHYMP.dir/src/core/strings.cpp.o
[ 78%] Building CXX object CMakeFiles/HYPHYMP.dir/src/core/time_difference.cpp.o
[ 78%] Building CXX object CMakeFiles/HYPHYMP.dir/src/core/trie.cpp.o
[ 81%] Building CXX object CMakeFiles/HYPHYMP.dir/src/core/variable.cpp.o
[ 84%] Building CXX object CMakeFiles/HYPHYMP.dir/src/core/variablecontainer.cpp.o
[ 84%] Building CXX object CMakeFiles/HYPHYMP.dir/src/new/bayesgraph.cpp.o
[ 87%] Building CXX object CMakeFiles/HYPHYMP.dir/src/new/bayesgraph2.cpp.o
[ 87%] Building CXX object CMakeFiles/HYPHYMP.dir/src/new/bgm.cpp.o
[ 90%] Building CXX object CMakeFiles/HYPHYMP.dir/src/new/bgm2.cpp.o
[ 93%] Building CXX object CMakeFiles/HYPHYMP.dir/src/new/scfg.cpp.o
[ 93%] Building C object CMakeFiles/HYPHYMP.dir/contrib/SQLite-3.8.2/sqlite3.c.o
[ 96%] Building CXX object CMakeFiles/HYPHYMP.dir/src/utils/hyphyunixutils.cpp.o
/users/thirdParty/hyphy-2.3.11/src/utils/hyphyunixutils.cpp:51:23: fatal error: curl/curl.h: No such file or directory
 #include <curl/curl.h>
                       ^
compilation terminated.
make[2]: *** [CMakeFiles/HYPHYMP.dir/src/utils/hyphyunixutils.cpp.o] Error 1
make[1]: *** [CMakeFiles/HYPHYMP.dir/all] Error 2
make: *** [all] Error 2

Thanks Migun

spond commented 6 years ago

Dear @mshakya,

You can do one of two things.

1). Install libcurl-devel on your system (the steps will depend on the flavor of Linux) 2). Cmake seems to think you have libcurl installed, so you can comment out (put '#' at the beginning of each line) the following block in CMakeLists.txt and then rerun the steps I suggested before.

#-------------------------------------------------------------------------------
# LIBCurl support
#-------------------------------------------------------------------------------
find_package(CURL)
if(${CURL_FOUND} AND NOT APPLE)
    set(DEFAULT_LIBRARIES dl pthread crypto curl ssl)
    add_definitions (-D__HYPHYCURL__)
endif(${CURL_FOUND} AND NOT APPLE)

Best, Sergei

PS. @stevenweaver : could you please modify CMakeList.txt to make use of CURL_INCLUDE_DIRS and CURL_LIBRARIES (see https://cmake.org/cmake/help/v3.0/module/FindCURL.html) instead of assuming they are in default paths

mshakya commented 6 years ago

Ok, great thank you. I will keep following this thread to test out the new version as well.

Best, Migun

mshakya commented 6 years ago

Hi Sergei,

Just FYI, but your suggestion worked.

migun