Changeset 3113 for trunk


Ignore:
Timestamp:
02/08/17 21:07:11 (8 years ago)
Author:
Kana Sugimoto
Message:

New Development: No

JIRA Issue: Yes (CAS-9626)

Ready for Test: Yes

Interface Changes: No

What Interface Changed:

Test Programs: build asap

Put in Release Notes: No

Module(s): asap

Description: Applied a patch received from Darrell to set appropriate build flags for intel Mac.


File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CMakeLists.txt

    r3108 r3113  
    6868   add_definitions( -DAIPS_DEBUG )
    6969endif()
    70 set( CMAKE_CXX_FLAGS_DEBUG "-ggdb3 -O0 -fno-omit-frame-pointer" )
     70set( CMAKE_CXX_FLAGS_DEBUG " -O0" )
     71if (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
     72   set( CMAKE_CXX_FLAGS_DEBUG "-ggdb3 -fno-omit-frame-pointer" )
     73endif( )
    7174
    7275# flags for Profile build
     
    104107# default flags
    105108if( APPLE )
    106     set( DEFAULT_CXX_FLAGS "-pipe -Wall -Wextra -Wcast-align -Wno-comment" )
     109    set( DEFAULT_CXX_FLAGS "-pipe -Wall -Wextra -Wno-comment" )
    107110else ()
    108     set( DEFAULT_CXX_FLAGS "-pipe -Wall -Wextra -Wno-non-template-friend -Wcast-align -Wno-comment" )
    109 endif()
     111    set( DEFAULT_CXX_FLAGS "-pipe -Wall -Wextra -Wno-comment" )
     112endif()
     113if (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
     114    set( DEFAULT_CXX_FLAGS "${DEFAULT_CXX_FLAGS} -Wcast-align" )
     115    if (NOT APPLE)
     116        set( DEFAULT_CXX_FLAGS "${DEFAULT_CXX_FLAGS} -Wno-non-template-friend" )
     117    endif( )
     118endif( )
    110119
    111120# additional flag for fortran complex div/mul rules.
     
    131140endif()
    132141
     142if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
     143   ## setting intel libraries with e.g.
     144   ##
     145   ##    find_library( INTEL_IRNG irng HINTS ${INTEL_PATH} )
     146   ##
     147   ## causes CMAKE to substitute fully qualified paths which makes
     148   ## python shared object unrelocatable in the case of libirng.so
     149   ##
     150   get_filename_component(INTEL_PATH ${CMAKE_CXX_COMPILER} DIRECTORY)
     151   set(INTEL_LIB_PATH ${INTEL_PATH}/../lib/intel64)
     152   set(INTEL_LIBS -limf -lsvml -lirng -lintlc -lifport -lifcore -liomp5)
     153   set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath,${INTEL_LIB_PATH}")
     154   set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-rpath,${INTEL_LIB_PATH}")
     155endif()
     156
    133157find_package( OpenMP )
    134158if( OPENMP_FOUND )
    135    set( DEFAULT_CXX_FLAGS "${DEFAULT_CXX_FLAGS} ${OpenMP_CXX_FLAGS}" )
     159   if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
     160      set(DEFAULT_CXX_FLAGS "${DEFAULT_CXX_FLAGS} -qopenmp")
     161   else( )
     162      set( DEFAULT_CXX_FLAGS "${DEFAULT_CXX_FLAGS} ${OpenMP_CXX_FLAGS}" )
     163   endif( )
    136164endif()
    137165
     
    606634        set( CMAKE_SHARED_LINKER_FLAGS "-Wl,-undefined -Wl,error -framework AppKit" )
    607635     else()
    608         set( CMAKE_SHARED_LINKER_FLAGS "-Wl,-undefined -Wl,error" )
     636        set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-undefined -Wl,error" )
    609637     endif()
    610638  endif()
Note: See TracChangeset for help on using the changeset viewer.