Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scikits-odes: init at 2.4.0 #64195

Merged
merged 7 commits into from Sep 8, 2019
Merged

scikits-odes: init at 2.4.0 #64195

merged 7 commits into from Sep 8, 2019

Conversation

flokli
Copy link
Contributor

@flokli flokli commented Jul 2, 2019

Motivation for this change

This adds scikits.odes, a scikit offering extra ode/dae solvers, as an extension to what is available in scipy.

It's not yet compatible with sundials 4.x, so we add sundials_3, too.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

cc @idontgetoutmuch

@flokli flokli requested a review from FRidh July 2, 2019 21:48
@flokli
Copy link
Contributor Author

flokli commented Jul 2, 2019

@GrahamcOfBorg build python3.pkgs.scikits-odes

Copy link
Contributor

@idontgetoutmuch idontgetoutmuch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works for me on macOS 10.13.6 (17G65).

@flokli
Copy link
Contributor Author

flokli commented Jul 3, 2019

One test breaks on aarch64:

running install tests
============================= test session starts ==============================
platform linux -- Python 3.7.3, pytest-4.6.3, py-1.7.0, pluggy-0.12.0
rootdir: /nix/store/4vkp4sslmcw3a7zia81yd8y6kdpbjkl2-python3.7-scikits.odes-2.4.0/lib/python3.7/site-packages/scikits/odes/tests
collected 81 items

test_dae.py ...F                                                         [  4%]
test_dop.py .                                                            [  6%]
test_get_info.py .....                                                   [ 12%]
test_odeint.py .....                                                     [ 18%]
test_on_funcs.py ............                                            [ 33%]
test_on_funcs_ida.py ............                                        [ 48%]
test_user_return_vals_cvode.py ........................                  [ 77%]
test_user_return_vals_ida.py ..................                          [100%]

=================================== FAILURES ===================================
______________________________ TestDae.test_lsodi ______________________________

self = <odes.tests.test_dae.TestDae testMethod=test_lsodi>

    def test_lsodi(self):
        """Check the lsodi solver"""
        for problem_cls in PROBLEMS_LSODI:
            problem = problem_cls()
>           self._do_problem(problem, 'lsodi', **problem.lsodi_pars)

test_dae.py:59:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test_dae.py:34: in _do_problem
    soln = ig.step(time, z[i], zprime[i])
../dae.py:439: in step
    return self._integrator.step(t, y_retn, yp_retn)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <scikits.odes.lsodiint.lsodi object at 0xffff7af8d3c8>, t = 400.0
y_retn = array([4.70187465e-01, 3.48124556e-06, 5.29809054e-01])
yp_retn = array([4.50537891e-01, 3.22315111e-06, 5.49458886e-01])

    def step(self, t, y_retn, yp_retn = None):
        """ See dae.DaeBase
        """
        if not self.initialized:
            raise ValueError('Method ''init_step'' has to be called prior to the'
                    'first call of ''step'' method, or after changing options')
        if t > 0.0:
            if self.tstop is None:
                itask = 1
                self.call_args[3] = 1
            else:
                itask = self.call_args[3]
                self.call_args[3] = 4
            self.y, self.yp, self.t = self.__run(self.y, self.yp, self.t, t)
            self.call_args[3] = itask
        else:
            itask = self.call_args[3]
            if self.tstop is None:
                self.call_args[3] = 2
            else:
                self.call_args[3] = 5
            self.y, self.yp, self.t  = self.__run(self.y, self.yp, self.t, -t)
            self.call_args[3] = itask
        y_retn[:] = self.y[:]
        if yp_retn is not None:
>           yp_retn[:] = self.yp[:]
E           TypeError: 'NoneType' object is not subscriptable

../lsodiint.py:376: TypeError
----------------------------- Captured stdout call -----------------------------
lsodi: excess work done on this call (check all inputs).
lsodi: present residual is [-1.17961196e-15  5.42101086e-20 -6.17733149e-12]
=============================== warnings summary ===============================
test_dae.py::TestDae::test_ida_old_api
test_dae.py::TestDae::test_ida_old_api
test_dae.py::TestDae::test_ida_old_api
  /nix/store/4vkp4sslmcw3a7zia81yd8y6kdpbjkl2-python3.7-scikits.odes-2.4.0/lib/python3.7/site-packages/scikits/odes/dae.py:389: DeprecationWarning: Old api is deprecated, move to new api
    return self._integrator.init_step(t0, y0, yp0, y_ic0_retn, yp_ic0_retn)

-- Docs: https://docs.pytest.org/en/latest/warnings.html
=============== 1 failed, 80 passed, 3 warnings in 1.89 seconds ================
builder for '/nix/store/gagbwvvk5hwfmn4cj667azympm6x5lz5-python3.7-scikits.odes-2.4.0.drv' failed with exit code 1
error: build of '/nix/store/gagbwvvk5hwfmn4cj667azympm6x5lz5-python3.7-scikits.odes-2.4.0.drv' failed

Any idea what could be the reason for that?

@idontgetoutmuch
Copy link
Contributor

I have never used the differential algebraic part of SUNDIALS. I think the only thing one can do is report it to the maintainers of scikits-odes. One of the problems I've had in the past is that if a matrix is selected at random and is close to being singular then tests will fail. Maybe it's something like that?

@flokli
Copy link
Contributor Author

flokli commented Jul 3, 2019 via email

@FRidh
Copy link
Member

FRidh commented Jul 17, 2019

Please move the numpy patch out. It causes this to be a mass-rebuild.

@flokli
Copy link
Contributor Author

flokli commented Jul 18, 2019

Please move the numpy patch out. It causes this to be a mass-rebuild.

I'd still like to eventually see this change land in master. What about dropping it from here, and file that change against staging?

@FRidh
Copy link
Member

FRidh commented Jul 19, 2019

yes, open a separate PR for it

@flokli flokli force-pushed the scikits-odes branch 2 times, most recently from 87b3c53 to 2a37885 Compare July 20, 2019 12:03
@flokli
Copy link
Contributor Author

flokli commented Jul 20, 2019

took the numpy patch out and rebased on latest master.

@flokli
Copy link
Contributor Author

flokli commented Jul 20, 2019

@GrahamcOfBorg build python3.pkgs.scikits-odes

@steinitznavican
Copy link

steinitznavican commented Jul 30, 2019

This works

cmake -DLAPACK_ENABLE=ON \
-DLAPACK_LIBRARIES="/usr/local/opt/openblas/lib/libblas.dylib;/usr/local/opt/openblas/lib/liblapack.dylib" \
-DSUNDIALS_INDEX_TYPE=int32_t \
-DCMAKE_INSTALL_PREFIX=/Users/dominic.steinitz/MySundials/instdir \
-DEXAMPLES_INSTALL_PATH=/Users/dominic.steinitz/MySundials/instdir/examples \
-DEXAMPLES_INSTALL=ON \
-DEXAMPLES_ENABLE_C=ON \
/Users/dominic.steinitz/sundials-3.1.1
-- The Fortran compiler identification is GNU 9.1.0
-- Searching for a Fortran compiler... /usr/local/bin/gfortran
-- Checking whether Fortran compiler has -isysroot
-- Checking whether Fortran compiler has -isysroot - yes
-- Checking whether Fortran compiler supports OSX deployment target flag
-- Checking whether Fortran compiler supports OSX deployment target flag - yes
-- Trying to compile and link a simple Fortran program... OK
-- Determining Fortran name-mangling scheme... OK
-- Looking for LAPACK libraries... OK
-- Checking if LAPACK works... OK
-- Added NVECTOR_SERIAL module
-- Added SUNMATRIX_DENSE module
-- Added SUNMATRIX_BAND module
-- Added SUNMATRIX_SPARSE module
-- Added SUNLINSOL_BAND module
-- Added SUNLINSOL_DENSE module
-- Added SUNLINSOL_LAPACKBAND module
-- Added SUNLINSOL_LAPACKDENSE module
-- Added SUNLINSOL_SPGMR module
-- Added SUNLINSOL_SPFGMR module
-- Added SUNLINSOL_SPBCGS module
-- Added SUNLINSOL_SPTFQMR module
-- Added SUNLINSOL_PCG module
-- Added ARKODE module
-- Added CVODE module
-- Added CVODES module
-- Added IDA module
-- Added IDAS module
-- Added KINSOL module
-- Configuring done
CMake Warning (dev):
  Policy CMP0042 is not set: MACOSX_RPATH is enabled by default.  Run "cmake
  --help-policy CMP0042" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  MACOSX_RPATH is not specified for the following targets:

   sundials_arkode_shared
   sundials_cvode_shared
   sundials_cvodes_shared
   sundials_ida_shared
   sundials_idas_shared
   sundials_kinsol_shared
   sundials_nvecserial_shared
   sundials_sunlinsolband_shared
   sundials_sunlinsoldense_shared
   sundials_sunlinsollapackband_shared
   sundials_sunlinsollapackdense_shared
   sundials_sunlinsolpcg_shared
   sundials_sunlinsolspbcgs_shared
   sundials_sunlinsolspfgmr_shared
   sundials_sunlinsolspgmr_shared
   sundials_sunlinsolsptfqmr_shared
   sundials_sunmatrixband_shared
   sundials_sunmatrixdense_shared
   sundials_sunmatrixsparse_shared

This warning is for project developers.  Use -Wno-dev to suppress it.

-- Generating done
-- Build files have been written to: /Users/dominic.steinitz/mySundials-3.1.1
bash-3.2$ make test
make test
Running tests...
Test project /Users/dominic.steinitz/mySundials-3.1.1
      Start  1: ark_analytic
 1/49 Test  #1: ark_analytic ......................................   Passed    0.11 sec
      Start  2: ark_robertson
 2/49 Test  #2: ark_robertson .....................................   Passed    0.07 sec
      Start  3: cvRoberts_dns
 3/49 Test  #3: cvRoberts_dns .....................................   Passed    0.06 sec
      Start  4: cvsRoberts_dns
 4/49 Test  #4: cvsRoberts_dns ....................................   Passed    0.06 sec
      Start  5: idaRoberts_dns
 5/49 Test  #5: idaRoberts_dns ....................................   Passed    0.06 sec
      Start  6: idasRoberts_dns
 6/49 Test  #6: idasRoberts_dns ...................................   Passed    0.06 sec
      Start  7: kinRoberts_fp
 7/49 Test  #7: kinRoberts_fp .....................................   Passed    0.07 sec
      Start  8: test_nvector_serial_1000_0
 8/49 Test  #8: test_nvector_serial_1000_0 ........................   Passed    0.06 sec
      Start  9: test_nvector_serial_10000_0
 9/49 Test  #9: test_nvector_serial_10000_0 .......................   Passed    0.07 sec
      Start 10: test_sunmatrix_dense_100_100_0
10/49 Test #10: test_sunmatrix_dense_100_100_0 ....................   Passed    0.06 sec
      Start 11: test_sunmatrix_dense_200_1000_0
11/49 Test #11: test_sunmatrix_dense_200_1000_0 ...................   Passed    0.07 sec
      Start 12: test_sunmatrix_dense_2000_100_0
12/49 Test #12: test_sunmatrix_dense_2000_100_0 ...................   Passed    0.07 sec
      Start 13: test_sunmatrix_band_10_2_3_0
13/49 Test #13: test_sunmatrix_band_10_2_3_0 ......................   Passed    0.06 sec
      Start 14: test_sunmatrix_band_300_7_4_0
14/49 Test #14: test_sunmatrix_band_300_7_4_0 .....................   Passed    0.06 sec
      Start 15: test_sunmatrix_band_1000_8_8_0
15/49 Test #15: test_sunmatrix_band_1000_8_8_0 ....................   Passed    0.06 sec
      Start 16: test_sunmatrix_band_5000_3_20_0
16/49 Test #16: test_sunmatrix_band_5000_3_20_0 ...................   Passed    0.08 sec
      Start 17: test_sunmatrix_sparse_400_400_0_0
17/49 Test #17: test_sunmatrix_sparse_400_400_0_0 .................   Passed    0.06 sec
      Start 18: test_sunmatrix_sparse_450_450_1_0
18/49 Test #18: test_sunmatrix_sparse_450_450_1_0 .................   Passed    0.07 sec
      Start 19: test_sunmatrix_sparse_200_1000_0_0
19/49 Test #19: test_sunmatrix_sparse_200_1000_0_0 ................   Passed    0.06 sec
      Start 20: test_sunmatrix_sparse_6000_350_0_0
20/49 Test #20: test_sunmatrix_sparse_6000_350_0_0 ................   Passed    0.10 sec
      Start 21: test_sunmatrix_sparse_500_5000_1_0
21/49 Test #21: test_sunmatrix_sparse_500_5000_1_0 ................   Passed    0.13 sec
      Start 22: test_sunmatrix_sparse_4000_800_1_0
22/49 Test #22: test_sunmatrix_sparse_4000_800_1_0 ................   Passed    0.14 sec
      Start 23: test_sunlinsol_band_10_2_3_0
23/49 Test #23: test_sunlinsol_band_10_2_3_0 ......................   Passed    0.06 sec
      Start 24: test_sunlinsol_band_300_7_4_0
24/49 Test #24: test_sunlinsol_band_300_7_4_0 .....................   Passed    0.06 sec
      Start 25: test_sunlinsol_band_1000_8_8_0
25/49 Test #25: test_sunlinsol_band_1000_8_8_0 ....................   Passed    0.06 sec
      Start 26: test_sunlinsol_band_5000_3_100_0
26/49 Test #26: test_sunlinsol_band_5000_3_100_0 ..................   Passed    0.09 sec
      Start 27: test_sunlinsol_dense_10_0
27/49 Test #27: test_sunlinsol_dense_10_0 .........................   Passed    0.06 sec
      Start 28: test_sunlinsol_dense_100_0
28/49 Test #28: test_sunlinsol_dense_100_0 ........................   Passed    0.06 sec
      Start 29: test_sunlinsol_dense_500_0
29/49 Test #29: test_sunlinsol_dense_500_0 ........................   Passed    0.15 sec
      Start 30: test_sunlinsol_dense_1000_0
30/49 Test #30: test_sunlinsol_dense_1000_0 .......................   Passed    0.69 sec
      Start 31: test_sunlinsol_lapackband_10_2_3_0
31/49 Test #31: test_sunlinsol_lapackband_10_2_3_0 ................   Passed    0.07 sec
      Start 32: test_sunlinsol_lapackband_300_7_4_0
32/49 Test #32: test_sunlinsol_lapackband_300_7_4_0 ...............   Passed    0.06 sec
      Start 33: test_sunlinsol_lapackband_1000_8_8_0
33/49 Test #33: test_sunlinsol_lapackband_1000_8_8_0 ..............   Passed    0.06 sec
      Start 34: test_sunlinsol_lapackband_5000_3_100_0
34/49 Test #34: test_sunlinsol_lapackband_5000_3_100_0 ............   Passed    0.08 sec
      Start 35: test_sunlinsol_lapackdense_10_0
35/49 Test #35: test_sunlinsol_lapackdense_10_0 ...................   Passed    0.06 sec
      Start 36: test_sunlinsol_lapackdense_100_0
36/49 Test #36: test_sunlinsol_lapackdense_100_0 ..................   Passed    0.06 sec
      Start 37: test_sunlinsol_lapackdense_500_0
37/49 Test #37: test_sunlinsol_lapackdense_500_0 ..................   Passed    0.08 sec
      Start 38: test_sunlinsol_lapackdense_1000_0
38/49 Test #38: test_sunlinsol_lapackdense_1000_0 .................   Passed    0.13 sec
      Start 39: test_sunlinsol_spgmr_serial_100_1_1_100_1e-13_0
39/49 Test #39: test_sunlinsol_spgmr_serial_100_1_1_100_1e-13_0 ...   Passed    0.06 sec
      Start 40: test_sunlinsol_spgmr_serial_100_2_1_100_1e-13_0
40/49 Test #40: test_sunlinsol_spgmr_serial_100_2_1_100_1e-13_0 ...   Passed    0.06 sec
      Start 41: test_sunlinsol_spgmr_serial_100_1_2_100_1e-13_0
41/49 Test #41: test_sunlinsol_spgmr_serial_100_1_2_100_1e-13_0 ...   Passed    0.06 sec
      Start 42: test_sunlinsol_spgmr_serial_100_2_2_100_1e-13_0
42/49 Test #42: test_sunlinsol_spgmr_serial_100_2_2_100_1e-13_0 ...   Passed    0.06 sec
      Start 43: test_sunlinsol_spfgmr_serial_100_1_100_1e-13_0
43/49 Test #43: test_sunlinsol_spfgmr_serial_100_1_100_1e-13_0 ....   Passed    0.06 sec
      Start 44: test_sunlinsol_spfgmr_serial_100_2_100_1e-13_0
44/49 Test #44: test_sunlinsol_spfgmr_serial_100_2_100_1e-13_0 ....   Passed    0.06 sec
      Start 45: test_sunlinsol_spbcgs_serial_100_1_100_1e-13_0
45/49 Test #45: test_sunlinsol_spbcgs_serial_100_1_100_1e-13_0 ....   Passed    0.06 sec
      Start 46: test_sunlinsol_spbcgs_serial_100_2_100_1e-13_0
46/49 Test #46: test_sunlinsol_spbcgs_serial_100_2_100_1e-13_0 ....   Passed    0.06 sec
      Start 47: test_sunlinsol_sptfqmr_serial_100_1_100_1e-13_0
47/49 Test #47: test_sunlinsol_sptfqmr_serial_100_1_100_1e-13_0 ...   Passed    0.06 sec
      Start 48: test_sunlinsol_sptfqmr_serial_100_2_100_1e-13_0
48/49 Test #48: test_sunlinsol_sptfqmr_serial_100_2_100_1e-13_0 ...   Passed    0.06 sec
      Start 49: test_sunlinsol_pcg_serial_100_200_1e-13_0
49/49 Test #49: test_sunlinsol_pcg_serial_100_200_1e-13_0 .........   Passed    0.06 sec

100% tests passed, 0 tests failed out of 49

Total Test time (real) =   4.20 sec

@steinitznavican
Copy link

steinitznavican commented Jul 30, 2019

The nix derivation uses cmake to generate

-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON \
-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON \
-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_SKIP_BUILD_RPATH=ON \
-DCMAKE_INSTALL_INCLUDEDIR=/nix/store/hq8bh2mwhm10vwr9w38n2hy3zrw1q2zz-sundials-3.2.1/include \
-DCMAKE_INSTALL_LIBDIR=/nix/store/hq8bh2mwhm10vwr9w38n2hy3zrw1q2zz-sundials-3.2.1/lib \
-DCMAKE_INSTALL_NAME_DIR=/nix/store/hq8bh2mwhm10vwr9w38n2hy3zrw1q2zz-sundials-3.2.1/lib \
-DCMAKE_POLICY_DEFAULT_CMP0025=NEW \
-DCMAKE_OSX_DEPLOYMENT_TARGET= \
-DCMAKE_OSX_SYSROOT= \
-DCMAKE_FIND_FRAMEWORK=last \
-DCMAKE_STRIP=/nix/store/p20s2ajhyhq6lbjsdyywsnvz3xf41jz8-cctools-binutils-darwin/bin/strip \
-DCMAKE_RANLIB=/nix/store/p20s2ajhyhq6lbjsdyywsnvz3xf41jz8-cctools-binutils-darwin/bin/ranlib \
-DCMAKE_AR=/nix/store/p20s2ajhyhq6lbjsdyywsnvz3xf41jz8-cctools-binutils-darwin/bin/ar \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_INSTALL_PREFIX=/nix/store/hq8bh2mwhm10vwr9w38n2hy3zrw1q2zz-sundials-3.2.1 \
-DEXAMPLES_INSTALL_PATH=/nix/store/hq8bh2mwhm10vwr9w38n2hy3zrw1q2zz-sundials-3.2.1/share/examples \
-DEXAMPLES_INSTALL=ON \
-DEXAMPLES_ENABLE_C=ON \
-DSUNDIALS_INDEX_TYPE=int32_t \
-DLAPACK_ENABLE=ON \
-DLAPACK_LIBRARIES=/nix/store/qcjzcrxwynyd7xyay58r3kl6qxq6qpxw-openblas-0.3.6/lib/libblas.dylib;/nix/store/qcjzcrxwynyd7xyay58r3kl6qxq6qpxw-openblas-0.3.6/lib/liblapack.dylib

@flokli if I run cmake outside of nix, I get a populated directory. How do I retain the equivalent directory in nix?

@steinitznavican
Copy link

I have this

  postInstall = ''
                  mkdir $out/easytofind
                  echo $(ls) > $out/easytofind/foo.txt
                  cp -r LapackTest $out/easytofind/LapackTest
                  cd $out/easytofind/LapackTest
                  make
                  ./ltest > $out/easytofind/ltest.out
                '';

but sadly don't get what I wanted

/nix/store/sy5iwww8nc4a7mdb3ls44q96i0kxy2dx-cmake-3.14.5/bin/cmake -S/private/var/folders/1g/xdjj8dy15k932b80r197qcnr0000gp/T/nix-build-sundials-3.2.1.drv-0/sundials-3.2.1/build/LapackTest -B/private/var/folders/1g/xdjj8dy15k932b80r197qcnr0000gp/T/nix-build-sundials-3.2.1.drv-0/sundials-3.2.1/build/LapackTest --check-build-system CMakeFiles/Makefile.cmake 0
-- The C compiler identification is Clang 7.1.0
-- Check for working C compiler: /nix/store/b8i7jqbkq80h6v03pnnkpihiq72iplwq-clang-wrapper-7.1.0/bin/clang
-- Check for working C compiler: /nix/store/b8i7jqbkq80h6v03pnnkpihiq72iplwq-clang-wrapper-7.1.0/bin/clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /private/var/folders/1g/xdjj8dy15k932b80r197qcnr0000gp/T/nix-build-sundials-3.2.1.drv-0/sundials-3.2.1/build/LapackTest
/nix/store/sy5iwww8nc4a7mdb3ls44q96i0kxy2dx-cmake-3.14.5/bin/cmake -E cmake_progress_start /private/var/folders/1g/xdjj8dy15k932b80r197qcnr0000gp/T/nix-build-sundials-3.2.1.drv-0/sundials-3.2.1/build/LapackTest/CMakeFiles /private/var/folders/1g/xdjj8dy15k932b80r197qcnr0000gp/T/nix-build-sundials-3.2.1.drv-0/sundials-3.2.1/build/LapackTest/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/nix/store/s41pkl0pjqxfq2hxfcmfc03205njp4sc-sundials-3.2.1/easytofind/LapackTest'
make[1]: CMakeFiles/Makefile2: No such file or directory
make[1]: *** No rule to make target 'CMakeFiles/Makefile2'.  Stop.
make[1]: Leaving directory '/nix/store/s41pkl0pjqxfq2hxfcmfc03205njp4sc-sundials-3.2.1/easytofind/LapackTest'
make: *** [Makefile:87: all] Error 2

@steinitznavican
Copy link

This is a bit better but still fails.

  postInstall = ''
                  mkdir $out/easytofind
                  echo $(ls) > $out/easytofind/foo.txt
                  cp -r . $out/easytofind
                  cd $out/easytofind/LapackTest
                  make
                  ./ltest > $out/easytofind/ltest.out
                '';
