Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
6ea15e9c
Commit
6ea15e9c
authored
8 years ago
by
Peter W. Draper
Browse files
Options
Downloads
Patches
Plain Diff
Add checks for optional tcmalloc library and default profiler, if available
parent
6d9f54ae
No related branches found
No related tags found
1 merge request
!190
Autotools update
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
configure.ac
+59
-6
59 additions, 6 deletions
configure.ac
examples/Makefile.am
+7
-4
7 additions, 4 deletions
examples/Makefile.am
with
66 additions
and
10 deletions
configure.ac
+
59
−
6
View file @
6ea15e9c
...
...
@@ -179,7 +179,7 @@ if test "$enable_opt" = "yes" ; then
ac_test_CFLAGS="yes"
CFLAGS="$old_CFLAGS $CFLAGS"
# Check SSE & AVX support (some overlap with AX_CC_MAXOPT).
# Check SSE & AVX support (some overlap with AX_CC_MAXOPT).
# Don't use the SIMD_FLAGS result with Intel compilers. The -x<code>
# value from AX_CC_MAXOPT should be sufficient.
AX_EXT
...
...
@@ -287,12 +287,63 @@ AC_SUBST([METIS_LIBS])
AC_SUBST([METIS_INCS])
AM_CONDITIONAL([HAVEMETIS],[test -n "$METIS_LIBS"])
# # Check for zlib.
# AC_CHECK_LIB([z],[gzopen],[
# AC_DEFINE([HAVE_LIBZ],[1],[Set to 1 if zlib is installed.])
# LDFLAGS="$LDFLAGS -lz"
# ],[])
# Check for tcmalloc a fast malloc that is part of the gperftools.
have_tcmalloc="no"
AC_ARG_WITH([tcmalloc],
[AS_HELP_STRING([--with-tcmalloc],
[use tcmalloc library or specify the directory with lib @<:@yes/no@:>@]
)],
[with_tcmalloc="$withval"],
[with_tcmalloc="no"]
)
if test "x$with_tcmalloc" != "xno"; then
if test "x$with_tcmalloc" != "xyes" && test "x$with_tcmalloc" != "x"; then
TCMALLOC_LIBS="-L$with_tcmalloc -ltcmalloc"
else
TCMALLOC_LIBS="-ltcmalloc"
fi
AC_CHECK_LIB([tcmalloc],[tc_cfree],[have_tcmalloc="yes"],[have_tcmalloc="no"],
$TCMALLOC_LIBS)
# Could just have the minimal version.
if test "$have_tcmalloc" = "no"; then
if test "x$with_tcmalloc" != "xyes" && test "x$with_tcmalloc" != "x"; then
TCMALLOC_LIBS="-L$with_tcmalloc -ltcmalloc_minimal"
else
TCMALLOC_LIBS="-ltcmalloc_minimal"
fi
AC_CHECK_LIB([tcmalloc],[tc_cfree],[have_tcmalloc="yes"],[have_tcmalloc="no"],
$TCMALLOC_LIBS)
fi
# These are recommended for GCC.
if test "$have_tcmalloc" = "yes" -a "$ax_cv_c_compiler_vendor" = "gnu"; then
CFLAGS="$CFLAGS -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free"
fi
fi
AC_SUBST([TCMALLOC_LIBS])
AM_CONDITIONAL([HAVETCMALLOC],[test -n "$TCMALLOC_LIBS"])
# Check for -lprofiler usually part of the gpreftools along with tcmalloc.
have_profiler="no"
AC_ARG_WITH([profiler],
[AS_HELP_STRING([--with-profiler],
[use cpu profiler library or specify the directory with lib @<:@yes/no@:>@]
)],
[with_profiler="$withval"],
[with_profiler="yes"]
)
if test "x$with_profiler" != "xno"; then
if test "x$with_profiler" != "xyes" && test "x$with_profiler" != "x"; then
PROFILER_LIBS="-L$with_profiler -lprofiler"
else
PROFILER_LIBS="-lprofiler"
fi
AC_CHECK_LIB([profiler],[ProfilerFlush],[have_profiler="yes"],[have_profiler="no"],
$PROFILER_LIBS)
fi
AC_SUBST([PROFILER_LIBS])
AM_CONDITIONAL([HAVEPROFILER],[test -n "$PROFILER_LIBS"])
# Check for HDF5. This is required.
AX_LIB_HDF5
...
...
@@ -410,6 +461,8 @@ AC_MSG_RESULT([
- parallel : $have_parallel_hdf5
Metis enabled : $have_metis
libNUMA enabled : $have_numa
Using tcmalloc : $have_tcmalloc
CPU profiler : $have_profiler
])
# Generate output.
...
...
This diff is collapsed.
Click to expand it.
examples/Makefile.am
+
7
−
4
View file @
6ea15e9c
...
...
@@ -23,10 +23,13 @@ AM_CFLAGS = -I../src $(HDF5_CPPFLAGS)
AM_LDFLAGS
=
EXTRA_LIBS
=
@PROFILER_LIBS@ @TCMALLOC_LIBS@
MPI_THREAD_LIBS
=
@MPI_THREAD_LIBS@
MPI_LIBS
=
$(
METIS_LIBS
)
$(
MPI_THREAD_LIBS
)
MPI_FLAGS
=
-DWITH_MPI
$(
METIS_INCS
)
# Set-up the library
bin_PROGRAMS
=
swift swift_fixdt
...
...
@@ -45,20 +48,20 @@ endif
# Sources for swift
swift_SOURCES
=
main.c
swift_CFLAGS
=
$(
MYFLAGS
)
$(
AM_CFLAGS
)
-DENGINE_POLICY
=
"engine_policy_keep
$(
ENGINE_POLICY_SETAFFINITY
)
"
swift_LDADD
=
../src/.libs/libswiftsim.a
$(
HDF5_LDFLAGS
)
$(
HDF5_LIBS
)
swift_LDADD
=
../src/.libs/libswiftsim.a
$(
HDF5_LDFLAGS
)
$(
HDF5_LIBS
)
$(
EXTRA_LIBS
)
swift_fixdt_SOURCES
=
main.c
swift_fixdt_CFLAGS
=
$(
MYFLAGS
)
$(
AM_CFLAGS
)
-DENGINE_POLICY
=
"engine_policy_fixdt | engine_policy_keep
$(
ENGINE_POLICY_SETAFFINITY
)
"
swift_fixdt_LDADD
=
../src/.libs/libswiftsim.a
$(
HDF5_LDFLAGS
)
$(
HDF5_LIBS
)
swift_fixdt_LDADD
=
../src/.libs/libswiftsim.a
$(
HDF5_LDFLAGS
)
$(
HDF5_LIBS
)
$(
EXTRA_LIBS
)
# Sources for swift_mpi, do we need an affinity policy for MPI?
swift_mpi_SOURCES
=
main.c
swift_mpi_CFLAGS
=
$(
MYFLAGS
)
$(
AM_CFLAGS
)
$(
MPI_FLAGS
)
-DENGINE_POLICY
=
"engine_policy_keep
$(
ENGINE_POLICY_SETAFFINITY
)
"
swift_mpi_LDADD
=
../src/.libs/libswiftsim_mpi.a
$(
HDF5_LDFLAGS
)
$(
HDF5_LIBS
)
$(
MPI_LIBS
)
swift_mpi_LDADD
=
../src/.libs/libswiftsim_mpi.a
$(
HDF5_LDFLAGS
)
$(
HDF5_LIBS
)
$(
MPI_LIBS
)
$(
EXTRA_LIBS
)
swift_fixdt_mpi_SOURCES
=
main.c
swift_fixdt_mpi_CFLAGS
=
$(
MYFLAGS
)
$(
AM_CFLAGS
)
$(
MPI_FLAGS
)
-DENGINE_POLICY
=
"engine_policy_fixdt | engine_policy_keep
$(
ENGINE_POLICY_SETAFFINITY
)
"
swift_fixdt_mpi_LDADD
=
../src/.libs/libswiftsim_mpi.a
$(
HDF5_LDFLAGS
)
$(
HDF5_LIBS
)
$(
MPI_LIBS
)
swift_fixdt_mpi_LDADD
=
../src/.libs/libswiftsim_mpi.a
$(
HDF5_LDFLAGS
)
$(
HDF5_LIBS
)
$(
MPI_LIBS
)
$(
EXTRA_LIBS
)
# Scripts to generate ICs
EXTRA_DIST
=
UniformBox/makeIC.py UniformBox/run.sh UniformBox/uniformBox.yml
\
...
...
This diff is collapsed.
Click to expand it.
Peter W. Draper
@pdraper
mentioned in issue
#181 (closed)
·
8 years ago
mentioned in issue
#181 (closed)
mentioned in issue #181
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment