Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ADIOS2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue 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
Podhorszki, Norbert
ADIOS2
Commits
159e16f7
Commit
159e16f7
authored
7 years ago
by
Atkins, Charles Vernon
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #218 from chuckatkins/fix-shared-libs-default
Fix shared libs default
parents
95ac9f6d
d3364d6e
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
CMakeLists.txt
+31
-19
31 additions, 19 deletions
CMakeLists.txt
bindings/python/CMakeLists.txt
+0
-4
0 additions, 4 deletions
bindings/python/CMakeLists.txt
cmake/DetectOptions.cmake
+1
-1
1 addition, 1 deletion
cmake/DetectOptions.cmake
with
32 additions
and
24 deletions
CMakeLists.txt
+
31
−
19
View file @
159e16f7
...
...
@@ -55,31 +55,40 @@ set(CMAKE_CXX_STANDARD_REQUIRED True)
include
(
CMakeDependentOption
)
# Setup shared library / -fPIC stuff
# Setup shared library defaults. If explicitly specified somehow, then default
# to that. Otherwise base the default on whether or not shared libs are even
# supported.
get_property
(
SHARED_LIBS_SUPPORTED GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS
)
if
(
DEFINED BUILD_SHARED_LIBS
)
set
(
ADIOS2_BUILD_SHARED_LIBS_DEFAULT
${
BUILD_SHARED_LIBS
}
)
elseif
(
DEFINED ADIOS2_BUILD_SHARED_LIBS
)
if
(
DEFINED ADIOS2_BUILD_SHARED_LIBS
)
set
(
ADIOS2_BUILD_SHARED_LIBS_DEFAULT
${
ADIOS2_BUILD_SHARED_LIBS
}
)
elseif
(
DEFINED BUILD_SHARED_LIBS
)
set
(
ADIOS2_BUILD_SHARED_LIBS_DEFAULT
${
BUILD_SHARED_LIBS
}
)
else
()
set
(
ADIOS2_BUILD_SHARED_LIBS_DEFAULT
${
SHARED_LIBS_SUPPORTED
}
)
endif
()
unset
(
BUILD_SHARED_LIBS
)
option
(
ADIOS2_BUILD_SHARED_LIBS
"Build shared libraries (so/dylib/dll)."
${
ADIOS2_BUILD_SHARED_LIBS
}
)
cmake_dependent_option
(
ADIOS2_BUILD_SHARED_LIBS
"Build shared libraries (so/dylib/dll)."
${
ADIOS2_BUILD_SHARED_LIBS_DEFAULT
}
"SHARED_LIBS_SUPPORTED"
OFF
)
set
(
BUILD_SHARED_LIBS
${
ADIOS2_BUILD_SHARED_LIBS
}
)
if
(
NOT SHARED_LIBS_SUPPORTED
)
if
(
BUILD_SHARED_LIBS
)
message
(
WARNING
"A shared library build was requested but is not supported on this platform / compiler. Unexpected build results will likely occur"
)
endif
()
set
(
BUILD_SHARED_LIBS OFF
)
mark_as_advanced
(
BUILD_SHARED_LIBS
)
# Setup PIC defaults. If explicitly specified somehow, then default
# to that. Otherwise base the default on whether or not shared libs are even
# supported.
if
(
DEFINED ADIOS2_ENABLE_PIC
)
set
(
ADIOS2_ENABLE_PIC_DEFAULT
${
ADIOS2_ENABLE_PIC
}
)
elseif
(
DEFINED CMAKE_POSITION_INDEPENDENT_CODE
)
set
(
ADIOS2_ENABLE_PIC_DEFAULT
${
CMAKE_POSITION_INDEPENDENT_CODE
}
)
else
()
set
(
ADIOS2_ENABLE_PIC_DEFAULT
${
SHARED_LIBS_SUPPORTED
}
)
endif
()
cmake_dependent_option
(
ADIOS2_ENABLE_PIC
"Build with Position Independent Code"
ON
"SHARED_LIBS_SUPPORTED"
OFF
)
if
(
ADIOS2_ENABLE_PIC
)
set
(
CMAKE_POSITION_INDEPENDENT_CODE
ON
)
endif
(
)
"Build with Position Independent Code"
${
ADIOS2_ENABLE_PIC_DEFAULT
}
"SHARED_LIBS_SUPPORTED"
OFF
)
set
(
CMAKE_POSITION_INDEPENDENT_CODE
${
ADIOS2_ENABLE_PIC
}
)
mark_as_advanced
(
CMAKE_POSITION_INDEPENDENT_CODE
)
adios_option
(
BZip2
"Enable support for BZip2 transforms"
AUTO
)
adios_option
(
ZFP
"Enable support for ZFP transforms"
AUTO
)
...
...
@@ -162,10 +171,13 @@ message("")
message
(
" Installation prefix:
${
CMAKE_INSTALL_PREFIX
}
"
)
message
(
" Features:"
)
if
(
BUILD_SHARED_LIBS
)
message
(
" Library Type: shared"
)
set
(
msg_lib_type
"shared"
)
elseif
(
CMAKE_POSITION_INDEPENDENT_CODE
)
set
(
msg_lib_type
"static (with PIC)"
)
else
()
message
(
" Library T
ype
:
static"
)
set
(
msg_lib_t
ype
"
static
(without PIC)
"
)
endif
()
message
(
" Library Type:
${
msg_lib_type
}
"
)
message
(
" Build Type:
${
CMAKE_BUILD_TYPE
}
"
)
message
(
" Testing:
${
BUILD_TESTING
}
"
)
message
(
" Build Options:"
)
...
...
This diff is collapsed.
Click to expand it.
bindings/python/CMakeLists.txt
+
0
−
4
View file @
159e16f7
if
(
NOT BUILD_SHARED_LIBS
)
message
(
ERROR
"Python bindings are only supported for shared libraries"
)
endif
()
set
(
Python_ADDITIONAL_VERSIONS 3 2.7
)
find_package
(
PythonInterp REQUIRED
)
find_package
(
PythonLibsNew REQUIRED
)
...
...
This diff is collapsed.
Click to expand it.
cmake/DetectOptions.cmake
+
1
−
1
View file @
159e16f7
...
...
@@ -94,7 +94,7 @@ list(INSERT CMAKE_MODULE_PATH 0
"
${
ADIOS2_SOURCE_DIR
}
/thirdparty/pybind11/pybind11/tools"
)
if
(
ADIOS2_USE_Python STREQUAL AUTO
)
if
(
BUILD_
SHARED_LIBS
)
if
(
SHARED_LIBS
_SUPPORTED AND ADIOS2_ENABLE_PIC
)
set
(
Python_ADDITIONAL_VERSIONS 3 2.7
)
find_package
(
PythonInterp
)
find_package
(
PythonLibsNew
)
...
...
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