Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
AUTOMAKE_OPTIONS = color-tests
SUBDIRS = src/usolve src/fglm src/neogb src/msolve

AM_CFLAGS = $(SIMD_FLAGS) $(CPUEXT_FLAGS) $(OPENMP_CFLAGS)
AM_CFLAGS = $(OPENMP_CFLAGS)
LDADD = src/neogb/libneogb.la src/fglm/libfglm.la src/usolve/libusolve.la

bin_PROGRAMS = msolve
Expand Down
43 changes: 42 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,48 @@ AC_TYPE_UINT8_T


AX_COUNT_CPUS
AX_EXT
# By default, select SIMD code from the compiler target rather than the build CPU.
# Let packagers disable either implementation without changing their CFLAGS.
AC_ARG_ENABLE([avx2],
[AS_HELP_STRING([--enable-avx2], [enable AVX2 code (default: compiler target)])],
[], [enable_avx2=auto])
AS_CASE([$enable_avx2], [yes|no|auto], [],
[AC_MSG_ERROR([bad value $enable_avx2 for --enable-avx2])])
AS_IF([test "x$enable_avx2" = xauto], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#ifndef __AVX2__
#error AVX2 is not enabled
#endif
]], [[]])], [enable_avx2=yes], [enable_avx2=no])
])
AS_IF([test "x$enable_avx2" = xyes], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <immintrin.h>]], [[
__m256i value = _mm256_set1_epi64x(1);
return _mm256_extract_epi64(value, 0);
]])], [AC_DEFINE([HAVE_AVX2], [1], [Enable AVX2 code])],
[AC_MSG_ERROR([AVX2 code requires a compiler target supporting AVX2 (for example, -mavx2 in CFLAGS)])])
])

AC_ARG_ENABLE([avx512f],
[AS_HELP_STRING([--enable-avx512f], [enable AVX-512 code (requires AVX-512F and AVX-512BW; default: compiler target)])],
[], [enable_avx512f=auto])
AS_CASE([$enable_avx512f], [yes|no|auto], [],
[AC_MSG_ERROR([bad value $enable_avx512f for --enable-avx512f])])
AS_IF([test "x$enable_avx512f" = xauto], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#ifndef __AVX512F__
#error AVX512F is not enabled
#endif
]], [[]])], [enable_avx512f=yes], [enable_avx512f=no])
])
AS_IF([test "x$enable_avx512f" = xyes], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <immintrin.h>]], [[
__m512i value = _mm512_set1_epi16(1);
value = _mm512_mullo_epi16(value, value);
return _mm512_cvtsi512_si32(value);
]])], [AC_DEFINE([HAVE_AVX512_F], [1], [Enable AVX512F code])],
[AC_MSG_ERROR([AVX-512 code requires a compiler target supporting AVX-512F and AVX-512BW (for example, -mavx512f -mavx512bw in CFLAGS)])])
])
AX_GCC_BUILTIN([__builtin_constant_p])
AX_GCC_BUILTIN([__builtin_clzll])
AX_GCC_BUILTIN([__builtin_clzl])
Expand Down
2 changes: 1 addition & 1 deletion src/fglm/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ noinst_LTLIBRARIES = libfglm.la
libfglm_la_SOURCES = fglm_core.c
libfglm_ladir = $(includedir)/msolve/fglm
libfglm_la_HEADERS = fglm.h
libfglm_la_CFLAGS = $(SIMD_FLAGS) $(CPUEXT_FLAGS) $(OPENMP_CFLAGS) -Wall -Wextra
libfglm_la_CFLAGS = $(OPENMP_CFLAGS) -Wall -Wextra

EXTRA_DIST = fglm.h \
libfglm.h \
Expand Down
2 changes: 1 addition & 1 deletion src/fglm/linalg-fglm.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <flint/nmod.h>
#endif

#ifdef HAVE_AVX2
#if defined(HAVE_AVX2) || defined(HAVE_AVX512_F)
#include <immintrin.h>
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/msolve/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ lib_LTLIBRARIES = libmsolve.la
libmsolve_la_SOURCES = libmsolve.c
libmsolve_ladir = $(includedir)/msolve/msolve
libmsolve_la_HEADERS = msolve-data.h msolve-version.h msolve.h
libmsolve_la_CFLAGS = $(SIMD_FLAGS) $(CPUEXT_FLAGS) $(OPENMP_CFLAGS) -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare
libmsolve_la_CFLAGS = $(OPENMP_CFLAGS) -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare
libmsolve_la_LDFLAGS = -version-info $(LT_VERSION)
libmsolve_la_LIBADD = ../usolve/libusolve.la ../fglm/libfglm.la ../neogb/libneogb.la

Expand Down
2 changes: 1 addition & 1 deletion src/neogb/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ libneogb_la_HEADERS =libneogb.h basis.h data.h engine.h f4.h sba.h hash.h \
io.h modular.h nf.h f4sat.h sort_r.h meta_data.h \
tools.h update.h
libneogb_la_LDFLAGS = -version-info $(LT_VERSION)
libneogb_la_CFLAGS = $(SIMD_FLAGS) $(CPUEXT_FLAGS) $(OPENMP_CFLAGS) -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare
libneogb_la_CFLAGS = $(OPENMP_CFLAGS) -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare

EXTRA_DIST = basis.h \
data.h \
Expand Down
3 changes: 1 addition & 2 deletions src/neogb/la_ff_16.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
#include "data.h"
#include "../msolve/streams.h"

/* That's also enough if AVX512 is avaialable on the system */
#if defined HAVE_AVX2
#if defined(HAVE_AVX2) || defined(HAVE_AVX512_F)
#include <immintrin.h>
#elif defined __aarch64__
#include <arm_neon.h>
Expand Down
3 changes: 1 addition & 2 deletions src/neogb/la_ff_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
#include "data.h"
#include "../msolve/streams.h"

/* That's also enough if AVX512 is available on the system */
#if defined HAVE_AVX2
#if defined(HAVE_AVX2) || defined(HAVE_AVX512_F)
#include <immintrin.h>
#elif defined __aarch64__
#include <arm_neon.h>
Expand Down
3 changes: 1 addition & 2 deletions src/neogb/la_ff_8.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
#include "data.h"
#include "../msolve/streams.h"

/* That's also enough if AVX512 is avaialable on the system */
#if defined HAVE_AVX2
#if defined(HAVE_AVX2) || defined(HAVE_AVX512_F)
#include <immintrin.h>
#elif defined __aarch64__
#include <arm_neon.h>
Expand Down
2 changes: 1 addition & 1 deletion src/usolve/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ noinst_LTLIBRARIES = libusolve.la
libusolve_la_SOURCES = usolve.c
libusolve_ladir = $(includedir)/msolve/usolve
libusolve_la_HEADERS = libusolve.h
libusolve_la_CFLAGS = $(SIMD_FLAGS) $(CPUEXT_FLAGS) $(OPENMP_CFLAGS) -Wall -Wextra
libusolve_la_CFLAGS = $(OPENMP_CFLAGS) -Wall -Wextra

EXTRA_DIST = libusolve.h \
bisection.h \
Expand Down
Loading