Skip to content

Commit 205c592

Browse files
committed
First CMake support : just test build of skv_server + minor libs
1 parent f9f921f commit 205c592

File tree

4 files changed

+241
-0
lines changed

4 files changed

+241
-0
lines changed

BGVIZ-MVAPICH.cmake

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
set( LOG4CXX_LIBRARIES /gpfs/bbp.cscs.ch/home/biddisco/bgas/apps/log4cxx/lib/liblog4cxx.so;/gpfs/bbp.cscs.ch/home/biddisco/bgas/apps/apr-1.4.8/lib/libapr-1.so;/gpfs/bbp.cscs.ch/home/biddisco/bgas/apps/apr-util-1.5.3/lib/libaprutil-1.so;/usr/lib64/libxml2.so.2 CACHE STRING "" FORCE)
2+
3+
4+
#------------------------------------------------------------------------------
5+
# Setup MPI variables for BGAS compilation using XL
6+
# Set BGAS 1 before including this file
7+
#------------------------------------------------------------------------------
8+
#if(BGAS)
9+
10+
set(SLURM_LIBRARY_PATH /bgsys/bgas/opt/slurm/2.5.7/lib)
11+
12+
set(CMAKE_CXX_COMPILER_FLAGS -mno-qpx)
13+
14+
#
15+
# Manually setup mpich variables
16+
#
17+
set( MPICH_ROOT /usr/lib64/mvapich2)
18+
set( MPICH_INCLUDE_ROOT /usr/include/mvapich2-ppc64)
19+
set( MPICH_LIB_PATH /usr/lib64/mvapich2/lib)
20+
set( MPI_FOUND 1)
21+
set( MPI_INCLUDE_PATH ${MPICH_INCLUDE_ROOT} CACHE STRING "" FORCE)
22+
set( MPI_C_INCLUDE_PATH ${MPICH_INCLUDE_ROOT} CACHE STRING "" FORCE)
23+
set( MPI_CXX_INCLUDE_PATH ${MPICH_INCLUDE_ROOT} CACHE STRING "" FORCE)
24+
25+
# * * * * * * * * * * * * *
26+
# Warning : on BGAS, order of libs is very important, we must link
27+
# slurm;pmi;mpich ....
28+
# * * * * * * * * * * * * *
29+
30+
set(MPI_EXTRA_LIBRARY ${MPICH_LIB_PATH}/libmpich.so;/usr/lib64/libibverbs.so;${MPICH_LIB_PATH}/libopa.so;${MPICH_LIB_PATH}/libmpl.so;rt;pthread CACHE STRING "" FORCE)
31+
# set(MPI_EXTRA_LIBRARY ${MPICH_LIB_PATH}/libmpich.a;/usr/lib64/libibverbs.so;${MPICH_LIB_PATH}/libopa.a;${MPICH_LIB_PATH}/libmpl.a;rt;pthread CACHE STRING "" FORCE)
32+
#
33+
# Newer cmake FindMPI uses per language settings
34+
#
35+
set(MPI_C_LIBRARIES ${MPI_EXTRA_LIBRARY} CACHE STRING "" FORCE)
36+
set(MPI_CXX_LIBRARIES ${MPI_EXTRA_LIBRARY} CACHE STRING "" FORCE)
37+
set(MPI_LIBRARY ${MPI_EXTRA_LIBRARY} CACHE STRING "" FORCE )
38+
39+
set(ppcflr /bgsys/drivers/V1R2M1/ppc64)
40+
41+
#################################################################
42+
# Declare link directories for MPI/PAMI/SPI
43+
#################################################################
44+
set(MPI_LINK_DIRS
45+
/bgsys/bgas/opt/slurm/2.5.7/lib
46+
${MPICH_LIB_PATH}
47+
)
48+
49+
set(MPI_C_COMPILER /gpfs/bbp.cscs.ch/home/biddisco/bgas/apps/clang/bin/bgclang CACHE STRING "" FORCE)
50+
set(MPI_CXX_COMPILER /gpfs/bbp.cscs.ch/home/biddisco/bgas/apps/clang/bin/bgclang++11 CACHE STRING "" FORCE)
51+
52+
# don't need to call this, but do it anyway just to be sure everything is initialized
53+
# find_package(MPI REQUIRED)
54+
#endif()

