diff --git a/.gitignore b/.gitignore index 230f55f..6a98c1a 100644 --- a/.gitignore +++ b/.gitignore @@ -6,16 +6,3 @@ /alglib-3.13.0.cpp.gpl.tgz /alglib-3.14.0.cpp.gpl.tgz /alglib-3.15.0.cpp.gpl.tgz -/alglib-3.16.0.cpp.gpl.tgz -/alglib-3.17.0.cpp.gpl.tgz -/alglib-3.18.0.cpp.gpl.tgz -/alglib-3.19.0.cpp.gpl.tgz -/alglib-3.20.0.cpp.gpl.tgz -/alglib-4.00.0.cpp.gpl.tgz -/alglib-4.01.0.cpp.gpl.tgz -/alglib-4.02.0.cpp.gpl.tgz -/alglib-4.03.0.cpp.gpl.tgz -/alglib-4.04.0.cpp.gpl.tgz -/alglib-4.05.0.cpp.gpl.tgz -/alglib-4.06.0.cpp.gpl.tgz -/alglib-4.07.0.cpp.gpl.tgz diff --git a/CMakeLists.txt b/CMakeLists.txt index 250a57d..6c8a871 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,43 +1,24 @@ -cmake_minimum_required(VERSION 3.5) +# Set the minimum required version of cmake for a project. +cmake_minimum_required(VERSION 2.6) set(ALGLIB_VERSION "" CACHE STRING "The package version") -project(alglib - VERSION ${ALGLIB_VERSION} - LANGUAGES CXX -) - -include(GNUInstallDirs) - file(GLOB_RECURSE HDR RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} src/*.h) file(GLOB_RECURSE SRC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} src/*.cpp) add_library(alglib SHARED ${SRC}) -set_target_properties(alglib PROPERTIES - SOVERSION ${PROJECT_VERSION} - VERSION ${PROJECT_VERSION} -) -target_include_directories(alglib PUBLIC - $ -) +set_target_properties(alglib PROPERTIES SUFFIX "-${ALGLIB_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}") -install(TARGETS alglib) -install(FILES ${HDR} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alglib) +add_executable(test_c tests/test_c.cpp) +add_executable(test_i tests/test_i.cpp) +# add_executable(test_x tests/test_x.cpp) +set_target_properties(test_c PROPERTIES COMPILE_FLAGS "-DAE_USE_ALLOC_COUNTER -DAE_DEBUG4POSIX") +set_target_properties(test_i PROPERTIES COMPILE_FLAGS "-DAE_USE_ALLOC_COUNTER -DAE_DEBUG4POSIX") +# set_target_properties(test_x PROPERTIES COMPILE_FLAGS "-DAE_USE_ALLOC_COUNTER -DAE_DEBUG4POSIX") +include_directories(src/) +target_link_libraries(test_c alglib) +target_link_libraries(test_i alglib) +# target_link_libraries(test_x alglib) -enable_testing() - -foreach(test IN ITEMS - test_c - test_i - # test_x -) - add_executable(${test} tests/${test}.cpp) - target_compile_definitions(${test} PRIVATE - AE_USE_ALLOC_COUNTER - AE_DEBUG4POSIX - ) - target_link_libraries(${test} PRIVATE alglib) - add_test(NAME ${test} - COMMAND ${test} - ) -endforeach() +install(TARGETS alglib LIBRARY DESTINATION lib${LIB_SUFFIX}) +install(FILES ${HDR} DESTINATION include/alglib) diff --git a/alglib.spec b/alglib.spec index 3a73cc4..c6fc0b4 100644 --- a/alglib.spec +++ b/alglib.spec @@ -1,17 +1,21 @@ Name: alglib -Version: 4.07.0 -Release: 2%{?dist} +Version: 3.15.0 +Release: 1%{?dist} Summary: A numerical analysis and data processing library -License: GPL-2.0-or-later +License: GPLv2+ URL: http://www.alglib.net/ Source0: http://www.alglib.net/translator/re/%{name}-%{version}.cpp.gpl.tgz Source1: CMakeLists.txt # Extracted from manual.cpp.html Source2: bsd.txt +# Make test output more verbose +Patch0: alglib_verbose-tests.patch + BuildRequires: cmake BuildRequires: gcc-c++ +BuildRequires: make %description ALGLIB is a cross-platform numerical analysis and data processing library. @@ -35,7 +39,7 @@ developing applications that use %{name}. %package doc Summary: API documentation for %{name} -License: ALGLIB-Documentation +License: BSD BuildArch: noarch %description doc @@ -43,31 +47,48 @@ The %{name}-doc package contains the %{name} API documentation. %prep -%autosetup -p1 -n %{name}-cpp +%autosetup -p1 -n cpp cp %{SOURCE1} . cp %{SOURCE2} . # Fix permissions and line endings -find -type f -exec chmod 0644 {} \; +chmod 644 gpl2.txt +chmod 644 manual.cpp.html sed -i 's|\r||g' manual.cpp.html %build -%cmake -DALGLIB_VERSION=%{version} -%cmake_build +mkdir build +( +cd build +# disable FMA support to get it pass all tests +%ifarch aarch64 %{power64} s390 s390x +export CXXFLAGS="$RPM_OPT_FLAGS -ffp-contract=off" +export CFLAGS="$RPM_OPT_FLAGS -ffp-contract=off" +%endif +%cmake -DALGLIB_VERSION=%{version} .. +%make_build +) %install -%cmake_install +%make_install -C build +ln -s libalglib-%{version}.so %{buildroot}%{_libdir}/libalglib.so %check -%ctest +pushd build +LD_LIBRARY_PATH=$PWD ./test_c || false +LD_LIBRARY_PATH=$PWD ./test_i || false +popd + + +%ldconfig_scriptlets %files %license gpl2.txt -%{_libdir}/libalglib.so.4.7.0 +%{_libdir}/libalglib-%{version}.so %files devel %{_includedir}/%{name}/ @@ -79,100 +100,6 @@ sed -i 's|\r||g' manual.cpp.html %changelog -* Fri Jan 16 2026 Fedora Release Engineering - 4.07.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild - -* Mon Dec 29 2025 Sandro Mani - 4.07.0-1 -- Update to 4.07.0 - -* Thu Oct 09 2025 Sandro Mani - 4.06.0-1 -- Update to 4.06.0 - -* Wed Jul 23 2025 Fedora Release Engineering - 4.05.0-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild - -* Wed Jul 16 2025 Sandro Mani - 4.05.0-2 -- Increase minimum cmake version, adapt library version - -* Mon Jun 09 2025 Sandro Mani - 4.05.0-1 -- Update to 4.05.0 - -* Fri May 30 2025 Cristian Le - 4.04.0-3 -- Allow to build with CMake 4.0 -- Use more modern CMake patterns - -* Thu Jan 16 2025 Fedora Release Engineering - 4.04.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild - -* Sun Dec 22 2024 Sandro Mani - 4.04.0-1 -- Update to 4.04.0 - -* Sun Sep 29 2024 Sandro Mani - 4.03.0-1 -- Update to 4.03.0 - -* Wed Aug 28 2024 Miroslav Suchý - 4.02.0-3 -- convert license to SPDX - -* Wed Jul 17 2024 Fedora Release Engineering - 4.02.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild - -* Tue Jun 04 2024 Sandro Mani - 4.02.0-1 -- Update to 4.02.0 - -* Mon Jan 22 2024 Fedora Release Engineering - 4.01.0-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild - -* Fri Jan 19 2024 Fedora Release Engineering - 4.01.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild - -* Mon Jan 01 2024 Sandro Mani - 4.01.0-1 -- Update to 4.01.0 - -* Wed Jul 19 2023 Fedora Release Engineering - 4.00.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild - -* Tue May 23 2023 Sandro Mani - 4.0.0-1 -- Update to 4.0.0 - -* Wed Jan 18 2023 Fedora Release Engineering - 3.20.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild - -* Wed Dec 21 2022 Sandro Mani - 3.20.0-1 -- Update to 3.20.0 - -* Wed Jul 20 2022 Fedora Release Engineering - 3.19.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild - -* Mon Jun 13 2022 Sandro Mani - 3.19.0-1 -- Update to 3.19.0 - -* Wed Jan 19 2022 Fedora Release Engineering - 3.18.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild - -* Tue Oct 26 2021 Sandro Mani - 3.18.0-1 -- Update to 3.18.0 - -* Wed Jul 21 2021 Fedora Release Engineering - 3.17.0-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild - -* Mon Jan 25 2021 Fedora Release Engineering - 3.17.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild - -* Tue Dec 29 2020 Sandro Mani - 3.17.0-1 -- Update to 3.17.0 - -* Mon Jul 27 2020 Fedora Release Engineering - 3.16.0-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - -* Tue Jan 28 2020 Fedora Release Engineering - 3.16.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild - -* Fri Dec 20 2019 Sandro Mani - 3.16.0-1 -- Update to 3.16.0 - -* Wed Jul 24 2019 Fedora Release Engineering - 3.15.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild - * Sat Feb 23 2019 Sandro Mani - 3.15.0-1 - Update to 3.15.0 diff --git a/alglib_verbose-tests.patch b/alglib_verbose-tests.patch new file mode 100644 index 0000000..7f3dd85 --- /dev/null +++ b/alglib_verbose-tests.patch @@ -0,0 +1,131 @@ +diff -rupN cpp/tests/test_c.cpp cpp-new/tests/test_c.cpp +--- cpp/tests/test_c.cpp 2019-02-20 16:34:14.000000000 +0100 ++++ cpp-new/tests/test_c.cpp 2019-02-23 17:32:31.243746932 +0100 +@@ -3687,8 +3687,8 @@ ae_bool testhqrnd(ae_bool silent, ae_sta + /* + *Discrete/Continuous tests + */ +- discreteerr = hqrnddiscretetest(ae_true, _state); +- continuouserr = hqrndcontinuoustest(ae_true, _state); ++ discreteerr = hqrnddiscretetest(ae_false, _state); ++ continuouserr = hqrndcontinuoustest(ae_false, _state); + + /* + * Final report +@@ -4356,8 +4356,8 @@ ae_bool testsparse(ae_bool silent, ae_st + linearserrors = linearfunctionsstest(_state); + linearmmerrors = linearfunctionsmmtest(_state); + linearsmmerrors = linearfunctionssmmtest(_state); +- copyerrors = copyfunctest(ae_true, _state)||testsparseunit_testconvertsm(_state); +- basiccopyerrors = basiccopyfunctest(ae_true, _state); ++ copyerrors = copyfunctest(ae_false, _state)||testsparseunit_testconvertsm(_state); ++ basiccopyerrors = basiccopyfunctest(ae_false, _state); + enumerateerrors = testsparseunit_enumeratetest(_state); + rewriteexistingerr = testsparseunit_rewriteexistingtest(_state); + testsparseunit_testgetrow(&getrowerrors, _state); +@@ -33206,14 +33206,14 @@ ae_bool testlinlsqr(ae_bool silent, ae_s + + + termreqerrors = ae_false; +- svdtesterrors = testlinlsqrunit_svdtest(ae_true, _state); +- mwcranksvderr = testlinlsqrunit_mwcranksvdtest(ae_true, _state); +- mwicranksvderr = testlinlsqrunit_mwicranksvdtest(ae_true, _state); +- bidiagonalerr = testlinlsqrunit_bidiagonaltest(ae_true, _state); +- zeromatrixerr = testlinlsqrunit_zeromatrixtest(ae_true, _state); +- reportcorrectnesserr = testlinlsqrunit_reportcorrectnesstest(ae_true, _state); +- stoppingcriteriaerr = testlinlsqrunit_stoppingcriteriatest(ae_true, _state); +- analytictesterrors = testlinlsqrunit_analytictest(ae_true, _state); ++ svdtesterrors = testlinlsqrunit_svdtest(ae_false, _state); ++ mwcranksvderr = testlinlsqrunit_mwcranksvdtest(ae_false, _state); ++ mwicranksvderr = testlinlsqrunit_mwicranksvdtest(ae_false, _state); ++ bidiagonalerr = testlinlsqrunit_bidiagonaltest(ae_false, _state); ++ zeromatrixerr = testlinlsqrunit_zeromatrixtest(ae_false, _state); ++ reportcorrectnesserr = testlinlsqrunit_reportcorrectnesstest(ae_false, _state); ++ stoppingcriteriaerr = testlinlsqrunit_stoppingcriteriatest(ae_false, _state); ++ analytictesterrors = testlinlsqrunit_analytictest(ae_false, _state); + prectesterrors = testlinlsqrunit_preconditionertest(_state); + testlinlsqrunit_testterminationrequests(&termreqerrors, _state); + +@@ -81685,9 +81685,9 @@ ae_bool testfilters(ae_bool silent, ae_s + ae_bool result; + + +- smaerrors = testsma(ae_true, _state); +- emaerrors = testema(ae_true, _state); +- lrmaerrors = testlrma(ae_true, _state); ++ smaerrors = testsma(ae_false, _state); ++ emaerrors = testema(ae_false, _state); ++ lrmaerrors = testlrma(ae_false, _state); + + /* + * Final report +@@ -101357,7 +101357,7 @@ static ae_bool testspline3dunit_basictes + * Prepare a model and check that functions (Spline3DBuildTrilinear, + * Spline3DCalc,Spline3DCalcV) work correctly and + */ +- testspline3dunit_buildrndgrid(ae_true, ae_true, &n, &m, &l, &d, &x, &y, &z, &vf, _state); ++ testspline3dunit_buildrndgrid(ae_false, ae_true, &n, &m, &l, &d, &x, &y, &z, &vf, _state); + rvectorsetlengthatleast(&sf, n*m*l, _state); + + /* +@@ -101469,7 +101469,7 @@ static ae_bool testspline3dunit_testunpa + * NOTE: for this test we need ordered grid, i.e. grid + * with nodes in ascending order + */ +- testspline3dunit_buildrndgrid(ae_true, ae_false, &n, &m, &l, &d, &x, &y, &z, &vf, _state); ++ testspline3dunit_buildrndgrid(ae_false, ae_false, &n, &m, &l, &d, &x, &y, &z, &vf, _state); + sz = n*m*l; + rvectorsetlengthatleast(&sf, sz, _state); + spline3dbuildtrilinearv(&x, n, &y, m, &z, l, &vf, d, &c, _state); +@@ -101628,7 +101628,7 @@ static ae_bool testspline3dunit_testlint + passcount = 15; + for(pass=1; pass<=passcount; pass++) + { +- testspline3dunit_buildrndgrid(ae_true, ae_false, &n, &m, &l, &d, &x, &y, &z, &f, _state); ++ testspline3dunit_buildrndgrid(ae_false, ae_false, &n, &m, &l, &d, &x, &y, &z, &f, _state); + spline3dbuildtrilinearv(&x, n, &y, m, &z, l, &f, d, &c, _state); + for(xjob=0; xjob<=1; xjob++) + { +@@ -108404,8 +108404,8 @@ ae_bool testspline2d(ae_bool silent, ae_ + /* + * Test for vector-function + */ +- vferrors = testspline2dunit_testspline2dvf(ae_true, _state); +- ++ vferrors = testspline2dunit_testspline2dvf(ae_false, _state); ++ + /* + * Report + */ +@@ -111166,7 +111166,7 @@ ae_bool testrbf(ae_bool silent, ae_state + basicrbferrors = testrbfunit_basicrbftest(_state); + irregularrbferrors = testrbfunit_irregularrbftest(_state); + linearitymodelrbferr = testrbfunit_linearitymodelrbftest(_state); +- sqrdegmatrixrbferr = sqrdegmatrixrbftest(ae_true, _state); ++ sqrdegmatrixrbferr = sqrdegmatrixrbftest(ae_false, _state); + multilayerrbf1derrors = ae_false; + multilayerrbferrors = testrbfunit_basicmultilayerrbftest(_state); + sererrors = testrbfunit_serializationtest(_state); +@@ -120336,14 +120336,14 @@ ae_bool testlincg(ae_bool silent, ae_sta + ae_bool result; + + +- basictestxerrors = testlincgunit_basictestx(ae_true, _state); +- basictestiterserr = testlincgunit_basictestiters(ae_true, _state); +- complexreserrors = testlincgunit_complexres(ae_true, _state); +- complexerrors = testlincgunit_complextest(ae_true, _state); +- rcorrectness = testlincgunit_testrcorrectness(ae_true, _state); +- krylovsubspaceerr = testlincgunit_krylovsubspacetest(ae_true, _state); +- sparseerrors = testlincgunit_sparsetest(ae_true, _state); +- preconderrors = testlincgunit_precondtest(ae_true, _state); ++ basictestxerrors = testlincgunit_basictestx(ae_false, _state); ++ basictestiterserr = testlincgunit_basictestiters(ae_false, _state); ++ complexreserrors = testlincgunit_complexres(ae_false, _state); ++ complexerrors = testlincgunit_complextest(ae_false, _state); ++ rcorrectness = testlincgunit_testrcorrectness(ae_false, _state); ++ krylovsubspaceerr = testlincgunit_krylovsubspacetest(ae_false, _state); ++ sparseerrors = testlincgunit_sparsetest(ae_false, _state); ++ preconderrors = testlincgunit_precondtest(ae_false, _state); + + /* + * report diff --git a/sources b/sources index 0594e7e..a644dd3 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (alglib-4.07.0.cpp.gpl.tgz) = abc0a5aecec019eb4fcb5b3a5a95e88ed1154a52f7348f944dee4ebc8079cddfc00de30b45c6a846a201d4064e55dbcad2afe09df5e74d51120f83277704d733 +SHA512 (alglib-3.15.0.cpp.gpl.tgz) = b71160aec478eb6abee370f407ad3eeb80d2d441269e3d969f7f8430e7c9e9956456aeec4b12ef720508dc748987fd45b535a1795e260474c46a1c75af45bfb4