Commit f3b92ebc authored by Peter W. Draper's avatar Peter W. Draper
Browse files

Get build working with intel compiler on COSMA

Various reorganisations to make sure that the compiler flags are not lost

Lots of compilers warnings to still resolve


Former-commit-id: 63fb4ac0f7e6f2885a11edc101108edc169f5c76
parent 6ea7a489
......@@ -16,7 +16,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Automake stuff
AUTOMAKE_OPTIONS = gnu
ACLOCAL_AMFLAGS = -I m4
# Show the way...
......
# This file is part of SWIFT.
# Coypright (c) 2012 pedro.gonnet@durham.ac.uk.
#
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
......@@ -19,8 +19,8 @@
AC_INIT([SWIFT],[0.1.0])
AC_CONFIG_SRCDIR([src/space.c])
AM_INIT_AUTOMAKE
AC_USE_SYSTEM_EXTENSIONS
LT_INIT
# my own macro collection
......@@ -31,14 +31,30 @@ AM_CONFIG_HEADER(config.h)
# find and test the compiler
AC_PROG_CC
AM_PROG_CC_C_O
# Check for MPI. Need to do this before characterising the compiler (C99 mode).
AC_ARG_ENABLE([mpi],
[AS_HELP_STRING([--enable-mpi],[compile with functionality for distributed-memory parallelim using MPI @<:@default=yes@:>@])],
[if test "x$enable_mpi" != "xno"
then
ACX_MPI([ CC="$MPICC" AC_DEFINE(HAVE_MPI,1,[Define if you have the MPI library.]) ])
fi],
[ACX_MPI([ CC="$MPICC" AC_DEFINE(HAVE_MPI,1,[Define if you have the MPI library.]) ])])
AM_CONDITIONAL([HAVEMPI],[test -n "$MPICC"])
AC_PROG_CC_C99
AC_C_INLINE
# AX_CC_MAXOPT
AX_CC_MAXOPT
AX_FUNC_POSIX_MEMALIGN
AX_GCC_ARCHFLAG([no])
AX_EXT
# Check SSE & AVX support.
AX_EXT
if test "$SIMD_FLAGS" != ""; then
CFLAGS="$CFLAGS $SIMD_FLAGS"
fi
# autoconf stuff
AC_PROG_INSTALL
......@@ -55,19 +71,18 @@ ACX_PTHREAD([LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
the pthread library. Make sure you have the library and header files installed
or use CPPFLAGS and LDFLAGS if the library is installed in a
non-standard location.]))
# Check for MPI
AC_ARG_ENABLE([mpi],
[AS_HELP_STRING([--enable-mpi],[compile with functionality for distributed-memory parallelim using MPI @<:@default=yes@:>@])],
[if test "x$enable_mpi" != "xno"
then
ACX_MPI([ CC="$MPICC" AC_DEFINE(HAVE_MPI,1,[Define if you have the MPI library.]) ])
fi],
[ACX_MPI([ CC="$MPICC" AC_DEFINE(HAVE_MPI,1,[Define if you have the MPI library.]) ])])
AM_CONDITIONAL([HAVEMPI],[test -n "$MPICC"])
# Check for OpenMP
AC_OPENMP
AC_SUBST(OPENMP_CFLAGS)
if test -z "${OPENMP_CFLAGS}"; then
echo $OPENMP_CFLAGS
AC_MSG_ERROR(Compiler does not support OpenMP, 1)
else
CFLAGS="$CFLAGS $OPENMP_CFLAGS"
fi
# Check for metis
AC_ARG_WITH([metis],
[AS_HELP_STRING([--with-metis=PATH],[prefix where the metis library is installed @<:@default=yes@:>@])],
......@@ -93,25 +108,14 @@ AC_CHECK_LIB(z,gzopen,[
LDFLAGS="$LDFLAGS -lz"
],[])
# check for memalign
AX_FUNC_POSIX_MEMALIGN
# Check for OpenMP
AC_OPENMP
AC_SUBST(OPENMP_CFLAGS)
if test -z "${OPENMP_CFLAGS}"; then
echo $OPENMP_CFLAGS
AC_MSG_ERROR(Compiler does not support OpenMP, 1)
fi
# Check for HDF5
AX_LIB_HDF5()
# check for setaffinity
AC_USE_SYSTEM_EXTENSIONS
AC_CHECK_FUNC( pthread_setaffinity_np , AC_DEFINE([HAVE_SETAFFINITY],[true],
[Defined if pthread_setaffinity_np exists.]) )
# Check for timing functions needed by cycle.h
AC_HEADER_TIME
AC_CHECK_HEADERS([sys/time.h c_asm.h intrinsics.h mach/mach_time.h])
......
......@@ -38,35 +38,35 @@ endif
# Sources for test
test_SOURCES = test.c
test_CFLAGS = $(MYFLAGS) $(AM_CFLAGS) -DENGINE_POLICY="engine_policy_multistep | engine_policy_keep | engine_policy_setaffinity"
test_LDADD = ../src/.libs/libswiftsim.a $(HDF5_LDFLAGS)
test_LDADD = ../src/.libs/libswiftsim.a $(HDF5_LDFLAGS) $(HDF5_LIBS)
# Sources for test_fixdt
test_fixdt_SOURCES = test.c
test_fixdt_CFLAGS = $(MYFLAGS) $(AM_CFLAGS) -DENGINE_POLICY="engine_policy_fixdt | engine_policy_keep | engine_policy_setaffinity"
test_fixdt_LDADD = ../src/.libs/libswiftsim.a $(HDF5_LDFLAGS)
test_fixdt_LDADD = ../src/.libs/libswiftsim.a $(HDF5_LDFLAGS) $(HDF5_LIBS)
# Sources for test_mindt
test_mindt_SOURCES = test.c
test_mindt_CFLAGS = $(MYFLAGS) $(AM_CFLAGS) -DENGINE_POLICY="engine_policy_keep | engine_policy_setaffinity"
test_mindt_LDADD = ../src/.libs/libswiftsim.a $(HDF5_LDFLAGS)
test_mindt_LDADD = ../src/.libs/libswiftsim.a $(HDF5_LDFLAGS) $(HDF5_LIBS)
# Sources for test_mpi
test_mpi_SOURCES = test.c
test_mpi_CFLAGS = $(MYFLAGS) $(AM_CFLAGS) -DWITH_MPI -DENGINE_POLICY="engine_policy_multistep | engine_policy_keep"
test_mpi_LDADD = ../src/.libs/libswiftsim_mpi.a $(HDF5_LDFLAGS)
test_mpi_LDADD = ../src/.libs/libswiftsim_mpi.a $(HDF5_LDFLAGS) $(HDF5_LIBS)
# Sources for test_fixdt_mpi
test_fixdt_mpi_SOURCES = test.c
test_fixdt_mpi_CFLAGS = $(MYFLAGS) $(AM_CFLAGS) -DWITH_MPI -DENGINE_POLICY="engine_policy_fixdt | engine_policy_keep"
test_fixdt_mpi_LDADD = ../src/.libs/libswiftsim_mpi.a $(HDF5_LDFLAGS)
test_fixdt_mpi_LDADD = ../src/.libs/libswiftsim_mpi.a $(HDF5_LDFLAGS) $(HDF5_LIBS)
# Sources for test_mindt_mpi
test_mindt_mpi_SOURCES = test.c
test_mindt_mpi_CFLAGS = $(MYFLAGS) $(AM_CFLAGS) -DWITH_MPI -DENGINE_POLICY="engine_policy_keep"
test_mindt_mpi_LDADD = ../src/.libs/libswiftsim_mpi.a $(HDF5_LDFLAGS)
test_mindt_mpi_LDADD = ../src/.libs/libswiftsim_mpi.a $(HDF5_LDFLAGS) $(HDF5_LIBS)
# Sources for test_single
test_single_SOURCES = test_single.c
test_single_CFLAGS = $(MYFLAGS) $(AM_CFLAGS)
test_single_LDADD = ../src/.libs/libswiftsim.a $(HDF5_LDFLAGS)
test_single_LDADD = ../src/.libs/libswiftsim.a $(HDF5_LDFLAGS) $(HDF5_LIBS)
......@@ -58,7 +58,7 @@
#serial 4
AC_DEFUN([AX_CHECK_COMPILE_FLAG],
[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
[AC_PREREQ(2.63)dnl for _AC_LANG_PREFIX and AS_VAR_IF
AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
......
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