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

cminpack: DIsable blas #183713

Closed
wants to merge 1 commit into from
Closed

cminpack: DIsable blas #183713

wants to merge 1 commit into from

Conversation

jschueller
Copy link
Contributor

@jschueller jschueller commented Sep 6, 2024

Else it crashes, see why it has been disabled by default: devernay/cminpack#66 (comment)

I dont have a mac to actually test this but I had the same issue on linux

/cc @chenrui333

  • Have you followed the guidelines for contributing?
  • Have you ensured that your commits follow the commit style guide?
  • Have you checked that there aren't other open pull requests for the same formula update/change?
  • Have you built your formula locally with HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>, where <formula> is the name of the formula you're submitting?
  • Is your test running fine brew test <formula>, where <formula> is the name of the formula you're submitting?
  • Does your build pass brew audit --strict <formula> (after doing HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>)? If this is a new formula, does it pass brew audit --new <formula>?

Else it crashes, see why it has been disabled by default:
devernay/cminpack#66 (comment)

/cc @chenrui333
@carlocab
Copy link
Member

carlocab commented Sep 6, 2024

Else it crashes, see why it has been disabled by default: devernay/cminpack#66 (comment)

How do we reproduce the crash? Also, I don't see any mention of crashes due to BLAS in devernay/cminpack#66.

@chenrui333
Copy link
Member

Else it crashes, see why it has been disabled by default: devernay/cminpack#66 (comment)

How do we reproduce the crash? Also, I don't see any mention of crashes due to BLAS in devernay/cminpack#66.

@jschueller has a comment about the issue

I got this error with your branch:

/cminpack/enorm_.c:59:11: error: unknown type name ‘__cminpack_blasint__’
   59 |     const __cminpack_blasint__ c__1 = 1;

this should probably be tested in the CI

@carlocab
Copy link
Member

carlocab commented Sep 6, 2024

@jschueller has a comment about the issue

I got this error with your branch:

/cminpack/enorm_.c:59:11: error: unknown type name ‘__cminpack_blasint__’
   59 |     const __cminpack_blasint__ c__1 = 1;

This seems like a build failure and not a crash from using cminpack with BLAS.

@jschueller
Copy link
Contributor Author

jschueller commented Sep 6, 2024

to reproduce the issue just run the full testsuite with DUSE_BLAS=ON you will see that a bunch do fail:

58% tests passed, 10 tests failed out of 24

Total Test time (real) =   0.93 sec

The following tests FAILED:
          4 - thybrdc (Failed)
          6 - thybrd1c (Failed)
          8 - thybrjc (Failed)
         10 - thybrj1c (Failed)
         12 - tlmderc (Failed)
         14 - tlmder1c (Failed)
         16 - tlmdifc (Failed)
         18 - tlmdif1c (Failed)
         20 - tlmstrc (Failed)
         22 - tlmstr1c (Failed)

all is ok with DUSE_BLAS=OFF (that is why it is the default since 1.3.9)

maybe it could be used instead of embedding a test into the recipe, its very quick to build and run

the compilation error you mentioned happened only during the development and should be disregarded

@carlocab
Copy link
Member

carlocab commented Sep 6, 2024

Test failures seem different from a crash. How do you run the test suite? How long does it take to run?

@jschueller
Copy link
Contributor Author

jschueller commented Sep 6, 2024

they are all segfaults, if I run one manually:

$ ./examples/tlmderc 
Segmentation fault (core dumped)

see gdb trace leading to the crash in blas because of incorrect address passed:

