Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please support Intel (compiler -- icc >= 14.0) #9

Open
ehiggs opened this issue Jul 30, 2015 · 4 comments
Open

Please support Intel (compiler -- icc >= 14.0) #9

ehiggs opened this issue Jul 30, 2015 · 4 comments
Assignees

Comments

@ehiggs
Copy link

ehiggs commented Jul 30, 2015

The CMakeLists.txt refuses to handle anything except GNU and Clang compilers. It should be easy to support Intel as well since it understands most/all(?) GNU compiler flags.

CMAKE will report the compiler type as "Intel" and C++11 is supported from 14.0 and forward.

My rough wip to get this building uses the following:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index c95f755..30f1223 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -118,8 +118,30 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
     else()
         set (PTHREAD_LIB "pthread")
     endif()
+elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Intel")
+    execute_process(
+        COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE INTEL_VERSION)
+    if (NOT (INTEL_VERSION VERSION_GREATER 14.0 OR INTEL_VERSION VERSION_EQUAL 14.0))
+        message(FATAL_ERROR "${PROJECT_NAME} requires intel 14.0 or greater.  Found ${INTEL_VERSION}")
+    endif ()
+
+    set (INTEL TRUE)
+    set (PTHREAD_LIB "pthread")
+    set (CMAKE_CXX_FLAGS "-pthread -funroll-loops -fPIC -fomit-frame-pointer -Ofast -DHAVE_ANSI_TERM -DHAVE_SSTREAM -Wall -std=c++11 -Wreturn-type -Werror=return-type")
+
+    # If we're on Linux (i.e. not OSX) and we're using 
+    # gcc, then set the -static-libstdc++ flag
+    if (NOT APPLE) 
+        set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libstdc++")
+    endif()
+
+    set (WARNING_IGNORE_FLAGS "${WARNING_IGNORE_FLAGS} -Wno-unused-local-typedefs")
+    set (BOOST_TOOLSET "intel")
+    set (BOOST_CONFIGURE_TOOLSET "--with-toolset=gcc")
+       set (BCXX_FLAGS "-std=c++11")
+    set (BOOST_EXTRA_FLAGS toolset=gcc cxxflags=${BCXX_FLAGS})
 else ()
-    message(FATAL_ERROR "Your C++ compiler does not support C++11.")
+    message(FATAL_ERROR "Your C++ compiler (${CMAKE_CXX_COMPILER_ID}) does not support C++11.")
 endif ()

 ## TODO: Figure out how to detect this automatically
@rob-p rob-p changed the title Please support Intel CPUs. Please support Intel (compiler -- icc >= 14.0) Jul 30, 2015
@rob-p rob-p self-assigned this Jul 30, 2015
@rob-p
Copy link
Collaborator

rob-p commented Jul 30, 2015

Hi @ehiggs, You're right; there's no real reason we shouldn't be able to support ICC. The only issue is that we currently don't have access to a machine with icc, so this prevents us from testing the build ourselves. Is there a (free) resource (similar to Travis) that would allow us to test ICC builds? I'd be willing to add CMake support either way, but it would obviously be better if we could iron out the details ourself rather than wait for users to report issues building with icc.

@ehiggs
Copy link
Author

ehiggs commented Jul 30, 2015

@rob-p We have our own Jenkins install at Gent University that we use to make sure EasyBuild scripts build a wide range of scientific software. I don't think we're to open it up for free use.

I see there is AppVeyor but they only support Visual Studio. I'll take a look at what's available.

@ehiggs
Copy link
Author

ehiggs commented Aug 3, 2015

I asked about this on travis-ci's irc channel and they asked that I create an issue.

@boegel
Copy link

boegel commented May 9, 2019

@rob-p Ping on enhancing the CMakeLists.txt as proposed to allow building Salmon with Intel compilers?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants