Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
ScalFMM
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
solverstack
ScalFMM
Commits
e28f89c6
Commit
e28f89c6
authored
May 05, 2015
by
COULAUD Olivier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new options for Intel compiler
parent
78b6a16c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
17 deletions
+23
-17
CMakeLists.txt
CMakeLists.txt
+23
-17
No files found.
CMakeLists.txt
View file @
e28f89c6
...
...
@@ -112,9 +112,9 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_SOURCE_DIR}/CMakeModules/morse/")
IF
(
APPLE
)
set
(
SSE_FLAGS
"-msse4 -mfpmath=sse"
)
# -mtune=native -march=native
else
(
APPLE
)
set
(
AVX_FLAGS
"-mavx"
)
set
(
AVX2_FLAGS
"-mavx2"
)
set
(
SSE_FLAGS
"-axSSE4.2"
)
set
(
AVX_FLAGS
"-mavx
-march=native
"
)
set
(
AVX2_FLAGS
"-mavx2
-march=native
"
)
set
(
SSE_FLAGS
"-axSSE4.2
-march=native
"
)
endif
(
APPLE
)
#-Wshadow -Wpointer-arith -Wcast-qual -Wconversion -Wall -Wnosign-conversion ")
else
()
...
...
@@ -178,15 +178,13 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_SOURCE_DIR}/CMakeModules/morse/")
##############################################################################
# Release flags #
##############################################################################
set
(
CMAKE_BUILD_TYPE Release
)
# force -O3 in release
set
(
CMAKE_CXX_FLAGS_RELEASE
"
${
CMAKE_CXX_FLAGS_RELEASE
}
-O3"
)
string
(
REPLACE
"-O2"
"-O3"
CMAKE_CXX_FLAGS_RELEASE
${
CMAKE_CXX_FLAGS_RELEASE
}
)
set
(
CMAKE_CXX_FLAGS_TYPE
"
${
CMAKE_CXX_FLAGS_RELEASE
}
"
)
# if compiler is intel add -ip
if
(
CMAKE_CXX_COMPILER_ID STREQUAL
"Intel"
)
set
(
SCALFMM_CXX_FLAGS
"
${
SCALFMM_CXX_FLAGS
}
-ip"
)
# set(SCALFMM_CXX_FLAGS "${SCALFMM_CXX_FLAGS} -ip -no-prec-div -no-prec-sqrt")
set
(
SCALFMM_CXX_FLAGS
"
${
SCALFMM_CXX_FLAGS
}
-ip -no-prec-div -no-prec-sqrt"
)
endif
()
# Compile optimization
if
(
APPLE
)
...
...
@@ -194,11 +192,11 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_SOURCE_DIR}/CMakeModules/morse/")
"Set your optimization flags for release mode."
)
else
(
APPLE
)
# Not apple system - Check the compiler flags
if
(
CMAKE_CXX_COMPILER_ID STREQUAL
"Intel"
)
#
set(SCALFMM_FLAGS_OPTI_RELEASE "-fp-model precise -fp-model source -fimf-precision=low -funroll-loops -ftree-vectorize"
#
CACHE STRING "Set your optimization flags for release mode.")
set
(
SCALFMM_FLAGS_OPTI_RELEASE
"
"
CACHE STRING
"Set your optimization flags for release mode."
)
if
(
CMAKE_CXX_COMPILER_ID STREQUAL
"Intel"
)
set
(
SCALFMM_FLAGS_OPTI_RELEASE
"-fp-model precise -fp-model source -fimf-precision=low -funroll-loops -ftree-vectorize"
CACHE STRING
"Set your optimization flags for release mode."
)
# set(SCALFMM_FLAGS_OPTI_RELEASE "-funroll-loops -ftree-vectorize
" CACHE STRING
#
"Set your optimization flags for release mode.")
else
()
set
(
SCALFMM_FLAGS_OPTI_RELEASE
"-ffast-math -funroll-loops -ftree-vectorize"
CACHE STRING
"Set your optimization flags for release mode."
)
...
...
@@ -207,6 +205,9 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_SOURCE_DIR}/CMakeModules/morse/")
#
set
(
SCALFMM_CXX_FLAGS
"
${
SCALFMM_CXX_FLAGS
}
${
SCALFMM_FLAGS_OPTI_RELEASE
}
"
)
endif
()
MESSAGE
(
STATUS
" %%%%%%%%%% SCALFMM_CXX_FLAGS
${
SCALFMM_CXX_FLAGS
}
%%%%%%%%%%%%%"
)
MESSAGE
(
STATUS
" %%%%%%%%%% CMAKE_CXX_FLAGS_RELEASE
${
CMAKE_CXX_FLAGS_RELEASE
}
%%%%%%%%%%%%%"
)
#
##############################################################################
# Attach source code to exec #
...
...
@@ -536,15 +537,20 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_SOURCE_DIR}/CMakeModules/morse/")
${
SCALFMM_CMAKE_MODULE_PATH
}
/compileTestAvx.cpp
COMPILE_DEFINITIONS
"
${
CMAKE_CXX_FLAGS
}
${
AVX_FLAGS
}
"
OUTPUT_VARIABLE COMPILE_AVX_OUTPUT
)
if
(
${
COMPILE_AVX
}
)
if
(
${
COMPILE_AVX
}
)
message
(
STATUS
"%%%%%%%%%%%% COMPILE_AVX =
${
COMPILE_AVX
}
%%%%<
${
AVX_FLAGS
}
"
)
set
(
SCALFMM_CXX_FLAGS
"
${
SCALFMM_CXX_FLAGS
}
${
AVX_FLAGS
}
"
)
#set( SCALFMM_USE_SSE OFF FORCE) # ne marche pas
message
(
STATUS
"%%%%%%%%%%%% SCALFMM_CXX_FLAGS =
${
SCALFMM_CXX_FLAGS
}
"
)
#set( SCALFMM_USE_SSE OFF FORCE) # ne marche pas
try_compile
(
COMPILE_RESULT_AVSPE
${
CMAKE_CURRENT_BINARY_DIR
}
${
SCALFMM_CMAKE_MODULE_PATH
}
/checkAVXpe.cpp
COMPILE_DEFINITIONS
"
${
CMAKE_CXX_FLAGS
}
${
AVX_FLAGS
}
"
)
if
(
NOT
${
COMPILE_RESULT_AVSPE
}
)
# if( NOT ${COMPILE_RESULT_AVSPE})
set
(
__AVXPE_INTEL_COMPILER ON
)
endif
()
#
endif()
message
(
STATUS
${
CMAKE_CXX_FLAGS
}
)
else
(
${
COMPILE_AVX
}
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment