Information : Suite au changement de serveur et d'adresse IP vos commandes git ssh vous retournerons probablement un message d'alerte. Il faut supprimer l'entrée Gitlbab dans le fichier .ssh/known_hosts

Commit cbe3a4dd authored by Emmanuel Thomé's avatar Emmanuel Thomé
Browse files

Merge branch 'future-lingen' into 'master'

Future lingen

See merge request !1
parents 79a432fe 9cbf86dd
Pipeline #165403 passed with stage
in 12 minutes
......@@ -51,16 +51,24 @@ set(CADO_DIST_ARCHIVE_NAME "cado-nfs-${CADO_VERSION_STRING}")
#####################################################################
# If you change the min version, also change scripts/call_cmake.sh
cmake_minimum_required(VERSION 2.8.11)
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
# VERSION_GREATER_EQUAL is newish
if (NOT CMAKE_VERSION VERSION_LESS 3.1)
# does this get in the way with cmake tests ?? We used to have
# CMP0054 OLD at some point.
cmake_policy(SET CMP0054 NEW)
endif()
endif()
cmake_minimum_required(VERSION 3.4.0)
cmake_policy(SET CMP0003 NEW)
# does this get in the way with cmake tests ?? We used to have
# CMP0054 OLD at some point.
cmake_policy(SET CMP0054 NEW)
# IN_LIST
cmake_policy(SET CMP0057 NEW)
# Here's how we set cmake policies that are unknown to old cmake
# versions.
#
# VERSION_GREATER_EQUAL is for cmake 3.7+
# if (NOT CMAKE_VERSION VERSION_LESS 3.8)
# cmake_policy(SET CMP1234 NEW)
# endif()
if (MINGW)
# we could do this as well in other cases.
......@@ -69,6 +77,8 @@ if (MINGW)
set(CMAKE_COLOR_MAKEFILE OFF)
endif()
set(CMAKE_REQUIRED_QUIET 1)
#####################################################################
# What are we building ?
......@@ -144,48 +154,25 @@ if(CMAKE_COMPILER_IS_GNUCC)
endif()
# Someday we'll enable c11. This will provide us aligned_alloc.
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set (CMAKE_CXX_FLAGS "-g -W -Wall ${CMAKE_CXX_FLAGS}")
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7)
# only gcc-4.8 is supposed to be c++11-complete. But for what we
# use, gcc-4.7 will be ok.
message(STATUS "Enabling C++11 support")
set(HAVE_CXX11 1)
endif()
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7 AND
CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
# see comment in utils/smallset.h
message(STATUS "Forcing -fabi-version=6 for g++-4.[789]")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fabi-version=6")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
message(FATAL_ERROR "cado-nfs requires gcc version 5 or greater")
endif()
if(HAVE_CXX11)
if(MINGW)
set (CMAKE_CXX_FLAGS "-std=gnu++11 ${CMAKE_CXX_FLAGS}")
else()
set (CMAKE_CXX_FLAGS "-std=c++11 -Wno-c++11-compat ${CMAKE_CXX_FLAGS}")
endif()
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-literal-suffix")
endif()
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0 AND
CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
# https://gcc.gnu.org/ml/gcc/2017-05/msg00073.html
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-psabi")
endif()
set(HAVE_CXX11 1)
if(MINGW)
set (CMAKE_CXX_FLAGS "-std=gnu++11 ${CMAKE_CXX_FLAGS}")
else()
# It seems that even g++-4.6.3, as shipped in ubuntu 12.04, is
# sufficient for the little we use, provided we use the -std=c++0x
# flag (-std=c++11 replaced it with gcc-4.7.0).
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6.3)
set (CMAKE_CXX_FLAGS "-std=c++0x -Wno-c++11-compat -g -W -Wall ${CMAKE_CXX_FLAGS}")
else()
if(MINGW)
set (CMAKE_CXX_FLAGS "-std=gnu++98 ${CMAKE_CXX_FLAGS}")
else()
set (CMAKE_CXX_FLAGS "-std=c++98 ${CMAKE_CXX_FLAGS}")
endif()
endif()
set (CMAKE_CXX_FLAGS "-std=c++11 -Wno-c++11-compat ${CMAKE_CXX_FLAGS}")
endif()
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-literal-suffix")
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0 AND
CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
# https://gcc.gnu.org/ml/gcc/2017-05/msg00073.html
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-psabi")
endif()
set (CMAKE_CXX_FLAGS "-export-dynamic ${CMAKE_CXX_FLAGS}")
endif()
if(CMAKE_C_COMPILER_ID MATCHES "Intel")
......@@ -266,7 +253,7 @@ math (EXPR ULONG_BITS "8*${ulong_size}")
math (EXPR ULONGLONG_BITS "8*${ulonglong_size}")
message(STATUS "bits in unsigned long: ${ULONG_BITS}")
message(STATUS "bits in unsigned long long: ${ULONGLONG_BITS}")
include(${CADO_NFS_SOURCE_DIR}/config/check_uint64_type.cmake)
include(${CADO_NFS_SOURCE_DIR}/config/check_types.cmake)
include(${CADO_NFS_SOURCE_DIR}/config/gmp_randstate.cmake)
......@@ -280,8 +267,10 @@ if (DEFINED ENV{NO_SSE})
message(STATUS "As per $NO_SSE, disabling all simd intrinsics")
elseif (ULONG_BITS EQUAL 32)
list(APPEND GF2X_CONFIGURE_FLAGS --disable-sse2)
include("${CADO_NFS_SOURCE_DIR}/config/mmx.cmake")
message(STATUS "32-bit platform, lazily disabling all Intel simd intrinsics")
else()
set(HAVE_MMX 1)
include("${CADO_NFS_SOURCE_DIR}/config/sse2.cmake")
include("${CADO_NFS_SOURCE_DIR}/config/sse3.cmake")
include("${CADO_NFS_SOURCE_DIR}/config/ssse3.cmake")
......@@ -330,6 +319,7 @@ include("${CADO_NFS_SOURCE_DIR}/config/aligned_alloc.cmake")
include("${CADO_NFS_SOURCE_DIR}/config/alignas.cmake")
include("${CADO_NFS_SOURCE_DIR}/config/glibc_vector_internals.cmake")
include("${CADO_NFS_SOURCE_DIR}/config/int128.cmake")
include("${CADO_NFS_SOURCE_DIR}/config/m4ri.cmake")
set(CADO_SHARED)
......@@ -353,8 +343,6 @@ else()
endif()
######################################################################
# Try to detect whether pthreads and/or MPI are available.
# This checks the MPI and PTHREADS environment variables.
......@@ -447,8 +435,6 @@ include_directories(${CADO_NFS_BINARY_DIR}/gf2x)
############################################################
add_custom_command(OUTPUT ${CADO_NFS_BINARY_DIR}/gf2x/Makefile
COMMAND mkdir -p ${CADO_NFS_BINARY_DIR}/gf2x
COMMAND echo Configuring gf2x with options ${GF2X_CONFIGURE_FLAGS}
......@@ -463,11 +449,6 @@ add_custom_target(gf2x-build ALL
COMMENT "Building gf2x"
)
# set(GF2X_LIB_FILE ${CADO_NFS_BINARY_DIR}/gf2x/.libs/libgf2x.a)
# set(GF2X-FFT_LIB_FILE ${CADO_NFS_BINARY_DIR}/gf2x/gf2x-fft/.libs/libgf2x-fft.a)
# set(CANTOR128_LIB_FILE ${CADO_NFS_BINARY_DIR}/gf2x/gf2x-fft/.libs/libcantor128.a)
# add_subdirectory (gf2x-fft)
add_subdirectory (utils)
add_subdirectory (polyselect)
......
......@@ -5,7 +5,7 @@ TOP:=.
# This makefile is a placeholder. Please have a look to $(TOP)/scripts/call_cmake.sh,
# and (possibly) edit a file $(TOP)/local.sh to tweak your build preferences.
all polyselect sqrt utils: ; +@MAKE=$(MAKE) $(TOP)/scripts/call_cmake.sh $@
tags: ; grep -h '^[^#].*\.[ch]' files.dist files.nodist | xargs ctags
tags: ; grep -h '^[^#].*\.[ch]' files.dist files.nodist | xargs ctags --fields=+l --langmap=c:.c.h
etags: ; grep -h '^[^#].*\.[ch]' files.dist files.nodist | xargs etags
show variables install tidy cmake dist: ; +@MAKE=$(MAKE) $(TOP)/scripts/call_cmake.sh $@
%: ; +@MAKE=$(MAKE) $(TOP)/scripts/call_cmake.sh $@
......@@ -65,7 +65,6 @@
...
fun:GOMP_parallel
...
fun:main
}
{
another_openmp_leak
......@@ -114,6 +113,19 @@
fun:_ZN11thread_pool*
...
}
{
another_one_quite_similar_to_the_previous_leak
Memcheck:Leak
match-leak-kinds: possible
fun:calloc
fun:allocate_dtv
fun:_dl_allocate_tls
fun:allocate_stack
fun:pthread_create*
...
fun:_ZN11thread_poolC1EmRdm
...
}
{
ok_there_is_an_annoying_error_with_glibc_2_22_which_seems_hard_to_reproduce_but_let_us_write_a_suppression_for_it
Memcheck:Cond
......
......@@ -27,6 +27,8 @@
// #cmakedefine HAVE_KNOWN_GMP_RANDOM_BEHAVIOUR
#cmakedefine HAVE_MMX
#cmakedefine HAVE_SSE2
#cmakedefine HAVE_SSE3
......@@ -125,6 +127,9 @@
#define EXECUTABLE_SUFFIX "@CMAKE_EXECUTABLE_SUFFIX@"
#endif
#cmakedefine HAVE_M4RI
#cmakedefine HAVE_M4RIE
#cmakedefine HAVE_JEVENTS
#cmakedefine HAVE_GLIBC_VECTOR_INTERNALS
......@@ -132,8 +137,49 @@
#cmakedefine HAVE_ALIGNED_ALLOC
#cmakedefine UINT64_T_IS_UNSIGNED_LONG
#cmakedefine UINT64_T_IS_UNSIGNED_LONG_LONG
#cmakedefine UINT64_T_IS_EXACTLY_UNSIGNED_LONG
#cmakedefine UINT64_T_IS_EXACTLY_UNSIGNED_LONG_LONG
#cmakedefine INT64_T_IS_EXACTLY_LONG
#cmakedefine INT64_T_IS_EXACTLY_LONG_LONG
#cmakedefine UINT32_T_IS_EXACTLY_UNSIGNED_LONG
#cmakedefine UINT32_T_IS_EXACTLY_UNSIGNED_INT
#cmakedefine INT32_T_IS_EXACTLY_LONG
#cmakedefine INT32_T_IS_EXACTLY_INT
#cmakedefine MP_LIMB_T_IS_EXACTLY_UNSIGNED_LONG
#cmakedefine MP_LIMB_T_IS_EXACTLY_UNSIGNED_LONG_LONG
#cmakedefine MP_SIZE_T_IS_EXACTLY_LONG_LONG
#cmakedefine MP_SIZE_T_IS_EXACTLY_LONG
#cmakedefine MP_SIZE_T_IS_EXACTLY_INT
#cmakedefine MPZ_INTERNAL_SIZE_T_IS_EXACTLY_LONG_LONG
#cmakedefine MPZ_INTERNAL_SIZE_T_IS_EXACTLY_LONG
#cmakedefine MPZ_INTERNAL_SIZE_T_IS_EXACTLY_INT
#cmakedefine UINT64_T_IS_COMPATIBLE_WITH_UNSIGNED_LONG
#cmakedefine UINT64_T_IS_COMPATIBLE_WITH_UNSIGNED_LONG_LONG
#cmakedefine INT64_T_IS_COMPATIBLE_WITH_LONG
#cmakedefine INT64_T_IS_COMPATIBLE_WITH_LONG_LONG
#cmakedefine UINT32_T_IS_COMPATIBLE_WITH_UNSIGNED_LONG
#cmakedefine UINT32_T_IS_COMPATIBLE_WITH_UNSIGNED_INT
#cmakedefine INT32_T_IS_COMPATIBLE_WITH_LONG
#cmakedefine INT32_T_IS_COMPATIBLE_WITH_INT
#cmakedefine MP_LIMB_T_IS_COMPATIBLE_WITH_UNSIGNED_LONG
#cmakedefine MP_LIMB_T_IS_COMPATIBLE_WITH_UNSIGNED_LONG_LONG
#cmakedefine MP_SIZE_T_IS_COMPATIBLE_WITH_LONG_LONG
#cmakedefine MP_SIZE_T_IS_COMPATIBLE_WITH_LONG
#cmakedefine MP_SIZE_T_IS_COMPATIBLE_WITH_INT
#cmakedefine MPZ_INTERNAL_SIZE_T_IS_COMPATIBLE_WITH_LONG_LONG
#cmakedefine MPZ_INTERNAL_SIZE_T_IS_COMPATIBLE_WITH_LONG
#cmakedefine MPZ_INTERNAL_SIZE_T_IS_COMPATIBLE_WITH_INT
#define CADO_MPI_SIZE_T @CADO_MPI_SIZE_T@
#define CADO_MPI_SSIZE_T @CADO_MPI_SSIZE_T@
#define CADO_MPI_UINT32_T @CADO_MPI_UINT32_T@
#define CADO_MPI_UINT64_T @CADO_MPI_UINT64_T@
#define CADO_MPI_INT32_T @CADO_MPI_INT32_T@
#define CADO_MPI_INT64_T @CADO_MPI_INT64_T@
#define CADO_MPI_MP_LIMB_T @CADO_MPI_MP_LIMB_T@
#define CADO_MPI_MP_SIZE_T @CADO_MPI_MP_SIZE_T@
#define CADO_MPI_MPZ_INTERNAL_SIZE_T @CADO_MPI_MPZ_INTERNAL_SIZE_T@
/* vim:set ft=c: */
#endif /* CADO_CONFIG_H_ */
......@@ -9,6 +9,9 @@
* the __mpiexec__ command has been found. */
#cmakedefine HAVE_MPI "@HAVE_MPI@"
#cmakedefine MPI_C_COMPILER "@MPI_C_COMPILER@"
#cmakedefine MPI_CXX_COMPILER "@MPI_CXX_COMPILER@"
#cmakedefine MPIEXEC "@MPIEXEC@"
#endif /* CADO_MPI_CONFIG_H_IN */
# expanded from cmake-3.14's CheckCXXSourceCompiles
#
# added much-to-desire CMAKE_REQUIRED_LIBDIRS, together with some help
# text.
#
# The name of the macro was changed too.
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#[=======================================================================[.rst:
CADO_CheckCXXSourceCompiles
----------------------
Check if given C++ source compiles and links into an executable.
.. command:: cado_check_cxx_source_compiles
.. code-block:: cmake
cado_check_cxx_source_compiles(<code> <resultVar>
[FAIL_REGEX <regex1> [<regex2>...]])
Check that the source supplied in ``<code>`` can be compiled as a C++ source
file and linked as an executable (so it must contain at least a ``main()``
function). The result will be stored in the internal cache variable specified
by ``<resultVar>``, with a boolean true value for success and boolean false
for failure. If ``FAIL_REGEX`` is provided, then failure is determined by
checking if anything in the output matches any of the specified regular
expressions.
The underlying check is performed by the :command:`try_compile` command. The
compile and link commands can be influenced by setting any of the following
variables prior to calling ``cado_check_cxx_source_compiles()``:
``CMAKE_REQUIRED_FLAGS``
Additional flags to pass to the compiler. Note that the contents of
:variable:`CMAKE_CXX_FLAGS <CMAKE_<LANG>_FLAGS>` and its associated
configuration-specific variable are automatically added to the compiler
command before the contents of ``CMAKE_REQUIRED_FLAGS``.
``CMAKE_REQUIRED_DEFINITIONS``
A :ref:`;-list <CMake Language Lists>` of compiler definitions of the form
``-DFOO`` or ``-DFOO=bar``. A definition for the name specified by
``<resultVar>`` will also be added automatically.
``CMAKE_REQUIRED_INCLUDES``
A :ref:`;-list <CMake Language Lists>` of header search paths to pass to
the compiler. These will be the only header search paths used by
``try_compile()``, i.e. the contents of the :prop_dir:`INCLUDE_DIRECTORIES`
directory property will be ignored.
``CMAKE_REQUIRED_LIBDIRS``
A :ref:`;-list <CMake Language Lists>` of library search paths to pass to
the linker. These will be the only linker search paths used by
``try_compile()``, i.e. the contents of the :prop_dir:`LINK_DIRECTORIES`
directory property will be ignored.
``CMAKE_REQUIRED_LINK_OPTIONS``
A :ref:`;-list <CMake Language Lists>` of options to add to the link
command (see :command:`try_compile` for further details).
``CMAKE_REQUIRED_LIBRARIES``
A :ref:`;-list <CMake Language Lists>` of libraries to add to the link
command. These can be the name of system libraries or they can be
:ref:`Imported Targets <Imported Targets>` (see :command:`try_compile` for
further details).
``CMAKE_REQUIRED_QUIET``
If this variable evaluates to a boolean true value, all status messages
associated with the check will be suppressed.
The check is only performed once, with the result cached in the variable
named by ``<resultVar>``. Every subsequent CMake run will re-use this cached
value rather than performing the check again, even if the ``<code>`` changes.
In order to force the check to be re-evaluated, the variable named by
``<resultVar>`` must be manually removed from the cache.
#]=======================================================================]
# we want this to work with oldish cmake, so no include_guard
# include_guard(GLOBAL)
macro(CADO_CHECK_CXX_SOURCE_COMPILES SOURCE VAR)
if(NOT DEFINED "${VAR}")
set(_FAIL_REGEX)
set(_key)
foreach(arg ${ARGN})
if("${arg}" MATCHES "^(FAIL_REGEX)$")
set(_key "${arg}")
elseif(_key)
list(APPEND _${_key} "${arg}")
else()
message(FATAL_ERROR "Unknown argument:\n ${arg}\n")
endif()
endforeach()
set(MACRO_CHECK_FUNCTION_DEFINITIONS
"-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
if(CMAKE_REQUIRED_LINK_OPTIONS)
set(CADO_CHECK_CXX_SOURCE_COMPILES_ADD_LINK_OPTIONS
LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS})
else()
set(CADO_CHECK_CXX_SOURCE_COMPILES_ADD_LINK_OPTIONS)
endif()
if(CMAKE_REQUIRED_LIBRARIES)
set(CADO_CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES
LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
else()
set(CADO_CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES)
endif()
if(CMAKE_REQUIRED_LIBDIRS)
set(CADO_CHECK_CXX_SOURCE_COMPILES_ADD_LIBDIRS
"-DLINK_DIRECTORIES:STRING=${CMAKE_REQUIRED_LIBDIRS}")
else()
set(CADO_CHECK_CXX_SOURCE_COMPILES_ADD_LIBDIRS)
endif()
if(CMAKE_REQUIRED_INCLUDES)
set(CADO_CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
else()
set(CADO_CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES)
endif()
file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx"
"${SOURCE}\n")
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Performing Test ${VAR}")
endif()
try_compile(${VAR}
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
${CADO_CHECK_CXX_SOURCE_COMPILES_ADD_LINK_OPTIONS}
${CADO_CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES}
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
"${CADO_CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES}"
"${CADO_CHECK_CXX_SOURCE_COMPILES_ADD_LIBDIRS}"
OUTPUT_VARIABLE OUTPUT)
foreach(_regex ${_FAIL_REGEX})
if("${OUTPUT}" MATCHES "${_regex}")
set(${VAR} 0)
endif()
endforeach()
if(${VAR})
set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Performing Test ${VAR} - Success")
endif()
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Performing C++ SOURCE FILE Test ${VAR} succeeded with the following output:\n"
"${OUTPUT}\n"
"Source file was:\n${SOURCE}\n")
else()
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Performing Test ${VAR} - Failed")
endif()
set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Performing C++ SOURCE FILE Test ${VAR} failed with the following output:\n"
"${OUTPUT}\n"
"Source file was:\n${SOURCE}\n")
endif()
endif()
endmacro()
# check_type_equality does _two_ things.
#
# 1 - check if the given type is exactly equal to one of the provided
# types, and define the corresponding macro FOO_IS_EXACTLY_BAR. It is
# not required that any of these succeeds. This is used to avoid
# exposing templates that would be ambiguous.
#
# 2 - check if the given type is compatible (size and
# signedness-wise) to one of the provided types, and define the
# corresponding macro FOO_IS_COMPATIBLE_WITH_BAR. It *is* required
# that one of these succeeds. This is chiefly used to define MPI type
# aliases.
# include(CheckCXXSourceCompiles)
include(${CADO_NFS_SOURCE_DIR}/config/cado_check_cxx_source_compiles.cmake)
macro(testcode_type_exact_eq type1 type2)
set(test_code "
#include <type_traits>
#include <stdint.h>
#include <stdio.h>
#include <gmp.h>
int main()
{
static_assert(std::is_same<${type1}, ${type2}>::value, \"not this type\");
return 0;
}
"
)
endmacro()
macro(testcode_type_compatible_eq type1 type2)
set(test_code "
#include <type_traits>
#include <stdint.h>
#include <stdio.h>
#include <gmp.h>
int main()
{
static_assert(std::is_same<${type1}, ${type2}>::value ||
(sizeof(${type1}) == sizeof(${type2})
&& std::is_signed<${type1}>::value == std::is_signed<${type2}>::value)
, \"not this type\");
return 0;
}
"
)
endmacro()
set(CADO_C_NAME_UINT64_T "uint64_t")
set(CADO_C_NAME_UINT32_T "uint32_t")
set(CADO_C_NAME_INT64_T "int64_t")
set(CADO_C_NAME_INT32_T "int32_t")
set(CADO_C_NAME_UNSIGNED "unsigned int")
set(CADO_C_NAME_INT "int")
set(CADO_C_NAME_UNSIGNED_LONG "unsigned long")
set(CADO_C_NAME_UNSIGNED_LONG_LONG "unsigned long long")
set(CADO_C_NAME_LONG "long")
set(CADO_C_NAME_LONG_LONG "long long")
set(CADO_C_NAME_SIZE_T "size_t")
set(CADO_C_NAME_SSIZE_T "ssize_t")
set(CADO_C_NAME_MP_LIMB_T "mp_limb_t")
set(CADO_C_NAME_MP_SIZE_T "mp_size_t")
set(CADO_C_NAME_MPZ_INTERNAL_SIZE_T "decltype(__mpz_struct::_mp_size)")
set(CMAKE_REQUIRED_LINK_OPTIONS)
set(CMAKE_REQUIRED_LIBDIRS ${GMP_LIBDIR})
set(CMAKE_REQUIRED_DEFINITIONS)
set(CMAKE_REQUIRED_INCLUDES ${GMP_INCDIR})
set(CMAKE_REQUIRED_LIBRARIES ${gmp_libname})
macro(check_type_equality basetype)
set(found_compatible)
set(found_exact)
set(must_list)
foreach(t ${ARGN})
testcode_type_exact_eq("${CADO_C_NAME_${basetype}}" "${CADO_C_NAME_${t}}")
CADO_CHECK_CXX_SOURCE_COMPILES("${test_code}" ${basetype}_IS_EXACTLY_${t})
if(${basetype}_IS_EXACTLY_${t})
message(STATUS "${CADO_C_NAME_${basetype}} == ${CADO_C_NAME_${t}} (exact match)")
if(NOT found_compatible)
set(${basetype}_IS_COMPATIBLE_WITH_${t})
set(found_compatible 1)
set(CADO_MPI_${basetype} MPI_${t})
endif()
else()
testcode_type_compatible_eq("${CADO_C_NAME_${basetype}}" "${CADO_C_NAME_${t}}")
CADO_CHECK_CXX_SOURCE_COMPILES("${test_code}" ${basetype}_IS_COMPATIBLE_WITH_${t})
if(${basetype}_IS_COMPATIBLE_WITH_${t})
message(STATUS "${CADO_C_NAME_${basetype}} == ${CADO_C_NAME_${t}} (compatibility match)")
if(NOT found_compatible)
# keep only the first match.
set(found_compatible 1)
set(CADO_MPI_${basetype} MPI_${t})
endif()
endif()
endif()
list(APPEND must_list "${CADO_C_NAME_${t}}")
endforeach()
if(NOT found_compatible)
string(JOIN " or " must ${must_list})
message(FATAL_ERROR "${CADO_C_NAME_${basetype}} must be either unsigned long or unsigned long long")
endif()
endmacro()
check_type_equality(UINT64_T UNSIGNED_LONG UNSIGNED_LONG_LONG)
check_type_equality(SIZE_T UNSIGNED_LONG UNSIGNED_LONG_LONG)
check_type_equality(MP_LIMB_T UNSIGNED_LONG UNSIGNED_LONG_LONG)
check_type_equality(UINT32_T UNSIGNED_LONG UNSIGNED)
check_type_equality(INT64_T LONG LONG_LONG)
check_type_equality(SSIZE_T LONG LONG_LONG)
check_type_equality(INT32_T LONG INT)
check_type_equality(MP_SIZE_T LONG_LONG LONG INT)
check_type_equality(MPZ_INTERNAL_SIZE_T LONG_LONG LONG INT)
# We need to know what exact type uint64_t is typedef'd to. The reason is
# that some templates would otherwise resolve ambiguously if we define
# both.
include(CheckCXXSourceCompiles)
macro(testcode_uint64_is type)
set(test_code "
#include <type_traits>
#include <stdint.h>
#include <stdio.h>
int main()
{
static_assert(std::is_same<uint64_t, ${type}>::value, \"not this type\");
return 0;
}
"
)
endmacro()
set(CMAKE_REQUIRED_FLAGS)
set(CMAKE_REQUIRED_DEFINITIONS)
set(CMAKE_REQUIRED_INCLUDES)
set(CMAKE_REQUIRED_LIBRARIES)
testcode_uint64_is("unsigned long")
CHECK_CXX_SOURCE_COMPILES("${test_code}" UINT64_T_IS_UNSIGNED_LONG)
testcode_uint64_is("unsigned long long")
CHECK_CXX_SOURCE_COMPILES("${test_code}" UINT64_T_IS_UNSIGNED_LONG_LONG)
# Define CURL=1 in local.sh to enable curl backend for bwc/u64_dispatch
# (if you do not know what this means, you do not need this
# functionality)
if($ENV{CURL})
set(WANT_CURL 1)
else()
string(REGEX MATCH "^/.*$" WANT_CURL "$ENV{CURL}")
if(WANT_CURL STREQUAL "")
set(WANT_CURL 0)
else()
set(WANT_CURL 1)
endif()
endif()
if(${WANT_CURL})
# You can force a path to curl/curl.h using the environment variables CURL, or
# CURL_INCDIR and CURL_LIBDIR (note that curl/curl.h is also searched)
if("$ENV{CURL}" MATCHES "^(1|YES|yes|ON|on|)$")
set(HAS_CURL_OVERRIDE 0)
else()
set(HAS_CURL_OVERRIDE 1)
endif()
if (HAS_CURL_OVERRIDE)
message(STATUS "Adding $ENV{CURL} to the search path for cURL")
set(CURL_INCDIR_HINTS "$ENV{CURL}/include" ${CURL_INCDIR_HINTS})
set(CURL_INCDIR_HINTS "$ENV{CURL}" ${CURL_INCDIR_HINTS})
set(CURL_LIBDIR_HINTS "$ENV{CURL}/lib" ${CURL_LIBDIR_HINTS})
set(CURL_LIBDIR_HINTS "$ENV{CURL}/.libs" ${CURL_LIBDIR_HINTS})
endif()
string(COMPARE NOTEQUAL "$ENV{CURL_INCDIR}" "" HAS_CURL_INCDIR_OVERRIDE)
if (HAS_CURL_INCDIR_OVERRIDE)
message(STATUS "Adding $ENV{CURL_INCDIR} to the search path for cURL")
set(CURL_INCDIR_HINTS "$ENV{CURL_INCDIR}" ${CURL_INCDIR_HINTS})
endif()
string(COMPARE NOTEQUAL "$ENV{CURL_LIBDIR}" "" HAS_CURL_LIBDIR_OVERRIDE)
if (HAS_CURL_LIBDIR_OVERRIDE)
message(STATUS "Adding $ENV{CURL_LIBDIR} to the search path for cURL")
set(CURL_LIBDIR_HINTS "$ENV{CURL_LIBDIR}" ${CURL_LIBDIR_HINTS})
endif()
find_path (CURL_INCDIR curl/curl.h HINTS ${CURL_INCDIR_HINTS} DOC "cURL headers")
find_library(CURL_LIB curl HINTS ${CURL_LIBDIR_HINTS} DOC "cURL library")
# Yeah. CMake docs defines the ``PATH'' to a file as being its dirname. Very
# helpful documentation there :-((
message(STATUS "CURL_INCDIR=${CURL_INCDIR}")
message(STATUS "CURL_LIB=${CURL_LIB}")
string(COMPARE NOTEQUAL "${CURL_INCDIR}" CURL_INCDIR-NOTFOUND CURL_INCDIR_OK)
string(COMPARE NOTEQUAL "${CURL_LIB}" CURL_LIB-NOTFOUND CURL_LIBDIR_OK)
get_filename_component(CURL_LIBDIR ${CURL_LIB} PATH)
if(CURL_INCDIR_OK AND CURL_LIBDIR_OK)
include_directories(${CURL_INCDIR})
link_directories(${CURL_LIBDIR})
include(CheckCSourceCompiles)
set(CMAKE_REQUIRED_FLAGS "-L${CURL_LIBDIR}")
set(CMAKE_REQUIRED_DEFINITIONS)
set(CMAKE_REQUIRED_INCLUDES ${CURL_INCDIR})
set(CMAKE_REQUIRED_LIBRARIES "-lcurl")
CHECK_C_SOURCE_COMPILES("
#include <curl/curl.h>
int main(void)
{
CURL *curl;
curl = curl_easy_init();
curl_easy_cleanup(curl);
return 0;
}
" HAVE_CURL)
endif()
endif()
if (ULONG_BITS EQUAL 64)
# m4ri pulls dependencies on some external libs only based on the
# existence of some headers (-lz, -lpng16). This is mostly a
# nuisance.
if (IS_DIRECTORY ${CADO_NFS_SOURCE_DIR}/linalg/m4ri)
if (EXISTS ${CADO_NFS_SOURCE_DIR}/linalg/m4ri/configure)
message(STATUS "Found linalg/m4ri source tree, enabling external component")
set(HAVE_M4RI 1)
else()
message(STATUS "Found linalg/m4ri source tree, but no ./configure there. Run autoreconf ?")
set(HAVE_M4RI 0)
endif()
else()
set(HAVE_M4RI 0)
endif()
else()
set(HAVE_M4RI 0)
endif()
if (HAVE_M4RI)
if (IS_DIRECTORY ${CADO_NFS_SOURCE_DIR}/linalg/m4rie)
if (EXISTS ${CADO_NFS_SOURCE_DIR}/linalg/m4rie/configure)
message(STATUS "Found linalg/m4rie source tree, enabling external component")
set(HAVE_M4RIE 1)
else()
message(STATUS "Found linalg/m4rie source tree, but no ./configure there. Run autoreconf ?")
endif()
endif()
endif()
/* This source file is our test case for mmx support. If this can be
*/
#include <stdint.h>
#include <stdlib.h>
#include <mmintrin.h>
int main(int argc, char *argv[])
{
volatile uint64_t a1 = 42;
__m64 mmask = _mm_set1_pi8(a1);
__m64 foo = (__m64) a1;
return _m_to_int(_mm_cmpeq_pi8(foo, mmask)) != 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
# MMX
message(STATUS "Testing whether mmx code can be used")
try_run(mmx_runs mmx_compiles
${PROJECT_BINARY_DIR}/config
${PROJECT_SOURCE_DIR}/config/mmx.c)
if(mmx_compiles)
if (mmx_runs MATCHES FAILED_TO_RUN)
message(STATUS "Testing whether mmx code can be used -- No")
set (HAVE_MMX 0)
else()
message(STATUS "Testing whether mmx code can be used -- Yes")
set (HAVE_MMX 1)
endif()
else()
try_run(mmx_runs mmx_compiles
${PROJECT_BINARY_DIR}/config
${PROJECT_SOURCE_DIR}/config/mmx.c
COMPILE_DEFINITIONS -mmmx)
if(mmx_compiles)
if (mmx_runs MATCHES FAILED_TO_RUN)
message(STATUS "Testing whether mmx code can be used -- No")
set (HAVE_MMX 0)
else()
message("${mmx_runs}")
message(STATUS "Testing whether mmx code can be used -- Yes, with -mmmx")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mmmx")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmmx")
set (HAVE_MMX 1)
endif()
else()
message(STATUS "Testing whether mmx code can be used -- No (cannot compile)")
set (HAVE_MMX 0)
endif()
endif()
......@@ -19,7 +19,6 @@ portability.h
typecast.h
config/asm_sample.c
config/ccwrap.pl.in
config/curl.cmake
config/cxxwrap.pl.in
config/gas-assembly.cmake
config/gcc-inline-assembly.cmake
......@@ -85,8 +84,8 @@ filter/sm_simple.cpp
filter/filter_galois.cpp
linalg/CMakeLists.txt
linalg/Makefile
linalg/blockmatrix.c
linalg/blockmatrix.h
linalg/blockmatrix.cpp
linalg/blockmatrix.hpp
linalg/bwc/CMakeLists.txt
linalg/bwc/GUIDED_TOUR_OF_SOURCES
linalg/bwc/Makefile
......@@ -100,14 +99,7 @@ linalg/bwc/async.c
linalg/bwc/async.h
linalg/bwc/balancing.c
linalg/bwc/balancing.h
linalg/bwc/balancing_curl_source.c
linalg/bwc/balancing_curl_source.h
linalg/bwc/balancing_data_source.h
linalg/bwc/balancing_file_source.c
linalg/bwc/balancing_file_source.h
linalg/bwc/balancing_mpi_source.c
linalg/bwc/balancing_mpi_source.h
linalg/bwc/balancing_workhorse.c
linalg/bwc/balancing_workhorse.cpp
linalg/bwc/balancing_workhorse.h
linalg/bwc/bw-common.c
linalg/bwc/bw-common.h
......@@ -117,13 +109,12 @@ tests/linalg/bwc/bwc-ptrace.sh
tests/linalg/bwc/bwc-test-secure-continuation.sh
linalg/bwc/bwc.pl
linalg/bwc/bwc_config_h.in
linalg/bwc/cleanup.c
linalg/bwc/cleanup.cpp
linalg/bwc/dispatch.cpp
linalg/bwc/gather.cpp
linalg/bwc/intersections.c
linalg/bwc/intersections.h
linalg/bwc/krylov.cpp
linalg/bwc/lingen_binary.cpp
linalg/bwc/lingen_mat_types.hpp
linalg/bwc/matmul-basic.c
linalg/bwc/matmul-basicp.cpp
......@@ -154,7 +145,6 @@ linalg/bwc/matmul_facade.c
linalg/bwc/matmul_facade.h
linalg/bwc/matmul_top.c
linalg/bwc/matmul_top.h
linalg/matops.cpp
linalg/bwc/mf.c
linalg/bwc/mf.h
linalg/bwc/mf_bal.c
......@@ -211,9 +201,7 @@ linalg/bwc/xdotprod.c
linalg/bwc/xdotprod.h
linalg/bwc/xvectors.c
linalg/bwc/xvectors.h
linalg/characters.c
linalg/gauss.c
linalg/gauss.h
linalg/characters.cpp
linalg/rowset_heap.cpp
linalg/rowset_heap.h
local.sh.example
......@@ -684,16 +672,19 @@ linalg/bwc/mpfq/mpfq_p_3.c
linalg/bwc/mpfq/mpfq_p_3.h
linalg/bwc/mpfq/mpfq_p_3_t.c
linalg/bwc/mpfq/mpfq_p_3_t.h
linalg/bwc/plingen.cpp
linalg/bwc/plingen.h
linalg/bwc/plingen-tuning.h
linalg/bwc/plingen-tuning.cpp
linalg/bwc/lingen-matpoly.c
linalg/bwc/lingen-matpoly.h
linalg/bwc/lingen-polymat.c
linalg/bwc/lingen-polymat.h
linalg/bwc/lingen-bigmatpoly.c
linalg/bwc/lingen-bigmatpoly.h
linalg/bwc/lingen.cpp
linalg/bwc/lingen_tuning_cache.cpp
linalg/bwc/lingen_tuning_cache.hpp
linalg/bwc/lingen_tune_cutoffs.cpp
linalg/bwc/lingen_tune_cutoffs.hpp
linalg/bwc/lingen_tuning.hpp
linalg/bwc/lingen_tuning.cpp
linalg/bwc/lingen_matpoly.cpp
linalg/bwc/lingen_matpoly.hpp
linalg/bwc/lingen_polymat.cpp
linalg/bwc/lingen_polymat.hpp
linalg/bwc/lingen_bigmatpoly.cpp
linalg/bwc/lingen_bigmatpoly.hpp
config/asprintf.c
config/asprintf.cmake
sieve/las-descent-trees.cpp
......@@ -748,7 +739,6 @@ linalg/bwc/flint-fft/split_bits.c
linalg/bwc/flint-fft/transform_interface.c
linalg/bwc/flint-fft/transform_interface.h
linalg/bwc/flint-fft/ulong_extras.h
linalg/bwc/test-flint.c
parameters/dlp/params.p2dd20
parameters/dlp/p2dd20.hint
parameters/dlp/p155.hint
......@@ -769,7 +759,6 @@ parameters/dlp/params.p90
parameters/dlp/params.p95
parameters/dlp/params.p100
parameters/dlp/params.p2dd30
parameters/dlp/Joux-Lercier/params.p100
parameters/dlp/Joux-Lercier/params.p30
parameters/dlp/Joux-Lercier/params.p35
parameters/dlp/Joux-Lercier/params.p40
......@@ -805,22 +794,22 @@ parameters/dlp/p95.hint
parameters/dlp/p100.hint
parameters/dlp/p2dd30.hint
parameters/dlp/README
linalg/bwc/lingen-matpoly-ft.h
linalg/bwc/lingen-matpoly-ft.cpp
linalg/bwc/lingen-bigmatpoly-ft.c
linalg/bwc/lingen-bigmatpoly-ft.h
linalg/bwc/lingen_matpoly_ft.hpp
linalg/bwc/lingen_matpoly_ft.cpp
linalg/bwc/lingen_bigmatpoly_ft.cpp
linalg/bwc/lingen_bigmatpoly_ft.hpp
scripts/split.py
linalg/bwc/mpfq/mpfq_pz.c
linalg/bwc/mpfq/mpfq_pz.h
linalg/bwc/mpfq/mpfq_pz_t.c
linalg/bwc/mpfq/mpfq_pz_t.h
linalg/bwc/logline.c
linalg/bwc/logline.cpp
linalg/bwc/logline.h
tests/linalg/bwc/CMakeLists.txt
tests/linalg/CMakeLists.txt
tests/linalg/bwc/mpfq/CMakeLists.txt
tests/linalg/bwc/mpfq/mpfq_name_K.h
tests/linalg/bwc/mpfq/mpfq_test.c.meta
tests/linalg/bwc/mpfq/mpfq_test.cpp.meta
tests/linalg/bwc/mpfq/mpfq_test_fixmp.c
tests/linalg/bwc/test-plingen.sh
tests/gf2x/CMakeLists.txt
......@@ -897,9 +886,8 @@ linalg/bwc/tree_stats.cpp
linalg/bwc/tree_stats.hpp
tests/linalg/bwc/perlrandom.pl
tests/linalg/bwc/test-lingen.sh
linalg/bwc/lingen_qcode.c
linalg/bwc/lingen_qcode_do.cpp
linalg/bwc/lingen_qcode.h
linalg/bwc/lingen_qcode_binary.cpp
linalg/bwc/lingen_qcode_binary.hpp
utils/version_info.h
utils/version_info.c.in
sieve/las-base.hpp
......@@ -987,16 +975,6 @@ gf2x/already_tuned/x86_sse2/gf2x_mul6.h
gf2x/already_tuned/x86_sse2/gf2x_mul7.h
gf2x/already_tuned/x86_sse2/gf2x_mul8.h
gf2x/already_tuned/x86_sse2/gf2x_mul9.h
gf2x/apps/COPYING
gf2x/apps/Makefile.am
gf2x/apps/Makefile.in
gf2x/apps/check-factor-000.sh
gf2x/apps/check-factor-001.sh
gf2x/apps/check-factor-002.sh
gf2x/apps/check-factor-003.sh
gf2x/apps/factor.cpp
gf2x/apps/halfgcd.cpp
gf2x/apps/halfgcd.hpp
gf2x/bench.c
gf2x/config/acinclude.m4
gf2x/config/compile
......@@ -1021,12 +999,10 @@ gf2x/fft/Makefile.in
gf2x/fft/README
gf2x/fft/debug/check_cantor.m
gf2x/fft/debug/check_cantor.sh
gf2x/fft/fft_adapter.hpp
gf2x/fft/gf2x-cantor-fft.c
gf2x/fft/gf2x-cantor-fft.h
gf2x/fft/gf2x-fake-fft.c
gf2x/fft/gf2x-fake-fft.h
gf2x/fft/gf2x-fft.h
gf2x/fft/gf2x-ternary-fft.c
gf2x/fft/gf2x-ternary-fft.h
gf2x/fft/mpfq/README.mpfq
......@@ -1044,7 +1020,6 @@ gf2x/fft/mpfq/x86_64/mpfq_2_128.h
gf2x/fft/mpfq/x86_64/mpfq_2_64.c
gf2x/fft/mpfq/x86_64/mpfq_2_64.h
gf2x/gf2x.c
gf2x/gf2x.h
gf2x/gf2x/gf2x-config-export.h.in
gf2x/gf2x/gf2x-config.h.in
gf2x/gf2x/gf2x-impl-export.h
......@@ -1158,9 +1133,6 @@ tests/linalg/bwc/test_hello.c
tests/ncpus.sh
tests/scripts/CMakeLists.txt
tests/scripts/cadofactor/CMakeLists.txt
linalg/matops.h
tests/linalg/test_bitlinalg_matops.cpp
tests/linalg/test_bitlinalg_gauss.c
gf2x/already_tuned/x86_64_nosse/gf2x-thresholds.h
gf2x/already_tuned/x86_64_nosse/gf2x_mul1.h
gf2x/already_tuned/x86_64_nosse/gf2x_mul2.h
......@@ -1173,10 +1145,10 @@ gf2x/already_tuned/x86_64_nosse/gf2x_mul8.h
gf2x/already_tuned/x86_64_nosse/gf2x_mul9.h
tests/provide-wdir.sh
tests/utils/test_mpz_vector.c
linalg/bwc/blocklanczos.c
linalg/bwc/blocklanczos.cpp
tests/linalg/bwc/test-blocklanczos.sh
linalg/bwc/cheating_vec_init.h
tests/linalg/bwc/test_bl_extraction.c
tests/linalg/bwc/test_bl_extraction.cpp
scripts/build_environment.sh
scripts/cadofactor/toplevel.py
scripts/realpath.sh
......@@ -1250,7 +1222,6 @@ tests/utils/numbertheory/badideals.rsa220.stdout
tests/utils/numbertheory/badideals.small-example.input
tests/utils/numbertheory/badideals.small-example.stdout
tests/utils/numbertheory/test-badideals.sh
scripts/cadofactor/wudb.py
tests/utils/test_mpz_mat.c
gf2x/toom128.c
utils/tdict.hpp
......@@ -1293,7 +1264,7 @@ utils/multityped_array.hpp
sieve/las-sieve-shared-data.cpp
sieve/las-sieve-shared-data.hpp
config/glibc_vector_internals.cmake
config/check_uint64_type.cmake
config/check_types.cmake
config/posix_memalign.cmake
utils/mmap_allocator.cpp
utils/mmap_allocator.hpp
......@@ -1338,9 +1309,54 @@ sieve/las-memory.hpp
tests/linalg/bwc/A.21744
tests/sieve/F9.with_hints.hints
tests/sieve/F9.with_hints.todo
linalg/bwc/lingen_platform.cpp
linalg/bwc/lingen_platform.hpp
linalg/bwc/lingen_substep_schedule.hpp
tests/utils/test_sha1.c
utils/sha1.c
utils/sha1.h
linalg/bwc/mpfq/mpfq_p_1.cpp
linalg/bwc/mpfq/mpfq_p_1.hpp
linalg/bwc/mpfq/mpfq_p_10.cpp
linalg/bwc/mpfq/mpfq_p_10.hpp
linalg/bwc/mpfq/mpfq_p_11.cpp
linalg/bwc/mpfq/mpfq_p_11.hpp
linalg/bwc/mpfq/mpfq_p_12.cpp
linalg/bwc/mpfq/mpfq_p_12.hpp
linalg/bwc/mpfq/mpfq_p_13.cpp
linalg/bwc/mpfq/mpfq_p_13.hpp
linalg/bwc/mpfq/mpfq_p_14.cpp
linalg/bwc/mpfq/mpfq_p_14.hpp
linalg/bwc/mpfq/mpfq_p_15.cpp
linalg/bwc/mpfq/mpfq_p_15.hpp
linalg/bwc/mpfq/mpfq_p_2.cpp
linalg/bwc/mpfq/mpfq_p_2.hpp
linalg/bwc/mpfq/mpfq_p_3.cpp
linalg/bwc/mpfq/mpfq_p_3.hpp
linalg/bwc/mpfq/mpfq_p_4.cpp
linalg/bwc/mpfq/mpfq_p_4.hpp
linalg/bwc/mpfq/mpfq_p_5.cpp
linalg/bwc/mpfq/mpfq_p_5.hpp
linalg/bwc/mpfq/mpfq_p_6.cpp
linalg/bwc/mpfq/mpfq_p_6.hpp
linalg/bwc/mpfq/mpfq_p_7.cpp
linalg/bwc/mpfq/mpfq_p_7.hpp
linalg/bwc/mpfq/mpfq_p_8.cpp
linalg/bwc/mpfq/mpfq_p_8.hpp
linalg/bwc/mpfq/mpfq_p_9.cpp
linalg/bwc/mpfq/mpfq_p_9.hpp
linalg/bwc/mpfq/mpfq_pz.cpp
linalg/bwc/mpfq/mpfq_pz.hpp
linalg/bwc/mpfq/mpfq_u64k1.cpp
linalg/bwc/mpfq/mpfq_u64k1.hpp
linalg/bwc/mpfq/mpfq_u64k2.cpp
linalg/bwc/mpfq/mpfq_u64k2.hpp
linalg/bwc/mpfq/mpfq_u64k3.cpp
linalg/bwc/mpfq/mpfq_u64k3.hpp
linalg/bwc/mpfq/mpfq_u64k4.cpp
linalg/bwc/mpfq/mpfq_u64k4.hpp
linalg/bwc/mpfq/mpfq_m128.cpp
linalg/bwc/mpfq/mpfq_m128.hpp
linalg/bwc/mf_scan2.cpp
linalg/bwc/mpfq/mpfq_m128.c
linalg/bwc/mpfq/mpfq_m128.h
......@@ -1349,14 +1365,134 @@ linalg/bwc/mpfq/mpfq_m128_t.h
config/popcnt.c
config/popcnt.cmake
tests/linalg/bwc/test-parallelizing_info.cpp
utils/subdivision.hpp
scripts/resubmit-tools.sh
linalg/bwc/check_mpi_problems.c
linalg/bwc/lingen_hints.cpp
linalg/bwc/lingen_qcode_prime.cpp
linalg/bwc/lingen_qcode_prime.hpp
linalg/bwc/lingen_call_companion.hpp
linalg/bwc/lingen_hints.hpp
linalg/bwc/lingen_round_operand_size.cpp
linalg/bwc/lingen_round_operand_size.hpp
linalg/bwc/lingen_matpoly_bigmatpoly_ft_common.hpp
linalg/bwc/lingen_mul_substeps.hpp
gf2x/README.release
gf2x/check-gf2x-version.c
gf2x/fft/gf2x_fft_check.c
gf2x/gf2x.h.in.in
gf2x/gf2x.pc.in
gf2x/fft/generate-api.pl
gf2x/fft/template.h
gf2x/fft/gf2x-fft-impl-utils.h
gf2x/fft/mpfq/remove_mpfq_malloc_calls.patch
gf2x/fft/gf2x-fft.c
gf2x/fft/gf2x-fft.h.in
gf2x/fft/mpfq/mpfq-api.pl
linalg/submatrix_range.hpp
linalg/bwc/mpfq_fake.hpp
linalg/bwc/lingen_matpoly_binary.cpp
linalg/bwc/lingen_matpoly_binary.hpp
linalg/bwc/lingen_memory_pool.cpp
linalg/bwc/lingen_memory_pool.hpp
tests/linalg/bwc/flint-fft/test-flint-debug-magma.sh
tests/linalg/bwc/flint-fft/test-flint.c
tests/linalg/bwc/flint-fft/test-flint.m
linalg/bwc/lingen_expected_pi_length.cpp
linalg/bwc/lingen_expected_pi_length.hpp
linalg/bwc/lingen_bmstatus.cpp
linalg/bwc/lingen_bmstatus.hpp
tests/linalg/bwc/time_matpoly_ft_parallel.cpp
linalg/bwc/README.IntelMPI
linalg/bwc/README.OpenMPI
linalg/bwc/lingen_substep_characteristics.hpp
linalg/bwc/lingen_call_companion.cpp
tests/linalg/bwc/test-lingen-checkpoints.sh
linalg/bwc/lingen_checkpoints.cpp
linalg/bwc/lingen_checkpoints.hpp
linalg/bwc/lingen_io_matpoly.cpp
linalg/bwc/lingen_io_matpoly.hpp
linalg/bwc/lingen_average_matsize.cpp
linalg/bwc/lingen_average_matsize.hpp
linalg/bwc/lingen_fft_select.hpp
linalg/bwc/lingen_matpoly_select.hpp
linalg/bwc/lingen_qcode_select.hpp
linalg/bwc/lingen_io_wrappers.cpp
linalg/bwc/lingen_io_wrappers.hpp
tests/do_with_mpi.sh
tests/guess_mpi_configs.sh
linalg/bwc/lingen_verify_checkpoints.cpp
linalg/bwc/list_lingen_checkpoints.sh
linalg/bwc/lingen_mul_substeps_base.hpp
sieve/las-output.cpp
sieve/las-output.hpp
config/cado_check_cxx_source_compiles.cmake
tests/sieve/torture-redc.cpp
tests/sieve/test_fb_root.cpp
scripts/filter-ctest.pl
config/xcode.cmake
config/m4ri.cmake
linalg/bblas/bblas.hpp
linalg/bblas/bblas_bitrev.hpp
linalg/bblas/bblas_simd.hpp
linalg/bblas/bblas_debug.cpp
linalg/bblas/bblas_gauss.c
linalg/bblas/bblas_gauss.h
linalg/bblas/bblas_level2a.cpp
linalg/bblas/bblas_level2a.hpp
linalg/bblas/bblas_level2b.cpp
linalg/bblas/bblas_level2b.hpp
linalg/bblas/bblas_level3a.cpp
linalg/bblas/bblas_level3a.hpp
linalg/bblas/bblas_level3a1.cpp
linalg/bblas/bblas_level3a1.hpp
linalg/bblas/bblas_level3b.cpp
linalg/bblas/bblas_level3b.hpp
linalg/bblas/bblas_level3c.cpp
linalg/bblas/bblas_level3c.hpp
linalg/bblas/bblas_level3d.cpp
linalg/bblas/bblas_level3d.hpp
linalg/bblas/bblas_level4.hpp
linalg/bblas/bpack.hpp
linalg/bblas/bpack.cpp
linalg/bblas/bblas_level4_echelon.cpp
linalg/bblas/bblas_level4_gauss.cpp
linalg/bblas/bblas_level4_lup.cpp
linalg/bblas/bblas_level4_pluq.cpp
linalg/bblas/bblas_level5.cpp
linalg/bblas/bblas_level5.hpp
linalg/bblas/bblas_mat64.hpp
linalg/bblas/bblas_perm_matrix.cpp
linalg/bblas/bblas_perm_matrix.hpp
tests/linalg/bblas/test_bblas.cpp
tests/linalg/bblas/test_bblas_base.hpp
tests/linalg/bblas/test_bblas_level2.cpp
tests/linalg/bblas/test_bblas_level2.hpp
tests/linalg/bblas/test_bblas_level3.cpp
tests/linalg/bblas/test_bblas_level3.hpp
tests/linalg/bblas/test_bpack.hpp
tests/linalg/bblas/test_bpack.cpp
tests/linalg/bblas/test_bblas_level4.hpp
tests/linalg/bblas/test_bblas_level4_gauss.cpp
tests/linalg/bblas/test_bblas_level4_pluq.cpp
tests/linalg/bblas/test_bblas_level5.cpp
tests/linalg/bblas/test_bblas_level5.hpp
tests/linalg/bblas/test_bblas_m4ri.cpp
tests/linalg/bblas/test_gauss.c
tests/linalg/bblas/time_bblas_common.hpp
linalg/bblas/CMakeLists.txt
tests/linalg/bblas/CMakeLists.txt
tests/linalg/bblas/test_bblas_base.cpp
tests/linalg/bblas/test_bblas_level4_ple.cpp
linalg/bblas/bblas_level4_ple_internal.hpp
linalg/bblas/bblas_bitmat.hpp
linalg/bblas/bblas_level4_ple_internal_inl.hpp
linalg/bblas/bblas_mat8.cpp
linalg/bblas/bblas_mat8.hpp
linalg/bblas/bblas_bitmat_inl.hpp
linalg/bblas/bblas_mat64.cpp
config/mmx.c
config/mmx.cmake
config/posix_memalign.c
config/test-srand-deterministic.c
config/alignas.cpp
......@@ -1386,7 +1522,6 @@ sieve/las-where-am-i-debug.hpp
sieve/las-where-am-i-prod.hpp
sieve/las-where-am-i.hpp
sieve/las-fill-in-buckets.cpp
sieve/las-output.cpp
sieve/las-process-bucket-region.cpp
sieve/las-smallsieve-lowlevel.hpp
sieve/las-smallsieve.cpp
......@@ -1422,6 +1557,8 @@ utils/omp_proxy.h
config/iwyu.pl.in
utils/renumber_proxy.cpp
utils/renumber_proxy.h
linalg/bwc/lingen_abfield.hpp
linalg/bwc/lingen_bw_dimensions.hpp
.gitlab-ci.yml
.docker-script.sh
tests/misc/test_renumber.data/c105_30003.poly
......
......@@ -135,7 +135,6 @@ filter/out-of-core/singleton.c
misc/singleton_simple.c
filter/replay_dblemat.cpp
scripts/cadofactor/README.OAR
scripts/plot_params.sh
scripts/make_graphs
scripts/rsa704.test
linalg/bwc/update-flint.sh
......@@ -148,6 +147,5 @@ sieve/strategies/script_str_r.sh
sieve/strategies/CMakeLists-nodist.txt
sieve/strategies/test_strategy_cado.cpp
sieve/strategies/F9.sh
linalg/bwc/lingen.txt
.mailmap
filter/CMakeLists-nodist.txt
......@@ -51,17 +51,25 @@ endif()
add_executable(sm sm.c)
target_link_libraries(sm utils_with_io)
if (${WITH_MPI})
set_target_properties(sm PROPERTIES
COMPILE_FLAGS "--mpi"
LINK_FLAGS "--mpi")
set_target_properties(sm PROPERTIES
COMPILE_FLAGS "--mpi ${OpenMP_C_FLAGS}" LINK_FLAGS "--mpi ${OpenMP_C_FLAGS}")
else()
set_target_properties(sm PROPERTIES
COMPILE_FLAGS "${OpenMP_C_FLAGS}" LINK_FLAGS "${OpenMP_C_FLAGS}")
endif()
add_executable(sm_append sm_append.cpp)
target_link_libraries(sm_append utils)
if (${WITH_MPI})
set_target_properties(sm_append PROPERTIES
COMPILE_FLAGS "--mpi"
LINK_FLAGS "--mpi")
COMPILE_FLAGS "--mpi ${OpenMP_C_FLAGS}"
LINK_FLAGS "--mpi ${OpenMP_C_FLAGS}"
)
else()
set_target_properties(sm_append PROPERTIES
COMPILE_FLAGS "${OpenMP_C_FLAGS}"
LINK_FLAGS "${OpenMP_C_FLAGS}"
)
endif()
......
......@@ -59,7 +59,7 @@ typedef struct {
} split_output_iter_t;
static split_output_iter_t *
split_iter_init(const char *prefix, const char *suffix,
split_iter_init(const char *prefix, const char *suffix,
const size_t lines_per_file, const char *msg)
{
split_output_iter_t *iter = malloc(sizeof(split_output_iter_t));
......@@ -76,7 +76,7 @@ split_iter_init(const char *prefix, const char *suffix,
ASSERT_ALWAYS(lines_per_file > 0);
iter->lines_per_file = lines_per_file;
iter->lines_left = 0; /* Force opening of file on next write */
return iter;
return iter;
}
/* used for counting time in different processes */
......@@ -96,7 +96,7 @@ split_iter_end(split_output_iter_t *iter)
}
/* Closes the currently open file, if any, and opens the next one */
void
void
split_iter_open_next_file(split_output_iter_t *iter)
{
if (iter->file != NULL) {
......@@ -112,7 +112,7 @@ split_iter_open_next_file(split_output_iter_t *iter)
}
free (iter->filename);
int rc = asprintf(&(iter->filename), "%s%04x%s",
int rc = asprintf(&(iter->filename), "%s%04x%s",
iter->prefix, iter->next_idx++, iter->suffix);
ASSERT_ALWAYS (rc >= 0);
if (iter->msg != NULL)
......
......@@ -31,8 +31,6 @@ Output
#include <string.h>
#include <inttypes.h> // for PRIu64, SCNu64, SCNd64, SCNx64
#include <stdint.h> // for uint64_t, int64_t
#include <pthread.h>
#include <unistd.h> // for usleep
#include <gmp.h>
#include "cado_poly.h" // for NB_POLYS_MAX, cado_poly_clear, cado_poly_init
#include "filter_io.h" // earlyparsed_relation_ptr
......@@ -40,6 +38,7 @@ Output
#include "gzip.h" // fopen_maybe_compressed
#include "macros.h"
#include "mpz_poly.h" // mpz_poly_ptr
#include "omp_proxy.h" // IWYU pragma: keep
#include "params.h"
#include "purgedfile.h" // purgedfile_read_firstline
#include "select_mpi.h"
......@@ -150,24 +149,19 @@ void print_all_sm(FILE *out, sm_side_info *sm_info, int nb_polys,
// Basic MPI communications
#define MPI_MY_MP_SIZE_T MPI_LONG
#define MPI_MY_MP_LIMB_T MPI_UNSIGNED_LONG
#define MPI_MY_GMP_INTERNAL_SIZE_FIELD_T MPI_INT
#define MPI_MY_UINT64_T MPI_UNSIGNED_LONG
void MPI_Send_mpz(mpz_ptr z, int dst) {
mp_size_t nlimbs = mpz_size(z);
MPI_Send(&nlimbs, 1, MPI_MY_MP_SIZE_T, dst, 0, MPI_COMM_WORLD);
MPI_Send(&z->_mp_size, 1, MPI_MY_GMP_INTERNAL_SIZE_FIELD_T, dst, 0, MPI_COMM_WORLD);
MPI_Send(z->_mp_d, nlimbs, MPI_MY_MP_LIMB_T, dst, 0, MPI_COMM_WORLD);
MPI_Send(&nlimbs, 1, CADO_MPI_MP_SIZE_T, dst, 0, MPI_COMM_WORLD);
MPI_Send(&z->_mp_size, 1, CADO_MPI_MPZ_INTERNAL_SIZE_T, dst, 0, MPI_COMM_WORLD);
MPI_Send(z->_mp_d, nlimbs, CADO_MPI_MP_LIMB_T, dst, 0, MPI_COMM_WORLD);
}
void MPI_Recv_mpz(mpz_ptr z, int src) {
mp_size_t nlimbs;
MPI_Recv(&nlimbs, 1, MPI_MY_MP_SIZE_T, src, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
MPI_Recv(&nlimbs, 1, CADO_MPI_MP_SIZE_T, src, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
_mpz_realloc(z, nlimbs);
MPI_Recv(&z->_mp_size, 1, MPI_MY_GMP_INTERNAL_SIZE_FIELD_T, src, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
MPI_Recv(z->_mp_d, nlimbs, MPI_MY_MP_LIMB_T, src, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
MPI_Recv(&z->_mp_size, 1, CADO_MPI_MPZ_INTERNAL_SIZE_T, src, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
MPI_Recv(z->_mp_d, nlimbs, CADO_MPI_MP_LIMB_T, src, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
}
......@@ -225,62 +219,6 @@ void MPI_Recv_res(mpz_poly * res, int src, sm_side_info * sm_info,
// Pthread part: on each node, we use shared memory instead of mpi
struct th_info_s {
sm_side_info * sm_info;
sm_relset_ptr rels;
mpz_poly ** dst;
uint64_t tot_relset;
int nb_polys;
};
typedef struct th_info_s th_info_t;
uint64_t next_relset = 0; // All relsets below this are done, or being processed
uint64_t count_processed_sm = 0; // Number of already computed relsets.
pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
void * thread_process(void *th_arg) {
th_info_t * args = (th_info_t *)th_arg;
int rank;
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
fprintf(stderr, "Starting thread on mpi job %d\n", rank);
const uint64_t BLOCK = 10;
while(1) {
// get a new block of relsets to compute
pthread_mutex_lock(&mutex);
if (next_relset >= args->tot_relset) {
pthread_mutex_unlock(&mutex);
fprintf(stderr, "Finishing thread on mpi job %d\n", rank);
return NULL;
}
uint64_t first = next_relset;
uint64_t last = MIN(first + BLOCK, args->tot_relset);
next_relset = last;
pthread_mutex_unlock(&mutex);
// Process the relsets
for (uint64_t i = first; i < last; ++i) {
for(int side = 0 ; side < args->nb_polys ; side++) {
if (args->sm_info[side]->nsm == 0)
continue;
mpz_poly_reduce_frac_mod_f_mod_mpz(
args->rels[i].num[side],
args->rels[i].denom[side],
args->sm_info[side]->f0,
args->sm_info[side]->ell2);
compute_sm_piecewise(args->dst[i][side],
args->rels[i].num[side],
args->sm_info[side]);
}
}
pthread_mutex_lock(&mutex);
count_processed_sm += BLOCK;
pthread_mutex_unlock(&mutex);
}
}
static void declare_usage(param_list pl)
{
param_list_decl_usage(pl, "poly", "(required) poly file");
......@@ -315,7 +253,6 @@ int main (int argc, char **argv)
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Comm_size(MPI_COMM_WORLD, &size);
int idoio = (rank == 0); // Am I the job allowed to do I/O ?
int mt = 1;
double t0 = seconds();
char *argv0 = argv[0];
......@@ -398,15 +335,6 @@ int main (int argc, char **argv)
exit(EXIT_FAILURE);
}
param_list_parse_int(pl, "t", &mt);
if (mt < 1) {
if (idoio) {
fprintf(stderr, "Error: parameter -mt must be at least 1\n");
param_list_print_usage(pl, argv0, stderr);
}
exit(EXIT_FAILURE);
}
/* Init polynomial */
cado_poly_init (pol);
if (!cado_poly_read (pol, polyfile))
......@@ -498,13 +426,18 @@ int main (int argc, char **argv)
///////////////////////
// Only process 0 constructs the relation sets.
#ifdef HAVE_OPENMP
unsigned int thmax = omp_get_max_threads();
#else
const unsigned int thmax = 1;
#endif
if (rank == 0) {
rels = build_rel_sets(purgedfile, indexfile, &nb_relsets, F, pol->nb_polys, ell2);
fprintf(stdout, "\n# Computing Shirokauer maps for %" PRIu64
" relation-sets.\n", nb_relsets);
" relation-sets, using %d threads and %d jobs.\n", nb_relsets, thmax, size);
fflush(stdout);
}
MPI_Bcast(&nb_relsets, 1, MPI_MY_UINT64_T, 0, MPI_COMM_WORLD);
MPI_Bcast(&nb_relsets, 1, CADO_MPI_UINT64_T, 0, MPI_COMM_WORLD);
///////////////////////
// Send a share of the rel sets to each process (round Robin)
......@@ -550,39 +483,49 @@ int main (int argc, char **argv)
}
}
// parameters for the threads (same for all).
th_info_t th_args;
th_args.sm_info = sm_info;
th_args.rels = part_rels;
th_args.dst = dst;
th_args.nb_polys = pol->nb_polys;
th_args.tot_relset = nb_parts;
if ((nb_parts-1)*size + rank > nb_relsets)
th_args.tot_relset = nb_parts - 1;
// start the threads
next_relset = 0;
pthread_t *th_id;
th_id = (pthread_t *) malloc(mt*sizeof(pthread_t));
ASSERT_ALWAYS(th_id != NULL);
for (int i = 0; i < mt; ++i) {
int ret;
ret = pthread_create(&th_id[i], NULL, &thread_process, (void *)&th_args);
ASSERT_ALWAYS(ret == 0);
}
/* updated only by thread 0 */
uint64_t count_processed_sm = 0;
stats_init(stats, stdout, &count_processed_sm, nbits(nb_relsets)-5,
"Computed", "SMs", "", "SMs");
while (count_processed_sm < nb_parts) {
if (stats_test_progress(stats))
stats_print_progress (stats, count_processed_sm, 0, 0, 0);
usleep(1);
"Computed", "SMs", "", "SMs");
#ifdef HAVE_OPENMP
#pragma omp parallel
#endif
{
#ifdef HAVE_OPENMP
unsigned int thid = omp_get_thread_num();
unsigned int thnb = omp_get_num_threads();
#else
const unsigned int thid = 0;
const unsigned int thnb = 1;
#endif
#ifdef HAVE_OPENMP
#pragma omp for schedule(static)
#endif
for(uint64_t i = 0 ; i < nb_relsets ; i++) {
for(int side = 0 ; side < pol->nb_polys ; side++) {
if (sm_info[side]->nsm == 0)
continue;
mpz_poly_reduce_frac_mod_f_mod_mpz(
part_rels[i].num[side],
part_rels[i].denom[side],
sm_info[side]->f0,
sm_info[side]->ell2);
compute_sm_piecewise(dst[i][side],
part_rels[i].num[side],
sm_info[side]);
}
if (thid == 0) {
/* Static schedule, all threads can reasonably be expected
* to progress at the same speed */
count_processed_sm+=thnb;
if (stats_test_progress(stats))
stats_print_progress (stats, count_processed_sm, 0, 0, 0);
}
}
}
stats_print_progress (stats, nb_parts, 0, 0, 1);
// join the threads.
for (int i = 0; i < mt; ++i)
pthread_join(th_id[i], NULL);
free(th_id);
fprintf(stderr, "Job %d: processed all relsets in %f s\n",
rank, seconds()-t0);
......
......@@ -87,7 +87,8 @@ void peer_status::receive(task_globals & tg, int peer, int turn)
MPI_Wait(&req, MPI_STATUS_IGNORE);
batch.clear();
mp_limb_t returns[bsize][tg.nsm_total][tg.limbs_per_ell];
mp_limb_t * returns = new mp_limb_t[bsize * tg.nsm_total * tg.limbs_per_ell];
// [bsize][tg.nsm_total][tg.limbs_per_ell];
MPI_Recv(returns, bsize * tg.nsm_total * tg.limbs_per_ell * sizeof(mp_limb_t), MPI_BYTE, peer, turn, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
......@@ -97,13 +98,16 @@ void peer_status::receive(task_globals & tg, int peer, int turn)
fputs(rels[i].c_str(), tg.out);
bool comma = false;
for (int j = 0 ; j < tg.nsm_total ; j++) {
gmp_fprintf(tg.out, "%c%Nd", comma ? ',' : ':', returns[i][j], tg.limbs_per_ell);
mp_limb_t * rij = returns + ((i * tg.nsm_total) + j) * tg.limbs_per_ell;
gmp_fprintf(tg.out, "%c%Nd", comma ? ',' : ':', rij, tg.limbs_per_ell);
comma=true;
}
fputc('\n', tg.out);
tg.nrels_out++;
}
rels.clear();
delete[] returns;
}
void peer_status::send_finish(task_globals &, int peer, int turn)
......@@ -205,7 +209,8 @@ static void sm_append_master(FILE * in, FILE * out, sm_side_info *sm_info, int n
fprintf(stderr, "# make sure you use \"--bind-to core\" or equivalent\n");
double t0 = wct_seconds();
for(int turn = 0 ; eof <= 2 ; turn++, eof += !!eof) {
int turn;
for(turn = 0 ; eof <= 2 ; turn++, eof += !!eof) {
double t = wct_seconds();
debug_fprintf(stderr, "%.3f " CSI_BOLDRED "start turn %d" CSI_RESET "\n", t0, turn);
for(int peer = 1; peer < size; peer++) {
......@@ -241,6 +246,11 @@ static void sm_append_master(FILE * in, FILE * out, sm_side_info *sm_info, int n
tg.nrels_out / (wct_seconds()-t0));
}
}
fprintf(stderr, "# final: printed %zu rels in %.1f s"
" (%.1f / batch, %.1f rels/s)\n",
tg.nrels_out, wct_seconds()-t0,
(wct_seconds()-t0) / turn,
tg.nrels_out / (wct_seconds()-t0));
}
static void sm_append_slave(sm_side_info *sm_info, int nb_polys)
......@@ -258,9 +268,6 @@ static void sm_append_slave(sm_side_info *sm_info, int nb_polys)
if (sm_info[side]->nsm) limbs_per_ell = mpz_size(sm_info[side]->ell);
}
mpz_poly smpol;
mpz_poly_init(smpol, maxdeg);
for(int turn = 0 ; ; turn++) {
unsigned long bsize;
......@@ -274,24 +281,33 @@ static void sm_append_slave(sm_side_info *sm_info, int nb_polys)
double t0 = wct_seconds();
debug_fprintf(stderr, "%.3f turn %d peer %d start on batch of size %lu\n", wct_seconds(), turn, rank, bsize);
mp_limb_t returns[bsize][nsm_total][limbs_per_ell];
mp_limb_t * returns = new mp_limb_t[bsize * nsm_total * limbs_per_ell];
memset(returns, 0, bsize*nsm_total*limbs_per_ell*sizeof(mp_limb_t));
for(unsigned long i = 0 ; i < bsize ; i++) {
mpz_poly pol;
mpz_poly_init_set_ab(pol, batch[i].a, batch[i].b);
int smidx = 0;
for (int side = 0; side < nb_polys; ++side) {
compute_sm_piecewise(smpol, pol, sm_info[side]);
for(int k = 0 ; k < sm_info[side]->nsm ; k++, smidx++) {
if (k <= smpol->deg) {
for(size_t j = 0 ; j < limbs_per_ell ; j++) {
returns[i][smidx][j] = mpz_getlimbn(smpol->coeff[k], j);
#ifdef HAVE_OPENMP
// #pragma omp parallel
#endif
{
cxx_mpz_poly smpol(maxdeg), pol(1);
#ifdef HAVE_OPENMP
// #pragma omp for
#endif
for(unsigned long i = 0 ; i < bsize ; i++) {
mpz_poly_setcoeff_int64(pol, 0, batch[i].a);
mpz_poly_setcoeff_int64(pol, 1, -(int64_t) batch[i].b);
int smidx = 0;
for (int side = 0; side < nb_polys; ++side) {
compute_sm_piecewise(smpol, pol, sm_info[side]);
for(int k = 0 ; k < sm_info[side]->nsm ; k++, smidx++) {
if (k <= smpol->deg) {
mp_limb_t * rix = returns + (i * nsm_total + smidx) * limbs_per_ell;
for(size_t j = 0 ; j < limbs_per_ell ; j++) {
rix[j] = mpz_getlimbn(smpol->coeff[k], j);
}
}
}
}
}
mpz_poly_clear(pol);
}
debug_fprintf(stderr, "%.3f " CSI_BLUE "turn %d peer %d done batch of size %lu" CSI_RESET " [taken %.1f]\n", wct_seconds(), turn, rank, bsize, wct_seconds() - t0);
if (rank == 1 && turn == 2)
......@@ -302,9 +318,9 @@ static void sm_append_slave(sm_side_info *sm_info, int nb_polys)
t0 = wct_seconds();
MPI_Send(returns, bsize * nsm_total * limbs_per_ell * sizeof(mp_limb_t), MPI_BYTE, 0, turn, MPI_COMM_WORLD);
delete[] returns;
debug_fprintf(stderr, "%.3f turn %d peer %d send return took %.1f\n", wct_seconds(), turn, rank, wct_seconds() - t0);
}
mpz_poly_clear(smpol);
}
static void sm_append_sync(FILE * in, FILE * out, sm_side_info *sm_info, int nb_polys)
......
......@@ -26,38 +26,33 @@
AUTOMAKE_OPTIONS=subdir-objects
ACLOCAL_AMFLAGS=-I config --install
AM_CPPFLAGS = -I$(top_srcdir) -I$(top_builddir)
FFT_SOURCES=fft/gf2x-ternary-fft.c
if ENABLE_FFT_INTERFACE
AM_CPPFLAGS += -I$(srcdir)/mpfq
FFT_SOURCES+=fft/gf2x-fake-fft.c
FFT_SOURCES+=fft/gf2x-cantor-fft.c
AM_CPPFLAGS += -I$(top_srcdir)/fft/mpfq
gf2x_includedir=$(includedir)/gf2x
gf2x_include_HEADERS= \
fft/gf2x-fft.h \
fft/gf2x-fake-fft.h \
fft/gf2x-cantor-fft.h \
fft/gf2x-ternary-fft.h
endif
AM_CPPFLAGS = -I$(top_srcdir) -I$(top_builddir) -I$(top_builddir)/fft -I$(top_srcdir)/fft
FFT_SOURCES_ALWAYS=fft/gf2x-ternary-fft.c
lib_LTLIBRARIES=libgf2x.la
if ENABLE_FFT_INTERFACE
# default which gets shipped
libgf2x_la_CFLAGS=$(AM_CFLAGS) -DCANTOR_BASE_FIELD_SIZE=128
noinst_LIBRARIES=libgf2x-local.a
if HAVE_HIDDEN_VISIBILITY_ATTRIBUTE
VH_FLAG=-fvisibility=hidden -DGF2X_EXPORTED="__attribute__((visibility(\"default\")))"
endif
libgf2x_la_SOURCES=gf2x.c toom.c toom128.c toom-gpl.c $(FFT_SOURCES)
libgf2x_la_SOURCES=gf2x.c toom.c toom128.c toom-gpl.c $(FFT_SOURCES_ALWAYS)
libgf2x_la_CFLAGS=$(AM_CFLAGS) $(VH_FLAG)
libgf2x_local_a_SOURCES=$(libgf2x_la_SOURCES)
libgf2x_local_a_CFLAGS=$(AM_CFLAGS)
nobase_include_HEADERS=gf2x.h \
gf2x/gf2x-impl.h \
gf2x/gf2x-impl-export.h \
gf2x/gf2x-small.h
# gf2x/gf2x-impl.h is distributed but not installed. Hence it goes to
# EXTRA_DIST, and is specified further down
# All these are generated.
nobase_nodist_include_HEADERS= \
gf2x/gf2x-config.h \
......@@ -76,9 +71,9 @@ nobase_nodist_include_HEADERS= \
libgf2x_la_LDFLAGS=-version-info @gf2x_lib_version@ -no-undefined
SUBDIRS=lowlevel src . fft tests $(MAYBE_APPS)
SUBDIRS=lowlevel src . fft tests
DIST_SUBDIRS=lowlevel src . fft tests apps
DIST_SUBDIRS=lowlevel src . fft tests
DISTCLEANFILES=gf2x/gf2x-thresholds.h \
gf2x/gf2x_mul1.h \
......@@ -92,12 +87,17 @@ DISTCLEANFILES=gf2x/gf2x-thresholds.h \
gf2x/gf2x_mul9.h
EXTRA_DIST=
EXTRA_DIST+=gf2x/gf2x-impl.h
EXTRA_DIST+=version.sh.in
EXTRA_DIST+=BUGS
EXTRA_DIST+=already_tuned
EXTRA_DIST+=config/configfsf.sub
EXTRA_DIST+=config/configfsf.guess
EXTRA_DIST+=toom-gpl-placeholder.c
EXTRA_DIST+=check-gf2x-version.c
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = gf2x.pc
# This is really a maintainer-only command. This can be used for creating
# a tarball with an LGPL-licensed gf2x. Note that when this is done,
......@@ -118,8 +118,14 @@ dist-LGPL: distdir
mv $(distdir)-LGPL/ $(distdir)/
$(am__post_remove_distdir)
if HAVE_NONCONSTANT_CLOCK
tune-lowlevel tune-toom tune-fft: all
cd src; $(MAKE) $@
else
tune-lowlevel tune-toom tune-fft:
@echo "Tuning cannot run since clock() apparently returns constant values"
endif
distclean-local:
-find already_tuned/tuned -maxdepth 1 -name "gf2x*" | xargs -r rm -f
This diff is collapsed.
gf2x-1.3.0:
- gf2x.h now contains GF2X_VERSION_* macros ; previous versions of
offered no way to distinguish between versions. For developers, an
example of how this can be done in config scripts is in
check-gf2x-version.c
- the shared library major version number has been increased to 3.0.0
(as we should have done for 1.2, in fact)
- gf2x now compiles fine with icc
- the fft dynamic library is now a separate file, and a build with or
without --enable-fft-interface does not affect the generated
libgf2x.so in any way.
- the shared libraries now expose only the official functions, not the
internal ones. In particular, even though libgf2x in itself uses
the ternary fft code, that code is not exposed in the external abi
of libgf2x. If you intend to use it, you must use libgf2x-fft.so
(compiled with --enable-fft-interface).
- the fft interface api has been significantly modified and improved.
A new interface for computing middle products has been added.
The C++ wrapper code has been improved (no longer an ugly macro).
- packaging bugs that affected usability of the fft interface have
been fixed.
- two long-standing bugs in the ternary FFT for ridiculously small
transform lengths have been fixed.
- configuration file for pkg-config added: assuming gf2x installed in
<prefix> known to pkg-config, "pkg-config --cflags gf2x" etc will
work. (Otherwise, one would need PKG_CONFIG_PATH=<prefix>/lib/pkg_config).
gf2x-1.2:
- changed the type representing the polynomial sizes from "unsigned int"
to "unsigned long". On a 64-bit machine, the maximal degree was
2^38-1, now it is 2^70-1.
- gf2x_mul is now thread-safe. gf2x_mul_r is here in case auser
- gf2x_mul is now thread-safe. gf2x_mul_r is here in case a user
wants to provide the storage pool and avoid having gf2x_mul do
allocation for that. Note that currently, for FFT sizes, gf2x_mul
does allocation anyway.
......@@ -19,7 +46,7 @@ gf2x-1.1: (bugfix release)
- Added a faster mul4
- Added some support for cross compilation (might also have been
broken in the meantime, we don't have regression testing for this).
The interface is unchanged, so the shared library version has not
changed and still is 1.0.0
......@@ -8,7 +8,7 @@ License (for the library) is either:
placeholder, the GNU Lesser General Public License, either
version 2.1 of the License, or (at your option) any later
version.
License for the apps/ subdir is the GNU General Public License, either
version 2 of the License, or (at your option) any later version.
......@@ -26,7 +26,10 @@ Dependencies
gf2x has no external dependencies.
Some of the demos in the apps/ subdirectory require the gmp and NTL libraries.
Some of the demos in the apps/ subdirectory require the gmp and NTL
libraries. (use ./configure ; make from that directory. You may want to
use PKG_CONFIG_PATH to have the autotools stuff there find gf2x
properly).
......
Before making a release:
*) check with ./configure --disable-hardware-specific-code
*) check the ABI for differences between the previous version and this one.
use abidiff from abigail tools.
E.g.:
> $ abidiff gf2x-1.1/.libs/libgf2x.so.1.0.0 gf2x-1.2/.libs/libgf2x.so.1.0.2
> Functions changes summary: 16 Removed, 4 Changed, 20 Added functions
> Variables changes summary: 0 Removed, 0 Changed, 1 Added variable
(the latter, incidentally, shows that I've made a mess of that thing
when doing 1.2).
*) create a package for the LGPL version as well as one for the GPL
version, and check that the ABIs are compatible.
make dist
\cp gf2x-1.3.0.tar.gz ../
\cp toom-gpl-placeholder.c toom-gpl.c
make dist
tar xf gf2x-1.3.0.tar.gz
mv gf2x-1.3.0 gf2x-1.3.0-LGPL
rm -f gf2x-1.3.0.tar.gz
tar czf gf2x-1.3.0-LGPL.tar.gz gf2x-1.3.0-LGPL
mv gf2x-1.3.0-LGPL.tar.gz ../
rm -f gf2x-1.3.0-LGPL
git co HEAD toom-gpl.c
cd ..
for f in gf2x-1.3.0{,-LGPL} ; do tar xf $f.tar.gz ; (cd $f ; ./configure && make -j8) ; done
abidiff gf2x-1.3.0{,-LGPL}/.libs/libgf2x.so.?.*
......@@ -193,12 +193,6 @@
1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, }
/* This macro is not what you think, and does not completely belong here.
* It merely recalls that the FFT code *DOES NOT WORK* below this size.
* So GF2X_MUL_FFT_TABLE should not wander in this bleak range.
*/
#define GF2X_MUL_FFT_THRESHOLD 28
/* {n, K} means use FFT(|K|) up from n words, */
/* where |K|<3 stands for Toom-Cook 3, K < 0 means use FFT2 */
#define GF2X_MUL_FFT_TABLE { \
......
......@@ -90,12 +90,6 @@
#define GF2X_BEST_UTOOM_TABLE {}
/* This macro is not what you think, and does not completely belong here.
* It merely recalls that the FFT code *DOES NOT WORK* below this size.
* So GF2X_MUL_FFT_TABLE should not wander in this bleak range.
*/
#define GF2X_MUL_FFT_THRESHOLD 28
/* {n, K} means use FFT(|K|) up from n words, */
/* where |K|<3 stands for Toom-Cook 3, K < 0 means use FFT2 */
#define GF2X_MUL_FFT_TABLE { \
......
......@@ -90,12 +90,6 @@
#define GF2X_BEST_UTOOM_TABLE {}
/* This macro is not what you think, and does not completely belong here.
* It merely recalls that the FFT code *DOES NOT WORK* below this size.
* So GF2X_MUL_FFT_TABLE should not wander in this bleak range.
*/
#define GF2X_MUL_FFT_THRESHOLD 28
/* {n, K} means use FFT(|K|) up from n words, */
/* where |K|<3 stands for Toom-Cook 3, K < 0 means use FFT2 */
......
......@@ -90,12 +90,6 @@
#define GF2X_BEST_UTOOM_TABLE {}
/* This macro is not what you think, and does not completely belong here.
* It merely recalls that the FFT code *DOES NOT WORK* below this size.
* So GF2X_MUL_FFT_TABLE should not wander in this bleak range.
*/
#define GF2X_MUL_FFT_THRESHOLD 28
/* {n, K} means use FFT(|K|) up from n words, */
/* where |K|<3 stands for Toom-Cook 3, K < 0 means use FFT2 */
......
......@@ -218,12 +218,6 @@
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, }
/* This macro is not what you think, and does not completely belong here.
* It merely recalls that the FFT code *DOES NOT WORK* below this size.
* So GF2X_MUL_FFT_TABLE should not wander in this bleak range.
*/
#define GF2X_MUL_FFT_THRESHOLD 28
/* {n, K} means use FFT(|K|) up from n words, */
/* where |K|<3 stands for Toom-Cook 3, K < 0 means use FFT2 */
#define GF2X_MUL_FFT_TABLE { \
......
......@@ -255,12 +255,6 @@
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, }
/* This macro is not what you think, and does not completely belong here.
* It merely recalls that the FFT code *DOES NOT WORK* below this size.
* So GF2X_MUL_FFT_TABLE should not wander in this bleak range.
*/
#define GF2X_MUL_FFT_THRESHOLD 28
/* {n, K} means use FFT(|K|) up from n words, */
/* where |K|<3 stands for Toom-Cook 3, K < 0 means use FFT2 */
#define GF2X_MUL_FFT_TABLE { \
......
......@@ -255,12 +255,6 @@
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, }
/* This macro is not what you think, and does not completely belong here.
* It merely recalls that the FFT code *DOES NOT WORK* below this size.
* So GF2X_MUL_FFT_TABLE should not wander in this bleak range.
*/
#define GF2X_MUL_FFT_THRESHOLD 28
/* {n, K} means use FFT(|K|) up from n words, */
/* where |K|<3 stands for Toom-Cook 3, K < 0 means use FFT2 */
#define GF2X_MUL_FFT_TABLE { \
......
......@@ -472,12 +472,6 @@
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, }
/* This macro is not what you think, and does not completely belong here.
* It merely recalls that the FFT code *DOES NOT WORK* below this size.
* So GF2X_MUL_FFT_TABLE should not wander in this bleak range.
*/
#define GF2X_MUL_FFT_THRESHOLD 28
/* {n, K} means use FFT(|K|) up from n words, */
/* where |K|<3 stands for Toom-Cook 3, K < 0 means use FFT2 */
#define GF2X_MUL_FFT_TABLE { \
......
......@@ -279,12 +279,6 @@
0, 0, 0, 0, 0, 1, }
/* This macro is not what you think, and does not completely belong here.
* It merely recalls that the FFT code *DOES NOT WORK* below this size.
* So GF2X_MUL_FFT_TABLE should not wander in this bleak range.
*/
#define GF2X_MUL_FFT_THRESHOLD 28
/* {n, K} means use FFT(|K|) up from n words, */
/* where |K|<3 stands for Toom-Cook 3, K < 0 means use FFT2 */
#define GF2X_MUL_FFT_TABLE { \
......
This diff is collapsed.
# put here the location of the NTL installation (for example /usr/local)
NTL=
# add -mbmi2 to use the pdep_u64 instruction
AM_CPPFLAGS = -I$(top_srcdir) -T$(top_builddir) -fopenmp -std=c++11 -I$(NTL)/include
check_PROGRAMS=factor
factor_SOURCES=factor.cpp halfgcd.cpp
noinst_HEADERS=halfgcd.hpp
factor_LDFLAGS=-fopenmp
factor_LDADD=../libgf2x.la $(NTL)/lib/libntl.a -lgmp
LOG_COMPILER=$(SHELL) 2>/dev/null
TESTS=check-factor-000.sh check-factor-001.sh \
check-factor-002.sh check-factor-003.sh
EXTRA_DIST=$(TESTS)
This diff is collapsed.
[ "`echo 12 u | ./factor 1279`" = "12 41 p3f5c0802ded" ]
[ "`echo 12345 u | ./factor 7654321`" = "12345 6 p5b" ]
[ "`echo 12345 u | ./factor 654321`" = "12345 6 p49" ]
[ "`echo 12345 u | ./factor 54321`" = "12345 5 p2f" ]
This diff is collapsed.
/* This file is part of the gf2x library.
Copyright 2007, 2008, 2009
Richard Brent, Pierrick Gaudry, Emmanuel Thome', Paul Zimmermann
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; see the file COPYING. If not, write to the Free
Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
02111-1307, USA.
*/
/* Subquadratic gcd over GF(2)[x]. */
// #define BOGONG // Selects routines that run well on bogong,
// a 2.2 Ghz AMD Opteron 275 at ANU
#undef STATS // If defined, statistics will be gathered
// and printed on stdout
#include <NTL/GF2X.h>
#include "halfgcd.hpp"
/* This threshold controls the internal calls to HalfGCD. */
#define NTL_GF2X_HalfGCD_CROSSOVER (4*NTL_BITS_PER_LONG)
/* this threshold controls the calls in FastGCD, thus is less sensitive */
#define NTL_GF2X_GCD_CROSSOVER (5*NTL_GF2X_HalfGCD_CROSSOVER)
#ifdef STATS
long mulktm = 0x3fffff; // mask for mul1kt, mul2kt
long addktm = 0xffff; // mask for Mul1kt, Add1kt
long mul1kt = 0; // counts calls to mul1 or mul1rpb
long mul2kt = 0; // counts calls to mul2 or mul2t
long Mul1kt = 0; // counts calls to mul_1_n
long Mul1kts = 0; // sum of sizes sb in calls to mul_1_n
long Add1kt = 0; // counts calls to addmul_1_n
long Add1kts = 0; // sum of sizes sb in calls to addmul_1_n
#endif
#include "gf2x.h"
using namespace NTL;
class GF2XMatrix {
private:
GF2XMatrix(const GF2XMatrix&); // disable
GF2X elts[2][2];
public:
GF2XMatrix() { }
~GF2XMatrix() { }
void operator=(const GF2XMatrix&);
GF2X& operator() (long i, long j) { return elts[i][j]; }
const GF2X& operator() (long i, long j) const { return elts[i][j]; }
};
void mul_gen(GF2X& c, const GF2X& a, const GF2X& b)
{
long sa = a.xrep.length();
long sb = b.xrep.length();
if (sa <= 0 || sb <= 0) {
clear(c);
return;
}
c.xrep.SetLength(sa+sb);
/* gf2x_mul now properly handles possible aliasing a==c and b==c */
gf2x_mul(c.xrep.elts(), a.xrep.elts(), sa, b.xrep.elts(), sb);
c.normalize();
}
void
mul (GF2X& U, GF2X& V, const GF2XMatrix& M)
// (U, V)^T = M*(U, V)^T
{
GF2X RU, RV, R1, R2;
// RU = U
// RV = V
// R1 = M(0,0)
mul_gen(R1, M(0,0), U);
// R2 = M(0,1)
mul_gen(R2, M(0,1), V);
add(R2, R1, R2);
// R1 = M(1,0)
mul_gen(R1, M(1,0), U);
U = R2; // previous value
// R2 = M(1,1)
mul_gen(R2, M(1,1), V);
add(V, R1, R2);
}
void
mul (GF2XMatrix& A, GF2XMatrix& B, GF2XMatrix& C)
// A = B*C, B and C are destroyed
{
GF2X B00, B01, B10, B11, C0, C1, T1, T2;
mul_gen(T1, B(0,0), C(0,0));
mul_gen(T2, B(0,1), C(1,0));
add(A(0,0), T1, T2);
mul_gen(T1, B(1,0), C(0,0));
mul_gen(T2, B(1,1), C(1,0));
add(A(1,0), T1, T2);
C(0,0).kill();
C(1,0).kill();
mul_gen(T1, B(0,0), C(0,1));
mul_gen(T2, B(0,1), C(1,1));
add(A(0,1), T1, T2);
mul_gen(T1, B(1,0), C(0,1));
mul_gen(T2, B(1,1), C(1,1));
add(A(1,1), T1, T2);
C(0,1).kill();
C(1,1).kill();
B(0,0).kill();
B(1,0).kill();
B(0,1).kill();
B(1,1).kill();
}
void
strassen_mul (GF2XMatrix& C, GF2XMatrix& A, GF2XMatrix& B)
// C = A*B, A and B are destroyed
/* we follow the code from SAGE 1.6, file strassen.pyx */
{
GF2X S0, T0, S1, T1, S2, T2, S3, T3, P0, P1, P2, P3, P4, P5, P6;
add (S0, A(1,0), A(1,1));
add (T0, B(0,1), B(0,0));
add (S1, S0, A(0,0));
add (T1, B(1,1), T0);
add (S2, A(0,0), A(1,0));
add (T2, B(1,1), B(0,1));
add (S3, A(0,1), S1);
add (T3, B(1,0), T1);
mul_gen (P0, A(0,0), B(0,0));
mul_gen (P1, A(0,1), B(1,0));
mul_gen (P2, S0, T0);
mul_gen (P3, S1, T1);
mul_gen (P4, S2, T2);
mul_gen (P5, S3, B(1,1));
mul_gen (P6, A(1,1), T3);
add (C(0,0), P0, P1); /* U0 */
add (C(0,1), P0, P3); /* U1 */
add (C(1,1), C(0,1), P4); /* U2 */
add (C(1,0), C(1,1), P6); /* U3 */
add (C(1,1), C(1,1), P2); /* U4 */
add (C(0,1), C(0,1), P2); /* U5 */
add (C(0,1), C(0,1), P5); /* U6 */
A(0,0).kill();
A(1,0).kill();
A(0,1).kill();
A(1,1).kill();
B(0,0).kill();
B(1,0).kill();
B(0,1).kill();
B(1,1).kill();
}
void
IterHalfGCD (GF2XMatrix& M_out, GF2X& U, GF2X& V, long d_red)
{
M_out(0,0).SetMaxLength(d_red);
M_out(0,1).SetMaxLength(d_red);
M_out(1,0).SetMaxLength(d_red);
M_out(1,1).SetMaxLength(d_red);
set(M_out(0,0)); clear(M_out(0,1));
clear(M_out(1,0)); set(M_out(1,1));
long goal = deg(U) - d_red;
if (deg(V) <= goal)
return;
GF2X Q, t(INIT_SIZE, d_red);
while (deg(V) > goal) {
/* For the gcd of two polynomials of degree < 74207281,
this PlainDivRem() call takes about 20% of the total gcd time.
Here U and V have degree less than about 2*NTL_GF2X_HalfGCD_CROSSOVER,
and usually deg(V) = deg(U) - <small value>. */
PlainDivRem(Q, U, U, V);
swap(U, V);
mul_gen(t, Q, M_out(1,0));
add(t, M_out(0,0), t); // add=sub over GF2
M_out(0,0) = M_out(1,0);
M_out(1,0) = t;
mul_gen(t, Q, M_out(1,1));
add(t, M_out(0,1), t); // add=sub over GF2
M_out(0,1) = M_out(1,1);
M_out(1,1) = t;
}
}
void GF2XMatrix::operator=(const GF2XMatrix& M)
{
elts[0][0] = M.elts[0][0];
elts[0][1] = M.elts[0][1];
elts[1][0] = M.elts[1][0];
elts[1][1] = M.elts[1][1];
}
// c <- a mod x^n, with n >= 0
void
RightShiftRem (GF2X& c, const GF2X& a, long n)
{
if (deg(a) < n) // covers a=0 too
{
c = a;
return;
}
long sa = a.xrep.length(); // number of words of a
long wn = n / NTL_BITS_PER_LONG;
long bn = n - wn * NTL_BITS_PER_LONG; // #bits of ap[wn]
if (wn >= sa)
{
wn = sa;
bn = 0;
}
c.xrep.SetLength (wn + (bn != 0));
_ntl_ulong *cp = c.xrep.elts();
const _ntl_ulong *ap = a.xrep.elts();
long i;
for (i = 0; i < wn; i++)
cp[i] = ap[i];
if (bn)
cp[wn] = ap[wn] & ((1UL << bn) - 1UL);
c.normalize();
}
// same as HalfGCD, except U and V are replaced by U' and V'
// if extended is zero, the matrix M_out is not computed, and the inputs are
// fully reduced.
// We want to reduce deg(V) to <= deg(U) - d_red
// Usually if deg(U) = m, then d_red = m/2
void
HalfGCD2 (GF2XMatrix& M_out, GF2X& U, GF2X& V, long d_red, int extended)
{
long degU = deg(U);
if (IsZero(V) || deg(V) <= degU - d_red)
{
if (extended != 0)
{
set(M_out(0,0)); clear(M_out(0,1));
clear(M_out(1,0)); set(M_out(1,1));
}
return;
}
if (d_red <= NTL_GF2X_HalfGCD_CROSSOVER)
{
IterHalfGCD(M_out, U, V, d_red);
return;
}
long d1 = (d_red + 1) / 2; /* d1 is about m/4 */
if (extended == 0) d1 = deg(U) / 4;
if (d1 < 1) d1 = 1;
if (d1 >= d_red) d1 = d_red - 1;
long n = degU - 2 * d1 + 2; /* n is the ignored part, about m/2 */
if (n < 0) n = 0;
GF2X U1, V1;
if (n != 0)
{
RightShiftRem (U1, U, n); /* U1 = U mod x^n: m/2 bits */
RightShiftRem (V1, V, n); /* V1 = V mod x^n: m/2 bits */
RightShift (U, U, n); /* U = U div x^n has about m/2 bits */
RightShift (V, V, n); /* V = V div x^n has about m/2 bits */
}
GF2XMatrix M1;
HalfGCD2 (M1, U, V, d1, extended || (n != 0));
/* the entries of M1 have m/4 bits, and U,V have been reduced to m/4 bits */
if (n != 0)
{
LeftShift (U, U, n);
LeftShift (V, V, n);
mul (U1, V1, M1); /* U1,V1:m/2 M1:m/4 cost: 4 M(m/2,m/4) */
add (U, U, U1);
add (V, V, V1);
}
/* now U, V have 3m/4 bits */
// FIXME (24 June 2007): shouldn't it be deg(U) instead of deg(V) below?
long d2 = deg(V) - (degU - d_red); /* should be about m/2 */
if (IsZero(V) || d2 <= 0)
{
if (extended != 0)
M_out = M1;
return;
}
GF2X Q;
GF2XMatrix M2;
/* this PlainDivRem() call takes negligible time */
PlainDivRem (Q, U, U, V);
swap (U, V);
if (extended)
{
GF2X t;
mul_gen (t, Q, M1(1,0));
add (t, M1(0,0), t);
swap (M1(0,0), M1(1,0));
swap (M1(1,0), t);
mul_gen (t, Q, M1(1,1));
add (t, M1(0,1), t);
swap (M1(0,1), M1(1,1));
swap (M1(1,1), t);
}
else
d2 = deg(U); // fully reduce V
if (IsZero(V) || deg(V) <= degU - d_red)
{
if (extended)
M_out = M1;
return;
}
n = deg(U) - 2 * d2 + 2; /* should be about m/4 */
if (n < 0 || extended == 0) n = 0;
if (n != 0)
{
RightShiftRem (U1, U, n); /* U1,V1 have m/4 bits */
RightShiftRem (V1, V, n);
RightShift(U, U, n); /* U,V have m/2 bits */
RightShift(V, V, n);
}
HalfGCD2 (M2, U, V, d2, extended || (n != 0));
/* now U,V have m/4 bits, like the entries of M2 */
if (n != 0)
{
LeftShift (U, U, n);
LeftShift (V, V, n);
mul (U1, V1, M2); /* 4 M(m/4) */
add (U, U, U1);
add (V, V, V1);
}
if (extended)
strassen_mul (M_out, M2, M1); /* 8 M(m/4) */
}
/* in the general case, we have deg(u) and deg(v) about the same here */
void FastGCD(GF2X& d, const GF2X& u, const GF2X& v)
{
GF2X u1, v1;
GF2XMatrix M1;
u1 = u;
v1 = v;
if (deg(u1) == deg(v1)) {
if (IsZero(u1)) {
clear(d);
return;
}
rem(v1, v1, u1);
}
else if (deg(u1) < deg(v1)) {
swap(u1, v1);
}
// deg(u1) > deg(v1)
/* in practice this while loop will be performed only once,
since HalfGCD fully reduces the inputs */
while (deg(u1) > NTL_GF2X_GCD_CROSSOVER && !IsZero(v1))
{
HalfGCD2 (M1, u1, v1, deg (u1), 0);
if (!IsZero(v1))
{
rem(u1, u1, v1);
swap(u1, v1);
}
}
// base case.
GCD(d, u1, v1);
}
/* This file is part of the gf2x library.
Copyright 2007, 2008, 2009
Richard Brent, Pierrick Gaudry, Emmanuel Thome', Paul Zimmermann
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; see the file COPYING. If not, write to the Free
Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
02111-1307, USA.
*/
#ifndef HALFGCD_HPP_
#define HALFGCD_HPP_
#include <NTL/GF2X.h>
extern void mul_gen(NTL::GF2X& c, const NTL::GF2X& a, const NTL::GF2X& b);
extern void FastGCD(NTL::GF2X& d, const NTL::GF2X& u, const NTL::GF2X& v);
#endif /* HALFGCD_HPP_ */
#include <stdint.h>
#include <stdlib.h>
#include "gf2x.h"
/*
*
* gf2x did not, prior to version 1.3, have a GF2X_VERSION macro defined.
*
* In order to check for the older gf2x versions, you may try to
* *compile* this source file with one of the CHECK macros enabled.
*
* In particular, with -DCHECK7, you are checking for gf2x version 1.2 or
* later.
*
* Such checks may be used in configure-time checks (autoconf, cmake).
*
version <--- -DCHECK# --->
1 2 3 4 5 6 7
0.9.1 to 0.9.5 OK NOK NOK NOK OK NOK NOK
0.9.6 NOK OK NOK NOK OK NOK NOK
1.0 to 1.1 NOK OK OK NOK OK NOK NOK
1.2 NOK NOK NOK OK OK NOK OK
1.2-fft NOK NOK NOK OK OK OK OK
1.2-LGPL NOK NOK NOK OK NOK NOK OK
1.2-LGPL-fft NOK NOK NOK OK NOK OK OK
later versions can check GF2X_VERSION
*/
#ifdef CHECK1
int version_0_9_1_to_0_9_5_ok() {
extern int gf2x_mul_fft0;
return gf2x_mul_fft0 == 0;
}
#endif
#ifdef CHECK2
int version_0_9_6_to_1_1_ok() {
extern int gf2x_tfft_alloc;
return gf2x_tfft_alloc == 0;
}
#endif
#ifdef CHECK3
int version_1_0_to_1_1_ok() {
extern int gf2x_tfft_compatible;
return gf2x_tfft_compatible == 0;
}
#endif
#ifdef CHECK4
int version_1_2_ok() {
extern int gf2x_ternary_fft_compatible;
return gf2x_ternary_fft_compatible == 0;
}
#endif
#ifdef CHECK5
int version_1_2_is_GPL_flavor() {
extern int gf2x_mul_tc3u;
return gf2x_mul_tc3u == 0;
}
#endif
#ifdef CHECK6
int version_1_2_has_fft_interface() {
extern int gf2x_fake_fft_init;
return gf2x_fake_fft_init == 0;
}
#endif
#ifdef CHECK7
int version_1_2_or_later() {
#ifdef GF2X_VERSION_MAJOR
/* gf2x 1.3 or later define this */
return 0;
#else
/* This will fail to link for gf2x versions prior to 1.2 */
extern int gf2x_ternary_fft_compatible;
return gf2x_ternary_fft_compatible == 0;
#endif
}
#endif
#ifdef CHECK8
/* This is a slightly more verbose version of the above, if you fear the
* linker may be averse to dirty casts. */
#ifndef GF2X_VERSION_MAJOR
extern "C" {
struct gf2x_ternary_fft_info_s;
typedef const struct gf2x_ternary_fft_info_s * gf2x_ternary_fft_info_srcptr;
int gf2x_ternary_fft_compatible(gf2x_ternary_fft_info_srcptr o1, gf2x_ternary_fft_info_srcptr o2);
}
#endif
/* This will fail to link for versions prior to v1.2. */
void fun() { gf2x_ternary_fft_compatible(0, 0); }
#endif
int main() {
unsigned long a = 0xdeadbeef, b=0xcafecafe, c[2];
/* result: 0x5fff29e51e50684a; */
gf2x_mul(c,&a,1,&b,1);
return ((uint32_t) c[0] == 0x1e50684a) ? 0 : EXIT_FAILURE;
}
......@@ -722,3 +722,67 @@ fi
AC_SUBST(EXEEXT_FOR_BUILD,$gf2x_cv_prog_exeext_for_build)
])
AC_DEFUN([GF2X_CHECK_VISIBILITY_HIDDEN],
[
AC_CACHE_CHECK([for __attribute__((visibility("hidden")))],
gf2x_cv_hidden_visibility_attribute, [
cat > conftest.c <<EOF
int __attribute__ ((visibility ("hidden"))) foo (void) { return 1; }
int __attribute__ ((visibility ("default"))) bar (void) { return 1; }
int baz (void) { return 1; }
EOF
gf2x_cv_hidden_visibility_attribute=no
if AC_TRY_COMMAND(${CC-cc} -fvisibility=hidden -Werror -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD);
then
if (grep '\.hidden.*foo' conftest.s && grep '\.hidden.*baz' conftest.s && ! grep '\.hidden.*bar' conftest.s) >/dev/null;
then
gf2x_cv_hidden_visibility_attribute=yes
fi
fi
rm -f conftest.*
])
if test $gf2x_cv_hidden_visibility_attribute = yes;
then
AC_DEFINE(HAVE_HIDDEN_VISIBILITY_ATTRIBUTE, 1,
[Define if __attribute__((visibility("hidden"))) is supported.])
fi
AM_CONDITIONAL([HAVE_HIDDEN_VISIBILITY_ATTRIBUTE],[test "x$gf2x_cv_hidden_visibility_attribute" = xyes])
])
AC_DEFUN([GF2X_TEST_CLOCK_NOT_CONSTANT_CODE],[AC_LANG_SOURCE([
#include <stdlib.h>
#include <time.h>
#include <sys/types.h>
int main()
{
clock_t c0 = clock(), c1;
long count = 0;
for( ; count < 1000000 ; count++) {
if ((c1 = clock()) != c0)
return EXIT_SUCCESS;
}
return EXIT_FAILURE;
}
])])
AC_DEFUN([GF2X_TEST_CLOCK_NOT_CONSTANT],
[
AC_CACHE_CHECK([that clock() returns non-constant values],
gf2x_cv_clock_is_not_constant, [
AC_RUN_IFELSE([GF2X_TEST_CLOCK_NOT_CONSTANT_CODE()],[
gf2x_cv_clock_is_not_constant=yes
],[
gf2x_cv_clock_is_not_constant=no
],[
AC_MSG_NOTICE([check skipped because of cross-compiling])
gf2x_cv_clock_is_not_constant=dontknow
])
])
if test $gf2x_cv_clock_is_not_constant = yes;
then
AC_DEFINE(HAVE_NONCONSTANT_CLOCK, 1,
[Define if clock() returns non-constant values.])
fi
AM_CONDITIONAL([HAVE_NONCONSTANT_CLOCK],[test "x$gf2x_cv_clock_is_not_constant" = xyes])
])
......@@ -4704,6 +4704,12 @@ m4_if([$1], [CXX], [
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
;;
# flang / f18. f95 an alias for gfortran or flang on Debian
flang* | f18* | f95*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
;;
# icc used to be incompatible with GCC.
# ICC 10 doesn't accept -KPIC any more.
icc* | ifort*)
......
......@@ -31,7 +31,7 @@
PROGRAM=libtool
PACKAGE=libtool
VERSION="2.4.6 Debian-2.4.6-6"
VERSION="2.4.6 Debian-2.4.6-11"
package_revision=2.4.6
......@@ -64,7 +64,7 @@ package_revision=2.4.6
# libraries, which are installed to $pkgauxdir.
# Set a version string for this script.
scriptversion=2015-10-04.22; # UTC
scriptversion=2015-01-20.17; # UTC
# General shell script boiler plate, and helper functions.
# Written by Gary V. Vaughan, 2004
......@@ -1091,57 +1091,6 @@ func_relative_path ()
}
# func_quote ARG
# --------------
# Aesthetically quote one ARG, store the result into $func_quote_result. Note
# that we keep attention to performance here (so far O(N) complexity as long as
# func_append is O(1)).
func_quote ()
{
$debug_cmd
func_quote_result=$1
case $func_quote_result in
*[\\\`\"\$]*)
case $func_quote_result in
*[\[\*\?]*)
func_quote_result=`$ECHO "$func_quote_result" | $SED "$sed_quote_subst"`
return 0
;;
esac
func_quote_old_IFS=$IFS
for _G_char in '\' '`' '"' '$'
do
# STATE($1) PREV($2) SEPARATOR($3)
set start "" ""
func_quote_result=dummy"$_G_char$func_quote_result$_G_char"dummy
IFS=$_G_char
for _G_part in $func_quote_result
do
case $1 in
quote)
func_append func_quote_result "$3$2"
set quote "$_G_part" "\\$_G_char"
;;
start)
set first "" ""
func_quote_result=
;;
first)
set quote "$_G_part" ""
;;
esac
done
IFS=$func_quote_old_IFS
done
;;
*) ;;
esac
}
# func_quote_for_eval ARG...
# --------------------------
# Aesthetically quote ARGs to be evaled later.
......@@ -1158,8 +1107,12 @@ func_quote_for_eval ()
func_quote_for_eval_unquoted_result=
func_quote_for_eval_result=
while test 0 -lt $#; do
func_quote "$1"
_G_unquoted_arg=$func_quote_result
case $1 in
*[\\\`\"\$]*)
_G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
*)
_G_unquoted_arg=$1 ;;
esac
if test -n "$func_quote_for_eval_unquoted_result"; then
func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
else
......@@ -2188,7 +2141,7 @@ include the following information:
compiler: $LTCC
compiler flags: $LTCFLAGS
linker: $LD (gnu? $with_gnu_ld)
version: $progname $scriptversion Debian-2.4.6-6
version: $progname $scriptversion Debian-2.4.6-11
automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q`
......@@ -5397,8 +5350,7 @@ else
if test \"\$libtool_execute_magic\" != \"$magic\"; then
file=\"\$0\""
func_quote "$ECHO"
qECHO=$func_quote_result
qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
$ECHO "\
# A function that is used when there is no print builtin or printf.
......@@ -7415,10 +7367,11 @@ func_mode_link ()
# -specs=* GCC specs files
# -stdlib=* select c++ std lib with clang
# -fsanitize=* Clang/GCC memory and address sanitizer
# -fuse-ld=* Linker select flags for GCC
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
-O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
-specs=*|-fsanitize=*)
-specs=*|-fsanitize=*|-fuse-ld=*)
func_quote_for_eval "$arg"
arg=$func_quote_for_eval_result
func_append compile_command " $arg"
......@@ -10655,8 +10608,8 @@ EOF
relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
fi
done
func_quote "(cd `pwd`; $relink_command)"
relink_command=$func_quote_result
relink_command="(cd `pwd`; $relink_command)"
relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
fi
# Only actually do things if not in dry run mode.
......@@ -10902,8 +10855,7 @@ EOF
done
# Quote the link command for shipping.
relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
func_quote "$relink_command"
relink_command=$func_quote_result
relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
if test yes = "$hardcode_automatic"; then
relink_command=
fi
......
This diff is collapsed.
......@@ -24,7 +24,16 @@
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301, USA.
AC_INIT([gf2x], [1.2.1])
AC_INIT([gf2x], [1.3.0])
AC_SUBST([GF2X_VERSION_MAJOR],
[regexp(AC_PACKAGE_VERSION,[\([0-9]+\)\.\([0-9]+\)\.\([0-9]+\)],[\1])])
AC_SUBST([GF2X_VERSION_MINOR],
[regexp(AC_PACKAGE_VERSION,[\([0-9]+\)\.\([0-9]+\)\.\([0-9]+\)],[\2])])
AC_SUBST([GF2X_VERSION_PATCHLEVEL],
[regexp(AC_PACKAGE_VERSION,[\([0-9]+\)\.\([0-9]+\)\.\([0-9]+\)],[\3])])
AC_SUBST([GF2X_FFT_VERSION_MAJOR],[GF2X_VERSION_MAJOR])
AC_SUBST([GF2X_FFT_VERSION_MINOR],[GF2X_VERSION_MINOR])
AC_SUBST([GF2X_FFT_VERSION_PATCHLEVEL],[GF2X_VERSION_PATCHLEVEL])
if test "x$CFLAGS" != x ; then
has_CFLAGS_from_env=yes
......@@ -41,7 +50,15 @@ AC_LANG([C])
AC_FUNC_ALLOCA
AC_SUBST([gf2x_lib_version], [2:0:0])
# We prefer to both version below in sync.
# 1:0:0 up to gf2x-1.1
# 1:2:0 gf2x-1.2 -- that was a mistake
# 2:0:0 gf2x-1.2.x branch
# 3:0:0 gf2x-1.3 branch
# the big changes to the fft interfaces (aug 2018) were done before gf2x-1.3 was
# actually released, so we retain the version number 3:0:0.
AC_SUBST([gf2x_lib_version], [3:0:0])
AC_SUBST([gf2x_fft_lib_version], [3:0:0])
AM_INIT_AUTOMAKE([1.13])
......@@ -50,10 +67,6 @@ AM_MAINTAINER_MODE([disable])
LT_INIT()
AC_ARG_ENABLE([ntl-checks],
[AS_HELP_STRING([--enable-ntl-checks],
[Turn on ntl checks])])
AC_ARG_ENABLE([hardware-specific-code],
[AS_HELP_STRING([--enable-hardware-specific-code],
[Turn on all cpu-dependent optimized code (default is yes)])],
......@@ -79,17 +92,12 @@ AC_ARG_ENABLE([pclmul],
[AS_HELP_STRING([--enable-pclmul],
[Turn on pclmul code (default is yes)])])
if test "x$enable_ntl_checks" = xyes ; then
MAYBE_APPS=apps
else
MAYBE_APPS=
fi
AC_SUBST([MAYBE_APPS])
AC_ARG_ENABLE([fft-interface],
[AS_HELP_STRING([--enable-fft-interface],
[compile with the optional fft interface (default is no)])],
[],[])
[
AC_DEFINE([GF2X_HAS_FFT_INTERFACE_SUPPORT],[1],[This is defined if gf2x was configured with --enable-fft-interface])
],[])
AM_CONDITIONAL([ENABLE_FFT_INTERFACE],[test "x$enable_fft_interface" = xyes])
AC_PROG_CC
......@@ -100,6 +108,8 @@ AC_PROG_CPP
GF2X_PROG_CC_FOR_BUILD
GF2X_PROG_EXEEXT_FOR_BUILD
GF2X_CHECK_VISIBILITY_HIDDEN
GF2X_TEST_CLOCK_NOT_CONSTANT
# This macro is used for tuning
AM_PROG_CC_C_O
......@@ -265,22 +275,13 @@ if grep -q "released under the GPL" "$srcdir/toom-gpl.c" ; then
else
echo "File $srcdir/toom-gpl.c is a placeholder, using an LGPL-licensed gf2x"
AC_DEFINE([GPL_CODE_PRESENT],0,[Have LGPL code (no GPL taint)])
AC_DEFINE([GF2X_IS_LGPL_VARIANT],[1],[This is defined if gf2x was compiled from an LGPL tarball])
fi
AC_CONFIG_HEADERS([gf2x/gf2x-config.h gf2x/gf2x-config-export.h])
#if test -d "$srcdir/gf2x-fft" ; then
# AC_MSG_NOTICE([Enabling optional gf2x-fft])
# AC_CONFIG_SUBDIRS([gf2x-fft])
# MAYBE_GF2X_FFT=gf2x-fft
#else
# AC_MSG_NOTICE([optional gf2x-fft not found])
# MAYBE_GF2X_FFT=
#fi
#AC_SUBST([MAYBE_GF2X_FFT])
AC_CONFIG_HEADERS([gf2x/gf2x-config.h gf2x/gf2x-config-export.h gf2x.h])
AC_CONFIG_FILES([version.sh Makefile tests/Makefile lowlevel/Makefile
src/Makefile fft/Makefile apps/Makefile])
src/Makefile fft/Makefile fft/gf2x-fft.h gf2x.h.in gf2x.pc])
AC_OUTPUT
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -13,6 +13,7 @@ typedef struct {
} mpfq_2_field_struct;
typedef mpfq_2_field_struct mpfq_2_field[1];
typedef const mpfq_2_field_struct * mpfq_2_src_field;
typedef mpfq_2_field_struct * mpfq_2_dst_field;
#if GNUC_VERSION(4,3,0) || GNUC_VERSION(4,3,1)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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