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
d45f35b7
Commit
d45f35b7
authored
7 years ago
by
Atkins, Charles Vernon
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #78 from chuckatkins/fix-dataman-libsearch
Fix dataman libsearch
parents
bbe96fb1
d6b2e378
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
source/dataman/CMakeLists.txt
+10
-2
10 additions, 2 deletions
source/dataman/CMakeLists.txt
source/dataman/DataManBase.cpp
+51
-8
51 additions, 8 deletions
source/dataman/DataManBase.cpp
with
61 additions
and
10 deletions
source/dataman/CMakeLists.txt
+
10
−
2
View file @
d45f35b7
...
...
@@ -3,18 +3,26 @@
# accompanying file Copyright.txt for details.
#------------------------------------------------------------------------------#
set
(
dataman_targets
)
add_library
(
dataman
DataManBase.h DataManBase.cpp
DataMan.h DataMan.cpp
)
target_include_directories
(
dataman PUBLIC
${
CMAKE_CURRENT_SOURCE_DIR
}
)
target_link_libraries
(
dataman PRIVATE adios2sys
)
list
(
APPEND dataman_targets dataman
)
# Add the dataman plugins as MODULE libraries instead of SHARED libraries.
# MODULE libraries are designed to be plugins, i.e. shared libs that nobody
# else links to.
add_library
(
cacheman
SHARED
CacheMan.h CacheMan.cpp
)
add_library
(
cacheman
MODULE
CacheMan.h CacheMan.cpp
)
target_link_libraries
(
cacheman PRIVATE dataman
)
list
(
APPEND dataman_targets cacheman
)
install
(
TARGETS dataman
cacheman
EXPORT adios2
TARGETS
${
dataman
_targets
}
EXPORT adios2
RUNTIME DESTINATION
${
CMAKE_INSTALL_BINDIR
}
LIBRARY DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
ARCHIVE DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
...
...
This diff is collapsed.
Click to expand it.
source/dataman/DataManBase.cpp
+
51
−
8
View file @
d45f35b7
...
...
@@ -18,19 +18,62 @@ struct DataManBase::ManagerLibrary
{
adios2sys
::
DynamicLoader
::
LibraryHandle
m_LibraryHandle
;
DataManBase
*
(
*
m_getManFunc
)();
ManagerLibrary
(
std
::
string
method
)
{
std
::
stringstream
libNameBuilder
;
libNameBuilder
<<
adios2sys
::
DynamicLoader
::
LibPrefix
()
<<
method
<<
"man"
<<
adios2sys
::
DynamicLoader
::
LibExtension
();
std
::
string
libName
=
libNameBuilder
.
str
();
std
::
vector
<
std
::
string
>
searchedLibs
;
std
::
string
libName
;
std
::
vector
<
std
::
string
>
libPrefixes
;
libPrefixes
.
emplace_back
(
""
);
libPrefixes
.
emplace_back
(
"lib"
);
#ifdef __CYGWIN__
libPrefixes
.
emplace_back
(
"cyg"
);
#endif
std
::
vector
<
std
::
string
>
libSuffixes
;
#ifdef __APPLE__
libSuffixes
.
emplace_back
(
"man.dylib"
);
libSuffixes
.
emplace_back
(
"man.so"
);
#endif
#ifdef __hpux
libSuffixes
.
emplace_back
(
"man.sl"
);
#endif
#ifdef __unix__
libSuffixes
.
emplace_back
(
"man.so"
);
#endif
#ifdef _WIN32
libSuffixes
.
emplace_back
(
"man.dll"
);
#endif
// Bind to the dynamic library
m_LibraryHandle
=
adios2sys
::
DynamicLoader
::
OpenLibrary
(
libName
);
// Test the various combinations of library names
for
(
const
std
::
string
&
prefix
:
libPrefixes
)
{
for
(
const
std
::
string
&
suffix
:
libSuffixes
)
{
libName
=
prefix
+
method
+
suffix
;
m_LibraryHandle
=
adios2sys
::
DynamicLoader
::
OpenLibrary
(
libName
);
searchedLibs
.
push_back
(
libName
);
if
(
m_LibraryHandle
)
{
break
;
}
}
if
(
m_LibraryHandle
)
{
break
;
}
}
if
(
!
m_LibraryHandle
)
{
throw
std
::
runtime_error
(
"Unable to locate the "
+
libName
+
" library."
);
std
::
stringstream
errString
;
errString
<<
"Unable to locate the "
<<
method
<<
" manager "
<<
"library; searched for "
;
std
::
copy
(
searchedLibs
.
begin
(),
searchedLibs
.
end
(),
std
::
ostream_iterator
<
std
::
string
>
(
errString
,
" "
));
throw
std
::
runtime_error
(
errString
.
str
());
}
// Bind to the getMan symbol
...
...
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