Skip to content

Commit 7febaf3

Browse files
committed
fixes for MacOS updates.
1 parent ec50af3 commit 7febaf3

File tree

4 files changed

+17
-11
lines changed

4 files changed

+17
-11
lines changed

SConstruct

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ vars.AddVariables(
136136
EnumVariable('build_trilinos', 'Instructs scons to build the trilinos library.', "make", allowed_values = build_trilinos_flavours),
137137
('trilinos_prefix', 'Prefix/Paths to Trilinos installation (need to be set if build_trilinos = False).', default_prefix),
138138
('trilinos_libs', 'Trilinos libraries to link with', []),
139-
PathVariable('trilinos_src', 'Top-level source directory for trilinos.', Dir('trilinos_source16').abspath, PathVariable.PathIsDir),
139+
PathVariable('trilinos_src', 'Top-level source directory for trilinos.', Dir('trilinos_source16_1_0').abspath, PathVariable.PathIsDir),
140140
PathVariable('trilinos_build', 'Top-level build directory for trilinos.', Dir('#/build_trilinos').abspath, PathVariable.PathIsDirCreate),
141141
PathVariable('trilinos_install', 'Top-level install directory for trilinos when built', Dir('#/esys.trilinos').abspath, PathVariable.PathIsDirCreate),
142142
#('trilinos_install', 'path to install trilinos libs, default is <prefix>/lib/esys', 'default'),

scons/sees_kxr2xgw_options.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
# "-I/opt/local/include/libomp -L/opt/local/lib/libomp -fopenmp" ???
5454

5555
from templates.homebrew_options import *
56-
build_trilinos="never"
56+
build_trilinos="True"
5757

5858
#cxx_extra = '-Wimplicit-function-declaration -Wno-string-concatenation -fopenmp' # --target arm64-apple-macosx13.0.0'
5959
# ld_extra='-v'# -L/Users/uqlgross/PycharmProjects/esys-escript.github.io/build/darwin/escriptcore/src'

scons/templates/homebrew_options.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@
4949
if t.startswith("-L") :
5050
pythonlibpath=p.stdout.split(" ")[0][2:]
5151

52+
try:
53+
p=subprocess.run(['xcrun', '--show-sdk-path'], capture_output=True, text=True)
54+
if p.stdout.strip():
55+
os.putenv("SDKROOT", p.stdout.strip())
56+
except FileNotFoundError:
57+
print("xcrun not found. SDKROOT is not set.")
5258
#pythonpath = os.path.join(HOMEBREW_PREFIX, "Cellar", f"python@3.{subversion}",
5359
# f"3.{subversion}.{revversion}", "Frameworks", "Python.framework",
5460
# "Versions", f"3.{subversion}" )

site_scons/dependencies.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ def checkBoost(env):
332332
if boostversion >= 106300 and not env['disable_boost_numpy'] :
333333
pyv = env['python_version'].split(".")
334334
if env["IS_OSX"]:
335-
libname = f'boost_numpy{pyv[0]}{pyv[1]}-mt'
335+
libname = f'boost_numpy{pyv[0]}{pyv[1]}'
336336
else:
337337
libname = f'boost_numpy{pyv[0]}{pyv[1]}'
338338
try:
@@ -450,12 +450,12 @@ def checkForTrilinos(env):
450450
'BelosTFQMRIter.hpp', 'BelosTFQMRSolMgr.hpp', 'BelosTpetraAdapter.hpp', 'BelosTypes.hpp', \
451451
'Ifpack2_Factory.hpp', 'Tpetra_KokkosCompat_DefaultNode.hpp', \
452452
'MatrixMarket_Tpetra.hpp', 'MueLu_CreateTpetraPreconditioner.hpp', \
453-
'Teuchos_DefaultComm.hpp', 'Teuchos_ParameterList.hpp', \
453+
'Teuchos_DefaultComm.hpp', 'Teuchos_ParameterList.hpp', 'Tpetra_BlockCrsMatrix.hpp', \
454454
'Teuchos_Comm.hpp', 'Teuchos_TimeMonitor.hpp', 'Tpetra_CrsMatrix_decl.hpp', \
455-
'Tpetra_BlockCrsMatrix_decl.hpp', \
455+
'Tpetra_BlockCrsMatrix_decl.hpp', 'kokkos/Kokkos_Core.hpp', \
456456
'Tpetra_CrsGraph.hpp', 'Tpetra_CrsMatrix.hpp', 'Tpetra_RowMatrix.hpp', \
457-
'TpetraExt_TripleMatrixMultiply_def.hpp', \
458-
'Tpetra_Vector.hpp', 'Trilinos_version.h']
457+
'TpetraExt_TripleMatrixMultiply_def.hpp', 'Tpetra_BlockVector.hpp', \
458+
'Tpetra_Vector.hpp', 'Trilinos_version.h', 'Tpetra_BlockCrsMatrix_Helpers.hpp']
459459
packages = ['Tpetra', 'Kokkos', 'Belos', 'Amesos2', 'Ifpack2', 'MueLu']
460460

