Commit 05bd067e authored by incardon's avatar incardon

insitu now is merged with 2.0.0

parents 8e5ec9fc 23c94dfb
centos_build:
stage: build
tags:
- centos
artifacts:
paths:
- ./openfpm_vcluster/build/src/vcluster_test
script:
- ./build.sh $CI_PROJECT_DIR $CI_RUNNER_TAGS $CI_COMMIT_REF_NAME
centos_run:
stage: test
tags:
- centos
dependencies:
- centos_build
script:
- ./run.sh $CI_PROJECT_DIR $CI_RUNNER_TAGS 3 $CI_COMMIT_REF_NAME
- ./run.sh $CI_PROJECT_DIR $CI_RUNNER_TAGS 4 $CI_COMMIT_REF_NAME
- ./run.sh $CI_PROJECT_DIR $CI_RUNNER_TAGS 5 $CI_COMMIT_REF_NAME
mac_build:
stage: build
tags:
- mac
artifacts:
paths:
- ./openfpm_vcluster/build/src/vcluster_test
script:
- ./build.sh $CI_PROJECT_DIR $CI_RUNNER_TAGS $CI_COMMIT_REF_NAME
mac_run:
stage: test
tags:
- mac
dependencies:
- mac_build
script:
- ./run.sh $CI_PROJECT_DIR $CI_RUNNER_TAGS 3 $CI_COMMIT_REF_NAME
- ./run.sh $CI_PROJECT_DIR $CI_RUNNER_TAGS 4 $CI_COMMIT_REF_NAME
- ./run.sh $CI_PROJECT_DIR $CI_RUNNER_TAGS 5 $CI_COMMIT_REF_NAME
ubuntu_build:
stage: build
tags:
- ubuntu
artifacts:
paths:
- ./openfpm_vcluster/build/src/vcluster_test
script:
- ./build.sh $CI_PROJECT_DIR $CI_RUNNER_TAGS $CI_COMMIT_REF_NAME
ubuntu_run:
stage: test
tags:
- ubuntu
dependencies:
- ubuntu_build
script:
- ./run.sh $CI_PROJECT_DIR $CI_RUNNER_TAGS 3 $CI_COMMIT_REF_NAME
- ./run.sh $CI_PROJECT_DIR $CI_RUNNER_TAGS 4 $CI_COMMIT_REF_NAME
- ./run.sh $CI_PROJECT_DIR $CI_RUNNER_TAGS 5 $CI_COMMIT_REF_NAME
cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
project(openfpm_pdata LANGUAGES C CXX)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake_modules/)
set(BOOST_INCLUDE ${Boost_INCLUDE_DIR} CACHE PATH "Include directory for BOOST")
set(SE_CLASS1 CACHE BOOL "Activate compilation with SE_CLASS1")
set(SE_CLASS2 CACHE BOOL "Activate compilation with SE_CLASS2")
set(SE_CLASS3 CACHE BOOL "Activate compilation with SE_CLASS3")
set(PETSC_ROOT CACHE PATH "If compiling with linear algebra indicate the PETSC root directory")
set(ENV{PETSC_DIR} ${PETSC_ROOT})
set (CMAKE_CXX_STANDARD 11)
set (CMAKE_CUDA_STANDARD 11)
if (ENABLE_GPU)
enable_language(CUDA)
find_package(CUDA)
if (CUDA_VERSION_MAJOR EQUAL 9 AND CUDA_VERSION_MINOR EQUAL 2)
message("CUDA is compatible")
set(WARNING_SUPPRESSION_AND_OPTION_NVCC -Xcudafe "--display_error_number --diag_suppress=611 --diag_suppress=2885 --diag_suppress=2886 --diag_suppress=2887 --diag_suppress=2888 --diag_suppress=186 --diag_suppress=111" --expt-extended-lambda)
elseif ( CUDA_VERSION_MAJOR EQUAL 10 AND CUDA_VERSION_MINOR EQUAL 1 )
message("CUDA is compatible")
set(WARNING_SUPPRESSION_AND_OPTION_NVCC -Xcudafe "--display_error_number --diag_suppress=2915 --diag_suppress=2912 --diag_suppress=2913 --diag_suppress=111 --diag_suppress=186 --diag_suppress=611 " --expt-extended-lambda)
else()
message(FATAL_ERROR "CUDA is incompatible, version 9.2 is only supported")
endif()
endif()
find_package(Boost 1.66.0 REQUIRED COMPONENTS unit_test_framework iostreams program_options)
find_package(MPI REQUIRED)
find_package(PETSc)
if(CUDA_FOUND)
set(OPENFPM_INIT_FILE "initialize/initialize_wrapper_cuda.cu")
else()
set(OPENFPM_INIT_FILE "initialize/initialize_wrapper_cuda.cpp")
endif()
###### CONFIG.h FILE ######
if(SE_CLASS1)
set(DEFINE_SE_CLASS1 "#define SE_CLASS1")
endif()
if(SE_CLASS2)
set(DEFINE_SE_CLASS2 "#define SE_CLASS2")
endif()
if(SE_CLASS3)
set(DEFINE_SE_CLASS3 "#define SE_CLASS3")
endif()
if(PETSC_FOUND)
set(DEFINE_HAVE_PETSC "#define HAVE_PETSC")
endif()
if(CUDA_FOUND)
set(DEFINE_CUDA_GPU "#define CUDA_GPU")
endif()
if(MPI_FOUND)
set(DEFINE_HAVE_MPI "#define HAVE_MPI")
else()
message( FATAL_ERROR "MPI is required in order to install OpenFPM" )
endif()
if (Boost_FOUND)
set(DEFINE_HAVE_BOOST "#define HAVE_BOOST")
set(DEFINE_HAVE_BOOST_IOSTREAMS "#define HAVE_BOOST_IOSTREAMS")
set(DEFINE_HAVE_BOOST_PROGRAM_OPTIONS "#define HAVE_BOOST_PROGRAM_OPTIONS")
set(DEFINE_HAVE_BOOST_UNIT_TEST_FRAMEWORK "#define HAVE_BOOST_UNIT_TEST_FRAMEWORK")
else()
message( FATAL_ERROR "BOOST is required in order to install OpenFPM" )
endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/config/config_cmake.h.in ${CMAKE_CURRENT_SOURCE_DIR}/src/config/config.h)
include_directories(SYSTEM ${MPI_INCLUDE_PATH})
add_subdirectory (src)
#!groovy
parallel (
"cifarm-centos-node" : {node ('cifarm-centos-node')
{
deleteDir()
checkout scm
stage ('build centos')
{
sh "./build.sh $WORKSPACE $NODE_NAME $BRANCH_NAME"
}
stage ('run centos')
{
sh "cd openfpm_vcluster && ./run.sh $WORKSPACE $NODE_NAME 2 $BRANCH_NAME"
sh "cd openfpm_vcluster && ./run.sh $WORKSPACE $NODE_NAME 3 $BRANCH_NAME"
sh "cd openfpm_vcluster && ./run.sh $WORKSPACE $NODE_NAME 4 $BRANCH_NAME"
sh "cd openfpm_vcluster && ./run.sh $WORKSPACE $NODE_NAME 5 $BRANCH_NAME"
sh "cd openfpm_vcluster && ./success.sh 2 centos openfpm_vcluster"
}
}
},
"cifarm-mac-node" : {node ('cifarm-mac-node')
{
deleteDir()
checkout scm
stage ('build mac')
{
sh "./build.sh $WORKSPACE $NODE_NAME $BRANCH_NAME"
}
stage ('run mac')
{
sh "cd openfpm_vcluster && ./run.sh $WORKSPACE $NODE_NAME 2 $BRANCH_NAME"
sh "cd openfpm_vcluster && ./run.sh $WORKSPACE $NODE_NAME 3 $BRANCH_NAME"
sh "cd openfpm_vcluster && ./run.sh $WORKSPACE $NODE_NAME 4 $BRANCH_NAME"
sh "cd openfpm_vcluster && ./run.sh $WORKSPACE $NODE_NAME 5 $BRANCH_NAME"
sh "cd openfpm_vcluster && ./run.sh $WORKSPACE $NODE_NAME 6 $BRANCH_NAME"
sh "cd openfpm_vcluster && ./run.sh $WORKSPACE $NODE_NAME 7 $BRANCH_NAME"
sh "cd openfpm_vcluster && ./success.sh 2 mac openfpm_vcluster"
}
}
},
"cifarm-ubuntu-node" : {node ('cifarm-ubuntu-node')
{
deleteDir()
checkout scm
stage ('build ubuntu')
{
sh "./build.sh $WORKSPACE $NODE_NAME $BRANCH_NAME"
}
stage ('run ubuntu')
{
sh "cd openfpm_vcluster && ./run.sh $WORKSPACE $NODE_NAME 2 $BRANCH_NAME"
sh "cd openfpm_vcluster && ./run.sh $WORKSPACE $NODE_NAME 3 $BRANCH_NAME"
sh "cd openfpm_vcluster && ./run.sh $WORKSPACE $NODE_NAME 4 $BRANCH_NAME"
sh "cd openfpm_vcluster && ./run.sh $WORKSPACE $NODE_NAME 5 $BRANCH_NAME"
sh "cd openfpm_vcluster && ./run.sh $WORKSPACE $NODE_NAME 6 $BRANCH_NAME"
sh "cd openfpm_vcluster && ./run.sh $WORKSPACE $NODE_NAME 7 $BRANCH_NAME"
sh "cd openfpm_vcluster && ./success.sh 2 ubuntu openfpm_vcluster"
}
}
}
)
SUBDIRS = src
bin_PROGRAMS =
\ No newline at end of file
This diff is collapsed.
#! /bin/bash
# Make a directory in /tmp/openfpm_data
#
workspace=$1
hostname=$(hostname)
branch=$3
echo "Directory: $workspace"
echo "Machine: $hostname"
echo "Branch: $branch"
echo "$PATH"
echo "Directory: $1"
echo "Machine: $2"
echo "Branch: $3"
mkdir /tmp/openfpm_vcluster
mv * .[^.]* /tmp/openfpm_vcluster
......@@ -13,25 +19,49 @@ mv /tmp/openfpm_vcluster openfpm_vcluster
mkdir openfpm_vcluster/src/config
## It is equivalent to the git modules
git clone git@git.mpi-cbg.de:/openfpm/openfpm_devices.git openfpm_devices
git clone git@git.mpi-cbg.de:/openfpm/openfpm_data.git openfpm_data
cd openfpm_data
git checkout 6c2a5911ac16f93ab0ae1e7ac14723c952aa5c16
git checkout master
cd ..
cd openfpm_devices
git checkout 46e4994c5dff879a71e6ae090c50b2f23235d435
git checkout master
cd ..
cd "$1/openfpm_vcluster"
cd "$workspace/openfpm_vcluster"
source $HOME/openfpm_vars_$3
# install MPI and BOOST LIBHILBERT if needed
if [ "$2" == "gin" ]; then
if [ ! -d $HOME/openfpm_dependencies/openfpm_vcluster/LIBHILBERT ]; then
./install_LIBHILBERT.sh $HOME/openfpm_dependencies/openfpm_vcluster/ 4
fi
if [ ! -d $HOME/openfpm_dependencies/openfpm_vcluster/BOOST ]; then
if [ x"$hostname" == x"cifarm-mac-node" ]; then
echo "Compiling for OSX"
./install_BOOST.sh $HOME/openfpm_dependencies/openfpm_vcluster/ 4 darwin
else
echo "Compiling for Linux"
./install_BOOST.sh $HOME/openfpm_dependencies/openfpm_vcluster/ 4 gcc
fi
fi
if [ ! -d $HOME/openfpm_dependencies/openfpm_vcluster/MPI ]; then
./install_MPI.sh $HOME/openfpm_dependencies/openfpm_vcluster/ 4
fi
export PATH="$PATH:$HOME/openfpm_dependencies/openfpm_vcluster/MPI/bin"
if [ "$hostname" == "gin" ]; then
echo "Compiling on gin\n"
module load gcc/4.9.2
module load openmpi/1.8.1
elif [ "$2" == "wetcluster" ]; then
elif [ "$hostname" == "wetcluster" ]; then
echo "Compiling on wetcluster"
## produce the module path
......@@ -53,7 +83,7 @@ exit(0)\n"
bsub -o output_compile.%J -K -n 1 -J compile sh ./compile_script
elif [ "$2" == "taurus" ]; then
elif [ "$hostname" == "taurus" ]; then
echo "Compiling on taurus"
echo "$PATH"
......@@ -75,8 +105,8 @@ else
echo "$PATH"
echo "Compiling general"
sh ./autogen.sh
sh ./configure CXX=mpic++
make
sh ./configure CXX=mpic++ --with-boost=$HOME/openfpm_dependencies/openfpm_vcluster/BOOST
make VERBOSE=1 -j 4
if [ $? -ne 0 ]; then exit 1 ; fi
fi
......
# CorrectWindowsPaths - this module defines one macro
#
# CONVERT_CYGWIN_PATH( PATH )
# This uses the command cygpath (provided by cygwin) to convert
# unix-style paths into paths useable by cmake on windows
macro (CONVERT_CYGWIN_PATH _path)
if (WIN32)
EXECUTE_PROCESS(COMMAND cygpath.exe -m ${${_path}}
OUTPUT_VARIABLE ${_path})
string (STRIP ${${_path}} ${_path})
endif (WIN32)
endmacro (CONVERT_CYGWIN_PATH)
This diff is collapsed.
# PackageMultipass - this module defines two macros
#
# FIND_PACKAGE_MULTIPASS (Name CURRENT
# STATES VAR0 VAR1 ...
# DEPENDENTS DEP0 DEP1 ...)
#
# This function creates a cache entry <UPPERCASED-Name>_CURRENT which
# the user can set to "NO" to trigger a reconfiguration of the package.
# The first time this function is called, the values of
# <UPPERCASED-Name>_VAR0, ... are saved. If <UPPERCASED-Name>_CURRENT
# is false or if any STATE has changed since the last time
# FIND_PACKAGE_MULTIPASS() was called, then CURRENT will be set to "NO",
# otherwise CURRENT will be "YES". IF not CURRENT, then
# <UPPERCASED-Name>_DEP0, ... will be FORCED to NOTFOUND.
# Example:
# find_path (FOO_DIR include/foo.h)
# FIND_PACKAGE_MULTIPASS (Foo foo_current
# STATES DIR
# DEPENDENTS INCLUDES LIBRARIES)
# if (NOT foo_current)
# # Make temporary files, run programs, etc, to determine FOO_INCLUDES and FOO_LIBRARIES
# endif (NOT foo_current)
#
# MULTIPASS_SOURCE_RUNS (Name INCLUDES LIBRARIES SOURCE RUNS LANGUAGE)
# Always runs the given test, use this when you need to re-run tests
# because parent variables have made old cache entries stale. The LANGUAGE
# variable is either C or CXX indicating which compiler the test should
# use.
# MULTIPASS_C_SOURCE_RUNS (Name INCLUDES LIBRARIES SOURCE RUNS)
# DEPRECATED! This is only included for backwards compatability. Use
# the more general MULTIPASS_SOURCE_RUNS instead.
# Always runs the given test, use this when you need to re-run tests
# because parent variables have made old cache entries stale.
macro (FIND_PACKAGE_MULTIPASS _name _current)
string (TOUPPER ${_name} _NAME)
set (_args ${ARGV})
list (REMOVE_AT _args 0 1)
set (_states_current "YES")
list (GET _args 0 _cmd)
if (_cmd STREQUAL "STATES")
list (REMOVE_AT _args 0)
list (GET _args 0 _state)
while (_state AND NOT _state STREQUAL "DEPENDENTS")
# The name of the stored value for the given state
set (_stored_var PACKAGE_MULTIPASS_${_NAME}_${_state})
if (NOT "${${_stored_var}}" STREQUAL "${${_NAME}_${_state}}")
set (_states_current "NO")
endif (NOT "${${_stored_var}}" STREQUAL "${${_NAME}_${_state}}")
set (${_stored_var} "${${_NAME}_${_state}}" CACHE INTERNAL "Stored state for ${_name}." FORCE)
list (REMOVE_AT _args 0)
list (GET _args 0 _state)
endwhile (_state AND NOT _state STREQUAL "DEPENDENTS")
endif (_cmd STREQUAL "STATES")
set (_stored ${_NAME}_CURRENT)
if (NOT ${_stored})
set (${_stored} "YES" CACHE BOOL "Is the configuration for ${_name} current? Set to \"NO\" to reconfigure." FORCE)
set (_states_current "NO")
endif (NOT ${_stored})
set (${_current} ${_states_current})
if (NOT ${_current} AND PACKAGE_MULTIPASS_${_name}_CALLED)
message (STATUS "Clearing ${_name} dependent variables")
# Clear all the dependent variables so that the module can reset them
list (GET _args 0 _cmd)
if (_cmd STREQUAL "DEPENDENTS")
list (REMOVE_AT _args 0)
foreach (dep ${_args})
set (${_NAME}_${dep} "NOTFOUND" CACHE INTERNAL "Cleared" FORCE)
endforeach (dep)
endif (_cmd STREQUAL "DEPENDENTS")
set (${_NAME}_FOUND "NOTFOUND" CACHE INTERNAL "Cleared" FORCE)
endif ()
set (PACKAGE_MULTIPASS_${name}_CALLED YES CACHE INTERNAL "Private" FORCE)
endmacro (FIND_PACKAGE_MULTIPASS)
macro (MULTIPASS_SOURCE_RUNS includes libraries source runs language)
include (Check${language}SourceRuns)
# This is a ridiculous hack. CHECK_${language}_SOURCE_* thinks that if the
# *name* of the return variable doesn't change, then the test does
# not need to be re-run. We keep an internal count which we
# increment to guarantee that every test name is unique. If we've
# gotten here, then the configuration has changed enough that the
# test *needs* to be rerun.
if (NOT MULTIPASS_TEST_COUNT)
set (MULTIPASS_TEST_COUNT 00)
endif (NOT MULTIPASS_TEST_COUNT)
math (EXPR _tmp "${MULTIPASS_TEST_COUNT} + 1") # Why can't I add to a cache variable?
set (MULTIPASS_TEST_COUNT ${_tmp} CACHE INTERNAL "Unique test ID")
set (testname MULTIPASS_TEST_${MULTIPASS_TEST_COUNT}_${runs})
set (CMAKE_REQUIRED_INCLUDES ${includes})
set (CMAKE_REQUIRED_LIBRARIES ${libraries})
if(${language} STREQUAL "C")
check_c_source_runs ("${source}" ${testname})
elseif(${language} STREQUAL "CXX")
check_cxx_source_runs ("${source}" ${testname})
endif()
set (${runs} "${${testname}}")
endmacro (MULTIPASS_SOURCE_RUNS)
macro (MULTIPASS_C_SOURCE_RUNS includes libraries source runs)
multipass_source_runs("${includes}" "${libraries}" "${source}" ${runs} "C")
endmacro (MULTIPASS_C_SOURCE_RUNS)
# ResolveCompilerPaths - this module defines two macros
#
# RESOLVE_LIBRARIES (XXX_LIBRARIES LINK_LINE)
# This macro is intended to be used by FindXXX.cmake modules.
# It parses a compiler link line and resolves all libraries
# (-lfoo) using the library path contexts (-L/path) in scope.
# The result in XXX_LIBRARIES is the list of fully resolved libs.
# Example:
#
# RESOLVE_LIBRARIES (FOO_LIBRARIES "-L/A -la -L/B -lb -lc -ld")
#
# will be resolved to
#
# FOO_LIBRARIES:STRING="/A/liba.so;/B/libb.so;/A/libc.so;/usr/lib/libd.so"
#
# if the filesystem looks like
#
# /A: liba.so libc.so
# /B: liba.so libb.so
# /usr/lib: liba.so libb.so libc.so libd.so
#
# and /usr/lib is a system directory.
#
# Note: If RESOLVE_LIBRARIES() resolves a link line differently from
# the native linker, there is a bug in this macro (please report it).
#
# RESOLVE_INCLUDES (XXX_INCLUDES INCLUDE_LINE)
# This macro is intended to be used by FindXXX.cmake modules.
# It parses a compile line and resolves all includes
# (-I/path/to/include) to a list of directories. Other flags are ignored.
# Example:
#
# RESOLVE_INCLUDES (FOO_INCLUDES "-I/A -DBAR='\"irrelevant -I/string here\"' -I/B")
#
# will be resolved to
#
# FOO_INCLUDES:STRING="/A;/B"
#
# assuming both directories exist.
# Note: as currently implemented, the -I/string will be picked up mistakenly (cry, cry)
include (CorrectWindowsPaths)
macro (RESOLVE_LIBRARIES LIBS LINK_LINE)
string (REGEX MATCHALL "((-L|-l|-Wl)([^\" ]+|\"[^\"]+\")|[^\" ]+\\.(a|so|dll|lib))" _all_tokens "${LINK_LINE}")
set (_libs_found "")
set (_directory_list "")
foreach (token ${_all_tokens})
if (token MATCHES "-L([^\" ]+|\"[^\"]+\")")
# If it's a library path, add it to the list
string (REGEX REPLACE "^-L" "" token ${token})
string (REGEX REPLACE "//" "/" token ${token})
convert_cygwin_path(token)
list (APPEND _directory_list ${token})
elseif (token MATCHES "^(-l([^\" ]+|\"[^\"]+\")|[^\" ]+\\.(a|so|dll|lib))")
# It's a library, resolve the path by looking in the list and then (by default) in system directories
if (WIN32) #windows expects "libfoo", linux expects "foo"
string (REGEX REPLACE "^-l" "lib" token ${token})
else (WIN32)
string (REGEX REPLACE "^-l" "" token ${token})
endif (WIN32)
set (_root "")
if (token MATCHES "^/") # We have an absolute path
#separate into a path and a library name:
string (REGEX MATCH "[^/]*\\.(a|so|dll|lib)$" libname ${token})
string (REGEX MATCH ".*[^${libname}$]" libpath ${token})
convert_cygwin_path(libpath)
set (_directory_list ${_directory_list} ${libpath})
set (token ${libname})
endif (token MATCHES "^/")
set (_lib "NOTFOUND" CACHE FILEPATH "Cleared" FORCE)
find_library (_lib ${token} HINTS ${_directory_list} ${_root})
if (_lib)
string (REPLACE "//" "/" _lib ${_lib})
list (APPEND _libs_found ${_lib})
else (_lib)
message (STATUS "Unable to find library ${token}")
endif (_lib)
endif (token MATCHES "-L([^\" ]+|\"[^\"]+\")")
endforeach (token)
set (_lib "NOTFOUND" CACHE INTERNAL "Scratch variable" FORCE)
# only the LAST occurence of each library is required since there should be no circular dependencies
if (_libs_found)
list (REVERSE _libs_found)
list (REMOVE_DUPLICATES _libs_found)
list (REVERSE _libs_found)
endif (_libs_found)
set (${LIBS} "${_libs_found}")
endmacro (RESOLVE_LIBRARIES)
macro (RESOLVE_INCLUDES INCS COMPILE_LINE)
string (REGEX MATCHALL "-I([^\" ]+|\"[^\"]+\")" _all_tokens "${COMPILE_LINE}")
set (_incs_found "")
foreach (token ${_all_tokens})
string (REGEX REPLACE "^-I" "" token ${token})
string (REGEX REPLACE "//" "/" token ${token})
convert_cygwin_path(token)
if (EXISTS ${token})
list (APPEND _incs_found ${token})
else (EXISTS ${token})
message (STATUS "Include directory ${token} does not exist")
endif (EXISTS ${token})
endforeach (token)
list (REMOVE_DUPLICATES _incs_found)
set (${INCS} "${_incs_found}")
endmacro (RESOLVE_INCLUDES)
This diff is collapsed.
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT(OpenFPM_vcluster, 1.0.0, BUG-REPORT-ADDRESS)
AC_CANONICAL_SYSTEM
AC_CONFIG_SRCDIR([src/main.cpp])
AM_INIT_AUTOMAKE([subdir-objects])
AC_CONFIG_HEADER([src/config/config.h])
m4_ifdef([ACX_PTHREAD],,[m4_include([m4/acx_pthread.m4])])
m4_ifdef([ACX_MPI],,[m4_include([m4/acx_mpi.m4])])
m4_ifdef([AX_OPENMP],,[m4_include([m4/ax_openmp.m4])])
m4_ifdef([AX_CUDA],,[m4_include([m4/ax_cuda.m4])])
m4_ifdef([AX_BOOST_BASE],,[m4_include([m4/ax_boost_base.m4])])
m4_ifdef([AX_BOOST_IOSTREAMS],,[m4_include([m4/ax_boost_iostreams.m4])])
m4_ifdef([AX_BOOST_PROGRAM_OPTIONS],,[m4_include([m4/ax_boost_program_options.m4])])
m4_ifdef([AX_BOOST_UNIT_TEST_FRAMEWORK],,[m4_include([m4/ax_boost_unit_test_framework.m4])])
case $host_os in
*cygwin*)
# Do something specific for cygwin
CXXFLAGS+=" --std=gnu++11 "
;;
*)
#Default Case
CXXFLAGS+=" --std=c++11 "
;;
esac
CXXFLAGS+=" -march=native -mtune=native -Wno-unused-local-typedefs -Wextra -Wno-unused-parameter "
NVCCFLAGS=" "
INCLUDES_PATH=" "
# set default prefix
if test "$prefix" = "NONE"; then
prefix="/usr/local"
fi
# Add openfpm_vcluster to prefix forlder (if prefix end if openfpm_pdata remove that path)
if [ echo "$prefix" | grep -qE "/openfpm_pdata$" ]; then
prefix=$(echo "$prefix" | sed 's/\(.*\)\/openfpm_pdata$/\1/g')
fi
prefix="$prefix/openfpm_vcluster"
echo "Installation dir is: $prefix"
LT_INIT
# Checks for programs.
AC_PROG_CXX
# Checks g++ flags
AC_CANONICAL_HOST
###### Check for verbose
AC_MSG_CHECKING(whether to build with verbose print)
verbose=no
AC_ARG_ENABLE(verbose,
AC_HELP_STRING(
[--enable-verbose],
[enable verbose print (def=no)]
),
verbose="$enableval"
)
AC_MSG_RESULT($verbose)
if test x"$verbose" = x"yes"; then
AC_DEFINE([VERBOSE_TEST],[],[Verbose test])
fi
###### Check for debug compilation
AC_MSG_CHECKING(whether to build with debug information)
debuger=no
AC_ARG_ENABLE(debug,
AC_HELP_STRING(
[--enable-debug],
[enable debug data generation (def=no)]
),
debuger="$enableval"
)
AC_MSG_RESULT($debuger)
if test x"$debuger" = x"yes"; then
AC_DEFINE([DEBUG_MODE],[],[Debug])
AC_DEFINE([DEBUG],[],[Debug])
CXXFLAGS="$CXXFLAGS -g3 -Wall -O0 "
NVCCFLAGS+="$NVCCFLAGS -g -O0 "
else
CXXFLAGS="$CXXFLAGS -Wall -O3 -g3 -funroll-loops "
NVCCFLAGS+="$NVCCFLAGS -O3 "
fi
###### Check for se-class1
AC_MSG_CHECKING(whether to build with security enhancement class1)
se_class1=no
AC_ARG_ENABLE(se-class1,
AC_HELP_STRING(
[--enable-se-class1],
[enable security enhancement class1]
),
se_class1="$enableval"
)
AC_MSG_RESULT($se_class1)
if test x"$se_class1" = x"yes"; then
AC_DEFINE([SE_CLASS1],[],[Security enhancement class 1])
fi
###### Check for se-class 2
AC_MSG_CHECKING(whether to build with security enhancement class 2)
se_class2=no
AC_ARG_ENABLE(se-class2,
AC_HELP_STRING(
[--enable-se-class2],
[enable security enhancement class 2]
),
se_class2="$enableval"
)
AC_MSG_RESULT($se_class2)
if test x"$se_class2" = x"yes"; then
AC_DEFINE([SE_CLASS2],[],[Security enhancement class 2])
fi
###### Check for se-class 3
AC_MSG_CHECKING(whether to build with security enhancement class 3)
se_class3=no
AC_ARG_ENABLE(se-class3,
AC_HELP_STRING(
[--enable-se-class3],
[enable security enhancement class 3]
),
se_class3="$enableval"
)
AC_MSG_RESULT($se_class3)
if test x"$se_class3" = x"yes"; then
AC_DEFINE([SE_CLASS3],[],[Security enhancement class 3])
fi
###### Check for test coverage
AC_MSG_CHECKING(whether to build with test coverage)
test_cov=no
AC_ARG_ENABLE(test-coverage,
AC_HELP_STRING(
[--enable-test-coverage],
[enable test coverage]
),
test_cov="$enableval"
)
AC_MSG_RESULT($test_cov)
if test x"$test_cov" = x"yes"; then
AC_DEFINE([TEST_COVERAGE_MODE],[],[Test coverage mode])
CXXFLAGS="$CXXFLAGS -fprofile-arcs -ftest-coverage "
fi