Commit 8a82d556 authored by berenger-bramas's avatar berenger-bramas

Renamed ScalFMM_config to ScalFmmConfig

Change the Cmake :
× add comments
× add mpi into cmake (not used yet)
× change variables names

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/scalfmm/scalfmm/trunk@56 2616d619-271b-44dc-8df4-d4a8f33a7222
parent a2539538
......@@ -5,44 +5,51 @@ project(scalfmm CXX)
# check if compiling into source directories
STRING(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" insource)
IF(insource)
if(insource)
MESSAGE(FATAL_ERROR "${PROJECT_NAME} requires an out of source build. Goto ./Build and tapes cmake ../")
ENDIF(insource)
endif(insource)
# Options
OPTION( FUSE_CBLAS "Set to ON to build ScaFMM with BLAS" ON )
OPTION( FUSE_MPI "Set to ON to build ScaFMM with MPI" OFF )
OPTION( BUILD_TESTS "Set to ON to build fonctionnalities Tests" ON )
OPTION( BUILD_UTESTS "Set to ON to build UTests" ON )
#
# Blas option
if( FUSE_CBLAS )
OPTION( FUSE_MKL_AS_BLAS "Set to ON to use MKL CBLAS" OFF )
IF( FUSE_MKL_AS_BLAS )
if( FUSE_MKL_AS_BLAS )
SET(CBLAS_LIBRARIES "-L$ENV{MKLROOT}/lib -lmkl_intel_lp64 -lmkl_sequential -lmkl_core")
ELSE( FUSE_MKL_AS_BLAS )
else( FUSE_MKL_AS_BLAS )
FIND_PACKAGE(BLAS)
SET(CBLAS_LIBRARIES "-lcblas")
ENDIF( FUSE_MKL_AS_BLAS )
ENDIF( FUSE_CBLAS )
endif( FUSE_MKL_AS_BLAS )
endif( FUSE_CBLAS )
#
# MPI option
if( FUSE_MPI )
SET(CMAKE_CXX_COMPILER mpicxx)
endif(FUSE_MPI)
# Compile option
ADD_DEFINITIONS(-O2 -Wall -Wshadow -Wpointer-arith -Wcast-qual)
CONFIGURE_FILE( ${CMAKE_SOURCE_DIR}/Sources/ScalFMM_config.h.cmake
${CMAKE_BINARY_DIR}/Sources/ScalFMM_config.h )
CONFIGURE_FILE( ${CMAKE_SOURCE_DIR}/Sources/ScalFmmConfig.h.cmake
${CMAKE_BINARY_DIR}/Sources/ScalFmmConfig.h )
# Build - lib
add_subdirectory(Sources)
# Build - Tests
MESSAGE( STATUS "BUILD_TESTS = ${BUILD_TESTS}" )
if( ${BUILD_TESTS} STREQUAL "ON" )
if( BUILD_TESTS )
add_subdirectory(Tests)
endif()
# Build - UTests
MESSAGE( STATUS "BUILD_UTESTS = ${BUILD_UTESTS}" )
if( ${BUILD_UTESTS} STREQUAL "ON" )
if( BUILD_UTESTS )
add_subdirectory(UTests)
endif()
......
cmake_minimum_required(VERSION 2.6)
#Configuration du projet
# Configuration du projet
project(Lib_scalfmm)
set(LIBRARY_OUTPUT_PATH ../lib/${CMAKE_BUILD_TYPE})
#Configuration de la bibliothèque
# Searching all cpp file
file(
GLOB_RECURSE
source_lib_files
./*.cpp
)
# Adding cpp files to project
add_library(
scalfmm
STATIC
${source_lib_files}
)
# Adding the entire project dir as an include dir
INCLUDE_DIRECTORIES(
${CMAKE_BINARY_DIR}/Sources
)
......
#ifndef ScalFMM_CONFIG_H
#define ScalFMM_CONFIG_H
#ifndef SSCALFMMCONFIG_H
#define SSCALFMMCONFIG_H
#cmakedefine FUSE_MKL_AS_BLAS
......
......@@ -5,7 +5,7 @@
// Manage Blas Version
///////////////////////////////////////////////////////
#include "ScalFMM_config.h"
#include "ScalFmmConfig.h"
#ifdef FUSE_MKL_AS_BLAS
#include <mkl_cblas.h>
......
......@@ -10,7 +10,7 @@ if(OPENMP_FOUND)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
endif()
#add CBLAS
# Add CBLAS
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CBLAS_LIBRARIES}")
#todo remove next line used to compile manually with intel compiler
#ADD_DEFINITIONS(-Wl,--start-group $(MKLROOT)/lib/ia32/libmkl_intel.a $(MKLROOT)/lib/ia32/libmkl_sequential.a $(MKLROOT)/lib/ia32/libmkl_core.a -Wl,--end-group -lpthread)
......@@ -24,6 +24,8 @@ file(
source_tests_files
./*.cpp
)
# Adding the project sources dir as an include dir
INCLUDE_DIRECTORIES(
${CMAKE_BINARY_DIR}/Sources
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment