yingjerkao / uni10

Official Repo for Uni10
28 stars 9 forks source link

Failing to find intel compiller #16

Closed rezah closed 8 years ago

rezah commented 8 years ago

CMakeCache.txt I've changed CMakeLists as follows, to enable mkl libraries. MKL library is located at /opt/intel/ unfortunately , it does not find the library. I've also attached CMakeCache file.

option(BUILD_CUDA_SUPPORT "Build using Nvidia CUDA for GPU library" OFF) option(BUILD_PACKAGES "Build Source/Binary Packages" ON) option(BUILD_EXAMPLES "Build Example Codes" ON) option(BUILD_PYTHON_WRAPPER "Build Python wrapper" ON) option(BUILD_WITH_MKL "Build Uni10 with MKL" ON) option(BUILD_WITH_INTEL_COMPILERS "Build Uni10 with Intel Compilers" ON) option(BUILD_ARPACK_SUPPORT "Build the arpack wrapper" ON) option(BUILD_DOC "Build API docuemntation" OFF) option(BUILD_HDF5_SUPPORT "Build HDF5" ON)

Finding Intel Compilers.... Cannot find Intel compilers. You may need to run `. /opt/intel/bin/compilervars.sh intel64/ia32' Falling back to system compilers.

yingjerkao commented 8 years ago

First, you should turn on the options by using -D BUILD_WITH_MKL=True -D BUILD_WITH_INTEL_COMPILERS=True. It is not advisable to change the CMakeLists.txt directly.

Did you run source /opt/intel/bin/compilervars.sh intel64 to activate the environment variables for icpc before you compile?

Which version of Intel compilers are you using?

rezah commented 8 years ago

version is 17.0.1.

I do source /opt/intel/bin/compilervars.sh intel64. I've also added mkl library and executable paths to bash file. It seems everything is fine: I got following as I run $icpc -v, icpc version 17.0.1 (gcc version 5.0.0 compatibility)

I run $ sudo cmake -D BUILD_WITH_MKL=True -D BUILD_WITH_INTEL_COMPILERS=True ~/Downloads/uni10-develop/uni10/ And again got the following error, Build with Intel Compilers Finding Intel Compilers.... Cannot find Intel compilers. You may need to run `. /opt/intel/bin/compilervars.sh intel64/ia32' Falling back to system compilers.....

Something weird happens while it comes back to system compiler: it produces error. CMakeFiles.tar.gz

I've attached the output files

yingjerkao commented 8 years ago

What is the CMake version?

rezah commented 8 years ago

cmake version 3.5.1

CMake suite maintained and supported by Kitware (kitware.com/cmake).

rezah commented 8 years ago

I updated it to the latest version, i.e., cmake version 3.7.0-rc3

nothing is different....

yingjerkao commented 8 years ago

This should be a cmake issue since we used cmake's find_program to locate icpc as indicated in the top CMakeLists.txt

if (BUILD_WITH_INTEL_COMPILERS)
  message("Build with Intel Compilers")
  message("Finding Intel Compilers....")
  find_program(CMAKE_C_COMPILER NAMES icc)
  find_program(CMAKE_CXX_COMPILER NAMES icpc)
  find_program(CMAKE_AR NAMES xiar)
  find_program(CMAKE_LINKER NAMES xild)

  if (NOT (CMAKE_C_COMPILER AND
           CMAKE_CXX_COMPILER AND
           CMAKE_AR AND
           CMAKE_LINKER ))
    message("Cannot find Intel compilers.")
    message("You may need to run `. /opt/intel/bin/compilervars.sh intel64/ia32'")
    message("Falling back to system compilers.")
    find_program(CMAKE_C_COMPILER NAMES cc)
    find_program(CMAKE_CXX_COMPILER NAMES cpp)
    find_program(CMAKE_AR NAMES ar)
    find_program(CMAKE_LINKER NAMES ld)
  endif ()
endif ()

One way to work around this is to use environment variables, for example, CC=icpc cmake path-to-uni10