461461
# 'Tpetra_createDeepCopy_CrsMatrix.hpp', \
@@ -467,10 +467,10 @@ def checkForTrilinos(env):
467467
trilinos_inc_path,trilinos_lib_path=findLibWithHeader(env,
468468
env['trilinos_libs'], 'Amesos2.hpp',
469469
env['trilinos_prefix'], lang='c++', try_link=havelibs)
470-
env.AppendUnique(CPPPATH = [trilinos_inc_path])
470+
env.AppendUnique(CPPPATH = [trilinos_inc_path, os.path.join(trilinos_inc_path,'kokkos')])
471471
env.AppendUnique(LIBPATH = [trilinos_lib_path])
472472
env.PrependENVPath(env['LD_LIBRARY_PATH_KEY'], trilinos_lib_path)
473-
env['buildvars']['trilinos_inc_path']=trilinos_inc_path
473+
env['buildvars']['trilinos_inc_path']=[trilinos_inc_path, os.path.join(trilinos_inc_path,'kokkos')]
474474
env['buildvars']['trilinos_lib_path']=trilinos_lib_path
475475
#conf = Configure(env.Clone())
476476

@@ -480,7 +480,7 @@ def checkForTrilinos(env):
480480
if not os.path.isfile(os.path.join(trilinos_inc_path,check)):
481481
print("Could not find the Trilinos header file %s (tried looking in directory %s)" % (check, trilinos_inc_path))
482482
env.Exit(1)
483-
483+
# .. not relevant for new trilinos versions (REMOVE):
484484
if os.path.isfile(os.path.join(trilinos_inc_path,'Tpetra_DefaultPlatform.hpp')):
485485
print("Checking for %s... %s" %('Tpetra_DefaultPlatform.hpp', "yes"))
486486
env.Append(CPPDEFINES = ['ESYS_HAVE_TPETRA_DP'])
@@ -506,7 +506,7 @@ def checkForTrilinos(env):
506506
# env.Append(CPPDEFINES = ['ESYS_TRILINOS_14_2'])
507507
# else:
508508
env.Append(CPPDEFINES = [f'ESYS_TRILINOS_{major}'])
509-
509+
# REVISE: remove 'ESYS_HAVE_TPETRA_EXPERIMENTAL_BLOCKCRS' 'ESYS_HAVE_TPETRA_EXPERIMENTAL_BLOCKCRSH' ESYS_HAVE_TPETRA_EXPERIMENTAL_BLOCKV
510510
if os.path.isfile(os.path.join(trilinos_inc_path,'Tpetra_BlockCrsMatrix.hpp')):
511511
print("Checking for %s... %s" % ('Tpetra_BlockCrsMatrix.hpp', "yes") )
512512
elif os.path.isfile(os.path.join(trilinos_inc_path,'Tpetra_Experimental_BlockCrsMatrix.hpp')):

0 commit comments

Comments
 (0)