CMake/FindOFED.cmake

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright (c) 2011-2012 Stefan Eilemann <[email protected]>
2+
3+
find_path(_ofed_INCLUDE_DIR rdma/rdma_verbs.h
4+
HINTS ${OFED_ROOT}/include
5+
PATHS /usr/include /usr/local/include /opt/local/include)
6+
find_library(_rdma_LIBRARY NAMES rdmacm
7+
HINTS ${OFED_ROOT}/lib
8+
PATHS /usr/lib /usr/local/lib /opt/local/lib)
9+
find_library(_ibverbs_LIBRARY NAMES ibverbs
10+
HINTS ${OFED_ROOT}/lib
11+
PATHS /usr/lib /usr/local/lib /opt/local/lib)
12+
13+
include(FindPackageHandleStandardArgs)
14+
find_package_handle_standard_args(OFED DEFAULT_MSG
15+
_ofed_INCLUDE_DIR _rdma_LIBRARY _ibverbs_LIBRARY)
16+
17+
set(OFED_INCLUDE_DIRS ${_ofed_INCLUDE_DIR})
18+
set(OFED_LIBRARIES ${_rdma_LIBRARY})
19+
list(APPEND OFED_LIBRARIES ${_ibverbs_LIBRARY})
20+
21+
if(OFED_FOUND AND NOT OFED_FIND_QUIETLY)
22+
message(STATUS "Found OFED in ${OFED_INCLUDE_DIRS};${OFED_LIBRARIES}")
23+
endif()

CMake/jb.txt

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#
2+
# clang
3+
#
4+
export CLANG_ROOT=/gpfs/bbp.cscs.ch/home/biddisco/apps/clang/bgclang/current
5+
export CC=$CLANG_ROOT/bin/clang
6+
export CXX=$CLANG_ROOT/bin/clang++
7+
export PATH=$CLANG_ROOT/bin:$PATH
8+
export LDFLAGS="-dynamic"
9+
export CFLAGS="-mcpu=a2 -std=c99"
10+
11+
export GCC_TOOOLCHAIN=/gpfs/bbp.cscs.ch/home/biddisco/clang/V1R2M1_base_4.7.2/gnu-linux-4.7.2/powerpc64-bgq-linux/include/c++/4.7.2
12+
export GCC_TOOLCHAIN_INCLUDE=$GCC_TOOOLCHAIN/powerpc64-bgq-linux
13+
export CLANG_LIBCPP=$CLANG_ROOT/libc++/lib
14+
export SYS_LIBSTDCPP=/gpfs/bbp.cscs.ch/home/biddisco/clang/V1R2M1_base_4.7.2/gnu-linux-4.7.2/powerpc64-bgq-linux/lib/
15+
16+
export CPPFLAGS="-mcpu=a2 --std=c++11 -stdlib=libc++ -I$GCC_TOOOLCHAIN -I$GCC_TOOLCHAIN_INCLUDE -L$CLANG_LIBCPP -L$SYS_LIBSTDCPP -L/bgsys/drivers/ppcfloor/gnu-linux-4.7.2/powerpc64-bgq-linux/lib -lstdc++"
17+
export CXXFLAGS=$CPPFLAGS
18+
export LD_LIBRARY_PATH=$CLANG_ROOT/libc++/lib:$SYS_LIBSTDCPP:$LD_LIBRARY_PATH

CMakeLists.txt

+146
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
project(SKV)
2+
3+
#------------------------------------------------------------------------------
4+
# OFED verbs libraries
5+
#------------------------------------------------------------------------------
6+
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMake)
7+
find_package(OFED)
8+
9+
set(FXLOGGER_SRCS
10+
./FxLogger/FxLogger.cpp
11+
./FxLogger/Trace.cpp
12+
./FxLogger/dlmalloc.c
13+
)
14+
15+
set(it_api_SRCS
16+
./it_api/make.conf.in
17+
./it_api/make.conf_dev
18+
./it_api/make.conf_rpm
19+
./it_api/src/it_api_o_verbs.cpp
20+
./it_api/src/it_api_o_verbs_thread.cpp
21+
)
22+
23+
set(C_SRCS
24+
./lib/src/skv.cpp
25+
)
26+
27+
# ./make.conf.in
28+
# ./make.conf_dev
29+
# ./make.conf_rpm
30+
31+
set(CLIENT_SRCS
32+
./src/client/skv_client.cpp
33+
./src/client/skv_client_2_server_active_bcast.cpp
34+
./src/client/skv_client_bulk_inserter.cpp
35+
./src/client/skv_client_command_manager_if.cpp
36+
./src/client/skv_client_conn_manager_if.cpp
37+
./src/client/skv_client_cursor.cpp
38+
./src/client/skv_client_internal.cpp
39+
)
40+
41+
set(COMMON_SRCS
42+
./src/common/skv_config.cpp
43+
./src/common/skv_distribution_manager.cpp
44+
./src/common/skv_utils.cpp
45+
)
46+
47+
set(SERVER_SRCS
48+
./src/server/skv_local_kv_asyncmem.cpp
49+
./src/server/skv_local_kv_inmem.cpp
50+
./src/server/skv_local_kv_rocksdb.cpp
51+
./src/server/skv_server.cpp
52+
./src/server/skv_server_IT_event_source.cpp
53+
./src/server/skv_server_command_event_source.cpp
54+
./src/server/skv_server_local_kv_event_source.cpp
55+
./src/server/skv_server_main.cpp
56+
./src/server/skv_server_network_event_manager.cpp
57+
./src/server/skv_server_tree_based_container.cpp
58+
./src/server/skv_server_uber_pds.cpp
59+
./system/bgq/etc/skv_server.conf
60+
)
61+
62+
set(TEST_SRCS
63+
./test/skv_base_test.cpp
64+
./test/skv_test_bulk.cpp
65+
./test/skv_test_clib.c
66+
./test/skv_test_insert_retrieve_async.cpp
67+
./test/skv_test_insert_retrieve_sync.cpp
68+
./test/test_skv_insert_command.cpp
69+
./test/test_skv_remove_command.cpp
70+
./unittest/test_skv_rdma_data_buffer.cpp
71+
./unittest/test_skv_ringbuffer_ptr.cpp
72+
)
73+
74+
#############################################
75+
# Define the local KV backend to use
76+
# inmem - in-memory version of local kv
77+
# asyncmem - async in-memory version for testing
78+
# rocksdb - rocksdb backend (tbd)
79+
set(SKV_LOCAL_KV_BACKEND inmem)
80+
81+
include(${CMAKE_CURRENT_SOURCE_DIR}/BGVIZ-MVAPICH.cmake)
82+
83+
include_directories(
84+
include
85+
it_api/include
86+
lib/include
87+
FxLogger
88+
FxLogger/Pk
89+
profiler
90+
${MPI_INCLUDE_PATH}
91+
)
92+
93+
#SKV_GLOBAL_LDFLAGS=${SKV_CONFIG} ${SKV_CCFLAGS} ${FXLOGGER_DIR}/libPkLinux.a
94+
#${SKV_TOP}/build/libit_api_o_verbs.a -L${MPI_DIR}/lib ${LOCAL_KV_LIB_OPTS}
95+
#${SKV_GLOBAL_LDFLAGS_EXTENSION} -lrt
96+
97+
add_Definitions(
98+
# default config file
99+
-DDEFAULT_CONFIG_FILE=\\"${CMAKE_CURRENT_SOURCE_DIR}/.skv_server.conf\\"
100+
# use PK_LINUX to pull in several important includes and macros
101+
-DPK_LINUX
102+
# use MSPACES from dlmalloc.h
103+
-DONLY_MSPACES
104+
# enable logging in general
105+
-DPKFXLOG
106+
# enable command header checksum
107+
-DSKV_HEADER_CHECKSUM
108+
# enable workaround for missing RoQ loopback functionality
109+
-DSKV_ROQ_LOOPBACK_WORKAROUND
110+
# set the local kv backend for SKV
111+
-DSKV_SERVER_LOCAL_KV=skv_local_kv_${SKV_LOCAL_KV_BACKEND}
112+
# logging in tests
113+
-DDO_CHECK
114+
115+
# IT_API_CONFIG+=-DPK_LINUX
116+
117+
# use event-based CQ reaping, if undefined it uses polling
118+
-DDIT_API_USE_EVENT_CQ
119+
120+
# ifdef SKV_FOR_NONBGQ
121+
-DIT_API_COMM_DEVICE=\\"lo\\"
122+
123+
# enable SIW workaround for ... and set the device name to use for
124+
# communication
125+
-DIT_API_USE_SIW_HACK
126+
)
127+
128+
add_library(fxlogger ${FXLOGGER_SRCS})
129+
130+
add_library(it_api ${it_api_SRCS})
131+
132+
add_library(skv_common ${COMMON_SRCS})
133+
134+
target_link_libraries(skv_common pthread)
135+
136+
add_executable(skv_server
137+
${SERVER_SRCS}
138+
)
139+
140+
target_link_libraries(skv_server
141+
skv_common
142+
it_api
143+
fxlogger
144+
${OFED_LIBRARIES}
145+
${MPI_LIBRARY}
146+
)

0 commit comments

Comments
 (0)