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

Update Spack to 0.22 #272

Merged
merged 47 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
a5d66c4
Updated blt and PYB11Generator submodules, fixed cmake logic for usin…
ldowen Mar 26, 2024
c276dd4
Merge branch 'develop' into update/update_TPLs
ldowen Mar 29, 2024
26e1185
Significant changes to spack recipes and minor changes to tpl-manager
ldowen Apr 19, 2024
b54070d
Spheral spack package is working without versions being set, ran into…
ldowen Apr 24, 2024
6b14d61
Reverting some things back to how it was done before regarding cmake …
ldowen Apr 24, 2024
8885141
Fix dev-build tpl manager command
ldowen Apr 25, 2024
c82ebe4
Combined separate TPL install and dev-build Spack calls into single i…
ldowen May 1, 2024
e93d46e
Updated spack commit hash
ldowen May 1, 2024
5809c5a
Add echo check for tpl-manager command function
ldowen May 2, 2024
d8e3df2
Added zlib provider for zlib-api in spack packages, added system exte…
ldowen May 2, 2024
5510a85
Removed blas and awk providers, added build_job 54 back in
ldowen May 6, 2024
4dd87f6
Update scripts/devtools/tpl-manager.py
ldowen May 6, 2024
5036536
Update scripts/devtools/tpl-manager.py
ldowen May 6, 2024
0de82d6
Merge branch 'update/update_TPLs' of https://github.com/LLNL/spheral …
ldowen May 6, 2024
2149bc4
Updated blueos package file, added qhull version number to spheral pa…
ldowen May 6, 2024
0a1e551
Removed cuda versions 8 and 9 from blueos package file
ldowen May 6, 2024
78de9f3
Added netlib-lapack as blas provider
ldowen May 6, 2024
108376e
Removed py-pillow provider
ldowen May 7, 2024
128baf9
Bring blas and pil providers back, add py-pillow back as a dependency…
ldowen May 7, 2024
123af2d
Set externals and providers to match axom
ldowen May 7, 2024
f7406a3
Removed second lapack external on blueOS
ldowen May 7, 2024
d681edd
Add externals to ubuntu 20 package file
ldowen May 7, 2024
5a0ff0a
Test where only zlib provider for toss
ldowen May 8, 2024
d71c5f7
Added providers back in since that did not fix the issue
ldowen May 8, 2024
4692ddf
Testing what happens when numpy version number is removed
ldowen May 9, 2024
8200720
Brought numpy version back, removed python module load from gitlab sc…
ldowen May 9, 2024
2305448
Provide path to dev_path option in tplmanager
ldowen May 10, 2024
b7cce65
No longer using external netlib-lapack on blueos
ldowen May 13, 2024
58387e7
Update to the 0.22.0 Spack release hash
ldowen May 14, 2024
1aafe5d
Removed openblas and switched back to netlib-lapack for the ubuntu pa…
ldowen May 14, 2024
7642454
Merge branch 'develop' into update/update_TPLs
ldowen May 14, 2024
250a035
Removed external netlib-lapack from ubuntu package config file
ldowen May 14, 2024
d4e3bc1
Removed external cmake for ubuntu build for now
ldowen May 14, 2024
119143e
Put spack install spec in tpl-manager in quotes
ldowen May 15, 2024
bdd8472
Brought py-ats recipe back to avoid having to bring in py-poetry, try…
ldowen May 15, 2024
996c3d8
Going back to using dev-build command to see if that still works
ldowen May 17, 2024
8759506
Added quiet flag to dev-build
ldowen May 17, 2024
758e7c7
Fixed versions for all Spheral dependencies in spack recipe
ldowen May 23, 2024
d82629d
Set py-pillow version to what is used by ubuntu
ldowen May 23, 2024
ab25e99
Fix scipy to ubuntu build version as well
ldowen May 23, 2024
4db574c
Updated the upstream location
ldowen May 28, 2024
332bc9f
Updated upstream directory name
ldowen May 30, 2024
8f91424
Update upstream directory again
ldowen May 31, 2024
8d2110a
Removed pkg-config and pic variant lines from ubuntu spack package
ldowen Jun 4, 2024
1801c47
Updated release notes
ldowen Jun 5, 2024
884c737
Merge branch 'develop' into update/update_TPLs
ldowen Jun 7, 2024
2427793
Merge branch 'develop' into update/update_TPLs
ldowen Jun 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitlab/scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
- cd $CI_BUILD_DIR
- echo $SPEC

- ml load python/3
- $BUILD_ALLOC ./$SCRIPT_DIR/gitlab/build_and_install.py --spec="$SPEC" --extra-cmake-args="$EXTRA_CMAKE_ARGS"

.build_and_test:
Expand Down
2 changes: 1 addition & 1 deletion .uberenv_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"package_version" : "develop",
"package_source_dir" : "../../..",
"spack_url" : "https://github.com/spack/spack",
"spack_commit" : "5e0d2107348eed6cbe6deca43a30f5b06c5e40af",
"spack_commit" : "e2088b599e69f3a863b65e06c534ccb611a119f0",
"spack_configs_path" : "scripts/spack/configs",
"spack_packages_path" : "scripts/spack/packages"
}
2 changes: 1 addition & 1 deletion cmake/CMakeDefinitions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,5 @@ if (ENABLE_TIMER)
endif()

if (ENABLE_MPI)
add_definitions(-DUSE_MPI=1)
add_definitions(-DUSE_MPI=1)
endif()
3 changes: 2 additions & 1 deletion cmake/InstallTPLs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ foreach(_comp ${AXOM_COMPONENTS_ENABLED})
endforeach()

# TPLs that must be imported
list(APPEND SPHERAL_EXTERN_LIBS zlib boost eigen qhull silo hdf5 polytope)
list(APPEND SPHERAL_EXTERN_LIBS boost eigen qhull silo hdf5 polytope)
mdavis36 marked this conversation as resolved.
Show resolved Hide resolved

blt_list_append( TO SPHERAL_EXTERN_LIBS ELEMENTS aneos IF ENABLE_ANEOS)
blt_list_append( TO SPHERAL_EXTERN_LIBS ELEMENTS opensubdiv IF ENABLE_OPENSUBDIV)
Expand All @@ -108,6 +108,7 @@ endforeach()
if (EXISTS ${EXTERNAL_SPHERAL_TPL_CMAKE})
include(${EXTERNAL_SPHERAL_TPL_CMAKE})
endif()

# Copied from serac, needed to bypass generator expression issue during export
set(_props)
if( ${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.13.0" )
Expand Down
3 changes: 0 additions & 3 deletions cmake/SetupSpheral.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ include(ExternalProject)
#-------------------------------------------------------------------------------
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_EXPORT_COMPILE_COMMANDS On)
set(CMAKE_EXPORT_COMPILE_COMMANDS On)

if (NOT SPHERAL_CMAKE_MODULE_PATH)
set(SPHERAL_CMAKE_MODULE_PATH "${SPHERAL_ROOT_DIR}/cmake")
Expand Down Expand Up @@ -83,8 +82,6 @@ if(ENABLE_CUDA)
list(APPEND SPHERAL_CXX_DEPENDS cuda)
endif()

option(BOOST_HEADER_ONLY "only use the header only components of Boost" OFF)
mdavis36 marked this conversation as resolved.
Show resolved Hide resolved

#-------------------------------------------------------------------------------#
# Set a default build type if none was specified
#-------------------------------------------------------------------------------#
Expand Down
2 changes: 1 addition & 1 deletion cmake/blt
Submodule blt updated 183 files
2 changes: 1 addition & 1 deletion cmake/spheral/InstantiateCXX.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function(instantiate _inst_var _source_var)
# Uses BLT's python for instantiations to work when building CXX_ONLY as well as with python
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_inst_file}
DEPENDS ${_inst_py}
COMMAND ${PYTHON_EXECUTABLE} ${SPHERAL_ROOT_DIR}/src/helpers/InstantiationGenerator.py ${_inst_py} ${_inst_file} ${_dim}
COMMAND ${Python3_EXECUTABLE} ${SPHERAL_ROOT_DIR}/src/helpers/InstantiationGenerator.py ${_inst_py} ${_inst_file} ${_dim}
BYPRODUCTS ${_inst_file}
COMMENT "Generating instantiation ${_inst_file}..."
)
Expand Down
70 changes: 40 additions & 30 deletions cmake/spheral_cxx-config.cmake.in
Original file line number Diff line number Diff line change
@@ -1,37 +1,47 @@

@PACKAGE_INIT@

if(NOT axom_DIR)
set(axom_DIR "@axom_DIR@" CACHE PATH "")
endif()
set(SPHERAL_CXX_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@")
set(SPHERAL_CXX_INCLUDE_DIRS "${SPHERAL_CXX_INSTALL_PREFIX}/include")
if(NOT @ENABLE_CXXONLY@ AND NOT TARGET Python3)
set(python_DIR "@python_DIR@")
set(Python_EXECUTABLE ${python_DIR}/bin/python3)
set(Python3_EXECUTABLE ${python_DIR}/bin/python3)
find_package(Python3 COMPONENTS Interpreter Development)
set(PYTHON_EXE ${Python3_EXECUTABLE})
endif()
if(NOT SPHERAL_FOUND)
#----------------------------------------------------------------------------
# Set user configuration options and features
#----------------------------------------------------------------------------

# Guard these assignments to not interfere with projects that use Spheral and SpheralC as TPLs
if(SPHERALC_STANDALONE)
set(CMAKE_C_COMPILER "@CMAKE_C_COMPILER@" CACHE PATH "Spheral C compiler path")
set(CMAKE_CXX_COMPILER "@CMAKE_CXX_COMPILER@" CACHE PATH "Spheral C++ compiler path")
set(CMAKE_Fortran_COMPILER "@CMAKE_Fortran_COMPILER@" CACHE PATH "Spheral C++ compiler path")
set(ENABLE_MPI @ENABLE_MPI@ CACHE BOOL "")
if(SPHERAL_ENABLE_MPI)
set(MPI_C_COMPILER "@MPI_C_COMPILER@" CACHE PATH "")
set(MPI_CXX_COMPILER "@MPI_CXX_COMPILER@" CACHE PATH "")
set(MPI_Fortran_COMPILER "@MPI_Fortran_COMPILER@" CACHE PATH "")
# Language features
set(SPHERAL_ENABLE_MPI "@ENABLE_MPI@")
set(SPHERAL_ENABLE_OPENMP "@ENABLE_OPENMP@")
set(SPHERAL_ENABLE_CUDA "@ENABLE_CUDA@")
if(NOT axom_DIR)
set(axom_DIR "@axom_DIR@" CACHE PATH "")
endif()
endif()

if(NOT TARGET axom)
find_package(axom REQUIRED QUIET NO_DEFAULT_PATH PATHS ${axom_DIR} ${axom_DIR}/lib ${axom_DIR}/lib/cmake)
endif()
include("${SPHERAL_CXX_INSTALL_PREFIX}/lib/cmake/spheral_cxx-targets.cmake")
set(SPHERAL_CXX_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@")
set(SPHERAL_CXX_INCLUDE_DIRS "${SPHERAL_CXX_INSTALL_PREFIX}/include")
if(NOT @ENABLE_CXXONLY@ AND NOT TARGET Python3)
set(python_DIR "@python_DIR@")
set(Python_EXECUTABLE ${python_DIR}/bin/python3)
set(Python3_EXECUTABLE ${python_DIR}/bin/python3)
find_package(Python3 COMPONENTS Interpreter Development)
set(PYTHON_EXE ${Python3_EXECUTABLE})
endif()

set_property(TARGET Spheral_CXX
APPEND PROPERTY
INTERFACE_INCLUDE_DIRECTORIES ${SPHERAL_CXX_INCLUDE_DIRS})
if(NOT TARGET axom)
find_package(axom REQUIRED QUIET NO_DEFAULT_PATH PATHS ${axom_DIR} ${axom_DIR}/lib ${axom_DIR}/lib/cmake)
endif()
if(SPHERALC_STANDALONE)
set(CMAKE_C_COMPILER "@CMAKE_C_COMPILER@" CACHE PATH "Spheral C compiler path")
set(CMAKE_CXX_COMPILER "@CMAKE_CXX_COMPILER@" CACHE PATH "Spheral C++ compiler path")
set(CMAKE_Fortran_COMPILER "@CMAKE_Fortran_COMPILER@" CACHE PATH "Spheral C++ compiler path")
set(ENABLE_MPI @ENABLE_MPI@ CACHE BOOL "")
if(SPHERAL_ENABLE_MPI)
set(MPI_C_COMPILER "@MPI_C_COMPILER@" CACHE PATH "")
set(MPI_CXX_COMPILER "@MPI_CXX_COMPILER@" CACHE PATH "")
set(MPI_Fortran_COMPILER "@MPI_Fortran_COMPILER@" CACHE PATH "")
endif()
endif()
include("${SPHERAL_CXX_INSTALL_PREFIX}/lib/cmake/spheral_cxx-targets.cmake")

set_property(TARGET Spheral_CXX
APPEND PROPERTY
INTERFACE_INCLUDE_DIRECTORIES ${SPHERAL_CXX_INCLUDE_DIRS})
set(SPHERAL_FOUND TRUE)
endif()
5 changes: 0 additions & 5 deletions cmake/tpl/zlib.cmake

This file was deleted.

2 changes: 1 addition & 1 deletion extern/PYB11Generator
80 changes: 42 additions & 38 deletions scripts/devtools/tpl-manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,24 +59,24 @@ def parse_args():
parser.add_argument('--no-spec', action='store_true',
help='Skip output of the dependency graph.')

parser.add_argument('--skip-init', action='store_true',
help='Skip setting up and configuring Spack.')

return parser.parse_args()


# Helper function for executing commands stolen from uberenv
def sexe(cmd,ret_output=False,echo=False):
def sexe(cmd,ret_output=False,echo=True):
""" Helper for executing shell commands. """
if echo:
print("[exe: {0}]".format(cmd))
print("[exe: {0}]".format(cmd))
p = subprocess.run(cmd, shell=True,
capture_output=ret_output,
check=True, text=True)
if ret_output:
p = subprocess.Popen(cmd,
shell=True,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
out = p.communicate()[0]
out = out.decode('utf8')
return p.returncode,out
else:
return subprocess.call(cmd,shell=True)
if echo:
print(p.stdout)
return p.stdout


# Parse the json formatted spec list...
Expand All @@ -89,26 +89,13 @@ def parse_spec_list(file_path):
#------------------------------
# Dependencies
#------------------------------
def build_deps(args):
def build_spack(args):
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
print("~~~~~ Building Dependencies")
print("~~~~~ Configuring Spack")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
print("")
print("{0}".format(project_dir))


# Figure out what specs this script is building TPLs for.
spec_list=[]
if args.spec_list:
spec_list = parse_spec_list(args.spec_list)
elif args.spec:
spec_list.append(args.spec)
else:
print("ERROR: Please define --spec or --spec-list, aborting...")
sys.exit(1)
for s in spec_list:
print("** SPEC : {0}".format(s))

spack_upstream_opt=""
if os.path.isdir(args.upstream_dir) and not args.no_upstream:
spack_upstream_opt="--upstream {0}".format(args.upstream_dir)
Expand Down Expand Up @@ -137,9 +124,9 @@ def build_deps(args):
# We need to install spack without any configuration files so we can use
# spack arch to determine the OS of the system and later to use spack find
# for generating external package files on external systems.
if sexe("python3 {0} --setup-only {1} {2} {3} {4}".format(uberenv_path, prefix_opt, uberenv_project_json_opt, spack_upstream_opt, uberenv_spack_url_opt), echo=True): sys.exit(1)
sexe("python3 {0} --setup-only {1} {2} {3} {4}".format(uberenv_path, prefix_opt, uberenv_project_json_opt, spack_upstream_opt, uberenv_spack_url_opt))
mdavis36 marked this conversation as resolved.
Show resolved Hide resolved

spack_arch_os = sexe("{0} arch -o".format(spack_cmd), ret_output=True)[1].strip()
spack_arch_os = sexe("{0} arch -o".format(spack_cmd), ret_output=True, echo=False).strip()
print("INFO : Detected Operating System :{0}".format(spack_arch_os))

spheral_config_dir += spack_arch_os
Expand All @@ -150,12 +137,31 @@ def build_deps(args):


# Setup spack w/ Uberenv and the appropriate external package/compiler configs.
if sexe("python3 {0} --setup-only {1} {2} {3} {4} {5}".format(uberenv_path, prefix_opt, uberenv_project_json_opt, spack_config_dir_opt, spack_upstream_opt, uberenv_spack_url_opt), echo=True): sys.exit(1)
sexe("python3 {0} --setup-only {1} {2} {3} {4} {5}".format(uberenv_path, prefix_opt, uberenv_project_json_opt, spack_config_dir_opt, spack_upstream_opt, uberenv_spack_url_opt))
mdavis36 marked this conversation as resolved.
Show resolved Hide resolved

# Uberenv doesn't copy the concretizer.yaml options...
if os.path.exists(spheral_config_dir+"/concretizer.yaml"):
sexe("cp {0}/concretizer.yaml {1}".format(spheral_config_dir, os.path.join(args.spheral_spack_dir, "spack/etc/spack/defaults")), echo=True)
sexe("cp {0}/concretizer.yaml {1}".format(spheral_config_dir, os.path.join(args.spheral_spack_dir, "spack/etc/spack/defaults")))

def build_deps(args):
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
print("~~~~~ Building Dependencies")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
print("")
print("{0}".format(project_dir))
mdavis36 marked this conversation as resolved.
Show resolved Hide resolved
# Figure out what specs this script is building TPLs for.
spec_list=[]
if args.spec_list:
spec_list = parse_spec_list(args.spec_list)
elif args.spec:
spec_list.append(args.spec)
else:
print("ERROR: Please define --spec or --spec-list, aborting...")
sys.exit(1)
for s in spec_list:
print("** SPEC : {0}".format(s))
spack_cmd=os.path.join(args.spheral_spack_dir, "spack/bin/spack")
ldowen marked this conversation as resolved.
Show resolved Hide resolved

# Optionally add a parallel job number for spack builds
if args.spack_jobs:
spack_cmd += " --jobs={0}".format(args.spack_jobs)
Expand All @@ -170,27 +176,25 @@ def build_deps(args):
# Loop through the specs we want TPLs for and build/install/get them as necessary.
if not args.init_only:
for s in spec_list:

print("** Building TPL's and generating host-config for {0}%{1} ...".format(package_name,s))
os.environ["SPEC"] = s
os.environ["LC_ALL"] = "en_US.UTF-8"

if not args.no_spec:
if sexe("{0} spec --fresh -I {1}@develop%{2}".format(spack_cmd, package_name, s), echo=True) : sys.exit(1)

# Install only the dependencies for Spheral
if sexe("{0} install --fail-fast --fresh --deprecated --only dependencies {2}@develop%{3} 2>&1 | tee -a \"dev-build-{3}-out.txt\"".format(spack_cmd, os.getcwd(), package_name, s), echo=True) : sys.exit(1)
sexe("{0} spec --fresh -IL {1}@develop%{2} 2>&1 | tee -a \"spec-info-{2}-out.txt\"".format(spack_cmd, package_name, s))

# Using dev-build we can have spack generate an init-config with the local source files for spheral.
if sexe("{0} dev-build --fresh --deprecated -u initconfig {2}@develop%{3} 2>&1 | tee -a \"dev-build-{3}-out.txt\"".format(spack_cmd, os.getcwd(), package_name, s), echo=True) : sys.exit(1)
# Install only the dependencies for Spheral and create CMake configure file
sexe("{0} install --fail-fast --fresh -u initconfig {1}@develop%{2} dev_path={3} 2>&1 | tee -a \"tpl-build-{2}-out.txt\"".format(spack_cmd, package_name, s, project_dir))

if not args.no_clean:
sexe("rm dev-build-* spack-build-* spack-configure-args.txt")
sexe("rm -f spec-info-* tpl-build-* spack-build-* spack-configure-args.txt")

#------------------------------------------------------------------------------

def main():
args = parse_args()
if (not args.skip_init):
build_spack(args)
build_deps(args)


Expand Down
51 changes: 37 additions & 14 deletions scripts/spack/configs/blueos_3_ppc64le_ib/packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,42 @@ packages:
all:
target: [ppc64le]
compiler: [gcc, clang]
providers:
blas: [netlib-lapack]
lapack: [netlib-lapack]
mpi: [spectrum-mpi]
zlib-api: [zlib]
cmake:
version: [3.20.2]
buildable: false
externals:
- spec: cmake@3.20.2
prefix: /usr/tce/packages/cmake/cmake-3.20.2
gmake:
version: [4.2.1]
buildable: false
externals:
- spec: gmake@4.2.1
prefix: /usr
git:
version: [2.29.1]
buildable: false
externals:
- spec: git@2.29.1+tcltk
prefix: /usr/tce
perl:
version: [5.26.3]
buildable: false
externals:
- spec: perl@5.26.3
prefix: /usr

cuda:
version: [11.1.0, 11.0.2, 10.1.243, 10.1.168, 9.2.148, 8.0]
version:
- 11.1.0
- 11.0.2
- 10.1.243
- 10.1.168
buildable: false
externals:
- spec: cuda@11.1.0~allow-unsupported-compilers
Expand All @@ -21,11 +48,7 @@ packages:
prefix: /usr/tce/packages/cuda/cuda-10.1.243
- spec: cuda@10.1.168+allow-unsupported-compilers
prefix: /usr/tce/packages/cuda/cuda-10.1.168
- spec: cuda@9.2.148~allow-unsupported-compilers
prefix: /usr/tce/packages/cuda/cuda-9.2.148
- spec: cuda@8.0~allow-unsupported-compilers
prefix: /usr/tce/packages/cuda/cuda-8.0


spectrum-mpi:
externals:
- spec: spectrum-mpi@10.3.1.03rtm0%pgi@19.10
Expand Down Expand Up @@ -130,15 +153,15 @@ packages:
prefix: /usr
buildable: false
tcl:
externals:
- spec: tcl@8.5.19
prefix: /usr
buildable: false
externals:
- spec: tcl@8.5.19
prefix: /usr
buildable: false
tk:
externals:
- spec: tk@8.5.19
prefix: /usr
buildable: false
externals:
- spec: tk@8.5.19
prefix: /usr
buildable: false
fontconfig:
externals:
- spec: fontconfig@2.13.1
Expand Down
Loading