Commit 310bcb5f by Ting PAN

Update CMakeLists.txt

1 parent ba81b99b
...@@ -12,7 +12,7 @@ option(WITH_PYTHON "Set ON to use PYTHON" ON) ...@@ -12,7 +12,7 @@ option(WITH_PYTHON "Set ON to use PYTHON" ON)
option(WITH_CUDA "Set ON to use CUDA" ON) option(WITH_CUDA "Set ON to use CUDA" ON)
option(WITH_CUDNN "Set ON to use CUDNN" ON) option(WITH_CUDNN "Set ON to use CUDNN" ON)
option(WITH_BLAS "Set ON to use BLAS" ON) option(WITH_BLAS "Set ON to use BLAS" ON)
option(WITH_OMP "Set ON to use OpenMP" OFF) option(WITH_OMP "Set ON to use OpenMP" ON)
option(WITH_SSE "Set ON to use SSE 4.1" ON) option(WITH_SSE "Set ON to use SSE 4.1" ON)
option(WITH_MPI "Set ON to use MPI" OFF) option(WITH_MPI "Set ON to use MPI" OFF)
option(WITH_MPI_CUDA "Set ON to use MPI-CUDA" OFF) option(WITH_MPI_CUDA "Set ON to use MPI-CUDA" OFF)
...@@ -33,10 +33,11 @@ set(3RDPARTY_DIR ${PROJECT_SOURCE_DIR}/../3rdparty) ...@@ -33,10 +33,11 @@ set(3RDPARTY_DIR ${PROJECT_SOURCE_DIR}/../3rdparty)
set(CUDA_ARCH -gencode arch=compute_30,code=sm_30 set(CUDA_ARCH -gencode arch=compute_30,code=sm_30
-gencode arch=compute_35,code=sm_35 -gencode arch=compute_35,code=sm_35
-gencode arch=compute_50,code=sm_50 -gencode arch=compute_50,code=sm_50
-gencode arch=compute_60,code=sm_60) -gencode arch=compute_60,code=sm_60
-gencode arch=compute_70,code=sm_70)
# Set CUDNN Libs if necessary (Linux Only) # Set CUDNN Library Dir if necessary (Linux Only)
set(CUDNN_LIBRARIES /usr/local/cuda/lib64) set(CUDNN_LIBRARY_DIR /usr/local/cuda/lib64)
# ---------------- User Config ---------------- # ---------------- User Config ----------------
...@@ -99,8 +100,9 @@ endif() ...@@ -99,8 +100,9 @@ endif()
# ---[ libs # ---[ libs
set(3RDPARTY_LIBS ${3RDPARTY_DIR}/lib) set(3RDPARTY_LIBS ${3RDPARTY_DIR}/lib)
link_directories(${3RDPARTY_LIBS}) link_directories(${3RDPARTY_LIBS})
link_directories(${CUDNN_LIBRARIES}) if (WITH_CUDNN)
link_directories(${PYTHON_LIBRARIES}) link_directories(${CUDNN_LIBRARY_DIR})
endif()
# ---[ Install # ---[ Install
set(CMAKE_INSTALL_PREFIX ${PROJECT_SOURCE_DIR} CACHE STRING "set install prefix" FORCE) set(CMAKE_INSTALL_PREFIX ${PROJECT_SOURCE_DIR} CACHE STRING "set install prefix" FORCE)
...@@ -148,7 +150,6 @@ if (WITH_SSE) ...@@ -148,7 +150,6 @@ if (WITH_SSE)
endif() endif()
if (WITH_MPI) if (WITH_MPI)
ADD_DEFINITIONS(-DWITH_MPI) ADD_DEFINITIONS(-DWITH_MPI)
#set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_RPATH} ${3RDPARTY_LIBS}/../openmpi/install/lib)
message(STATUS "Use MPI [Optional]") message(STATUS "Use MPI [Optional]")
endif() endif()
if (WITH_MPI_CUDA) if (WITH_MPI_CUDA)
...@@ -167,14 +168,14 @@ endif() ...@@ -167,14 +168,14 @@ endif()
# ---[ Flags # ---[ Flags
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} ${CUDA_ARCH}") set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} ${CUDA_ARCH}")
if(WIN32) if(WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP /O2") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP /O2 /Oi /GL /Ot /Gy")
if (WITH_OMP) if (WITH_OMP)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /openmp") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /openmp")
endif() endif()
endif() endif()
if(UNIX) if(UNIX)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s -fPIC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w -fPIC -O2 -m64 -std=c++11") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s -w -fPIC -O3 -m64 -std=c++11")
if (WITH_OMP) if (WITH_OMP)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
......
...@@ -21,6 +21,7 @@ FILE(GLOB targets ${3RDPARTY_LIBS}/*.so ${3RDPARTY_LIBS}/*.lib) ...@@ -21,6 +21,7 @@ FILE(GLOB targets ${3RDPARTY_LIBS}/*.so ${3RDPARTY_LIBS}/*.lib)
foreach(target ${targets}) foreach(target ${targets})
TARGET_LINK_LIBRARIES(${PROJECT_NAME}_python ${target}) TARGET_LINK_LIBRARIES(${PROJECT_NAME}_python ${target})
endforeach() endforeach()
TARGET_LINK_LIBRARIES(${PROJECT_NAME}_python ${PYTHON_LIBRARIES})
# ---[ link optional libs # ---[ link optional libs
if (UNIX AND WITH_CUDNN) if (UNIX AND WITH_CUDNN)
......
...@@ -36,7 +36,7 @@ find_packages('dragon') ...@@ -36,7 +36,7 @@ find_packages('dragon')
find_modules() find_modules()
setup(name = 'dragon', setup(name = 'dragon',
version='0.2.1.16', version='0.2.1.17',
description = 'Dragon: A Computation Graph Virtual Machine Based Deep Learning Framework', description = 'Dragon: A Computation Graph Virtual Machine Based Deep Learning Framework',
url='https://github.com/seetaresearch/Dragon', url='https://github.com/seetaresearch/Dragon',
author='Ting Pan', author='Ting Pan',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!