Skip to content

Commit

Permalink
Cmake, chunk server, and S3 IO library: remove IO method based on libs3.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeov committed Oct 10, 2015
1 parent 96d71ec commit 1ea3aab
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 107 deletions.
90 changes: 1 addition & 89 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -379,82 +379,6 @@ IF (NOT USE_FIND_FUSE_CMAKE_MODULE AND NOT QFS_OMIT_FUSE AND NOT FUSE_FOUND)
ENDIF (FUSE_FOUND)
ENDIF (NOT USE_FIND_FUSE_CMAKE_MODULE AND NOT QFS_OMIT_FUSE AND NOT FUSE_FOUND)

# For now try to find libs3 build artifacts in ../libs3/libs3 directory,
# assuming that the following successfully completed in ../libs3 directory:
# make DESTDIR=libs3 install
#
IF (NOT DEFINED LIBS3_GIT_DIR)
SET(LIBS3_GIT_DIR ${KFS_DIR_PREFIX}../)
ENDIF (NOT DEFINED LIBS3_GIT_DIR)
IF (NOT DEFINED LIBS3_LIBRARY_DIR)
SET(LIBS3_LIBRARY_DIR ${LIBS3_GIT_DIR}libs3/libs3/lib)
ENDIF (NOT DEFINED LIBS3_LIBRARY_DIR)
IF (NOT DEFINED LIBS3_INCLUDE_DIR)
SET(LIBS3_INCLUDE_DIR ${LIBS3_GIT_DIR}libs3/libs3/include)
ENDIF (NOT DEFINED LIBS3_INCLUDE_DIR)

find_library(LIBS3_LIBRARIES
NAMES ${CMAKE_SHARED_LIBRARY_PREFIX}s3${CMAKE_SHARED_LIBRARY_SUFFIX}
PATHS ${LIBS3_LIBRARY_DIR}
)
IF (LIBS3_LIBRARIES)
find_path(LIBS3_INCLUDE_DIR
libs3.h
PATHS ${LIBS3_INCLUDE_DIR}
)
IF (NOT LIBS3_INCLUDE_DIR)
message (STATUS "S3 include directory not found")
SET(LIBS3_LIBRARIES FALSE)
ELSE (NOT LIBS3_INCLUDE_DIR)
find_package(CURL)
IF (NOT CURL_FOUND)
message (STATUS "S3 library requires cURL library")
SET(LIBS3_LIBRARIES FALSE)
ELSE (NOT CURL_FOUND)
find_library(LIBXML2_LIBRARIES
NAMES ${CMAKE_SHARED_LIBRARY_PREFIX}xml2${CMAKE_SHARED_LIBRARY_SUFFIX}
)
IF (NOT LIBXML2_LIBRARIES)
message (STATUS "S3 library requires xml2 library")
SET(LIBS3_LIBRARIES FALSE)
ENDIF (NOT LIBXML2_LIBRARIES)
ENDIF (NOT CURL_FOUND)
ENDIF (NOT LIBS3_INCLUDE_DIR)
IF (LIBS3_LIBRARIES)
INCLUDE(CheckFunctionExists)
SET(CMAKE_REQUIRED_INCLUDES ${LIBS3_INCLUDE_DIR})
SET(CMAKE_REQUIRED_LIBRARIES
${CURL_LIBRARIES}
${XML2_LIBRARIES}
${LIBS3_LIBRARIES}
)
CHECK_FUNCTION_EXISTS(S3_initializeEx S3_HAS_S3_initializeEx)
IF (S3_HAS_S3_initializeEx)
CHECK_FUNCTION_EXISTS(S3_finish_request_context
S3_HAS_S3_finish_request_context)
IF (S3_HAS_S3_finish_request_context)
CHECK_FUNCTION_EXISTS(S3_get_curl_request_context
S3_HAS_S3_get_curl_request_context)
IF (S3_HAS_S3_get_curl_request_context)
SET(S3_HAS_ALL_REQUIRED_FUNCTIONS TRUE)
ENDIF (S3_HAS_S3_get_curl_request_context)
ENDIF (S3_HAS_S3_finish_request_context)
ENDIF (S3_HAS_S3_initializeEx)
IF (NOT S3_HAS_ALL_REQUIRED_FUNCTIONS)
SET(LIBS3_LIBRARIES FALSE)
ENDIF (NOT S3_HAS_ALL_REQUIRED_FUNCTIONS)
ENDIF (LIBS3_LIBRARIES)
ELSE (LIBS3_LIBRARIES)
message (STATUS "S3 library"
" ${CMAKE_SHARED_LIBRARY_PREFIX}s3${CMAKE_SHARED_LIBRARY_SUFFIX}"
" not found in ${LIBS3_LIBRARY_DIR}")
message (STATUS "To build S3 library:")
message (STATUS "(cd ${LIBS3_GIT_DIR} && "
"git clone https://github.com/mikeov/libs3.git && "
"make DESTDIR=libs3 install)"
)
ENDIF (LIBS3_LIBRARIES)

# include dirs
include_directories(
${Boost_INCLUDE_DIRS}
Expand All @@ -463,15 +387,6 @@ include_directories(
${KFS_DIR_PREFIX}src/cc
)

IF (LIBS3_LIBRARIES)
message (STATUS "Using S3 includes: ${LIBS3_INCLUDE_DIR}")
message (STATUS "Using S3 libraries: ${LIBS3_LIBRARIES}")
include_directories(${CURL_INCLUDE_DIRS} ${LIBS3_INCLUDE_DIR})
add_definitions(-D KFS_IO_METHOD_NAME_S3IO=S3IO)
ELSE (LIBS3_LIBRARIES)
message (STATUS "Not building S3 support")
ENDIF (LIBS3_LIBRARIES)

IF (JNI_FOUND)
message(STATUS "JNI found: building qfs_access")
include_directories ( ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2} )
Expand Down Expand Up @@ -506,14 +421,11 @@ add_subdirectory (${KFS_DIR_PREFIX}src/cc/qcdio src/cc/qcdio)
add_subdirectory (${KFS_DIR_PREFIX}src/cc/qcrs src/cc/qcrs)
add_subdirectory (${KFS_DIR_PREFIX}src/cc/krb src/cc/krb)
add_subdirectory (${KFS_DIR_PREFIX}src/cc/qfsc src/cc/qfsc)
add_subdirectory (${KFS_DIR_PREFIX}src/cc/s3io src/cc/s3io)

add_subdirectory (${KFS_DIR_PREFIX}examples/cc examples/cc)
add_subdirectory (${KFS_DIR_PREFIX}benchmarks/mstress benchmarks/mstress)

IF (LIBS3_LIBRARIES)
add_subdirectory (${KFS_DIR_PREFIX}src/cc/s3io src/cc/s3io)
ENDIF (LIBS3_LIBRARIES)

IF (NOT QFS_OMIT_FUSE AND FUSE_FOUND)
add_subdirectory (${KFS_DIR_PREFIX}src/cc/fuse src/cc/fuse)
ENDIF (NOT QFS_OMIT_FUSE AND FUSE_FOUND)
Expand Down
12 changes: 5 additions & 7 deletions src/cc/chunk/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,11 @@ foreach (exe_file ${exe_files})
endif (USE_STATIC_LIB_LINKAGE)
endforeach (exe_file)

if (LIBS3_LIBRARIES)
if (USE_STATIC_LIB_LINKAGE)
target_link_libraries(chunkserver qfss3io)
else (USE_STATIC_LIB_LINKAGE)
target_link_libraries(chunkserver qfss3io-shared)
endif (USE_STATIC_LIB_LINKAGE)
endif (LIBS3_LIBRARIES)
if (USE_STATIC_LIB_LINKAGE)
target_link_libraries(chunkserver qfss3io)
else (USE_STATIC_LIB_LINKAGE)
target_link_libraries(chunkserver qfss3io-shared)
endif (USE_STATIC_LIB_LINKAGE)

if (CMAKE_SYSTEM_NAME STREQUAL "SunOS")
target_link_libraries(chunkserver umem)
Expand Down
4 changes: 0 additions & 4 deletions src/cc/chunk/IOMethod.cc
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,6 @@ IOMethod::Create(

__KFS_DECLARE_EXTERN_IO_METHOD(KFS_IO_METHOD_NAME_S3ION);

#ifdef KFS_IO_METHOD_NAME_S3IO
__KFS_DECLARE_EXTERN_IO_METHOD(KFS_IO_METHOD_NAME_S3IO);
#endif

#undef __KFS_DECLARE_EXTERN_IO_METHOD

} // namespace KFS
7 changes: 0 additions & 7 deletions src/cc/s3io/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#

set (sources
s3io.cc
s3ion.cc
)

Expand All @@ -44,15 +43,9 @@ set_target_properties (qfss3io-shared PROPERTIES CLEAN_DIRECT_OUTPUT 1)

target_link_libraries (qfss3io
kfsIO
${CURL_LIBRARIES}
${XML2_LIBRARIES}
${LIBS3_LIBRARIES}
)
target_link_libraries (qfss3io-shared
kfsIO-shared
${CURL_LIBRARIES}
${XML2_LIBRARIES}
${LIBS3_LIBRARIES}
)

install (TARGETS qfss3io qfss3io-shared
Expand Down

0 comments on commit 1ea3aab

Please sign in to comment.