CMakeLists.txt 1.35 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22

IF(WIN32)
    IF(BUILD_SHARED_LIBS)
        ADD_DEFINITIONS(-DNL_EXPORTS)
        ADD_DEFINITIONS(-DNL_SHARED_LIBS)
    ENDIF(BUILD_SHARED_LIBS)
ENDIF(WIN32)

AUX_SOURCE_DIRECTORY(NL SOURCES)

# extensions
IF(USE_CNC)
    AUX_SOURCE_DIRECTORY(plugins/cnc SOURCES)
    set(SOURCES ${SOURCES};plugins/cnc/cnc_cuda_blas.cu)
ENDIF(USE_CNC)

IF(USE_ATLAS)
    ADD_DEFINITIONS(-DNL_USE_ATLAS)
ENDIF(USE_ATLAS)

IF(USE_SUPERLU)
    ADD_DEFINITIONS(-DNL_USE_SUPERLU)
23 24
#   SET(SUPERLU_INCS ${SUPERLU_HOME}/SRC)
	INCLUDE_DIRECTORIES(${SUPERLU_INCLUDE_DIRS})
25 26 27
ENDIF(USE_SUPERLU)

IF(USE_CHOLMOD)
Sylvain Thery's avatar
Sylvain Thery committed
28 29 30
	IF (APPLE)
		FIND_LIBRARY(CHOL_DEPS Accelerate)
	ENDIF (APPLE)
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
	ADD_DEFINITIONS(-DNL_USE_CHOLMOD)
	INCLUDE_DIRECTORIES(${SUITESPARSE_INCLUDE_DIRS})
ENDIF(USE_CHOLMOD)


# creation of the library
IF(USE_CNC)
    IF(WIN32)
	    CUDA_ADD_LIBRARY(nl ${SOURCES} ${HeaderFiles})
    ELSE(WIN32)
        CUDA_ADD_LIBRARY(nl ${SOURCES} )
        set_target_properties(nl PROPERTIES COMPILE_FLAGS "-malign-double")
    ENDIF(WIN32)
    CUDA_ADD_CUBLAS_TO_TARGET(nl)
ELSE(USE_CNC)
    IF(WIN32)
Sylvain Thery's avatar
Sylvain Thery committed
47
	ADD_LIBRARY(nl ${SOURCES} ${HeaderFiles})
48
    ELSE(WIN32)
Sylvain Thery's avatar
Sylvain Thery committed
49 50 51 52 53 54 55
	ADD_LIBRARY(nl ${SOURCES} )
	IF(USE_CHOLMOD)
		TARGET_LINK_LIBRARIES(nl ${SUITESPARSE_LIBRARIES} ${CHOL_DEPS})
	ENDIF(USE_CHOLMOD)
	IF(USE_SUPERLU)
		TARGET_LINK_LIBRARIES(nl ${SUPERLU_LIBRARIES})
	ENDIF(USE_SUPERLU)
56 57
    ENDIF(WIN32)
ENDIF(USE_CNC)