From 1d4027664e10fee1b0f6f5bf6558bb2aa5984443 Mon Sep 17 00:00:00 2001 From: Pietro Incardona <incardon@mpi-cbg.de> Date: Fri, 26 Jun 2015 18:42:30 +0200 Subject: [PATCH] Adding configure script --- configure.ac | 150 ++++++++++++++++++++++++++++++++++++++++++++++++ src/Makefile.am | 11 ++++ 2 files changed, 161 insertions(+) create mode 100755 configure.ac create mode 100755 src/Makefile.am diff --git a/configure.ac b/configure.ac new file mode 100755 index 00000000..7bc18102 --- /dev/null +++ b/configure.ac @@ -0,0 +1,150 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + + +AC_PREREQ(2.59) +AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS) +AC_CANONICAL_SYSTEM +AC_CONFIG_SRCDIR([src/main.cpp]) +AM_INIT_AUTOMAKE +AC_CONFIG_HEADER([src/config/config.h]) +m4_ifdef([ACX_PTHREAD],,[m4_include([m4/acx_pthread.m4])]) +m4_ifdef([AX_BOOST],,[m4_include([m4/ax_boost.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])]) + +CXXFLAGS+=" --std=c++11 -march=native -mtune=native -Wno-unused-local-typedefs -Wextra -Wno-unused-parameter " +NVCCFLAGS=" " +INCLUDES_PATH=" " + +# Checks for programs. +AC_PROG_CXX + +# Checks g++ flags + +AC_CANONICAL_HOST + +###### 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 + +####### include OpenFPM_devices include path + +INCLUDES_PATH+="-I. -Iconfig -I../../OpenFPM_data/src -I../../OpenFPM_devices/src -I../../OpenFPM_pdata/src " + +###### Check for memleak check compilation + +AC_MSG_CHECKING(whether to build with memory check) +mem_check=no +AC_ARG_ENABLE(memcheck, + AC_HELP_STRING( + [--enable-memcheck], + [enable memory checking (def=no)] + ), + mem_check="$enableval" +) + + + +AC_MSG_RESULT($mem_check) +if test x"$mem_check" = x"yes"; then + AC_DEFINE([MEMLEAK_CHECK],[],[Memory check]) +fi + +##### CHECK FOR BOOST ############## + +AX_BOOST([1.52],[],[]) + +####### Checking for GPU support + +AX_CUDA + +if test x"$NVCC_EXIST" = x"yes"; then + AC_MSG_CHECKING(whether to build with GPU support) + gpu_support=yes + AC_ARG_ENABLE(gpu, + AC_HELP_STRING( + [--enable-gpu], + [enable gpu support] + ), + gpu_support="$enableval" + ) + + AC_MSG_RESULT($gpu_support) + if test x"$gpu_support" = x"yes"; then + AC_DEFINE([CUDA_GPU],[],[CUDA GPU support]) + fi +else + gpu_support=no +fi + + +# Set this conditional if cuda is wanted + +# + +AM_CONDITIONAL(BUILDCUDA, test x$gpu_support = x"yes") + +##### CHECK FOR BOOST ### + +AX_BOOST([1.52],[],[]) + +########################## + +AC_SUBST(NVCCFLAGS) +AC_SUBST(INCLUDES_PATH) + +# Checks for typedefs, structures, and compiler characteristics. + +# Checks for library functions. + +AC_CONFIG_FILES([Makefile src/Makefile]) +AC_OUTPUT +echo "" +echo "***********************************" +echo "* *" +if [ test x"$profiler" = x"yes" ]; then + echo "* profiler: yes *" +else + echo "* profiler: no *" +fi +if [ test x"$memcheck" = x"yes" ]; then + echo "* memcheck: yes *" +else + echo "* memcheck: no *" +fi +if [ test x"$debuger" = x"yes" ]; then + echo "* debug: yes *" +else + echo "* debug: no *" +fi +if [ test x"$gpu_support" = x"no" ]; then + echo "* gpu: no *" +else + echo "* gpu: yes *" +fi +echo "* *" +echo "***********************************" + diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100755 index 00000000..c3a63f93 --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,11 @@ + +LINKLIBS = $(PTHREAD_LIBS) $(OPT_LIBS) $(BOOST_IOSTREAMS_LIB) $(BOOST_LDFLAGS) $(BOOST_PROGRAM_OPTIONS_LIB) $(BOOST_THREAD_LIB) + +bin_PROGRAMS = io +io_SOURCES = main.cpp ../../OpenFPM_devices/src/memory/HeapMemory.cpp ../../OpenFPM_data/src/Memleak_check.cpp +io_CXXFLAGS = $(CUDA_CFLAGS) $(INCLUDES_PATH) -fopenmp +io_CFLAGS = $(CUDA_CFLAGS) +io_LDADD = $(LINKLIBS) + +.cu.o : + $(NVCC) $(NVCCFLAGS) -o $@ -c $< -- GitLab