/nix/store/sy5iwww8nc4a7mdb3ls44q96i0kxy2dx-cmake-3.14.5/bin/cmake -S/private/var/folders/1g/xdjj8dy15k932b80r197qcnr0000gp/T/nix-build-sundials-3.2.1.drv-0/sundials-3.2.1/build/LapackTest -B/private/var/folders/1g/xdjj8dy15k932b80r197qcnr0000gp/T/nix-build-sundials-3.2.1.drv-0/sundials-3.2.1/build/LapackTest --check-build-system CMakeFiles/Makefile.cmake 0
-- The C compiler identification is Clang 7.1.0
-- Check for working C compiler: /nix/store/b8i7jqbkq80h6v03pnnkpihiq72iplwq-clang-wrapper-7.1.0/bin/clang
-- Check for working C compiler: /nix/store/b8i7jqbkq80h6v03pnnkpihiq72iplwq-clang-wrapper-7.1.0/bin/clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /private/var/folders/1g/xdjj8dy15k932b80r197qcnr0000gp/T/nix-build-sundials-3.2.1.drv-0/sundials-3.2.1/build/LapackTest
/nix/store/sy5iwww8nc4a7mdb3ls44q96i0kxy2dx-cmake-3.14.5/bin/cmake -E cmake_progress_start /private/var/folders/1g/xdjj8dy15k932b80r197qcnr0000gp/T/nix-build-sundials-3.2.1.drv-0/sundials-3.2.1/build/LapackTest/CMakeFiles /private/var/folders/1g/xdjj8dy15k932b80r197qcnr0000gp/T/nix-build-sundials-3.2.1.drv-0/sundials-3.2.1/build/LapackTest/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/nix/store/84h3i703qzjkf876pxvc7ny9vqcqj28i-sundials-3.2.1/easytofind/LapackTest'
make[1]: CMakeFiles/Makefile2: No such file or directory
make[1]: *** No rule to make target 'CMakeFiles/Makefile2'.  Stop.
make[1]: Leaving directory '/nix/store/84h3i703qzjkf876pxvc7ny9vqcqj28i-sundials-3.2.1/easytofind/LapackTest'
make: *** [Makefile:87: all] Error 2

@flokli
Copy link
Contributor Author

flokli commented Aug 1, 2019

CMake can be convinced to use a working RUNPATH during testPhase, by following https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling#always-full-rpath. I opened LLNL/sundials#19 upstream.

@flokli
Copy link
Contributor Author

flokli commented Aug 1, 2019

liblapack needed to be built with shared library support (BUILD_SHARED_LIBS=ON), after that, sundials was able to use everything just fine from only liblapack, without openblas involved. I guess the previous segfaults were mostly due to us using incompatible libraries there.

@flokli
Copy link
Contributor Author

flokli commented Aug 1, 2019

@GrahamcOfBorg build python3.pkgs.scikits-odes

@flokli flokli force-pushed the scikits-odes branch 3 times, most recently from 0e679d8 to 65f600c Compare August 2, 2019 12:49
@flokli
Copy link
Contributor Author

flokli commented Aug 2, 2019

@GrahamcOfBorg build python2.pkgs.scikits-odes python3.pkgs.scikits-odes

@idontgetoutmuch
Copy link
Contributor

Any reason this can't be merged?

@flokli
Copy link
Contributor Author

flokli commented Aug 8, 2019

Hm. It would have been nice if we heard back from LLNL/sundials about the patches we sent upstream, but their repo seems to be only code dumps of release snapshots so far, so I don't really see if and how patches are merged in 😢

I did not yet include the patch from LLNL/sundials#21 to remove test flakiness into this PR. It doesn't apply cleanly on sundials_3 (which we need for scikits-odes until bmcage/odes#98 is solved).

I really hope LLNL/sundials is moving development to github soon as indicated on LLNL/sundials#8 (comment) - a sundials 3 branch containing a rebased patch would be really cool - nixpkgs policy is to not include patches into nixpkgs directly, but fetch them if possible…

flokli and others added 7 commits September 8, 2019 15:15
That's needed for scikits.odes.
Upstream bug to migrate to sundials 4:
bmcage/odes#98
This test fails on MacOS otherwise, due to slightly different math.

Only add for sundials 4, it's not in sundials_3 yet.
The provided patch doesn't apply cleanly on sundials_3 (no
SundialsTesting.cmake, SundialsAddTest.cmake containing trailing
whitespaces inside context), so for now we just disable tests for
sundials_3 - scikits-odes plans to move to sundials 4 anyways - see
bmcage/odes#106.
@flokli
Copy link
Contributor Author

flokli commented Sep 8, 2019

I included the non-flakyness patches for sundials 4, and disabled tests for sundials_3, as the patches don't apply cleanly there.

I also bumped scikits-odes to 2.4.0-9-g93075ae, containing the aarch64 and macos patches from bmcage/odes#104 and bmcage/odes#105.

@flokli
Copy link
Contributor Author

flokli commented Sep 8, 2019

@GrahamcOfBorg build python.pkgs.scikits-odes python3.pkgs.scikits-odes sundials

@flokli flokli merged commit a77fba2 into NixOS:master Sep 8, 2019
@flokli flokli deleted the scikits-odes branch September 8, 2019 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants