From 34eb6f7ea4bbe75bc3cbe1701247e44f7f666cb6 Mon Sep 17 00:00:00 2001 From: Jason M Miller Date: Mon, 21 Oct 2024 11:54:10 -0600 Subject: [PATCH] Pin compiler everywhere Everywhere we were allowing use of jinja2 compilers from conda-forge, supply a pinned default instead. This insures our packages are compatible with each other. When moving away from jinja templated compilers, I found we are not including enough. *compilers*_arch package is necessary. For example: ```pre conda install gcc cmake dosomething ``` ...may fail with Cmake not able to discover where/how to use GCC. SEACAS contrib example: ```pre -- The C compiler identification is unknown CMake Error at cmake/tribits/core/package_arch/TribitsGlobalMacros.cmake:1462 (enable_language): No CMAKE_C_COMPILER could be found. ``` `conda install gcc gcc_linux-64`, is the proper way (or rather, more proper than without it). As with all things conda-build, I am still learning. SEACAS build.sh change: Supply lib directory when building SEACAS. There seems to now be an issue with contribs being installed in `lib64` while Conda still expects things in `lib`. This is the bit I am referring to when I say "or rather, more proper than without it" above. Before this change, telling Cmake were libs go was not necessary... --- conda/mpi/conda_build_config.yaml | 16 +++++++++-- conda/mpi/meta.yaml | 4 +++ conda/seacas/build.sh | 3 ++- conda/seacas/conda_build_config.yaml | 40 ++++++++++++++++++++-------- conda/seacas/meta.yaml | 8 +++--- conda/wasp/conda_build_config.yaml | 15 +++++++++-- conda/wasp/meta.yaml | 4 ++- 7 files changed, 70 insertions(+), 20 deletions(-) diff --git a/conda/mpi/conda_build_config.yaml b/conda/mpi/conda_build_config.yaml index 2096b14aeb9d..1b33f9ff6336 100644 --- a/conda/mpi/conda_build_config.yaml +++ b/conda/mpi/conda_build_config.yaml @@ -25,23 +25,35 @@ zip_keys: - mpi_website - mpi_dev_website -### If you change these versions, change also conda/wasp/* +### If you change these versions, change also conda/wasp/*, conda/seacas/* moose_cc: - gcc 12.3.0 h915e2ae_7 # [linux] - clang 16.0.6 hdae98eb_6 # [not arm64 and osx] - clang 16.0.6 h30cc82d_6 # [arm64] -### If you change these versions, change also conda/wasps/* +### If you change these versions, change also conda/wasps/*, conda/seacas/* moose_cxx: - gxx 12.3.0 h915e2ae_7 # [linux] - clangxx 16.0.6 default_h7151d67_6 # [not arm64 and osx] - clangxx 16.0.6 default_h4cf2255_6 # [arm64] +### If you change these versions, change also conda/seacas/* moose_gfortran: - gfortran 12.3.0 h915e2ae_13 # [linux] - gfortran 12.3.0 h2c809b3_1 # [not arm64 and osx] - gfortran 12.3.0 h1ca8e4b_1 # [arm64] +### Cmake requires these be installed in order to "find" compilers +moose_ccompiler: + - gcc_linux-64 # [linux] + - clang_osx-64 # [not arm64 and osx] + - clang_osx-arm64 # [arm64] + +moose_cxxcompiler: + - gxx_linux-64 # [linux] + - clangxx_osx-64 # [not arm64 and osx] + - clangxx_osx-arm64 # [arm64] + moose_libgfortran5: - libgfortran5 13.2.0 ha4646dd_5 # [linux] - libgfortran5 13.2.0 h2873a65_3 # [not arm64 and osx] diff --git a/conda/mpi/meta.yaml b/conda/mpi/meta.yaml index 024876c20040..8bdf624f47f3 100644 --- a/conda/mpi/meta.yaml +++ b/conda/mpi/meta.yaml @@ -47,6 +47,8 @@ outputs: - {{ moose_libcxx }} - {{ moose_cc }} - {{ moose_cxx }} + - {{ moose_ccompiler }} + - {{ moose_cxxcompiler }} - {{ moose_clang_osx }} # [osx] - {{ moose_compiler_rt }} # [osx] - {{ moose_libclang }} # [osx] @@ -70,6 +72,8 @@ outputs: - {{ moose_libcxx }} - {{ moose_cc }} - {{ moose_cxx }} + - {{ moose_ccompiler }} + - {{ moose_cxxcompiler }} - {{ moose_clang_osx }} # [osx] - {{ moose_compiler_rt }} # [osx] - {{ moose_libclang }} # [osx] diff --git a/conda/seacas/build.sh b/conda/seacas/build.sh index d5d91ef54cf2..1f1c993eabc2 100644 --- a/conda/seacas/build.sh +++ b/conda/seacas/build.sh @@ -30,7 +30,8 @@ function do_build(){ cd "${SRC_DIR:?}/build" || exit 1 ../cmake-config \ -DTPL_X11_LIBRARIES="${BUILD_PREFIX:?}"/lib/libX11."${BUILD_LD_EXT:?}" \ - -DTPL_X11_INCLUDE_DIRS="${BUILD_PREFIX:?}"/include || return 1 + -DTPL_X11_INCLUDE_DIRS="${BUILD_PREFIX:?}"/include \ + -DCMAKE_INSTALL_LIBDIR='lib' || return 1 # Make and install make -j "${JOBS:?}" || return 1 diff --git a/conda/seacas/conda_build_config.yaml b/conda/seacas/conda_build_config.yaml index 11e4be80b576..9be22532ba49 100644 --- a/conda/seacas/conda_build_config.yaml +++ b/conda/seacas/conda_build_config.yaml @@ -1,17 +1,35 @@ -#### Darwin SDK SYSROOT -CONDA_BUILD_SYSROOT: # [osx] - - /opt/MacOSX11.3.sdk # [osx] +### If you change these versions, change also conda/wasp/*, conda/seacas/* +moose_cc: + - gcc 12.3.0 h915e2ae_7 # [linux] + - clang 16.0.6 hdae98eb_6 # [not arm64 and osx] + - clang 16.0.6 h30cc82d_6 # [arm64] + +### If you change these versions, change also conda/wasps/*, conda/seacas/* +moose_cxx: + - gxx 12.3.0 h915e2ae_7 # [linux] + - clangxx 16.0.6 default_h7151d67_6 # [not arm64 and osx] + - clangxx 16.0.6 default_h4cf2255_6 # [arm64] -c_compiler_version: # [unix] - - 12.3.0 # [linux] - - 16.0.6 # [osx] +### If you change these versions, change also conda/mpi/* +moose_gfortran: + - gfortran 12.3.0 h915e2ae_13 # [linux] + - gfortran 12.3.0 h2c809b3_1 # [not arm64 and osx] + - gfortran 12.3.0 h1ca8e4b_1 # [arm64] -cxx_compiler_version: # [unix] - - 12.3.0 # [linux] - - 16.0.6 # [osx] +### Cmake requires these be installed in order to "find" compilers +moose_ccompiler: + - gcc_linux-64 # [linux] + - clang_osx-64 # [not arm64 and osx] + - clang_osx-arm64 # [arm64] -fortran_compiler_version: # [unix] - - 12.3.0 # [unix] +moose_cxxcompiler: + - gxx_linux-64 # [linux] + - clangxx_osx-64 # [not arm64 and osx] + - clangxx_osx-arm64 # [arm64] + +#### Darwin SDK SYSROOT +CONDA_BUILD_SYSROOT: # [osx] + - /opt/MacOSX11.3.sdk # [osx] macos_min_version: # [osx] - 11.3 # [osx] diff --git a/conda/seacas/meta.yaml b/conda/seacas/meta.yaml index 488310fdb32d..663ae27598ce 100644 --- a/conda/seacas/meta.yaml +++ b/conda/seacas/meta.yaml @@ -21,9 +21,11 @@ build: requirements: build: - - {{ compiler('c') }} - - {{ compiler('cxx') }} - - {{ compiler('fortran') }} + - {{ moose_cc }} + - {{ moose_cxx }} + - {{ moose_gfortran }} + - {{ moose_ccompiler }} + - {{ moose_cxxcompiler }} - xorg-libx11 - cmake - make diff --git a/conda/wasp/conda_build_config.yaml b/conda/wasp/conda_build_config.yaml index d033025585db..70f1469596a1 100644 --- a/conda/wasp/conda_build_config.yaml +++ b/conda/wasp/conda_build_config.yaml @@ -4,18 +4,29 @@ moose_python: - python 3.10 - python 3.9 -### If you change these versions, change also conda/mpi/* +### If you change these versions, change also conda/mpi/*, conda/seacas/* moose_cc: - gcc 12.3.0 h915e2ae_7 # [linux] - clang 16.0.6 hdae98eb_6 # [not arm64 and osx] - clang 16.0.6 h30cc82d_6 # [arm64] -### If you change these versions, change also conda/mpi/* +### If you change these versions, change also conda/mpi/*, conda/seacas/* moose_cxx: - gxx 12.3.0 h915e2ae_7 # [linux] - clangxx 16.0.6 default_h7151d67_6 # [not arm64 and osx] - clangxx 16.0.6 default_h4cf2255_6 # [arm64] +### Cmake requires these be installed in order to "find" compilers +moose_ccompiler: + - gcc_linux-64 # [linux] + - clang_osx-64 # [not arm64 and osx] + - clang_osx-arm64 # [arm64] + +moose_cxxcompiler: + - gxx_linux-64 # [linux] + - clangxx_osx-64 # [not arm64 and osx] + - clangxx_osx-arm64 # [arm64] + #### Darwin SDK SYSROOT CONDA_BUILD_SYSROOT: # [osx] - /opt/MacOSX11.3.sdk # [osx] diff --git a/conda/wasp/meta.yaml b/conda/wasp/meta.yaml index c126bc2eed94..df1d86e22975 100644 --- a/conda/wasp/meta.yaml +++ b/conda/wasp/meta.yaml @@ -48,6 +48,8 @@ outputs: build: - {{ moose_cc }} - {{ moose_cxx }} + - {{ moose_ccompiler }} + - {{ moose_cxxcompiler }} - make - cmake - pkg-config @@ -64,7 +66,7 @@ outputs: - {{ pin_subpackage('moose-pyhit', max_pin='x.x')}} requirements: build: - - {{ compiler('cxx') }} + - {{ moose_cxxcompiler }} - {{ moose_python }} - {{ pin_subpackage("moose-wasp-base", exact=True) }} - make