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

Erroneous "Stack size likely to be exceeded" make error when 'ulimit -s' returns "unlimited" #98

Closed
fgvanzee opened this issue Aug 22, 2019 · 2 comments

Comments

@fgvanzee
Copy link

After making three variable modifications to Makefile.rule:

BLAS_API = 1
FORTRAN_BLAS_API = 1
CBLAS_API = 1

of commit 78c3120, I run make and then receive the following error:

$ make
Parsing Makefile.rule
Makefile.rule:324: *** stack size likely to be exceeded, please decrease the value of K_MAX_STACK .  Stop.

Looking at Makefile.rule more closely, I find around line 321:

STACK_SIZE := $(shell ulimit -s)
STACK_SIZE_EXCEEDED := $(shell echo $(K_MAX_STACK)*12*8*2 \> $(STACK_SIZE)*1024 | bc )
ifeq ($(STACK_SIZE_EXCEEDED), 1)
$(error stack size likely to be exceeded, please decrease the value of K_MAX_STACK )
endif
CFLAGS  += -DK_MAX_STACK=$(K_MAX_STACK)

It appears that this code doesn't work properly when ulimit -s returns unlimited, as it does on my current Cray Linux Environment 6 system:

$ uname -a
Linux nid00019 4.4.103-6.38_4.0.95-cray_ari_c #1 SMP Fri Feb 9 17:52:44 UTC 2018 (172b90b) x86_64 x86_64 x86_64 GNU/Linux

I checked a previous version of BLASFEO that was working fine (2c9f312) and it appears that the code snippet above is new.

Commenting out the first five lines above (all except for update of CFLAGS) seems to allow the build system to finish normally.

@giaf
Copy link
Owner

giaf commented Aug 23, 2019

Hi Field,
thanks for the bug report. The case of unlimited stack size is indeed not correctly handled, I will take care of it now.
For now you can simply comment out the 5 lines

STACK_SIZE := $(shell ulimit -s)
STACK_SIZE_EXCEEDED := $(shell echo $(K_MAX_STACK)*12*8*2 \> $(STACK_SIZE)*1024 | bc )
ifeq ($(STACK_SIZE_EXCEEDED), 1)
$(error stack size likely to be exceeded, please decrease the value of K_MAX_STACK )
endif

@giaf
Copy link
Owner

giaf commented Aug 23, 2019

This should fix it f5ebb2d

@giaf giaf closed this as completed Sep 2, 2019
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

No branches or pull requests

2 participants