Skip to content

Commit

Permalink
math/cado-nfs: update 2.3.0-20220722 → 2.3.0-20240318
Browse files Browse the repository at this point in the history
Also add workaround for the build breakage caused by the conflict with
the pre-installed libfmt.
  • Loading branch information
yurivict committed Apr 7, 2024
1 parent bfc9d84 commit 9f93126
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 23 deletions.
11 changes: 6 additions & 5 deletions math/cado-nfs/Makefile
@@ -1,6 +1,6 @@
PORTNAME= cado-nfs
DISTVERSIONPREFIX= v
DISTVERSION= 2.3.0-20220722
DISTVERSION= 2.3.0-20240318
CATEGORIES= math

MAINTAINER= yuri@FreeBSD.org
Expand All @@ -10,8 +10,6 @@ WWW= https://cado-nfs.gitlabpages.inria.fr/
LICENSE= LGPL21
LICENSE_FILE= ${WRKSRC}/COPYING

CONFLICTS_BUILD= libfmt # bundled libfmt conflicts with package-installed headers

BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}sqlite3>0:databases/py-sqlite3@${PY_FLAVOR} \
bash:shells/bash
LIB_DEPENDS= libecm.so:math/gmp-ecm \
Expand All @@ -24,15 +22,18 @@ USES= cmake:noninja compiler:c++11-lang gmake perl5 python shebangfix # noninja

USE_GITLAB= yes
GL_SITE= https://gitlab.inria.fr
GL_TAGNAME= 3ab6a4781fa5d218ed332834809ba6c6fd1a591f
GL_TAGNAME= a24829267c8e81f58d8c643c7c5be5e454ef106e

SHEBANG_GLOB= *.py

MAKE_ENV+= WRKSRC=${WRKSRC} # for files/fake-c++: workaround for external libfmt getting into the build

CXXFLAGS_i386= -msse2 # workaround for error: always_inline function '_mm_setzero_si128' requires target feature 'sse2', but would be inlined into function 'gf2x_mul4' that is compiled without support for 'sse2'

TEST_TARGET= check # 'test' does the same but is less verbose

BINARY_ALIAS= python3=${PYTHON_CMD}
BINARY_ALIAS= python3=${PYTHON_CMD} \
c++=${FILESDIR}/fake-c++ # workaround for external libfmt getting into the build

.include <bsd.port.options.mk>

Expand Down
6 changes: 3 additions & 3 deletions math/cado-nfs/distinfo
@@ -1,3 +1,3 @@
TIMESTAMP = 1658477035
SHA256 (cado-nfs-cado-nfs-3ab6a4781fa5d218ed332834809ba6c6fd1a591f_GL0.tar.gz) = 8f93d56f0cfef0693110882509365da192fc1ebd52307af3a1a763e0fb068fea
SIZE (cado-nfs-cado-nfs-3ab6a4781fa5d218ed332834809ba6c6fd1a591f_GL0.tar.gz) = 4742485
TIMESTAMP = 1712522573
SHA256 (cado-nfs-cado-nfs-a24829267c8e81f58d8c643c7c5be5e454ef106e_GL0.tar.gz) = 0af1c4ad0fd20caba7667cb9df3bcb999b7ea0bf7bb89bf3fd3c4b708d940cdb
SIZE (cado-nfs-cado-nfs-a24829267c8e81f58d8c643c7c5be5e454ef106e_GL0.tar.gz) = 4190790
2 changes: 2 additions & 0 deletions math/cado-nfs/files/fake-c++
@@ -0,0 +1,2 @@
# workaround for external libfmt getting into the buid
/usr/bin/c++ -I $WRKSRC/utils/embedded "$@"
28 changes: 14 additions & 14 deletions math/cado-nfs/files/patch-CMakeLists.txt
@@ -1,8 +1,8 @@
- workaround for the failure: error: variable 'total_weight' set but not used [-Werror,-Wunused-but-set-variable]

