Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
dynamic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
MostafaMollaali
dynamic
Commits
f9f79ccd
Commit
f9f79ccd
authored
12 years ago
by
Lars Bilke
Browse files
Options
Downloads
Patches
Plain Diff
Introduced CMake compiler variables COMPILER_IS_... (see scripts/cmake/CompilerSetup.cmake).
Fixed OpenMP build on Windows.
parent
a128934a
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
scripts/cmake/CompilerSetup.cmake
+16
-6
16 additions, 6 deletions
scripts/cmake/CompilerSetup.cmake
scripts/cmake/Find.cmake
+1
-1
1 addition, 1 deletion
scripts/cmake/Find.cmake
scripts/cmake/FindMetis.cmake
+2
-0
2 additions, 0 deletions
scripts/cmake/FindMetis.cmake
with
19 additions
and
7 deletions
scripts/cmake/CompilerSetup.cmake
+
16
−
6
View file @
f9f79ccd
...
@@ -3,8 +3,19 @@ INCLUDE(SetDefaultBuildType)
...
@@ -3,8 +3,19 @@ INCLUDE(SetDefaultBuildType)
SET_DEFAULT_BUILD_TYPE
(
Debug
)
SET_DEFAULT_BUILD_TYPE
(
Debug
)
INCLUDE
(
MSVCMultipleProcessCompile
)
# /MP switch (multi processor) for VS
INCLUDE
(
MSVCMultipleProcessCompile
)
# /MP switch (multi processor) for VS
### GNU C/CXX compiler
# Set compiler helper variables
IF
(
CMAKE_CXX_COMPILER MATCHES
".*clang"
)
SET
(
COMPILER_IS_CLANG 1
)
ENDIF
()
IF
(
CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUCC
)
IF
(
CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUCC
)
SET
(
COMPILER_IS_GCC 1
)
ENDIF
()
IF
(
${
CMAKE_C_COMPILER
}
MATCHES
"icc.*$"
OR
${
CMAKE_CXX_COMPILER
}
MATCHES
"icpc.*$"
)
SET
(
COMPILER_IS_INTEL
)
ENDIF
()
### GNU C/CXX compiler
IF
(
COMPILER_IS_GCC
)
get_gcc_version
(
GCC_VERSION
)
get_gcc_version
(
GCC_VERSION
)
IF
(
NOT CMAKE_BUILD_TYPE STREQUAL
"Debug"
)
IF
(
NOT CMAKE_BUILD_TYPE STREQUAL
"Debug"
)
MESSAGE
(
STATUS
"Set GCC release flags"
)
MESSAGE
(
STATUS
"Set GCC release flags"
)
...
@@ -19,17 +30,16 @@ IF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUCC)
...
@@ -19,17 +30,16 @@ IF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUCC)
# -g
# -g
SET
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wno-deprecated -Wall -Wextra -fno-nonansi-builtins"
)
SET
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wno-deprecated -Wall -Wextra -fno-nonansi-builtins"
)
ADD_DEFINITIONS
(
-DGCC
)
ADD_DEFINITIONS
(
-DGCC
)
ENDIF
(
CMAKE_COMPILER_IS_GNUCXX OR CMAKE_
COMPILER_IS_G
NU
CC
)
ENDIF
(
)
#
COMPILER_IS_GCC
### Intel compiler
### Intel compiler
IF
(
${
CMAKE_C_COMPILER
}
MATCHES
"icc.*$"
OR
${
CMAKE_CXX_COMPILER
}
MATCHES
"icpc.*$"
)
IF
(
COMPILER_IS_INTEL
)
IF
(
NOT CMAKE_BUILD_TYPE STREQUAL
"Debug"
)
IF
(
NOT CMAKE_BUILD_TYPE STREQUAL
"Debug"
)
MESSAGE
(
STATUS
"Set Intel release flags"
)
MESSAGE
(
STATUS
"Set Intel release flags"
)
SET
(
CMAKE_CXX_FLAGS
"-O3 -DNDEBUG"
)
SET
(
CMAKE_CXX_FLAGS
"-O3 -DNDEBUG"
)
ENDIF
()
ENDIF
()
SET
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wno-deprecated -Wall"
)
SET
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wno-deprecated -Wall"
)
ENDIF
(
${
CMAKE_C_COMPILER
}
MATCHES
"icc.*$"
OR
${
CMAKE_CXX_COMPILER
}
MATCHES
ENDIF
()
# COMPILER_IS_INTEL
"icpc.*$"
)
# Profiling
# Profiling
IF
(
OGS_PROFILE
)
IF
(
OGS_PROFILE
)
...
@@ -38,7 +48,7 @@ IF (OGS_PROFILE)
...
@@ -38,7 +48,7 @@ IF (OGS_PROFILE)
ENDIF
()
ENDIF
()
SET
(
PROFILE_FLAGS
"-pg -fno-omit-frame-pointer -O2 -DNDEBUG"
)
SET
(
PROFILE_FLAGS
"-pg -fno-omit-frame-pointer -O2 -DNDEBUG"
)
# clang compiler does not know the following flags
# clang compiler does not know the following flags
IF
(
CMAKE_CXX_COMPILER MATCHES
"!clang"
)
IF
(
NOT COMPILER_IS_CLANG
)
SET
(
PROFILE_FLAGS
"
${
PROFILE_FLAGS
}
-fno-inline-functions-called-once -fno-optimize-sibling-calls"
)
SET
(
PROFILE_FLAGS
"
${
PROFILE_FLAGS
}
-fno-inline-functions-called-once -fno-optimize-sibling-calls"
)
ENDIF
()
ENDIF
()
SET
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
${
PROFILE_FLAGS
}
"
)
SET
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
${
PROFILE_FLAGS
}
"
)
...
...
This diff is collapsed.
Click to expand it.
scripts/cmake/Find.cmake
+
1
−
1
View file @
f9f79ccd
...
@@ -18,7 +18,7 @@ FIND_PACKAGE(cppcheck)
...
@@ -18,7 +18,7 @@ FIND_PACKAGE(cppcheck)
######################
######################
# Clang does not have OpenMP support atm, see https://github.com/ufz/ogs/issues/8
# Clang does not have OpenMP support atm, see https://github.com/ufz/ogs/issues/8
IF
(
CMAKE_CXX_COMPILER MATCHES
"!clang"
)
IF
(
NOT COMPILER_IS_CLANG
)
FIND_PACKAGE
(
OpenMP
)
FIND_PACKAGE
(
OpenMP
)
ENDIF
()
# !clang
ENDIF
()
# !clang
IF
(
OPENMP_FOUND
)
IF
(
OPENMP_FOUND
)
...
...
This diff is collapsed.
Click to expand it.
scripts/cmake/FindMetis.cmake
+
2
−
0
View file @
f9f79ccd
...
@@ -23,5 +23,7 @@ FIND_LIBRARY(METIS_LIBRARY metis
...
@@ -23,5 +23,7 @@ FIND_LIBRARY(METIS_LIBRARY metis
${
CMAKE_SOURCE_DIR
}
/../libs/lib
${
CMAKE_SOURCE_DIR
}
/../libs/lib
)
)
SET
(
METIS_LIBRARIES
${
METIS_LIBRARY
}
)
INCLUDE
(
FindPackageHandleStandardArgs
)
INCLUDE
(
FindPackageHandleStandardArgs
)
FIND_PACKAGE_HANDLE_STANDARD_ARGS
(
Metis DEFAULT_MSG METIS_LIBRARY METIS_INCLUDE_DIR
)
FIND_PACKAGE_HANDLE_STANDARD_ARGS
(
Metis DEFAULT_MSG METIS_LIBRARY METIS_INCLUDE_DIR
)
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