0x00007ffff7dddcb0 in dnrm2_ () from /usr/lib/libblas.so.3
(gdb) bt
#0  0x00007ffff7dddcb0 in dnrm2_ () from /usr/lib/libblas.so.3
#1  0x00007ffff7faece3 in lmder (fcnder_mn=fcnder_mn@entry=0x555555555610 <fcn>, p=p@entry=0x7fffffffdd20, m=m@entry=15, n=n@entry=3, x=x@entry=0x7fffffffdd40, fvec=fvec@entry=0x7fffffffde00, fjac=0x7fffffffdf80, ldfjac=15, 
    ftol=ftol@entry=1.4901161193847656e-08, xtol=1.4901161193847656e-08, gtol=gtol@entry=0, maxfev=400, diag=0x7fffffffdd60, mode=1, factor=factor@entry=100, nprint=0, nfev=0x7fffffffdd18, njev=0x7fffffffdd1c, ipvt=0x7fffffffdd34, 
    qtf=0x7fffffffdd80, wa1=0x7fffffffdda0, wa2=0x7fffffffddc0, wa3=0x7fffffffdde0, wa4=0x7fffffffde80) at /home/schueller/projects/cminpack/lmder.c:245
#2  0x0000555555555283 in main () at /home/schueller/projects/cminpack/examples/tlmderc.c:82

@carlocab
Copy link
Member

carlocab commented Sep 6, 2024

I tried running the test suite, twice, once with USE_BLAS=ON and again with USE_BLAS=OFF, and all the tests fail (in both cases):

Total Test time (real) =  12.25 sec

The following tests FAILED:
          1 - tchkder_ (Failed)
          2 - tchkderc (Failed)
          3 - thybrd_ (Failed)
          4 - thybrdc (Failed)
          5 - thybrd1_ (Failed)
          6 - thybrd1c (Failed)
          7 - thybrj_ (Failed)
          8 - thybrjc (Failed)
          9 - thybrj1_ (Failed)
         10 - thybrj1c (Failed)
         11 - tlmder_ (Failed)
         12 - tlmderc (Failed)
         13 - tlmder1_ (Failed)
         14 - tlmder1c (Failed)
         15 - tlmdif_ (Failed)
         16 - tlmdifc (Failed)
         17 - tlmdif1_ (Failed)
         18 - tlmdif1c (Failed)
         19 - tlmstr_ (Failed)
         20 - tlmstrc (Failed)
         21 - tlmstr1_ (Failed)
         22 - tlmstr1c (Failed)
         23 - tfdjac2_ (Failed)
         24 - tfdjac2c (Failed)
Errors while running CTest

Are we sure that the tests aren't just broken?

@jschueller
Copy link
Contributor Author

jschueller commented Sep 6, 2024

yes sure, as the gdb stacktrace above

@jschueller
Copy link
Contributor Author

jschueller commented Sep 7, 2024

if you use ctest -V --output-on-failure you should see something like that:

14:   Test /home/schueller/projects/cminpack/build/examples/tlmder1c returned
14:   Segmentation fault
14: 
14: 
14/24 Test #14: tlmder1c .........................***Failed    0.13 sec

you can also try to run this manually

@cho-m
Copy link
Member

cho-m commented Sep 9, 2024

It will be difficult to run ctest in formula given we build shared libraries without build RPATHs so they won't run without either adding RPATHs or using (DY)LD_LIBRARY_PATH hacks. Anyway, ctest currently doesn't fully pass on ARM based on local attempt.


On topic of BLAS, I assume support will need devernay/cminpack@f63e16d. Is it worth trying to get a new release or backporting fixes?

@jschueller
Copy link
Contributor Author

jschueller commented Sep 9, 2024

Rather change the recipe internal test to reflect one of the 10 examples that segfaults like tlmderc:
https://github.com/devernay/cminpack/blob/master/examples/tlmderc.c

@jschueller jschueller closed this Sep 11, 2024
@jschueller jschueller deleted the patch-1 branch September 11, 2024 15:48
@jschueller
Copy link
Contributor Author

jschueller commented Sep 11, 2024

hello,
could you try to update the formula to 1.3.10 ?
https://github.com/devernay/cminpack/releases/tag/v1.3.10
it should solve the blas issue
cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants