Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sébastien Peillet
otb
Commits
256f237f
Commit
256f237f
authored
7 years ago
by
Rashad Kanavath
Browse files
Options
Downloads
Patches
Plain Diff
COMP: fix openmp & sse flag checks
parent
76a47998
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMake/OTBCheckSSEFeatures.cmake
+10
-22
10 additions, 22 deletions
CMake/OTBCheckSSEFeatures.cmake
CMake/OTBSetStandardCompilerFlags.cmake
+8
-7
8 additions, 7 deletions
CMake/OTBSetStandardCompilerFlags.cmake
CMakeLists.txt
+2
-0
2 additions, 0 deletions
CMakeLists.txt
with
20 additions
and
29 deletions
CMake/OTBCheckSSEFeatures.cmake
+
10
−
22
View file @
256f237f
function
(
check_sse_features sse_flags
)
include
(
CheckIncludeFile
)
include
(
CheckLibraryExists
)
include
(
CheckCXXSourceRuns
)
include
(
CheckCXXCompilerFlag
)
set
(
has_sse FALSE
)
set
(
${
sse_flags
}
"0"
PARENT_SCOPE
)
# For apple assume sse2 is on for all intel builds, check for 64 and 32 bit versions
if
(
APPLE
)
...
...
@@ -24,14 +21,11 @@ function(check_sse_features sse_flags )
b = _mm_add_pd(a,a);
_mm_storeu_pd(vals,b);
return 0;
}"
has_sse
)
}"
HAVE_SSE2_FLAGS
)
if
(
has_sse
)
message
(
STATUS
"Performing Test CXX_HAS_SSE2 - Success"
)
if
(
HAVE_SSE2_FLAGS
)
set
(
${
sse_flags
}
"-msse2 -mfpmath=sse"
PARENT_SCOPE
)
else
()
message
(
STATUS
"Performing Test CXX_HAS_SSE2 - Failed"
)
return
()
endif
()
set
(
CMAKE_REQUIRED_FLAGS
"-msse"
)
...
...
@@ -46,18 +40,13 @@ function(check_sse_features sse_flags )
b = _mm_add_ps(a,b);
_mm_storeu_ps(vals,b);
return 0;
}"
has_sse
)
}"
HAVE_SSE_FLAGS
)
if
(
has_sse
)
message
(
STATUS
"Performing Test CXX_HAS_SSE - Success"
)
if
(
HAVE_SSE_FLAGS
)
set
(
${
sse_flags
}
"-msse -mfpmath=sse"
PARENT_SCOPE
)
return
()
else
()
message
(
STATUS
"Performing Test CXX_HAS_SSE - Failed"
)
return
()
endif
()
elseif
(
MSVC
)
if
(
CMAKE_SIZEOF_VOID_P EQUAL 8
)
return
()
...
...
@@ -73,15 +62,14 @@ function(check_sse_features sse_flags )
b = _mm_add_pd(a,a);
_mm_storeu_pd(vals,b);
return 0;
}"
has_sse
)
}"
HAVE_SSE_FLAGS
)
if
(
has_sse
)
message
(
STATUS
"Performing Test
CXX_HAS_SSE
- Success"
)
if
(
HAVE_SSE_FLAGS
)
message
(
STATUS
"Performing Test
HAVE_SSE_FLAGS
- Success"
)
set
(
${
sse_flags
}
"/arch:SSE2 /fp:fast -D__SSE__ -D__SSE2__"
PARENT_SCOPE
)
return
()
else
()
message
(
STATUS
"Performing Test
CXX_HAS_SSE
- Failed"
)
message
(
STATUS
"Performing Test
HAVE_SSE_FLAGS
- Failed"
)
return
()
endif
()
endif
()
...
...
This diff is collapsed.
Click to expand it.
CMake/OTBSetStandardCompilerFlags.cmake
+
8
−
7
View file @
256f237f
...
...
@@ -281,23 +281,24 @@ macro(check_compiler_platform_flags)
# check for OpenMP
if
(
OTB_USE_OPENMP
)
message
(
STATUS
"OpenMP support requested with OTB_USE_OPENMP=
${
OTB_USE_OPENMP
}
"
)
find_package
(
OpenMP QUIET
)
endif
()
if
(
OPENMP_FOUND
)
message
(
STATUS
"Enabling OpenMP support"
)
set
(
OTB_REQUIRED_C_FLAGS
"
${
OTB_REQUIRED_C_FLAGS
}
${
OpenMP_C_FLAGS
}
"
)
message
(
STATUS
"Adding '
${
OpenMP_CXX_FLAGS
}
' to OTB_REQUIRED_CXX_FLAGS "
)
set
(
OTB_REQUIRED_CXX_FLAGS
"
${
OTB_REQUIRED_CXX_FLAGS
}
${
OpenMP_CXX_FLAGS
}
"
)
set
(
OTB_REQUIRED_LINK_FLAGS
"
${
OTB_REQUIRED_LINK_FLAGS
}
${
OpenMP_EXE_LINKER_FLAGS
}
"
)
else
(
)
message
(
STATUS
"Disabling OpenMP support"
)
if
(
OpenMP_EXE_LINKER_FLAGS
)
set
(
OTB_REQUIRED_LINK_FLAGS
"
${
OTB_REQUIRED_LINK_FLAGS
}
${
OpenMP_EXE_LINKER_FLAGS
}
"
)
endif
(
)
endif
()
set
(
OTB_SSE_FLAGS
)
if
(
OTB_USE_SSE_FLAGS
)
if
(
OTB_USE_SSE_FLAGS
)
message
(
STATUS
"SIMD extensions requested with OTB_USE_SSE_FLAGS=
${
OTB_USE_SSE_FLAGS
}
"
)
include
(
OTBCheckSSEFeatures
)
check_sse_features
(
OTB_SSE_FLAGS
)
if
(
OTB_SSE_FLAGS
)
message
(
STATUS
"Adding
OTB_SSE_FLAGS(
${
OTB_SSE_FLAGS
}
)
to OTB_REQUIRED_CXX_FLAGS"
)
message
(
STATUS
"Adding
'
${
OTB_SSE_FLAGS
}
'
to OTB_REQUIRED_CXX_FLAGS"
)
set
(
OTB_REQUIRED_CXX_FLAGS
"
${
OTB_REQUIRED_CXX_FLAGS
}
${
OTB_SSE_FLAGS
}
"
)
endif
()
endif
()
...
...
This diff is collapsed.
Click to expand it.
CMakeLists.txt
+
2
−
0
View file @
256f237f
...
...
@@ -506,6 +506,8 @@ foreach(otb_option
OTB_WRAP_PYTHON
OTB_WRAP_JAVA
OTB_DATA_ROOT
OTB_USE_OPENMP
OTB_USE_SSE_FLAGS
)
get_white_spaces
(
"
${
otb_option
}
"
spaces
)
message
(
"
${
otb_option
}
${
spaces
}
=
${${
otb_option
}}
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment