From e8578cfea272cfd0df7da6cd23646d859695552d Mon Sep 17 00:00:00 2001 From: J08nY Date: Sun, 29 Nov 2020 14:08:30 +0100 Subject: Fix builds with makefile. --- CMakeLists.txt | 4 ++-- lib/CMakeLists.txt | 4 ++-- src/gen/field.c | 2 +- src/invalid/invalid.c | 1 - src/io/output.c | 5 +++++ src/io/output.h | 8 ++++---- test/CMakeLists.txt | 4 ++-- 7 files changed, 16 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cf6b3fe..929ef0b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.10) project(ecgen C) add_subdirectory(lib) @@ -12,7 +12,7 @@ set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DNDEBUG -O3 -Wall -flto") include_directories(src) include_directories(lib) -add_subdirectory(test) +#add_subdirectory(test) add_executable(ecgen ${ECGEN_SRC}) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index c97b838..2883b2c 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.1O) project(ecgen_libs C) set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DDEBUG -g -Wall -Werror -pedantic") @@ -8,4 +8,4 @@ file(GLOB PARSON_SRC "parson/*.c") file(GLOB SHA1_SRC "sha1/*.c") add_library(parson STATIC ${PARSON_SRC}) -add_library(sha1 STATIC ${SHA1_SRC}) \ No newline at end of file +add_library(sha1 STATIC ${SHA1_SRC}) diff --git a/src/gen/field.c b/src/gen/field.c index b7dd40b..7780406 100644 --- a/src/gen/field.c +++ b/src/gen/field.c @@ -84,7 +84,7 @@ GENERATOR(field_gen_input) { gel(v, 1) = gen_1; GEN poly = gmul(gtopolyrev(v, -1), gmodulss(1, 2)); - if (!isirreducible(poly)) { + if (!polisirreducible(poly)) { fprintf(err, "Polynomial is reducible.\n"); avma = ltop; return 0; diff --git a/src/invalid/invalid.c b/src/invalid/invalid.c index 560b6e7..da2a0b3 100644 --- a/src/invalid/invalid.c +++ b/src/invalid/invalid.c @@ -239,7 +239,6 @@ static size_t invalid_curves_threaded(const curve_t *curve, pari_ulong *primes, pthread_t pthreads[cfg->threads]; thread_t threads[cfg->threads]; struct pari_thread pari_threads[cfg->threads]; - pari_thread_sync(); size_t *generated = try_calloc(sizeof(size_t)); state_e *states = try_calloc(sizeof(state_e) * nprimes); diff --git a/src/io/output.c b/src/io/output.c index 5f9bb3e..12b412d 100644 --- a/src/io/output.c +++ b/src/io/output.c @@ -9,6 +9,11 @@ #include "util/bits.h" #include "util/memory.h" +char *(*output_s)(curve_t *curve); +char *(*output_s_separator)(); +char *(*output_s_begin)(); +char *(*output_s_end)(); + FILE *out; FILE *err; FILE *verbose; diff --git a/src/io/output.h b/src/io/output.h index 1bf9aee..f68acfc 100644 --- a/src/io/output.h +++ b/src/io/output.h @@ -110,7 +110,7 @@ char *output_sjson_end(); * @param curve * @return */ -char *(*output_s)(curve_t *curve); +extern char *(*output_s)(curve_t *curve); /** * @brief Output curve to a FILE *out in configured format. @@ -129,7 +129,7 @@ void output_o(curve_t *curve); * @brief Output separator to a malloc'ed string in configured format. * @return */ -char *(*output_s_separator)(); +extern char *(*output_s_separator)(); /** * @brief Output separator to a FILE *out in configured format. @@ -146,7 +146,7 @@ void output_o_separator(); * @brief Output header to a malloc'ed string in configured format. * @return */ -char *(*output_s_begin)(); +extern char *(*output_s_begin)(); /** * @brief Output header to a FILE *out in configured format. @@ -163,7 +163,7 @@ void output_o_begin(); * @brief Output footer to a malloc'ed string in configured format. * @return */ -char *(*output_s_end)(); +extern char *(*output_s_end)(); /** * @brief Output footer to a FILE *out in configured format. diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index ff528cd..deab05a 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.10) # This is an issue because criterion contains a header "io/output.h" which is # after ecgen's "io/output.h" and so gets shadowed in the include directories @@ -18,4 +18,4 @@ add_executable(test_ecgen ${TEST_SRC} ${TESTING_SRC} ${SRC}) target_link_libraries(test_ecgen pthread rt pari parson sha1 ${criterion}) enable_testing() -add_test(NAME test_ecgen COMMAND test_ecgen) \ No newline at end of file +add_test(NAME test_ecgen COMMAND test_ecgen) -- cgit v1.2.3-70-g09d2