@@ -384,16 +384,6 @@ def pre_single_extension_hook(ext, *args, **kwargs):
384
384
PRE_SINGLE_EXTENSION_HOOKS [ext .name ](ext , * args , ** kwargs )
385
385
386
386
387
- def pre_single_extension_testthat (ext , * args , ** kwargs ):
388
- """
389
- Pre-extension hook for testthat R package, to fix build on top of recent glibc.
390
- """
391
- if ext .name == 'testthat' and LooseVersion (ext .version ) < LooseVersion ('3.1.0' ):
392
- # use constant value instead of SIGSTKSZ for stack size,
393
- # cfr. https://github.com/r-lib/testthat/issues/1373 + https://github.com/r-lib/testthat/pull/1403
394
- ext .cfg ['preinstallopts' ] = "sed -i 's/SIGSTKSZ/32768/g' inst/include/testthat/vendor/catch.h && "
395
-
396
-
397
387
def pre_single_extension_isoband (ext , * args , ** kwargs ):
398
388
"""
399
389
Pre-extension hook for isoband R package, to fix build on top of recent glibc.
@@ -404,6 +394,33 @@ def pre_single_extension_isoband(ext, *args, **kwargs):
404
394
ext .cfg ['preinstallopts' ] = "sed -i 's/SIGSTKSZ/32768/g' src/testthat/vendor/catch.h && "
405
395
406
396
397
+ def pre_single_extension_scipy (ext , * args , ** kwargs ):
398
+ """
399
+ Pre-extension hook for scipy, to change -march=native to -march=armv8.4-a for scipy 1.10.x when buidling for
400
+ aarch64/neoverse_v1 CPU target.
401
+ """
402
+ cpu_target = get_eessi_envvar ('EESSI_SOFTWARE_SUBDIR' )
403
+ if ext .name == 'scipy' and ext .version == '1.10.1' and cpu_target == CPU_TARGET_NEOVERSE_V1 :
404
+ cflags = os .getenv ('CFLAGS' )
405
+ if '-mcpu=native' in cflags :
406
+ cflags = cflags .replace ('-mcpu=native' , '-march=armv8.4-a' )
407
+ ext .cfg .update ('configopts' , ' ' .join ([
408
+ "-Dc_args='%s'" % cflags ,
409
+ "-Dcpp_args='%s'" % cflags ,
410
+ "-Dfortran_args='%s'" % cflags ,
411
+ ]))
412
+
413
+
414
+ def pre_single_extension_testthat (ext , * args , ** kwargs ):
415
+ """
416
+ Pre-extension hook for testthat R package, to fix build on top of recent glibc.
417
+ """
418
+ if ext .name == 'testthat' and LooseVersion (ext .version ) < LooseVersion ('3.1.0' ):
419
+ # use constant value instead of SIGSTKSZ for stack size,
420
+ # cfr. https://github.com/r-lib/testthat/issues/1373 + https://github.com/r-lib/testthat/pull/1403
421
+ ext .cfg ['preinstallopts' ] = "sed -i 's/SIGSTKSZ/32768/g' inst/include/testthat/vendor/catch.h && "
422
+
423
+
407
424
def post_sanitycheck_hook (self , * args , ** kwargs ):
408
425
"""Main post-sanity-check hook: trigger custom functions based on software name."""
409
426
if self .name in POST_SANITYCHECK_HOOKS :
@@ -531,6 +548,7 @@ def inject_gpu_property(ec):
531
548
532
549
PRE_SINGLE_EXTENSION_HOOKS = {
533
550
'isoband' : pre_single_extension_isoband ,
551
+ 'scipy' : pre_single_extension_scipy ,
534
552
'testthat' : pre_single_extension_testthat ,
535
553
}
536
554
0 commit comments