add the install target and clean the cmakelist.txt
This commit is contained in:
Родитель
569dcc91fb
Коммит
383ff9f9e8
|
@ -6,28 +6,22 @@ OPTION(USE_HDFS "won't use hdfs on default, set ON to enable" OFF)
|
|||
OPTION(TEST "Build all tests." ON)
|
||||
|
||||
find_package(MPI REQUIRED)
|
||||
if(UNIX)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11")
|
||||
endif()
|
||||
|
||||
if(USE_HDFS)
|
||||
ADD_DEFINITIONS(-DMULTIVERSO_USE_HDFS)
|
||||
SET(JVM_LIB /usr/local/java/default/jre/lib/amd64/server)
|
||||
SET(HDFS_LIB /usr/local/hadoop/lib/native)
|
||||
endif(USE_HDFS)
|
||||
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11")
|
||||
# [TODO] change the THIRD_PARTY to an option
|
||||
SET(THIRD_PARTY /usr/local)
|
||||
#SET(THIRD_PARTY ${PROJECT_SOURCE_DIR}/third_party)
|
||||
SET(THIRD_PARTY_INC ${THIRD_PARTY}/include)
|
||||
SET(THIRD_PARTY_LIB ${THIRD_PARTY}/lib)
|
||||
SET(MULTIVERSO_HEADER_DIR ${PROJECT_SOURCE_DIR}/include)
|
||||
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
|
||||
SET(MULTIVERSO_LIBRARY_DIR ${PROJECT_BINARY_DIR}/lib)
|
||||
SET(TEST_INC ${PROJECT_SOURCE_DIR}/Test)
|
||||
|
||||
Message(MPI_CXX_COMPILER)
|
||||
if(USE_HDFS)
|
||||
ADD_DEFINITIONS(-DMULTIVERSO_USE_HDFS)
|
||||
# TODO: I think these paths should not be hard coded
|
||||
SET(JVM_LIB /usr/local/java/default/jre/lib/amd64/server)
|
||||
SET(HDFS_LIB /usr/local/hadoop/lib/native)
|
||||
LINK_DIRECTORIES(${HDFS_LIB})
|
||||
LINK_DIRECTORIES(${JVM_LIB})
|
||||
endif(USE_HDFS)
|
||||
|
||||
include_directories(${PROJECT_SOURCE_DIR}/include)
|
||||
|
||||
ADD_SUBDIRECTORY(src)
|
||||
ADD_SUBDIRECTORY(Test)
|
||||
|
||||
# TODO: more header files should be installed. Only c_api.h is installed so far
|
||||
install (FILES ${PROJECT_SOURCE_DIR}/include/multiverso/c_api.h DESTINATION include/multiverso)
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
INCLUDE_DIRECTORIES(${HEADER_DIR})
|
||||
INCLUDE_DIRECTORIES(${MULTIVERSO_HEADER_DIR})
|
||||
MESSAGE(${TEST_INC})
|
||||
INCLUDE_DIRECTORIES(${TEST_INC})
|
||||
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/Test)
|
||||
|
||||
SET(MULTIVERSO_TEST_SRC main.cpp test_filter.cpp test_async_buffer.cpp)
|
||||
|
||||
|
@ -10,10 +7,6 @@ SET(CMAKE_CXX_COMPILER mpicxx)
|
|||
LINK_DIRECTORIES(${LIBRARY_OUTPUT_PATH})
|
||||
LINK_DIRECTORIES(${GTEST_LIBRARIES})
|
||||
|
||||
if(USE_HDFS)
|
||||
link_directories(${HDFS_LIB})
|
||||
LINK_DIRECTORIES(${JVM_LIB})
|
||||
endif()
|
||||
|
||||
MESSAGE(${MPI_LIBRARIES})
|
||||
MESSAGE(${MPI_CXX_LIBRARIES})
|
||||
|
|
|
@ -1,25 +1,10 @@
|
|||
include_directories(${MULTIVERSO_HEADER_DIR})
|
||||
include_directories(${THIRD_PARTY_INC})
|
||||
include_directories(${MPI_CXX_INCLUDE_PATH})
|
||||
|
||||
ADD_DEFINITIONS(-DMULTIVERSO_USE_MPI)
|
||||
|
||||
set(LIBRARY_PATH $ENV{CMAKE_LIBRARY_PATH})
|
||||
|
||||
set(MULTIVERSO_SRC actor.cpp communicator.cpp controller.cpp dashboard.cpp multiverso.cpp net.cpp node.cpp server.cpp table.cpp table/array_table.cpp table/matrix_table.cpp table/sparse_matrix_table.cpp timer.cpp updater/updater.cpp util/configure.cpp io/hdfs_stream.cpp io/io.cpp io/local_stream.cpp util/log.cpp util/net_util.cpp util/quantization_util.cpp worker.cpp zoo.cpp c_api.cpp util/allocator.cpp table_factory.cpp blob.cpp)
|
||||
|
||||
link_directories(${THIRD_PARTY_LIB} ${LIBRARY_PATH})
|
||||
|
||||
if(USE_HDFS)
|
||||
link_directories(${HDFS_LIB})
|
||||
LINK_DIRECTORIES(${JVM_LIB})
|
||||
endif(USE_HDFS)
|
||||
|
||||
#target_link_libraries(multiverso ${MPI_CXX_LIBARIES})
|
||||
#target_link_libraries(mpi)
|
||||
|
||||
add_library(multiverso SHARED ${MULTIVERSO_SRC})
|
||||
|
||||
#set_property(TARGET multiverso PROPERTY CXX_STANDARD 11)
|
||||
|
||||
target_link_libraries(multiverso ${MPI_LIBRARY})
|
||||
|
||||
install (TARGETS multiverso DESTINATION lib)
|
||||
|
|
Загрузка…
Ссылка в новой задаче