--- CMakeLists.txt.orig 2022-01-31 23:16:04 UTC
--- CMakeLists.txt.orig 2024-03-18 08:56:37 UTC
+++ CMakeLists.txt
@@ -146,7 +146,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
@@ -149,7 +149,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
# prevents the definition of __STRICT_ANSI__
#
# Ditto for C++, with the c++98/gnu++98 subtlety.
Expand All @@ -11,7 +11,7 @@
if (MINGW)
set (CMAKE_C_FLAGS "-std=gnu99 ${CMAKE_C_FLAGS}")
else()
@@ -156,7 +156,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
@@ -159,7 +159,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
endif()

if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
Expand All @@ -20,9 +20,9 @@
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
message(FATAL_ERROR "cado-nfs requires gcc version 5 or greater")
endif()
@@ -187,8 +187,8 @@ endif()

if(CMAKE_C_COMPILER_ID MATCHES "Intel")
@@ -201,8 +201,8 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
message(STATUS "Enabling C++11 support")
elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
message(STATUS "Applying flags for icc")
- set (CMAKE_C_FLAGS "-W -Wall -wd13200,13203 ${CMAKE_C_FLAGS}")
- set (CMAKE_CXX_FLAGS "-W -Wall -wd13200,13203,3058 ${CMAKE_CXX_FLAGS}")
Expand All @@ -31,7 +31,7 @@
set (CMAKE_C_FLAGS "-std=c99 ${CMAKE_C_FLAGS}")

# only icc>=15 is full c++11 compliant, it seems. But 14 will do.
@@ -206,7 +206,7 @@ endif()
@@ -220,7 +220,7 @@ if(CMAKE_C_COMPILER_ID MATCHES "AppleClang" OR CMAKE_H

if(CMAKE_C_COMPILER_ID MATCHES "AppleClang" OR CMAKE_HOST_SYSTEM_NAME
STREQUAL "Darwin" AND CMAKE_C_COMPILER_ID MATCHES "Clang" )
Expand All @@ -40,12 +40,12 @@
endif()

if(CMAKE_CXX_COMPILER_ID MATCHES "AppleClang" OR CMAKE_HOST_SYSTEM_NAME
@@ -226,7 +226,7 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "^Clang")
set (CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
set (HAVE_CXX11 1)
@@ -232,7 +232,7 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "^Clang")
message(STATUS "Enabling C++11 support")
- set (CMAKE_CXX_FLAGS "-std=c++11 -W -Wall ${CMAKE_CXX_FLAGS}")
+ set (CMAKE_CXX_FLAGS "-std=c++11 -W ${CMAKE_CXX_FLAGS}")
endif()
endif()
message(STATUS "CFLAGS=${CMAKE_C_FLAGS} (synthetized)")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "^Clang")
- set (CMAKE_CXX_FLAGS "-W -Wall ${CMAKE_CXX_FLAGS}")
+ set (CMAKE_CXX_FLAGS "-W ${CMAKE_CXX_FLAGS}")
# According to http://clang.llvm.org/cxx_status.html
# Caveat: Apple's clang identifies itself as plain Clang on some
# occasions... I don't exactly know when and how, but there's some
35 changes: 35 additions & 0 deletions math/cado-nfs/files/patch-config_fmt.cmake
@@ -0,0 +1,35 @@
--- config/fmt.cmake.orig 2024-04-07 21:30:28 UTC
+++ config/fmt.cmake
@@ -23,7 +23,7 @@ endif()
endif()

