cmake_minimum_required(VERSION3.7)project(test2016_2)set(CMAKE_CXX_STANDARD14)# Set CMake behaviorcmake_policy(SETCMP0004NEW)# Get DOLFIN configuration data (DOLFINConfig.cmake must be in# DOLFIN_CMAKE_CONFIG_PATH)find_package(DOLFINREQUIRED)set(CMAKE_BUILD_TYPE"Release")if(EXISTS${DOLFIN_USE_FILE})include(${DOLFIN_USE_FILE})# Default build type (can be overridden by user)if(NOTCMAKE_BUILD_TYPE)set(CMAKE_BUILD_TYPE"RelWithDebInfo"CACHESTRING"Choose the type of build, options are: Debug MinSizeRel Release RelWithDebInfo."FORCE)endif()# Do not throw error for 'multi-line comments' (these are typical in# rst which includes LaTeX)include(CheckCXXCompilerFlag)CHECK_CXX_COMPILER_FLAG("-Wno-comment"HAVE_NO_MULTLINE)if(HAVE_NO_MULTLINE)set(CMAKE_CXX_FLAGS"-Wno-comment ${CMAKE_CXX_FLAGS}")endif()else()# Compiler definitionsadd_definitions(${DOLFIN_CXX_DEFINITIONS})# Compiler flagsset(CMAKE_CXX_FLAGS"${DOLFIN_CXX_FLAGS} ${CMAKE_CXX_FLAGS}")# Do not throw error for 'multi-line comments' (these are typical in# rst which includes LaTeX)include(CheckCXXCompilerFlag)CHECK_CXX_COMPILER_FLAG("-Wno-comment"HAVE_NO_MULTLINE)if(HAVE_NO_MULTLINE)set(CMAKE_CXX_FLAGS"-Wno-comment ${CMAKE_CXX_FLAGS}")endif()# Include directoriesinclude_directories(${DOLFIN_INCLUDE_DIRS})include_directories(SYSTEM${DOLFIN_3RD_PARTY_INCLUDE_DIRS})endif()set(MKLROOT"/opt/intel/compilers_and_libraries/mac/mkl")set(OMPROOT"/opt/intel/compilers_and_libraries/mac")set(CMAKE_CXX_FLAGS"-DEIGEN_USE_MKL_ALL -m64 -I${MKLROOT}/include -Ofast ${CMAKE_CXX_FLAGS}")set(CMAKE_EXE_LINKER_FLAGS"-L${MKLROOT}/lib -L${OMPROOT}/lib -Wl,-rpath,${MKLROOT}/lib -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread -lm -ldl ${CMAKE_EXE_LINKER_FLAGS}")set(SOURCE_FILESmain.cpp)add_executable(test2016_2${SOURCE_FILES})target_link_libraries(${PROJECT_NAME}${DOLFIN_LIBRARIES}${MKL_LIBRARIES})
Comments (0)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.