diff --git a/math/clad/Makefile b/math/clad/Makefile index 482b728bea5f..3587f0dae51b 100644 --- a/math/clad/Makefile +++ b/math/clad/Makefile @@ -1,46 +1,45 @@ PORTNAME= clad DISTVERSIONPREFIX= v -DISTVERSION= 2.2 -PORTREVISION= 1 +DISTVERSION= 2.4 CATEGORIES= math MAINTAINER= yuri@FreeBSD.org COMMENT= Automatic differentiation for C/C++ WWW= https://github.com/vgvassilev/clad LICENSE= LGPL3 LICENSE_FILE= ${WRKSRC}/License.txt .if !exists(/usr/include/omp.h) BROKEN= requires OpenMP support that is missing on this architecture .endif TEST_DEPENDS= kokkos>0:devel/kokkos -USES= cmake:testing llvm:16,build,run localbase +USES= cmake:testing llvm:build,run localbase USE_LDCONFIG= yes USE_GITHUB= yes GH_ACCOUNT= vgvassilev CMAKE_ARGS= -DClang_DIR=${LLVM_PREFIX}/lib/cmake/clang \ -DLLVM_DIR=${LLVM_PREFIX}/lib/cmake/llvm \ -DLLVM_EXTERNAL_LIT=${LLVM_PREFIX}/bin/llvm-lit CMAKE_ON= BUILD_SHARED_LIBS CMAKE_TESTING_ON= FREEBSD_BUILD_TESTS FREEBSD_BUILD_DEMOS CMAKE_TESTING_TARGET= check-clad #CXXFLAGS+= -D_OPENMP CXXFLAGS+= -fopenmp post-patch: @${REINPLACE_CMD} \ -e ' \ s|import lit|&${LLVM_VERSION}|; \ s|lit\.|lit${LLVM_VERSION}.| \ ' \ ${WRKSRC}/test/lit.cfg -# tests fail to compile: https://github.com/vgvassilev/clad/issues/993, https://github.com/vgvassilev/clad/issues/1181 +# tests fail to compile: https://github.com/vgvassilev/clad/issues/993, https://github.com/vgvassilev/clad/issues/1181, https://github.com/vgvassilev/clad/issues/1860 .include diff --git a/math/clad/distinfo b/math/clad/distinfo index 7090ea2705e5..0f9ffa35ed19 100644 --- a/math/clad/distinfo +++ b/math/clad/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1762232638 -SHA256 (vgvassilev-clad-v2.2_GH0.tar.gz) = 9bcfae0931849658443deecae4f13ff23e9b79de60632c318efa059f9fd2dc6d -SIZE (vgvassilev-clad-v2.2_GH0.tar.gz) = 1327715 +TIMESTAMP = 1782805921 +SHA256 (vgvassilev-clad-v2.4_GH0.tar.gz) = 69502d31bc4f399e696652373e6c77ded5f015c9639fce0c177ad98b207337e9 +SIZE (vgvassilev-clad-v2.4_GH0.tar.gz) = 1420962 diff --git a/math/clad/files/patch-CMakeLists.txt b/math/clad/files/patch-CMakeLists.txt index 8fd367a13fc2..4da3b09126fc 100644 --- a/math/clad/files/patch-CMakeLists.txt +++ b/math/clad/files/patch-CMakeLists.txt @@ -1,22 +1,11 @@ ---- CMakeLists.txt.orig 2024-07-17 20:27:26 UTC +--- CMakeLists.txt.orig 2026-06-28 13:38:25 UTC +++ CMakeLists.txt -@@ -321,8 +321,10 @@ if (NOT CLAD_BUILD_STATIC_ONLY) - include(GoogleBenchmark) - endif(CLAD_ENABLE_BENCHMARKS) - -+ if (FREEBSD_BUILD_DEMOS) - add_subdirectory(demos/ErrorEstimation/CustomModel) - add_subdirectory(demos/ErrorEstimation/PrintModel) -+ endif() - - if (NOT CLAD_DISABLE_TESTS OR CLAD_ENABLE_BENCHMARKS) - # Change the default compiler to the clang which we run clad upon. Our unittests -@@ -337,7 +339,7 @@ if (NOT CLAD_BUILD_STATIC_ONLY) - string(REPLACE "-Wno-class-memaccess" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +@@ -352,7 +352,7 @@ if (NOT CLAD_BUILD_STATIC_ONLY) + endforeach() endif() - if (NOT CLAD_DISABLE_TESTS) + if (FREEBSD_BUILD_TESTS) add_subdirectory(unittests) add_subdirectory(test) endif() diff --git a/math/clad/files/patch-demos_ErrorEstimation_CustomModel_CustomModel.cpp b/math/clad/files/patch-demos_ErrorEstimation_CustomModel_CustomModel.cpp deleted file mode 100644 index d8e6163e4c60..000000000000 --- a/math/clad/files/patch-demos_ErrorEstimation_CustomModel_CustomModel.cpp +++ /dev/null @@ -1,16 +0,0 @@ -- workaround for errors like: -- ld: error: undefined reference due to --no-allow-shlib-undefined: __progname -- >>> referenced by /lib/libc.so.7 - ---- demos/ErrorEstimation/CustomModel/CustomModel.cpp.orig 2023-07-19 16:59:14 UTC -+++ demos/ErrorEstimation/CustomModel/CustomModel.cpp -@@ -2,6 +2,9 @@ - - #include "CustomModel.h" - -+char **environ = nullptr; -+const char *__progname = "x"; -+ - // Here we use the BuildOp function provided by clad to build a multiplication - // expression that clad can generate code for. - clang::Expr* CustomModel::AssignError(clad::StmtDiff refExpr, diff --git a/math/clad/files/patch-demos_ErrorEstimation_PrintModel_PrintModel.cpp b/math/clad/files/patch-demos_ErrorEstimation_PrintModel_PrintModel.cpp deleted file mode 100644 index ba2ae07083d5..000000000000 --- a/math/clad/files/patch-demos_ErrorEstimation_PrintModel_PrintModel.cpp +++ /dev/null @@ -1,16 +0,0 @@ -- workaround for errors like: -- ld: error: undefined reference due to --no-allow-shlib-undefined: __progname -- >>> referenced by /lib/libc.so.7 - ---- demos/ErrorEstimation/PrintModel/PrintModel.cpp.orig 2023-07-18 14:54:11 UTC -+++ demos/ErrorEstimation/PrintModel/PrintModel.cpp -@@ -4,6 +4,9 @@ - #include "PrintModel.h" - #include "clad/Differentiator/CladUtils.h" - -+char **environ = nullptr; -+const char *__progname = "x"; -+ - // Here we use the BuildOp function provided by clad to build a multiplication - // expression that clad can generate code for. - clang::Expr* PrintModel::AssignError(clad::StmtDiff refExpr, diff --git a/math/clad/pkg-plist b/math/clad/pkg-plist index fe06b56e3445..75cde9e0ac24 100644 --- a/math/clad/pkg-plist +++ b/math/clad/pkg-plist @@ -1,46 +1,47 @@ include/clad/Differentiator/Array.h include/clad/Differentiator/ArrayExpression.h include/clad/Differentiator/ArrayRef.h include/clad/Differentiator/BaseForwardModeVisitor.h include/clad/Differentiator/BuiltinDerivatives.h include/clad/Differentiator/CladConfig.h include/clad/Differentiator/CladUtils.h +include/clad/Differentiator/CladtorchBuiltins.h include/clad/Differentiator/Compatibility.h include/clad/Differentiator/DerivativeBuilder.h include/clad/Differentiator/DerivedFnCollector.h include/clad/Differentiator/DerivedFnInfo.h include/clad/Differentiator/DiffMode.h include/clad/Differentiator/DiffPlanner.h include/clad/Differentiator/Differentiator.h include/clad/Differentiator/DynamicGraph.h include/clad/Differentiator/ErrorEstimator.h -include/clad/Differentiator/EstimationModel.h include/clad/Differentiator/ExternalRMVSource.h include/clad/Differentiator/FunctionTraits.h include/clad/Differentiator/HessianModeVisitor.h include/clad/Differentiator/KokkosBuiltins.h include/clad/Differentiator/Matrix.h include/clad/Differentiator/MultiplexExternalRMVSource.h include/clad/Differentiator/NumericalDiff.h include/clad/Differentiator/ParseDiffArgsTypes.h include/clad/Differentiator/PushForwardModeVisitor.h include/clad/Differentiator/RestoreTracker.h include/clad/Differentiator/ReverseModeForwPassVisitor.h include/clad/Differentiator/ReverseModeVisitor.h include/clad/Differentiator/ReverseModeVisitorDirectionKinds.h include/clad/Differentiator/STLBuiltins.h include/clad/Differentiator/Sins.h include/clad/Differentiator/StmtClone.h include/clad/Differentiator/Tape.h include/clad/Differentiator/ThrustBuiltins.h include/clad/Differentiator/ThrustDerivatives.h include/clad/Differentiator/Timers.h include/clad/Differentiator/VectorForwardModeVisitor.h include/clad/Differentiator/VectorPushForwardModeVisitor.h include/clad/Differentiator/Version.h include/clad/Differentiator/Version.inc include/clad/Differentiator/VisitorBase.h include/clad/tools/ClangBackendPlugin.h include/clad/tools/ClangPlugin.h lib/clad.so lib/cmake/clad/AddClad.cmake +@dir include/cladtorch