Skip to content

Commit

Permalink
Pin compiler everywhere
Browse files Browse the repository at this point in the history
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...
  • Loading branch information
milljm committed Oct 21, 2024
1 parent a82e27d commit 34eb6f7
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 20 deletions.
16 changes: 14 additions & 2 deletions conda/mpi/conda_build_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
4 changes: 4 additions & 0 deletions conda/mpi/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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]
Expand Down
3 changes: 2 additions & 1 deletion conda/seacas/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
40 changes: 29 additions & 11 deletions conda/seacas/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
8 changes: 5 additions & 3 deletions conda/seacas/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 13 additions & 2 deletions conda/wasp/conda_build_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
4 changes: 3 additions & 1 deletion conda/wasp/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ outputs:
build:
- {{ moose_cc }}
- {{ moose_cxx }}
- {{ moose_ccompiler }}
- {{ moose_cxxcompiler }}
- make
- cmake
- pkg-config
Expand All @@ -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
Expand Down

0 comments on commit 34eb6f7

Please sign in to comment.