# Try in three passes, otherwise cmake gets in the way...
-find_path (FMT_INCDIR fmt/core.h HINTS ${FMT_INCDIR_HINTS} DOC "fmt headers"
+find_path (FMT_INCDIR fmt-invalid/core.h HINTS ${FMT_INCDIR_HINTS} DOC "fmt headers"
NO_DEFAULT_PATH
NO_SYSTEM_ENVIRONMENT_PATH
NO_CMAKE_PATH
@@ -32,19 +32,19 @@ if(NOT FMT_INCDIR)
NO_CMAKE_FIND_ROOT_PATH
)
if(NOT FMT_INCDIR)
-find_path (FMT_INCDIR fmt/core.h HINTS ${FMT_INCDIR_HINTS} DOC "fmt headers"
+find_path (FMT_INCDIR fmt-invalid/core.h HINTS ${FMT_INCDIR_HINTS} DOC "fmt headers"
NO_DEFAULT_PATH
)
endif()
if(NOT FMT_INCDIR)
-find_path (FMT_INCDIR fmt/core.h HINTS ${FMT_INCDIR_HINTS} DOC "fmt headers")
+find_path (FMT_INCDIR fmt-invalid/core.h HINTS ${FMT_INCDIR_HINTS} DOC "fmt headers")
endif()

-find_library(FMT_LIB fmt HINTS ${FMT_LIBDIR_HINTS} DOC "fmt library"
+find_library(FMT_LIB fmt-invalid HINTS ${FMT_LIBDIR_HINTS} DOC "fmt library"
NO_DEFAULT_PATH
)
if(NOT FMT_LIB)
-find_library(FMT_LIB fmt HINTS ${FMT_LIBDIR_HINTS} DOC "fmt library")
+find_library(FMT_LIB fmt-invalid HINTS ${FMT_LIBDIR_HINTS} DOC "fmt library")
endif()


12 changes: 11 additions & 1 deletion math/cado-nfs/pkg-plist
Expand Up @@ -18,8 +18,8 @@ lib/cado-nfs-3.0.0/linalg/bwc/cleanup
lib/cado-nfs-3.0.0/linalg/bwc/dispatch
lib/cado-nfs-3.0.0/linalg/bwc/gather
lib/cado-nfs-3.0.0/linalg/bwc/krylov
lib/cado-nfs-3.0.0/linalg/bwc/lingen_b64
%%LINGEN_PZ%%lib/cado-nfs-3.0.0/linalg/bwc/lingen_pz
lib/cado-nfs-3.0.0/linalg/bwc/lingen_u64k1
lib/cado-nfs-3.0.0/linalg/bwc/mf_bal
lib/cado-nfs-3.0.0/linalg/bwc/mksol
lib/cado-nfs-3.0.0/linalg/bwc/prep
Expand Down Expand Up @@ -114,10 +114,15 @@ lib/cado-nfs-3.0.0/utils/numbertheory_tool
%%DATADIR%%-3.0.0/factor/params.c130
%%DATADIR%%-3.0.0/factor/params.c135
%%DATADIR%%-3.0.0/factor/params.c140
%%DATADIR%%-3.0.0/factor/params.c143
%%DATADIR%%-3.0.0/factor/params.c145
%%DATADIR%%-3.0.0/factor/params.c148
%%DATADIR%%-3.0.0/factor/params.c150
%%DATADIR%%-3.0.0/factor/params.c153
%%DATADIR%%-3.0.0/factor/params.c155
%%DATADIR%%-3.0.0/factor/params.c158
%%DATADIR%%-3.0.0/factor/params.c160
%%DATADIR%%-3.0.0/factor/params.c163
%%DATADIR%%-3.0.0/factor/params.c165
%%DATADIR%%-3.0.0/factor/params.c170
%%DATADIR%%-3.0.0/factor/params.c175
Expand Down Expand Up @@ -154,10 +159,15 @@ lib/cado-nfs-3.0.0/utils/numbertheory_tool
%%DATADIR%%-3.0.0/polynomials/c130.poly
%%DATADIR%%-3.0.0/polynomials/c135.poly
%%DATADIR%%-3.0.0/polynomials/c140.poly
%%DATADIR%%-3.0.0/polynomials/c143.poly
%%DATADIR%%-3.0.0/polynomials/c145.poly
%%DATADIR%%-3.0.0/polynomials/c148.poly
%%DATADIR%%-3.0.0/polynomials/c150.poly
%%DATADIR%%-3.0.0/polynomials/c153.poly
%%DATADIR%%-3.0.0/polynomials/c155.poly
%%DATADIR%%-3.0.0/polynomials/c158.poly
%%DATADIR%%-3.0.0/polynomials/c160.poly
%%DATADIR%%-3.0.0/polynomials/c163.poly
%%DATADIR%%-3.0.0/polynomials/c165.poly
%%DATADIR%%-3.0.0/polynomials/c170.poly
%%DATADIR%%-3.0.0/polynomials/c175.poly
Expand Down

0 comments on commit 9f93126

Please sign in to comment.