diff --git a/.conda/elements/build.sh b/.conda/elements/build.sh index 7f8140909..b5e2aaed6 100755 --- a/.conda/elements/build.sh +++ b/.conda/elements/build.sh @@ -19,4 +19,4 @@ cmake -D CMAKE_BUILD_TYPE:STRING=RELEASE \ $SRC_DIR \ -D CMAKE_CXX_FLAGS="$PATCHED_CXXFLAGS" \ -make -j 10 install \ No newline at end of file +make install diff --git a/.conda/elements/meta.yaml b/.conda/elements/meta.yaml index a3b2cde6a..500d621f2 100644 --- a/.conda/elements/meta.yaml +++ b/.conda/elements/meta.yaml @@ -3,7 +3,7 @@ {% set macos_compiler_version = "16" %} package: - name: elements + name: elements-cpu version: {{ version }} source: @@ -23,17 +23,17 @@ requirements: - {{ compiler('cxx') }}={{ macos_compiler_version }} # [osx] about: - home: https://github.com/lanl/Fierro + home: https://github.com/lanl/ELEMENTS license: BSD-3-Clause license_family: BSD license_file: LICENSE summary: - LANL's software for simulating quasi-static solid mechanics. + LANL's for lagrangian mesh libraries. description: - Fierro (LANL code number C21030) is a modern C++ code designed to simulate quasi-static - solid mechanics problems and transient, compressible material dynamic problems with Lagrangian methods, - which have meshes with constant mass elements that move with the material, - or with Eulerian methods, which have stationary meshes. + The C++ ELEMENTS library is a collection of sub-libraries to support implementing a diverse range + of numerical methods on low and high-order meshes. The ELEMENTS library can be used for research + and development of both continuous and discontinuous finite element methods, as well as, + finite volume methods to solve a diverse range of partial differential equations. dev_url: https://github.com/lanl/Fierro extra: diff --git a/.conda/evpfft-dev/cpu/meta.yaml b/.conda/evpfft-dev/cpu/meta.yaml index 3f9a6ef5c..c5bf76e3f 100644 --- a/.conda/evpfft-dev/cpu/meta.yaml +++ b/.conda/evpfft-dev/cpu/meta.yaml @@ -3,7 +3,7 @@ {% set macos_compiler_version = "16" %} package: - name: evpfft-dev + name: dev-evpfft-cpu version: {{ version }} build: @@ -14,9 +14,9 @@ build: - PLATFORM={{ target_platform }} requirements: - host: - # - {{ compiler('c') }}={{ linux_compiler_version }} # [linux] - # - {{ compiler('c') }}={{ macos_compiler_version }} # [osx] + run: + - {{ compiler('c') }}={{ linux_compiler_version }} # [linux] + - {{ compiler('c') }}={{ macos_compiler_version }} # [osx] - {{ compiler('cxx') }}={{ linux_compiler_version }} # [linux] - {{ compiler('cxx') }}={{ macos_compiler_version }} # [osx] - openmpi @@ -25,17 +25,6 @@ requirements: - kokkos=4.1 - hdf5=*=mpi_openmpi_* - elements - run: - # - {{ compiler('c') }}={{ linux_compiler_version }} # [linux] - # - {{ compiler('c') }}={{ macos_compiler_version }} # [osx] - # - {{ compiler('cxx') }}={{ linux_compiler_version }} # [linux] - # - {{ compiler('cxx') }}={{ macos_compiler_version }} # [osx] - - openmpi - - fierro-heffte - - fftw=*=mpi_openmpi_* - - kokkos=4.1 - - hdf5=*=mpi_openmpi_* - - elements about: home: https://github.com/lanl/Fierro diff --git a/.conda/evpfft/cpu/build.sh b/.conda/evpfft/cpu/build.sh index a6bd71c8b..1080b894f 100755 --- a/.conda/evpfft/cpu/build.sh +++ b/.conda/evpfft/cpu/build.sh @@ -1,12 +1,13 @@ # Patch the cxx variables for cross-compilation source "$RECIPE_DIR/../../cross-compile-setup.sh" + #-D VECTOR_ARCH_FLAGS="$VECTOR_ARCH_FLAGS" \ + cd src/EVPFFT mkdir build cd build cmake ../src/ \ -D CMAKE_INSTALL_PREFIX:PATH=$PREFIX \ - -D VECTOR_ARCH_FLAGS="$VECTOR_ARCH_FLAGS" \ -D USE_FFTW=1 \ $CMAKE_ARGS \ -D CMAKE_CXX_FLAGS="$PATCHED_CXXFLAGS" \ diff --git a/.conda/evpfft/cpu/meta.yaml b/.conda/evpfft/cpu/meta.yaml index 1fe23e817..f49f13168 100644 --- a/.conda/evpfft/cpu/meta.yaml +++ b/.conda/evpfft/cpu/meta.yaml @@ -3,7 +3,7 @@ {% set macos_compiler_version = "16" %} package: - name: evpfft + name: fierro-evpfft-cpu version: {{ version }} source: diff --git a/.conda/evpfft/cuda/conda_build_config.yaml b/.conda/evpfft/cuda/conda_build_config.yaml new file mode 100644 index 000000000..8ef61a34a --- /dev/null +++ b/.conda/evpfft/cuda/conda_build_config.yaml @@ -0,0 +1,8 @@ +c_compiler: + - gcc +cxx_compiler: + - gxx +target_platform: + - linux-64 + #- linux-aarch64 + #- linux-ppc64le diff --git a/.conda/evpfft/cuda/meta.yaml b/.conda/evpfft/cuda/meta.yaml index 758bd077f..07478e41c 100644 --- a/.conda/evpfft/cuda/meta.yaml +++ b/.conda/evpfft/cuda/meta.yaml @@ -3,7 +3,7 @@ {% set macos_compiler_version = "16" %} package: - name: evpfft-cuda + name: fierro-evpfft-cuda version: {{ version }} source: @@ -12,29 +12,34 @@ source: build: number: 1 + noarch: False script_env: - PLATFORM={{ target_platform }} + skip: True # [osx] + skip: False # [linux] requirements: build: - cmake >=3.17.0 + - {{ compiler('c') }}={{ linux_compiler_version }} # [linux] + - {{ compiler('c') }}={{ macos_compiler_version }} # [osx] - {{ compiler('cxx') }}={{ linux_compiler_version }} # [linux] - {{ compiler('cxx') }}={{ macos_compiler_version }} # [osx] - - cuda-compiler + - cuda-toolkit + - kokkos=4.1 - openmpi host: - - cuda-toolkit - openmpi - fierro-heffte-cuda - hdf5=*=mpi_openmpi_* - kokkos=4.1 - - elements + - matar-cuda run: - openmpi - fierro-heffte-cuda - - kokkos=4.1 - hdf5=*=mpi_openmpi_* - - elements + - kokkos=4.1 + - matar-cuda about: home: https://github.com/lanl/Fierro diff --git a/.conda/fierro-dev/cpu/meta.yaml b/.conda/fierro-dev/cpu/meta.yaml index 3ef68df40..b63acd2bb 100644 --- a/.conda/fierro-dev/cpu/meta.yaml +++ b/.conda/fierro-dev/cpu/meta.yaml @@ -3,7 +3,7 @@ {% set macos_compiler_version = "16" %} package: - name: fierro-dev + name: dev-fe-cpu version: {{ version }} build: diff --git a/.conda/fierro-gui/meta.yaml b/.conda/fierro-gui/meta.yaml index 48012ac19..548b93cc8 100644 --- a/.conda/fierro-gui/meta.yaml +++ b/.conda/fierro-gui/meta.yaml @@ -1,5 +1,5 @@ package: - name: fierro_gui + name: fierro-gui version: 1 source: @@ -30,7 +30,15 @@ requirements: test: imports: - fierro_gui - + +about: + home: https://github.com/lanl/Fierro + license: BSD-3-Clause + license_family: BSD + summary: + GUI for the Fierro application, including all dependencies + dev_url: https://github.com/lanl/Fierro + extra: recipe-maintainers: - fierromechanics diff --git a/.conda/fierro/cpu/build.sh b/.conda/fierro/cpu/build.sh index 4e6db1c0b..a7dbe36e7 100755 --- a/.conda/fierro/cpu/build.sh +++ b/.conda/fierro/cpu/build.sh @@ -21,4 +21,4 @@ cmake .. \ -D MPI_CXX_COMPILER="$BUILD_PREFIX/bin/mpicxx" \ -D VECTOR_ARCH_FLAGS="$VECTOR_ARCH_FLAGS" \ -make -j 10 install +make install diff --git a/.conda/fierro/cpu/meta.yaml b/.conda/fierro/cpu/meta.yaml index 2dad0321a..c9cb9bf8d 100644 --- a/.conda/fierro/cpu/meta.yaml +++ b/.conda/fierro/cpu/meta.yaml @@ -7,12 +7,13 @@ #{% set mpi_version = "4.1" %} package: - name: fierro-cpu + name: fierro-fe-cpu version: {{ version }} source: git_url: https://github.com/lanl/Fierro.git git_depth: 1 + git_submodules: false # don't need submodules build: number: 2 diff --git a/.conda/heffte/cpu/build.sh b/.conda/heffte/cpu/build.sh index 946fa6e25..df861fffe 100755 --- a/.conda/heffte/cpu/build.sh +++ b/.conda/heffte/cpu/build.sh @@ -23,6 +23,6 @@ cmake -D CMAKE_BUILD_TYPE:STRING=RELEASE \ -D MPI_C_COMPILER="$BUILD_PREFIX/bin/mpicc" \ -D MPI_CXX_COMPILER="$BUILD_PREFIX/bin/mpicxx" \ -make -j 10 install +make install -source "$RECIPE_DIR/../make-relocatable.sh" \ No newline at end of file +source "$RECIPE_DIR/../make-relocatable.sh" diff --git a/.conda/heffte/cpu/meta.yaml b/.conda/heffte/cpu/meta.yaml index 9b5c10033..1da60b198 100644 --- a/.conda/heffte/cpu/meta.yaml +++ b/.conda/heffte/cpu/meta.yaml @@ -3,7 +3,7 @@ {% set macos_compiler_version = "16" %} package: - name: fierro-heffte + name: heffte-cpu version: {{ version }} source: @@ -35,7 +35,7 @@ about: license_family: BSD license_file: LICENSE summary: - LANL Fierro's dependency for EVPFFT solutions + LANL Fierro's dependency for EVPFFT solver description: Fierro (LANL code number C21030) is a modern C++ code designed to simulate quasi-static solid mechanics problems and transient, compressible material dynamic problems with Lagrangian methods, diff --git a/.conda/heffte/cuda/build.sh b/.conda/heffte/cuda/build.sh index 26a7b1d7c..a26d874db 100755 --- a/.conda/heffte/cuda/build.sh +++ b/.conda/heffte/cuda/build.sh @@ -7,35 +7,35 @@ export MPI_FLAGS="--allow-run-as-root" if [ $(uname) == Linux ]; then export MPI_FLAGS="$MPI_FLAGS;-mca;plm;isolated" -# export CUDACXX=$(which nvcc) + export CUDACXX=$(which nvcc) fi source "$RECIPE_DIR/../../cross-compile-setup.sh" -export OMPI_CXX=nvcc +export OMPI_CXX=$(which nvcc) # Only do this for cross compiling -#if [ "$PLATFORM" != "linux-64" ] ; then -# export NVCC_PREPEND_FLAGS="-ccbin $CXX"; -#fi +if [ "$PLATFORM" != "linux-64" ] ; then + export NVCC_PREPEND_FLAGS="-ccbin $CXX"; +fi # These things need to be set for certain cmake versions. # The cmake CUDA compiler tests need to see the host env libs export LD_LIBRARY_PATH="$LD_LIBRARY_PATH $PREFIX/lib" export LIBRARIES="$LIBRARIES \"-L$PREFIX/lib\"" - #-D CMAKE_CUDA_COMPILER=${CUDACXX} \ cmake -D CMAKE_BUILD_TYPE:STRING=RELEASE \ -D BUILD_SHARED_LIBS=ON \ -D CMAKE_INSTALL_PREFIX:PATH=$PREFIX \ -D CMAKE_CXX_STANDARD:STRING=17 \ -D Heffte_ENABLE_CUDA=ON \ -D Heffte_DISABLE_GPU_AWARE_MPI=ON \ + -D CMAKE_CUDA_COMPILER=${CUDACXX} \ + -D CMAKE_CUDA_HOST_LINK_LAUNCHER=$CXX \ $CMAKE_ARGS \ $SRC_DIR \ -D CMAKE_CXX_FLAGS="$PATCHED_CXXFLAGS" \ -# -D MPI_C_COMPILER="$BUILD_PREFIX/bin/mpicc" \ -# -D MPI_CXX_COMPILER="$BUILD_PREFIX/bin/mpicxx" \ -# -D CMAKE_CUDA_HOST_LINK_LAUNCHER=$CXX \ + -D MPI_C_COMPILER="$BUILD_PREFIX/bin/mpicc" \ + -D MPI_CXX_COMPILER="$BUILD_PREFIX/bin/mpicxx" \ -make -j 10 install +make install source "$RECIPE_DIR/../make-relocatable.sh" diff --git a/.conda/heffte/cuda/conda_build_config.yaml b/.conda/heffte/cuda/conda_build_config.yaml new file mode 100644 index 000000000..8ef61a34a --- /dev/null +++ b/.conda/heffte/cuda/conda_build_config.yaml @@ -0,0 +1,8 @@ +c_compiler: + - gcc +cxx_compiler: + - gxx +target_platform: + - linux-64 + #- linux-aarch64 + #- linux-ppc64le diff --git a/.conda/heffte/cuda/legacymeta.txt b/.conda/heffte/cuda/legacymeta.txt new file mode 100644 index 000000000..ba1c2e800 --- /dev/null +++ b/.conda/heffte/cuda/legacymeta.txt @@ -0,0 +1,68 @@ +{% set version = "1.0.0" %} +{% set linux_compiler_version = "12.4.0" %} +{% set macos_compiler_version = "16" %} +{% set cuda_version = "12.4" %} + +package: + name: heffte-cuda + version: {{ version }} + +source: + git_url: https://github.com/icl-utk-edu/heffte.git + git_depth: 1 + +build: + number: 1 + noarch: False + script_env: + - PLATFORM={{ target_platform }} + skip: True # [osx] + skip: False # [linux] + +requirements: + build: + - cmake=3.24 + - {{ compiler('c') }}={{ linux_compiler_version }} # [linux] + - {{ compiler('c') }}={{ macos_compiler_version }} # [osx] + - {{ compiler('cxx') }}={{ linux_compiler_version }} # [linux] + - {{ compiler('cxx') }}={{ macos_compiler_version }} # [osx] + - {{ compiler('fortran') }}={{ linux_compiler_version }} + - openmpi + - cuda-compiler + - cuda-toolkit={{ cuda_version }} + #- cuda-toolkit + # These host CUDA dependencies are definitely overspecified. + # Not sure which ones are totally necessary. + host: + - cuda-cudart-static={{ cuda_version }} # Make sure your nvcc version and cudart versions are the same + - cuda-compiler + #- cuda-cudart-static + - cuda-toolkit + - libcusolver-dev + - libcufft-dev + - libcublas-dev + - libcusparse-dev + - openmpi + run: + - cuda-cudart + - libcufft + - libcublas + - openmpi + +about: + home: https://github.com/lanl/Fierro + license: BSD-3-Clause + license_family: BSD + license_file: LICENSE + summary: + LANL Fierro's dependency for EVPFFT solver + description: + Fierro (LANL code number C21030) is a modern C++ code designed to simulate quasi-static + solid mechanics problems and transient, compressible material dynamic problems with Lagrangian methods, + which have meshes with constant mass elements that move with the material, + or with Eulerian methods, which have stationary meshes. + dev_url: https://github.com/lanl/Fierro + +extra: + recipe-maintainers: + - fierromechanics diff --git a/.conda/heffte/cuda/meta.yaml b/.conda/heffte/cuda/meta.yaml index 723c9ebfd..9fdc579bf 100644 --- a/.conda/heffte/cuda/meta.yaml +++ b/.conda/heffte/cuda/meta.yaml @@ -1,10 +1,10 @@ {% set version = "1.0.0" %} -{% set linux_compiler_version = "12.4.0" %} +{% set linux_compiler_version = "10.4.0" %} {% set macos_compiler_version = "16" %} -#{% set cuda_version = "12.5" %} +{% set cuda_version = "12.4" %} package: - name: fierro-heffte-cuda + name: heffte-cuda version: {{ version }} source: @@ -21,33 +21,21 @@ build: requirements: build: - - cmake >=3.17.0 - - {{ compiler('c') }}={{ linux_compiler_version }} # [linux] - - {{ compiler('c') }}={{ macos_compiler_version }} # [osx] - - {{ compiler('cxx') }}={{ linux_compiler_version }} # [linux] - - {{ compiler('cxx') }}={{ macos_compiler_version }} # [osx] - - {{ compiler('fortran') }}={{ linux_compiler_version }} - - openmpi - # - cuda-compiler - # - cuda-toolkit={{ cuda_version }} + - cmake=3.24 + - {{ compiler('c') }} ={{ linux_compiler_version }} + - {{ compiler('cxx') }} ={{ linux_compiler_version }} - cuda-toolkit - # These host CUDA dependencies are definitely overspecified. - # Not sure which ones are totally necessary. + - openmpi host: - #- cuda-cudart-static={{ cuda_version }} # Make sure your nvcc version and cudart versions are the same - - cuda-compiler - - cuda-cudart-static - - cuda-toolkit - - libcusolver-dev - - libcufft-dev + - cuda-cudart-dev - libcublas-dev - - libcusparse-dev - - openmpi >=4.1.6,<5.0a0 + - libcufft-dev + - openmpi run: - cuda-cudart - libcufft - libcublas - - openmpi >=4.1.6,<5.0a0 + - openmpi about: home: https://github.com/lanl/Fierro @@ -55,7 +43,7 @@ about: license_family: BSD license_file: LICENSE summary: - LANL Fierro's dependency for EVPFFT solutions + LANL Fierro's dependency for EVPFFT solver description: Fierro (LANL code number C21030) is a modern C++ code designed to simulate quasi-static solid mechanics problems and transient, compressible material dynamic problems with Lagrangian methods, diff --git a/.conda/legacy_packages/README.md b/.conda/legacy_packages/README.md new file mode 100644 index 000000000..46e331f15 --- /dev/null +++ b/.conda/legacy_packages/README.md @@ -0,0 +1,213 @@ +# Building Anaconda Packages +This folder holds some recipies and shared scripts for building several anaconda packages. The end goal is to distribute EVPFFT and Fierro for several CPU architecture, OS and GPU combinations. + +## Primer on Anaconda + +### Anaconda Environments +Anaconda primarily functions by creating an environment that mirrors your OS's system folder structure inside a user owned folder. If you are on linux-64 and have a root folder stucture that looks like: + +``` +/bin +/lib +/include +/etc +/var +/cmake +... +``` +Then when you make an Anaconda environment, it will have a similar structure: +``` +~/anaconda3/envs/MyEnv/bin +~/anaconda3/envs/MyEnv/lib +~/anaconda3/envs/MyEnv/include +~/anaconda3/envs/MyEnv/etc +~/anaconda3/envs/MyEnv/var +~/anaconda3/envs/MyEnv/cmake +... +``` + +Then, when you activate an Anaconda environment, it will set several environment variables that means that your terminal and tools launched from your terminal will look in the Anaconda environment folders first to find things. + +### Packages +Anaconda is a "package" manager that hooks into a couple of opensource package distribution streams. A "package" in Anaconda is a collection of files, with relative file structure, and some metadata. The metadata primarily covers two things: +1. What the version, build number, and name of the of the package is. +2. What *other* packages this one depends on (i.e. is required to be installed in the system for this package to function as expected) + +The packages built and used in this repository come in 2 flavors: native, and system agnostic (re: "noarch"). + +#### Native Packages +The native packages in this repo are all C++/C/Fortran packages that are compiled and managed by CMake. These are installed into a system via "install" targets generated by the CMake commands and running `make install`. This generally means that the relative folder structure of the package consists of a `/bin`, `/lib[64]`[^1] and `/include` folders. The `/include` folder contains all of the header files for C/C++, while the `/lib` and `/bin` folders contain architecture/OS specific libraries and executable binaries, respectively. + +[^1]: Whether the folder is called "lib" or "lib64" is usually a choice made by the compiler used. + +#### Noarch Packages +While it is possible to have hardware agnostic packages that *aren't* python based, ours are. These packages consist of python modules that are installed under `/lib/python$VERSION/site-packages/`. Anaconda has special handling for *noarach* python packages and will install the python module into the currently active python folder without you having to specify the version. + +### Distribution Streams +These packages are almost always obtained through an anaconda *channel*. A *channel* is a web hosted repository of packages. There are 3 main channels/types of channels: +1. defaults -- The default channel included with Anaconda +2. conda-forge -- A community led, opensource channel containing more niche packages +3. user channels -- Each user with an account on Anaconda.org has their own public channel + +When you run `conda install X` anaconda will look at the configured channels for `X` and its dependencies. You can change the configured channels by editing your `~/condarc.yaml` file or by appending `... -c ` to your install command. + +### Anaconda Build System +Anaconda also has a build system, with conda-build, for creating the target packages. conda-build takes a *recipe* (instructions on what the package is and how to build it) and creates a package. This package can then be uploaded to a channel. + +The build recipe for a package is a folder that usually contains the following: +``` +/build.sh -- Bash script to build and install your package into your local system +/bld.bat -- If building on Windows systems +/LICENSE +/meta.yaml -- Metadata about the package +/conda_build_config.yaml -- Metadata for conda-build +``` + +When conda-build goes to build your package, it will create two temporary environments in which to compile/install your code - a *build* and *host* environment. These will exist under `~/anaconda3/conda-bld/` and can be deleted with `conda build purge`. The *build* environment contains the compilers and build tools that need to run on the build system. The *host* environment, on the other hand, contains the packages that your program can link against. This distinction exists to support cross-compiling, where the *host* system contains binaries that are uninterpretable by the *build* system. + +If the `build.sh` script runs successfully, your program should be installed into the *host* environment. Anaconda then looks at this environment to see what changed, and collects the new build artifacts that you generated to put into a package. + +## Our Packages +When creating these recipes for our packages, a few things needed to be solved beyond the most basic Anaconda packages: +1. Compiling and installing C++ +2. Building native packages for several OS + CPU architecture combinations +3. Cross compiling on both MacOS-arm64 and Linux-64 systems for other CPU architectures +4. Compiling for different GPU hardware +5. Distributing native hardware Python extensions + +### Compiling C++ Packages +To make valid C++ packages all that is necessary is to define an appropriate CMake *install* target, such that `make install` will relocate the correct files/binaries. Most robust CMake projects support this already and there are plenty of example of doing this. However, we need to change our typical `cmake` command to include the following additional arguments: `-DCMAKE_INSTALL_PREFIX=$PREFIX $CMAKE_ARGS`. When using conda-bld, the `$PREFIX` variable tells you where Anaconda wants you to install your package. Similarly, the `$CMAKE_ARGS` variable contains several arguments that point CMake to the correct[^2] versions of several compiler related binaries. + +The only thing left to consider is linking. To make a valid package, all of the libraries that your project links to must be included in the *host* system, and be located exactly where you project expects. This means either the dependencies are all Anaconda packages themselves, or in a very narrow set of circumstances some system libraries can reliably be found in the host system. + +For this repo, we had to create a couple of dependency packages for distribution: Heffte, Trilinos, Elements. + +[^2]: The correct ones may not be the ones you expect if you are cross compiling. + +### Cross Compiling +Anaconda has robust support for cross compiling within an operating system. It has two tools that are essentially to successfully cross-compiling: the build matrix and compiler packages. The build matrix is a combination of variants listed in the `conda_build_config.yaml` file. This file contains a list of arbitrary keys that map to lists and instructs conda-build to run multiple times with different configurations. In the case of *our* build config file (`build_variants.yaml`), it looks the following on linux: +```yaml +c_compiler: + - gcc +cxx_compiler: + - gxx +target_platform: + - linux-64 + - linux-aarch64 + - linux-ppc64le +``` + +When `conda-build` is run and given this config file, it will take the cartesian product of each list of options and run conda-build for each one. In this case, it will run with the following configurations: +```yaml +{ c_compiler: gcc, cxx_compiler: gxx, target_platform: linux-64 } +{ c_compiler: gcc, cxx_compiler: gxx, target_platform: linux-aarch64 } +{ c_compiler: gcc, cxx_compiler: gxx, target_platform: linux-ppc64le } +``` + +In general, the keys can be anything you want. However, these three keys happen to be recognized by anaconda functionality. In our C++ package meta.yaml files, we have the following specified as a *build* dependency: `{{ compiler('cxx') }}`. This is a special template variable that gets compiled into the package name: `$cxx_compiler _ $target_platform`. Additionally, there are several packages on the Anaconda defaults channel named things like `gxx_linux-64` or `gxx_linux-aarch64`. These packages contain gxx, AR, ld, CPPFILT, and other compiler tools that go into cross compiling from your current linux system to the `target_platform`. These compiler packages are what allow us to create binaries that contain other machine instructions other than what our machine can interpret. + +Note: It is possible to cross compile across operating systems, but it is typically more work than its worth and can occasionally require a system with the target OS on hand anyway. + +#### Architecture flags +Anaconda injects a few optimization flags into CXXFLAGS. Additionally, some of our packages contain compiler flags that instructs the compiler to apply vectorization optimizations. To ensure our builds are as portable as possible, we have a script for patching those flags to ensure that we are creating binaries with valid machine instructions for all kinds of CPU hardware. This is located under `/.conda/patch_conda_cxxflags.sh` and exports the variables: `PATCHED_CXXFLAGS` and `VECTOR_ARCH_FLAGS`. + + +#### Exit Codes +CMake supports running test code to see if the compilation of dependent modules completed successfully. However, if we are cross compiling, it is impossible for us to execute the compiled code. As a result, it will always fail. To circumvent this, we override the results of those tests with valid exit codes. This can be seen in the Trilinos CPU and CUDA packages -- +``` +cmake ... + ... + -D HAVE_TEUCHOS_LAPACKLARND=0 \ + -D HAVE_TEUCHOS_BLASFLOAT=0 \ + -D HAVE_GCC_ABI_DEMANGLE=0 \ + -D KOKKOSKERNELS_TPL_BLAS_RETURN_COMPLEX_EXITCODE=0 \ + -D KK_BLAS_RESULT_AS_POINTER_ARG_EXITCODE=0 \ +``` +Here, we hardcode the exit codes of those test scripts to be 0 (valid), which allows the build to continue. + +### Building for different OSs +We need to build these packages for both Linux and MacOS. However, we don't always have reliable access to both kinds of machines. To make these builds, we rely on CI/CD tools via Github Actions to run our builds on both Linux and MacOS systems. For more details, checkout the `.github` folder. + +### Compiling for GPU Hardware +Anaconda is able to detect the presence of GPU hardware through virtual packages. These are small system packages that can run some code to determine if the necessary hardware + drivers are installed. In the case of NVIDIA, the package is called `__cuda` and will be present in your system if you have the capability of running CUDA code. This package is actually what Kokkos uses to key off of to determine what version of Kokkos to install. However, we have opted instead to have separate packages with the "-cuda" or "-hip" suffix depending on how it was compiled. + +In the case of CUDA, we get our package dependencies from the [nvidia](https://anaconda.org/nvidia/repo) anaconda channel. Here we need two kinds of packages, the NVCC compiler tools found in the cuda-toolkit package as well as the runtime dependencies like `libcufft-dev` or `libcublas-dev`. The `cuda-toolkit` package goes into the *build* dependencies while the runtime libraries go into the *host* dependencies. + +#### Cross Compiling CUDA +When compiling CUDA kernels with `nvcc`, the default behavior is to search your local system for CUDA supported hardware and compile for that hardware target. However, in our cases, we typically want to compile either from a machine that doesn't have a CUDA GPU at all, or for a more general audience of machines. This is done by asking `nvcc` to generate code that is compatible with a relatively general set of CUDA GPUs. To control this, we have `gencode`, and `arch` compiler flags[^3]. For our purposes, we target "sm_50" (Maxwell), because Kokkos can only compile for a single architecture target at once[^4]. The `arch` flag controls which hardware target the PTX code is compiled for natively, while the `gencode` flag controls which targets PTX code is generated for. If you don't compile the PTX for a target GPU, but did generate the PTX for it, the code will be JIT'ed at runtime, incurring a ~small performance cost. + +[^3]: More information can be found [here](https://stackoverflow.com/questions/35656294/cuda-how-to-use-arch-and-code-and-sm-vs-compute). +[^4]: For more details on compute compatibility, see [this post](https://arnon.dk/matching-sm-architectures-arch-and-gencode-for-various-nvidia-cards/). + +#### Trilinos/Kokkos CUDA +When compiling Kokkos with a CUDA backend (and by extension Trilinos), a compiler wrapper...wrapper is provided (`nvcc_wrapper`). All this does is change some compiler flags from ones that are not supported by `nvcc` to ones that are. The important thing here is that we set the correct variables to specify the internal compilers for each wrapper we use. In the case of Trilinos, we need to use 3 compiler wrappers: MPI, nvcc_wrapper, and nvcc. To ensure that these wrappers end up wrapping the right compilers, we set `OMPI_CXX=nvcc_wrapper` so that `mpicxx` calls `nvcc_wrapper`. `nvcc_wrapper` already calls `nvcc`, but we need to set `NVCC_WRAPPER_DEFAULT_COMPILER=$GXX` so `nvcc_wrapper` gives `nvcc` the right compiler and `nvcc` ultimately calls `$GXX`, which is set by Anaconda to the appropriate build compiler/cross compiler. To get Kokkos to set the right `arch` flag, we use the CMake variable `Kokkos_ARCH_MAXWELL50=ON`. + +### Native Python Extensions +Lastly, we need to compile C++ into Python extensions to offer a python interface to some of our C++ programs. For details on how that build works and an example, see `/python/Voxelizer`. But here we will just discuss the packaging considerations. These are python libraries, but unlike other python libraries, they contain native machine code and are potentially cross compiled. So instead of specifying `python` as a *host* dependency, we specify `python`, `pybind11` and a c++ compiler as build dependencies. + +We then use the locally install `pybind11` to build the python package. As a minor modification to our build script, `pip install .` would install the package into the *build* environment, so we use `pip install . --prefix=$PREFIX` to tell our local pip to install the pacakge into the *host* environment for Anaconda to pick it up. Additionally, since this method installs into a specific `/lib/python*.*/` folder, and the python ABI can change between each minor version, we have to build the native python package for all supported python minor versions separately. With our voxelizer, we are doing this by adding in more things to the conda build matrix. We additionally specify another conda_build_config.yaml file like this: +```yaml +python: + - 3.8 + - 3.9 + - 3.10 + - 3.11 + - 3.12 +``` +This will tell conda-build to do all of the build configurations specified by our `build_variants.yaml` file for each of the python versions listed here. At the time of writing, this package is compiled 25 times, for MacOS (64 and arm64), Linux (64, arm64, powerpc) and for each python version listed here. All of these packages are then hosted on Anaconda.org, and the user gets whichever one makes sense for their environemnt automatically. Lastly, we ensure that these python versions get used in our `meta.yaml` recipy file by specifying `python={{ python }}` for build, host and runtime dependencies. + + +### Metapackages +Metapackages are packages that contain no installable content or build instructions, but only contain metadata. The can range from completely useless to useful shortcuts for pulling in a number of packages, or complicated/specific package dependencies. We use metapackages to make it easy to set up the development environments for Fierro and EVPFFT. Our dev packages (Fierro-dev, EVPFFT-dev) only contain runtime dependencies, and are created so you can run something like: +``` +conda create -n fierro-dev fierro-dev -c fierromechanics -c conda-forge +conda activate fierro-dev +``` +And then you have all of the dependencies necessary to successfully build Fierro from source. + +These packages are `noarch: generic` packages, because they don't contain any architecture/OS specific build artifacts themselves. Whether or not you can install them on your system depends solely on the dependencies being available. + + +## Debugging Tips +Anaconda packages are great when they work, but debugging them can be a pain, since it takes so long (relatively) to initailize the build environment. If you find yourself having to debug a conda package, don't waste time and follow these tips: + + +### Inspect the build/host environments. +The intermediate build environments created can be found under `~/anaconda3/conda-bld/`. These are cleaned up if the build is successful, but are left for inspecting if it fails. Your intermediate environemnts might look something like `~/mambaforge/conda-bld/fierro-cpu_1702931506301`, and ones that are still around can be uncovered by running `conda env list`: +``` +# conda environments: +# + ~/anaconda3 +base * ~/mambaforge + ~/mambaforge/conda-bld/cross-apple-test_1699913171912/_build_env + ~/mambaforge/conda-bld/fierro-cpu_1702931083445/_build_env + ~/mambaforge/conda-bld/fierro-cpu_1702931506301/_build_env + ~/mambaforge/conda-bld/fierro-evpfft_1700005728459/_build_env + ~/mambaforge/conda-bld/fierro-heffte-cuda_1702567877996/_build_env + ~/mambaforge/conda-bld/fierro-heffte-cuda_1702568248715/_build_env + ~/mambaforge/conda-bld/fierro-heffte-cuda_1702569485778/_build_env + ~/mambaforge/conda-bld/fierro-heffte-cuda_1702571726755/_build_env + ~/mambaforge/conda-bld/fierro-heffte-cuda_1702572653009/_build_env + ~/mambaforge/conda-bld/fierro-heffte-cuda_1702573356532/_build_env + ~/mambaforge/conda-bld/fierro-heffte-cuda_1702581207071/_build_env + ~/mambaforge/conda-bld/fierro-heffte-cuda_1702582399999/_build_env + ~/mambaforge/conda-bld/fierro-voxelizer-py_1700001705130/_build_env + ~/mambaforge/conda-bld/fierro-voxelizer-py_1700003960166/_build_env + ~/mambaforge/conda-bld/fierro-voxelizer-py_1700006765747/_build_env +EVPFFT_MATAR ~/mambaforge/envs/EVPFFT_MATAR +... ... + +``` + +Under that build folder you will find 3 relevant things: +1. `_build_env` -- The environment where your "build" dependencies get installed (aka `$BUILD_PREFIX`) +2. `_h_env_placehold_placehold_placehold_placehold_placehold...` -- The environment where your "host" dependencies get installed, and where you install your package (aka `$PREFIX`). +3. `work` -- Where your source files are placed + where `conda_build.sh` (the exact script that is run) can be found. + +You can activate each of these environments or just inspect the installed packages with `conda list -p `. + +### Modify and rebuild under `work` +If you think you identified the issue, don't go back and try the package build again. First modify the intermediate build files and try the rebuild from there. If you think you are missing a host dependency, for example, run `conda install -p ` and rerun `work/conda_build.sh` to see if that fixes it. If you think you need to modify the build script, just change `conda_build.sh` and rerun. Once the package builds successfully, make sure to make you changes to the original `meta.yaml` and/or `build.sh` files and then try the package build again. + +### Targetting Cross Compiling +If you are having issues with the cross-compiling build targets, you can speicfically target just those by adding `--variants "{ target_platform: linux-aarch64 }"`. If you are using the `.conda/build_variants.yaml` file, you will need to comment out the variants you don't want to test. \ No newline at end of file diff --git a/.conda/legacy_packages/build_variants.yaml b/.conda/legacy_packages/build_variants.yaml new file mode 100644 index 000000000..97c094d43 --- /dev/null +++ b/.conda/legacy_packages/build_variants.yaml @@ -0,0 +1,16 @@ +# These "# [...]" comments are functional. +# They enable the line when the thing in [...] is a valid python expression that +# evaluates to True. linux and osx are variables provided to us and set to True if +# we are running conda-build on a Linux OS or MacOS, respectively. +c_compiler: + - gcc # [linux] + - clang # [osx] +cxx_compiler: + - gxx # [linux] + - clangxx # [osx] +target_platform: + - linux-64 # [linux] + - linux-aarch64 # [linux] + - linux-ppc64le # [linux] + - osx-64 # [osx] + - osx-arm64 # [osx] \ No newline at end of file diff --git a/.conda/legacy_packages/cross-compile-setup.sh b/.conda/legacy_packages/cross-compile-setup.sh new file mode 100644 index 000000000..f1f86a67e --- /dev/null +++ b/.conda/legacy_packages/cross-compile-setup.sh @@ -0,0 +1,6 @@ +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +source "${SCRIPT_DIR}/patch_conda_cxxflags.sh" +# Make sure the MPI wrappers find the right compilers +export OMPI_CC=$CC +export OMPI_CXX=$CXX +export OMPI_FC=$FC \ No newline at end of file diff --git a/.conda/legacy_packages/cross-linux.cmake b/.conda/legacy_packages/cross-linux.cmake new file mode 100644 index 000000000..7049d80d5 --- /dev/null +++ b/.conda/legacy_packages/cross-linux.cmake @@ -0,0 +1,20 @@ +# this one is important +set(CMAKE_SYSTEM_NAME Linux) +set(CMAKE_PLATFORM Linux) +#this one not so much +set(CMAKE_SYSTEM_VERSION 1) + +# specify the cross compiler +set(CMAKE_C_COMPILER $ENV{CC}) + +# where is the target environment +set(CMAKE_FIND_ROOT_PATH $ENV{PREFIX} $ENV{BUILD_PREFIX}/$ENV{HOST}/sysroot) + +# search for programs in the build host directories +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +# for libraries and headers in the target directories +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) + +# god-awful hack because it seems to not run correct tests to determine this: +set(__CHAR_UNSIGNED___EXITCODE 1) \ No newline at end of file diff --git a/.conda/legacy_packages/elements/LICENSE b/.conda/legacy_packages/elements/LICENSE new file mode 100644 index 000000000..698d6edf2 --- /dev/null +++ b/.conda/legacy_packages/elements/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2021, Los Alamos National Laboratory +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/.conda/legacy_packages/elements/build.sh b/.conda/legacy_packages/elements/build.sh new file mode 100755 index 000000000..7f8140909 --- /dev/null +++ b/.conda/legacy_packages/elements/build.sh @@ -0,0 +1,22 @@ +export SRC_DIR=$(pwd) +echo ${SRC_DIR} +mkdir -p build +cd build + +export MPI_FLAGS="--allow-run-as-root" + +if [ $(uname) == Linux ]; then + export MPI_FLAGS="$MPI_FLAGS;-mca;plm;isolated" +fi + +source "$RECIPE_DIR/../cross-compile-setup.sh" + +cmake -D CMAKE_BUILD_TYPE:STRING=RELEASE \ + -D CMAKE_INSTALL_PREFIX:PATH=$PREFIX \ + -D CMAKE_CXX_STANDARD:STRING=17 \ + -D VECTOR_ARCH_FLAGS="$VECTOR_ARCH_FLAGS" \ + $CMAKE_ARGS \ + $SRC_DIR \ + -D CMAKE_CXX_FLAGS="$PATCHED_CXXFLAGS" \ + +make -j 10 install \ No newline at end of file diff --git a/.conda/legacy_packages/elements/meta.yaml b/.conda/legacy_packages/elements/meta.yaml new file mode 100644 index 000000000..a3b2cde6a --- /dev/null +++ b/.conda/legacy_packages/elements/meta.yaml @@ -0,0 +1,41 @@ +{% set version = "1.0.0" %} +{% set linux_compiler_version = "10.4.0" %} +{% set macos_compiler_version = "16" %} + +package: + name: elements + version: {{ version }} + +source: + - git_url: https://github.com/lanl/ELEMENTS.git + git_depth: 1 + +build: + number: 1 + noarch: False + script_env: + - PLATFORM={{ target_platform }} # [linux] + +requirements: + build: + - cmake >=3.10.0 + - {{ compiler('cxx') }}={{ linux_compiler_version }} # [linux] + - {{ compiler('cxx') }}={{ macos_compiler_version }} # [osx] + +about: + home: https://github.com/lanl/Fierro + license: BSD-3-Clause + license_family: BSD + license_file: LICENSE + summary: + LANL's software for simulating quasi-static solid mechanics. + description: + Fierro (LANL code number C21030) is a modern C++ code designed to simulate quasi-static + solid mechanics problems and transient, compressible material dynamic problems with Lagrangian methods, + which have meshes with constant mass elements that move with the material, + or with Eulerian methods, which have stationary meshes. + dev_url: https://github.com/lanl/Fierro + +extra: + recipe-maintainers: + - fierromechanics diff --git a/.conda/empty.yaml b/.conda/legacy_packages/empty.yaml similarity index 100% rename from .conda/empty.yaml rename to .conda/legacy_packages/empty.yaml diff --git a/.conda/legacy_packages/evpfft-dev/cpu/meta.yaml b/.conda/legacy_packages/evpfft-dev/cpu/meta.yaml new file mode 100644 index 000000000..3f9a6ef5c --- /dev/null +++ b/.conda/legacy_packages/evpfft-dev/cpu/meta.yaml @@ -0,0 +1,48 @@ +{% set version = "1.0.0" %} +{% set linux_compiler_version = "10.4.0" %} +{% set macos_compiler_version = "16" %} + +package: + name: evpfft-dev + version: {{ version }} + +build: + number: 1 + noarch: generic + skip: True # [not (linux and x86_64)] + script_env: + - PLATFORM={{ target_platform }} + +requirements: + host: + # - {{ compiler('c') }}={{ linux_compiler_version }} # [linux] + # - {{ compiler('c') }}={{ macos_compiler_version }} # [osx] + - {{ compiler('cxx') }}={{ linux_compiler_version }} # [linux] + - {{ compiler('cxx') }}={{ macos_compiler_version }} # [osx] + - openmpi + - fierro-heffte + - fftw=*=mpi_openmpi_* + - kokkos=4.1 + - hdf5=*=mpi_openmpi_* + - elements + run: + # - {{ compiler('c') }}={{ linux_compiler_version }} # [linux] + # - {{ compiler('c') }}={{ macos_compiler_version }} # [osx] + # - {{ compiler('cxx') }}={{ linux_compiler_version }} # [linux] + # - {{ compiler('cxx') }}={{ macos_compiler_version }} # [osx] + - openmpi + - fierro-heffte + - fftw=*=mpi_openmpi_* + - kokkos=4.1 + - hdf5=*=mpi_openmpi_* + - elements + +about: + home: https://github.com/lanl/Fierro + summary: This is a metapackage for EVPFFT developers. Installing this package gives you all the dependencies necessary to build EVPFFT from source. + description: + dev_url: https://github.com/lanl/Fierro + +extra: + recipe-maintainers: + - fierromechanics diff --git a/.conda/evpfft-gui/meta.yaml b/.conda/legacy_packages/evpfft-gui/meta.yaml similarity index 100% rename from .conda/evpfft-gui/meta.yaml rename to .conda/legacy_packages/evpfft-gui/meta.yaml diff --git a/.conda/legacy_packages/evpfft/cpu/LICENSE b/.conda/legacy_packages/evpfft/cpu/LICENSE new file mode 100644 index 000000000..698d6edf2 --- /dev/null +++ b/.conda/legacy_packages/evpfft/cpu/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2021, Los Alamos National Laboratory +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/.conda/legacy_packages/evpfft/cpu/build.sh b/.conda/legacy_packages/evpfft/cpu/build.sh new file mode 100755 index 000000000..a6bd71c8b --- /dev/null +++ b/.conda/legacy_packages/evpfft/cpu/build.sh @@ -0,0 +1,16 @@ +# Patch the cxx variables for cross-compilation +source "$RECIPE_DIR/../../cross-compile-setup.sh" + +cd src/EVPFFT +mkdir build +cd build +cmake ../src/ \ + -D CMAKE_INSTALL_PREFIX:PATH=$PREFIX \ + -D VECTOR_ARCH_FLAGS="$VECTOR_ARCH_FLAGS" \ + -D USE_FFTW=1 \ + $CMAKE_ARGS \ + -D CMAKE_CXX_FLAGS="$PATCHED_CXXFLAGS" \ + -D CMAKE_CXX_COMPILER=$BUILD_PREFIX/bin/mpicxx \ + -D CMAKE_C_COMPILER=$BUILD_PREFIX/bin/mpicc \ + +make install diff --git a/.conda/legacy_packages/evpfft/cpu/meta.yaml b/.conda/legacy_packages/evpfft/cpu/meta.yaml new file mode 100644 index 000000000..1fe23e817 --- /dev/null +++ b/.conda/legacy_packages/evpfft/cpu/meta.yaml @@ -0,0 +1,55 @@ +{% set version = "1.0.0" %} +{% set linux_compiler_version = "10.4.0" %} +{% set macos_compiler_version = "16" %} + +package: + name: evpfft + version: {{ version }} + +source: + git_url: https://github.com/lanl/Fierro.git + git_depth: 1 + +build: + number: 1 + script_env: + - PLATFORM={{ target_platform }} + +requirements: + build: + - cmake >=3.17.0 + - make + - {{ compiler('c') }}={{ linux_compiler_version }} # [linux] + - {{ compiler('c') }}={{ macos_compiler_version }} # [osx] + - {{ compiler('cxx') }}={{ linux_compiler_version }} # [linux] + - {{ compiler('cxx') }}={{ macos_compiler_version }} # [osx] + - openmpi + host: + - openmpi + - fierro-heffte + - fftw=*=mpi_openmpi_* + - kokkos=4.1 + - hdf5=*=mpi_openmpi_* + - elements + run: + - openmpi + - fierro-heffte + - fftw=*=mpi_openmpi_* + - kokkos=4.1 + - hdf5=*=mpi_openmpi_* + - elements + +#TODO: Add tests + +about: + home: https://github.com/lanl/Fierro + license: BSD-3-Clause + license_family: BSD + license_file: LICENSE + summary: + description: + dev_url: https://github.com/lanl/Fierro + +extra: + recipe-maintainers: + - fierromechanics diff --git a/.conda/legacy_packages/evpfft/cuda/LICENSE b/.conda/legacy_packages/evpfft/cuda/LICENSE new file mode 100644 index 000000000..698d6edf2 --- /dev/null +++ b/.conda/legacy_packages/evpfft/cuda/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2021, Los Alamos National Laboratory +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/.conda/legacy_packages/evpfft/cuda/build.sh b/.conda/legacy_packages/evpfft/cuda/build.sh new file mode 100755 index 000000000..199b3eb46 --- /dev/null +++ b/.conda/legacy_packages/evpfft/cuda/build.sh @@ -0,0 +1,30 @@ +#### +## Notes: +## * You may need to run this with boa's "conda mambabuild" to correctly resolve the dependencies. +## * If you are compiling this on a non-cuda machine, to install the right kokkos package, you need to +## set the CONDA_OVERRIDE_CUDA flag to 12.0 . This will mark __cuda (the cuda virtual package) as installed. +#### + +# Patch the cxx variables for cross-compilation +source "$RECIPE_DIR/../../cross-compile-setup.sh" + +# MPICXX -> nvcc_wrapper -> nvcc -> $GXX +# ^ Passes $NVCC_WRAPPER_DEFAULT_COMPILER as the host compiler to nvcc +# Setting NVCC_WRAPPER_DEFAULT_COMPILER=$GXX enforces that +# nvcc gets the correct compiler for the target platform. +export OMPI_CXX=nvcc_wrapper +export NVCC_WRAPPER_DEFAULT_COMPILER=$GXX + +cd src/EVPFFT +mkdir build +cd build +cmake ../src/ \ + -D CMAKE_INSTALL_PREFIX:PATH=$PREFIX \ + -D USE_CUFFT=1 \ + $CMAKE_ARGS \ + -D CMAKE_CXX_FLAGS="$PATCHED_CXXFLAGS" \ + -D CUDAToolkit_ROOT=$PREFIX/bin \ + -D CMAKE_CXX_COMPILER=$BUILD_PREFIX/bin/mpicxx \ + -D CMAKE_C_COMPILER=$BUILD_PREFIX/bin/mpicc \ + +make install \ No newline at end of file diff --git a/.conda/legacy_packages/evpfft/cuda/meta.yaml b/.conda/legacy_packages/evpfft/cuda/meta.yaml new file mode 100644 index 000000000..758bd077f --- /dev/null +++ b/.conda/legacy_packages/evpfft/cuda/meta.yaml @@ -0,0 +1,50 @@ +{% set version = "1.0.0" %} +{% set linux_compiler_version = "10.4.0" %} +{% set macos_compiler_version = "16" %} + +package: + name: evpfft-cuda + version: {{ version }} + +source: + git_url: https://github.com/lanl/Fierro.git + git_depth: 1 + +build: + number: 1 + script_env: + - PLATFORM={{ target_platform }} + +requirements: + build: + - cmake >=3.17.0 + - {{ compiler('cxx') }}={{ linux_compiler_version }} # [linux] + - {{ compiler('cxx') }}={{ macos_compiler_version }} # [osx] + - cuda-compiler + - openmpi + host: + - cuda-toolkit + - openmpi + - fierro-heffte-cuda + - hdf5=*=mpi_openmpi_* + - kokkos=4.1 + - elements + run: + - openmpi + - fierro-heffte-cuda + - kokkos=4.1 + - hdf5=*=mpi_openmpi_* + - elements + +about: + home: https://github.com/lanl/Fierro + license: BSD-3-Clause + license_family: BSD + license_file: LICENSE + summary: + description: + dev_url: https://github.com/lanl/Fierro + +extra: + recipe-maintainers: + - fierromechanics diff --git a/.conda/legacy_packages/fierro-dev/cpu/meta.yaml b/.conda/legacy_packages/fierro-dev/cpu/meta.yaml new file mode 100644 index 000000000..3ef68df40 --- /dev/null +++ b/.conda/legacy_packages/fierro-dev/cpu/meta.yaml @@ -0,0 +1,48 @@ +{% set version = "1.0.0" %} +{% set linux_compiler_version = "10.4.0" %} +{% set macos_compiler_version = "16" %} + +package: + name: fierro-dev + version: {{ version }} + +build: + number: 1 + noarch: generic + skip: True # [not (linux and x86_64)] + script_env: + - PLATFORM={{ target_platform }} + +requirements: + host: + - cmake >=3.17 + - {{ compiler('c') }}={{ linux_compiler_version }} # [linux] + - {{ compiler('c') }}={{ macos_compiler_version }} # [osx] + - {{ compiler('cxx') }}={{ linux_compiler_version }} # [linux] + - {{ compiler('cxx') }}={{ macos_compiler_version }} # [osx] + - {{ compiler('fortran') }} + - fierro-trilinos-cpu + - mpi + - elements + run: + #- cmake >=3.17 + - {{ compiler('c') }}={{ linux_compiler_version }} # [linux] + - {{ compiler('c') }}={{ macos_compiler_version }} # [osx] + - {{ compiler('cxx') }}={{ linux_compiler_version }} # [linux] + - {{ compiler('cxx') }}={{ macos_compiler_version }} # [osx] + - {{ compiler('fortran') }} + - fierro-trilinos-cpu + - mpi + - elements + +about: + home: https://github.com/lanl/Fierro + license: BSD-3-Clause + license_family: BSD + summary: + Metapackage for consolidating development dependencies for fierro. + dev_url: https://github.com/lanl/Fierro + +extra: + recipe-maintainers: + - fierromechanics diff --git a/.conda/legacy_packages/fierro-gui/meta.yaml b/.conda/legacy_packages/fierro-gui/meta.yaml new file mode 100644 index 000000000..48012ac19 --- /dev/null +++ b/.conda/legacy_packages/fierro-gui/meta.yaml @@ -0,0 +1,36 @@ +package: + name: fierro_gui + version: 1 + +source: + path: ../../ + # - git_url: https://github.com/lanl/Fierro.git + # depth: 1 + +build: + number: 0 + script: cd python/FIERRO-GUI/; python -m pip install . + noarch: python # This is a pure python package. So build for noarch on linux64 + entry_points: + - fierro-gui = fierro_gui.gui:main + skip: true # [not (linux and x86_64)] + skip: false # [linux and x86_64] + +requirements: + host: + - python + - setuptools + run: + - paraview=5.11.2 + - python + - numpy + - matplotlib + - pyside6=6.5 + +test: + imports: + - fierro_gui + +extra: + recipe-maintainers: + - fierromechanics diff --git a/.conda/legacy_packages/fierro/cpu/LICENSE b/.conda/legacy_packages/fierro/cpu/LICENSE new file mode 100644 index 000000000..698d6edf2 --- /dev/null +++ b/.conda/legacy_packages/fierro/cpu/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2021, Los Alamos National Laboratory +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/.conda/legacy_packages/fierro/cpu/build.sh b/.conda/legacy_packages/fierro/cpu/build.sh new file mode 100755 index 000000000..4e6db1c0b --- /dev/null +++ b/.conda/legacy_packages/fierro/cpu/build.sh @@ -0,0 +1,24 @@ +# These flag variables are set by anaconda. +source "$RECIPE_DIR/../../cross-compile-setup.sh" +mkdir build +cd build + +# -D _LIBCPP_DISABLE_AVAILABILITY +# is added to the CXXFLAGS for MacOS builds. +# see https://conda-forge.org/docs/maintainer/knowledge_base.html#newer-c-features-with-old-sdk + +cmake .. \ + -D CMAKE_BUILD_TYPE:STRING=RELEASE \ + -D CMAKE_INSTALL_PREFIX:PATH=$PREFIX \ + -D CMAKE_CXX_STANDARD:STRING=17 \ + -D BUILD_PARALLEL_EXPLICIT_SOLVER=ON \ + -D BUILD_IMPLICIT_SOLVER=ON \ + -D BUILD_ELEMENTS=OFF \ + -D DISTRIBUTION=On \ + $CMAKE_ARGS \ + -D CMAKE_CXX_FLAGS="$PATCHED_CXXFLAGS -fopenmp -D_LIBCPP_DISABLE_AVAILABILITY" \ + -D MPI_C_COMPILER="$BUILD_PREFIX/bin/mpicc" \ + -D MPI_CXX_COMPILER="$BUILD_PREFIX/bin/mpicxx" \ + -D VECTOR_ARCH_FLAGS="$VECTOR_ARCH_FLAGS" \ + +make -j 10 install diff --git a/.conda/legacy_packages/fierro/cpu/meta.yaml b/.conda/legacy_packages/fierro/cpu/meta.yaml new file mode 100644 index 000000000..2dad0321a --- /dev/null +++ b/.conda/legacy_packages/fierro/cpu/meta.yaml @@ -0,0 +1,57 @@ +{% set version = "1.0.0" %} +{% set linux_compiler_version = "10.4.0" %} +{% set macos_compiler_version = "16" %} +# We need the same MPI version in build + host. +# So we have to specify it, unfortunately +# UPDATE: Not necessary right now, perhaps in the future +#{% set mpi_version = "4.1" %} + +package: + name: fierro-cpu + version: {{ version }} + +source: + git_url: https://github.com/lanl/Fierro.git + git_depth: 1 + +build: + number: 2 + script_env: + - PLATFORM={{ target_platform }} + +requirements: + build: + - cmake >=3.17.0 + - {{ compiler('c') }}={{ linux_compiler_version }} # [linux] + - {{ compiler('c') }}={{ macos_compiler_version }} # [osx] + - {{ compiler('cxx') }}={{ linux_compiler_version }} # [linux] + - {{ compiler('cxx') }}={{ macos_compiler_version }} # [osx] + - {{ compiler('fortran') }} + - openmpi + host: + - _openmp_mutex # [linux] + - llvm-openmp # [osx] + - fierro-trilinos-cpu + - elements + - openmpi + run: + - fierro-trilinos-cpu + - openmpi + +about: + home: https://github.com/lanl/Fierro + license: BSD-3-Clause + license_family: BSD + license_file: LICENSE + summary: + LANL's software for simulating quasi-static solid mechanics. + description: + Fierro (LANL code number C21030) is a modern C++ code designed to simulate quasi-static + solid mechanics problems and transient, compressible material dynamic problems with Lagrangian methods, + which have meshes with constant mass elements that move with the material, + or with Eulerian methods, which have stationary meshes. + dev_url: https://github.com/lanl/Fierro + +extra: + recipe-maintainers: + - fierromechanics diff --git a/.conda/legacy_packages/heffte/cpu/LICENSE b/.conda/legacy_packages/heffte/cpu/LICENSE new file mode 100644 index 000000000..698d6edf2 --- /dev/null +++ b/.conda/legacy_packages/heffte/cpu/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2021, Los Alamos National Laboratory +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/.conda/legacy_packages/heffte/cpu/build.sh b/.conda/legacy_packages/heffte/cpu/build.sh new file mode 100755 index 000000000..946fa6e25 --- /dev/null +++ b/.conda/legacy_packages/heffte/cpu/build.sh @@ -0,0 +1,28 @@ +export SRC_DIR=$(pwd) +echo ${SRC_DIR} +mkdir -p build +cd build + +export MPI_FLAGS="--allow-run-as-root" + +if [ $(uname) == Linux ]; then + export MPI_FLAGS="$MPI_FLAGS;-mca;plm;isolated" +fi + +source "$RECIPE_DIR/../../cross-compile-setup.sh" + +# I don't know why, but I couldn't compile for osx-arm64 from osx-64 with shared libs. +cmake -D CMAKE_BUILD_TYPE:STRING=RELEASE \ + -D BUILD_SHARED_LIBS=OFF \ + -D CMAKE_INSTALL_PREFIX:PATH=$PREFIX \ + -D CMAKE_CXX_STANDARD:STRING=17 \ + -D Heffte_ENABLE_FFTW=ON \ + $CMAKE_ARGS \ + $SRC_DIR \ + -D CMAKE_CXX_FLAGS="$PATCHED_CXXFLAGS" \ + -D MPI_C_COMPILER="$BUILD_PREFIX/bin/mpicc" \ + -D MPI_CXX_COMPILER="$BUILD_PREFIX/bin/mpicxx" \ + +make -j 10 install + +source "$RECIPE_DIR/../make-relocatable.sh" \ No newline at end of file diff --git a/.conda/legacy_packages/heffte/cpu/meta.yaml b/.conda/legacy_packages/heffte/cpu/meta.yaml new file mode 100644 index 000000000..9b5c10033 --- /dev/null +++ b/.conda/legacy_packages/heffte/cpu/meta.yaml @@ -0,0 +1,48 @@ +{% set version = "1.0.0" %} +{% set linux_compiler_version = "10.4.0" %} +{% set macos_compiler_version = "16" %} + +package: + name: fierro-heffte + version: {{ version }} + +source: + git_url: https://github.com/icl-utk-edu/heffte.git + git_depth: 1 + +build: + number: 1 + noarch: False + script_env: + - PLATFORM={{ target_platform }} + +requirements: + build: + - cmake >=3.17.0 + - {{ compiler('cxx') }}={{ linux_compiler_version }} # [linux] + - {{ compiler('cxx') }} # [osx] + - openmpi + host: + - openmpi >=4.1.6,<5.0a0 + - fftw + run: + - openmpi >=4.1.6,<5.0a0 + - fftw + +about: + home: https://github.com/lanl/Fierro + license: BSD-3-Clause + license_family: BSD + license_file: LICENSE + summary: + LANL Fierro's dependency for EVPFFT solutions + description: + Fierro (LANL code number C21030) is a modern C++ code designed to simulate quasi-static + solid mechanics problems and transient, compressible material dynamic problems with Lagrangian methods, + which have meshes with constant mass elements that move with the material, + or with Eulerian methods, which have stationary meshes. + dev_url: https://github.com/lanl/Fierro + +extra: + recipe-maintainers: + - fierromechanics diff --git a/.conda/legacy_packages/heffte/cuda/LICENSE b/.conda/legacy_packages/heffte/cuda/LICENSE new file mode 100644 index 000000000..698d6edf2 --- /dev/null +++ b/.conda/legacy_packages/heffte/cuda/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2021, Los Alamos National Laboratory +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/.conda/legacy_packages/heffte/cuda/build.sh b/.conda/legacy_packages/heffte/cuda/build.sh new file mode 100755 index 000000000..26a7b1d7c --- /dev/null +++ b/.conda/legacy_packages/heffte/cuda/build.sh @@ -0,0 +1,41 @@ +export SRC_DIR=$(pwd) +echo ${SRC_DIR} +mkdir -p build +cd build + +export MPI_FLAGS="--allow-run-as-root" + +if [ $(uname) == Linux ]; then + export MPI_FLAGS="$MPI_FLAGS;-mca;plm;isolated" +# export CUDACXX=$(which nvcc) +fi + +source "$RECIPE_DIR/../../cross-compile-setup.sh" + +export OMPI_CXX=nvcc +# Only do this for cross compiling +#if [ "$PLATFORM" != "linux-64" ] ; then +# export NVCC_PREPEND_FLAGS="-ccbin $CXX"; +#fi +# These things need to be set for certain cmake versions. +# The cmake CUDA compiler tests need to see the host env libs +export LD_LIBRARY_PATH="$LD_LIBRARY_PATH $PREFIX/lib" +export LIBRARIES="$LIBRARIES \"-L$PREFIX/lib\"" + + #-D CMAKE_CUDA_COMPILER=${CUDACXX} \ +cmake -D CMAKE_BUILD_TYPE:STRING=RELEASE \ + -D BUILD_SHARED_LIBS=ON \ + -D CMAKE_INSTALL_PREFIX:PATH=$PREFIX \ + -D CMAKE_CXX_STANDARD:STRING=17 \ + -D Heffte_ENABLE_CUDA=ON \ + -D Heffte_DISABLE_GPU_AWARE_MPI=ON \ + $CMAKE_ARGS \ + $SRC_DIR \ + -D CMAKE_CXX_FLAGS="$PATCHED_CXXFLAGS" \ +# -D MPI_C_COMPILER="$BUILD_PREFIX/bin/mpicc" \ +# -D MPI_CXX_COMPILER="$BUILD_PREFIX/bin/mpicxx" \ +# -D CMAKE_CUDA_HOST_LINK_LAUNCHER=$CXX \ + +make -j 10 install + +source "$RECIPE_DIR/../make-relocatable.sh" diff --git a/.conda/legacy_packages/heffte/cuda/meta.yaml b/.conda/legacy_packages/heffte/cuda/meta.yaml new file mode 100644 index 000000000..723c9ebfd --- /dev/null +++ b/.conda/legacy_packages/heffte/cuda/meta.yaml @@ -0,0 +1,68 @@ +{% set version = "1.0.0" %} +{% set linux_compiler_version = "12.4.0" %} +{% set macos_compiler_version = "16" %} +#{% set cuda_version = "12.5" %} + +package: + name: fierro-heffte-cuda + version: {{ version }} + +source: + git_url: https://github.com/icl-utk-edu/heffte.git + git_depth: 1 + +build: + number: 1 + noarch: False + script_env: + - PLATFORM={{ target_platform }} + skip: True # [osx] + skip: False # [linux] + +requirements: + build: + - cmake >=3.17.0 + - {{ compiler('c') }}={{ linux_compiler_version }} # [linux] + - {{ compiler('c') }}={{ macos_compiler_version }} # [osx] + - {{ compiler('cxx') }}={{ linux_compiler_version }} # [linux] + - {{ compiler('cxx') }}={{ macos_compiler_version }} # [osx] + - {{ compiler('fortran') }}={{ linux_compiler_version }} + - openmpi + # - cuda-compiler + # - cuda-toolkit={{ cuda_version }} + - cuda-toolkit + # These host CUDA dependencies are definitely overspecified. + # Not sure which ones are totally necessary. + host: + #- cuda-cudart-static={{ cuda_version }} # Make sure your nvcc version and cudart versions are the same + - cuda-compiler + - cuda-cudart-static + - cuda-toolkit + - libcusolver-dev + - libcufft-dev + - libcublas-dev + - libcusparse-dev + - openmpi >=4.1.6,<5.0a0 + run: + - cuda-cudart + - libcufft + - libcublas + - openmpi >=4.1.6,<5.0a0 + +about: + home: https://github.com/lanl/Fierro + license: BSD-3-Clause + license_family: BSD + license_file: LICENSE + summary: + LANL Fierro's dependency for EVPFFT solutions + description: + Fierro (LANL code number C21030) is a modern C++ code designed to simulate quasi-static + solid mechanics problems and transient, compressible material dynamic problems with Lagrangian methods, + which have meshes with constant mass elements that move with the material, + or with Eulerian methods, which have stationary meshes. + dev_url: https://github.com/lanl/Fierro + +extra: + recipe-maintainers: + - fierromechanics diff --git a/.conda/legacy_packages/heffte/make-relocatable.sh b/.conda/legacy_packages/heffte/make-relocatable.sh new file mode 100644 index 000000000..566f32c35 --- /dev/null +++ b/.conda/legacy_packages/heffte/make-relocatable.sh @@ -0,0 +1,4 @@ +# Heffte forwards a link to sysroot libpthread from fftw +# This is annoying for anaconda, so we just patch it out. +sed -i.backup "s|;/home/[^;]*/sysroot/usr/lib/libpthread.so||g" ${PREFIX}/lib/cmake/Heffte/HeffteConfig.cmake +rm ${PREFIX}/lib/cmake/Heffte/HeffteConfig.cmake.backup \ No newline at end of file diff --git a/.conda/legacy_packages/patch_conda_cxxflags.sh b/.conda/legacy_packages/patch_conda_cxxflags.sh new file mode 100644 index 000000000..a1ef967c4 --- /dev/null +++ b/.conda/legacy_packages/patch_conda_cxxflags.sh @@ -0,0 +1,54 @@ +arch_flags=(-fno-tree-vectorize) +if [ "$PLATFORM" == "linux-64" ]; then + arch_flags+=(-march=x86-64 -mtune=generic) + echo "Compiling with generic x86_64 instruction set." + # VECTOR_ARCH_FLAGS is used by FindVector.cmake + export VECTOR_ARCH_FLAGS=" -march=x86-64 -mtune=generic " +fi +if [ "$PLATFORM" == "linux-ppc64le" ]; then + arch_flags+=(-mtune=powerpc64) + echo "Tuning for powerpc64 CPUs" + export VECTOR_ARCH_FLAGS=" -mcpu=powerpc64le " +fi +if [ "$PLATFORM" == "linux-aarch64" ]; then + arch_flags+=(-mtune=generic) + echo "Tuning for generic aarch64 CPUs" + export VECTOR_ARCH_FLAGS=" -mtune=generic " +fi + +# Some apple architectures. +# Only applies for clang. +if [ "$PLATFORM" == "osx-arm64" ]; then + arch_flags+=(-arch arm64 --target=arm64-apple-darwin) + echo "Tuning for generic aarch64 CPUs" + export VECTOR_ARCH_FLAGS=" -mtune=generic " +fi +if [ "$PLATFORM" == "osx-64" ]; then + arch_flags+=(--target=x86_64-apple-darwin) + echo "Tuning for generic aarch64 CPUs" + export VECTOR_ARCH_FLAGS=" -mtune=generic " +fi + +PATCHED_CXXFLAGS=() +for arg in $CXXFLAGS +do + case $arg in + -march* | -mtune* | -mcpu*) + # We are going to add our own instruction optimization flags. + echo "Removing architecture CXXFLAG: $arg" + ;; + -fvisibility-inlines-hidden | -ftree-vectorize) + # inlines-hidden is a problem when compiling the trilinos package and then + # using it later. + # also clang does not support -fnovisibility-inlines-hidden to disable it. + echo "Removing CXXFLAG $arg" + ;; + *) + PATCHED_CXXFLAGS+=($arg) + ;; + esac +done + +PATCHED_CXXFLAGS+=(${arch_flags[@]}) +PATCHED_CXXFLAGS=${PATCHED_CXXFLAGS[@]} +export PATCHED_CXXFLAGS \ No newline at end of file diff --git a/.conda/legacy_packages/voxelizer/build.sh b/.conda/legacy_packages/voxelizer/build.sh new file mode 100644 index 000000000..673aea6f2 --- /dev/null +++ b/.conda/legacy_packages/voxelizer/build.sh @@ -0,0 +1,10 @@ +# These flag variables are set by anaconda. +source "$RECIPE_DIR/../cross-compile-setup.sh" +export CMAKE_CXX_FLAGS=$PATCHED_CXXFLAGS + +cd python/Voxelizer +# Use the --prefix flag here because we are +# not using the *host* python to do this. We are (against Anaconda's recommendations) +# using the *build* python here, since we actually need to do cross compilation +# not really sure how to do the cross compilation with python. +pip install . --prefix=$PREFIX diff --git a/.conda/legacy_packages/voxelizer/meta.yaml b/.conda/legacy_packages/voxelizer/meta.yaml new file mode 100644 index 000000000..cfcbf40d6 --- /dev/null +++ b/.conda/legacy_packages/voxelizer/meta.yaml @@ -0,0 +1,32 @@ +{% set version = "1.0.0" %} +{% set linux_compiler_version = "10.4.0" %} +{% set macos_compiler_version = "16" %} + +package: + name: fierro-voxelizer + version: 2 + +source: + path: ../../ + # - git_url: https://github.com/lanl/Fierro.git + # depth: 1 + +requirements: + build: + - cmake >=3.17.0 + - {{ compiler('cxx') }}={{ linux_compiler_version }} # [linux] + - {{ compiler('cxx') }}={{ macos_compiler_version }} # [osx] + - python={{ python }} + - pybind11 + - setuptools + host: + - python={{ python }} + - elements + - llvm-openmp + run: + - python={{ python }} + - llvm-openmp + +test: + imports: + - fierro_voxelizer # [x86_64] diff --git a/.conda/legacy_packages/voxelizer/python_variants.yaml b/.conda/legacy_packages/voxelizer/python_variants.yaml new file mode 100644 index 000000000..cca353425 --- /dev/null +++ b/.conda/legacy_packages/voxelizer/python_variants.yaml @@ -0,0 +1,6 @@ +python: + - 3.8 + - 3.9 + - 3.10 + - 3.11 + - 3.12 \ No newline at end of file diff --git a/.conda/ls-evpfft-j2/cpu/LICENSE b/.conda/ls-evpfft-j2/cpu/LICENSE new file mode 100644 index 000000000..698d6edf2 --- /dev/null +++ b/.conda/ls-evpfft-j2/cpu/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2021, Los Alamos National Laboratory +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/.conda/ls-evpfft-j2/cpu/build.sh b/.conda/ls-evpfft-j2/cpu/build.sh new file mode 100755 index 000000000..ff333b05c --- /dev/null +++ b/.conda/ls-evpfft-j2/cpu/build.sh @@ -0,0 +1,15 @@ +# Patch the cxx variables for cross-compilation +source "$RECIPE_DIR/../../cross-compile-setup.sh" + +cd src/LS-EVPFFT-J2 +mkdir build +cd build +cmake ../src/ \ + -D CMAKE_INSTALL_PREFIX:PATH=$PREFIX \ + -D USE_FFTW=1 \ + $CMAKE_ARGS \ + -D CMAKE_CXX_FLAGS="$PATCHED_CXXFLAGS" \ + -D CMAKE_CXX_COMPILER=$BUILD_PREFIX/bin/mpicxx \ + -D CMAKE_C_COMPILER=$BUILD_PREFIX/bin/mpicc \ + +make install diff --git a/.conda/ls-evpfft-j2/cpu/meta.yaml b/.conda/ls-evpfft-j2/cpu/meta.yaml new file mode 100644 index 000000000..6a89ed955 --- /dev/null +++ b/.conda/ls-evpfft-j2/cpu/meta.yaml @@ -0,0 +1,55 @@ +{% set version = "1.0.0" %} +{% set linux_compiler_version = "10.4.0" %} +{% set macos_compiler_version = "16" %} + +package: + name: fierro-ls-evpfft-j2-cpu + version: {{ version }} + +source: + git_url: https://github.com/lanl/Fierro.git + git_depth: 1 + +build: + number: 1 + script_env: + - PLATFORM={{ target_platform }} + +requirements: + build: + - cmake >=3.17.0 + - make + - {{ compiler('c') }}={{ linux_compiler_version }} # [linux] + - {{ compiler('c') }}={{ macos_compiler_version }} # [osx] + - {{ compiler('cxx') }}={{ linux_compiler_version }} # [linux] + - {{ compiler('cxx') }}={{ macos_compiler_version }} # [osx] + - openmpi + host: + - openmpi + - fierro-heffte + - fftw=*=mpi_openmpi_* + - kokkos=4.1 + - hdf5=*=mpi_openmpi_* + - elements + run: + - openmpi + - fierro-heffte + - fftw=*=mpi_openmpi_* + - kokkos=4.1 + - hdf5=*=mpi_openmpi_* + - elements + +#TODO: Add tests + +about: + home: https://github.com/lanl/Fierro + license: BSD-3-Clause + license_family: BSD + license_file: LICENSE + summary: + description: + dev_url: https://github.com/lanl/Fierro + +extra: + recipe-maintainers: + - fierromechanics diff --git a/.conda/ls-evpfft-j2/cuda/LICENSE b/.conda/ls-evpfft-j2/cuda/LICENSE new file mode 100644 index 000000000..698d6edf2 --- /dev/null +++ b/.conda/ls-evpfft-j2/cuda/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2021, Los Alamos National Laboratory +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/.conda/ls-evpfft-j2/cuda/build.sh b/.conda/ls-evpfft-j2/cuda/build.sh new file mode 100755 index 000000000..913d55e1a --- /dev/null +++ b/.conda/ls-evpfft-j2/cuda/build.sh @@ -0,0 +1,30 @@ +#### +## Notes: +## * You may need to run this with boa's "conda mambabuild" to correctly resolve the dependencies. +## * If you are compiling this on a non-cuda machine, to install the right kokkos package, you need to +## set the CONDA_OVERRIDE_CUDA flag to 12.0 . This will mark __cuda (the cuda virtual package) as installed. +#### + +# Patch the cxx variables for cross-compilation +source "$RECIPE_DIR/../../cross-compile-setup.sh" + +# MPICXX -> nvcc_wrapper -> nvcc -> $GXX +# ^ Passes $NVCC_WRAPPER_DEFAULT_COMPILER as the host compiler to nvcc +# Setting NVCC_WRAPPER_DEFAULT_COMPILER=$GXX enforces that +# nvcc gets the correct compiler for the target platform. +export OMPI_CXX=nvcc_wrapper +export NVCC_WRAPPER_DEFAULT_COMPILER=$GXX + +cd src/LS-EVPFFT-J2 +mkdir build +cd build +cmake ../src/ \ + -D CMAKE_INSTALL_PREFIX:PATH=$PREFIX \ + -D USE_CUFFT=1 \ + $CMAKE_ARGS \ + -D CMAKE_CXX_FLAGS="$PATCHED_CXXFLAGS" \ + -D CUDAToolkit_ROOT=$PREFIX/bin \ + -D CMAKE_CXX_COMPILER=$BUILD_PREFIX/bin/mpicxx \ + -D CMAKE_C_COMPILER=$BUILD_PREFIX/bin/mpicc \ + +make install diff --git a/.conda/ls-evpfft-j2/cuda/meta.yaml b/.conda/ls-evpfft-j2/cuda/meta.yaml new file mode 100644 index 000000000..e151ad32d --- /dev/null +++ b/.conda/ls-evpfft-j2/cuda/meta.yaml @@ -0,0 +1,54 @@ +{% set version = "1.0.0" %} +{% set linux_compiler_version = "10.4.0" %} +{% set macos_compiler_version = "16" %} + +package: + name: fierro-ls-evpfft-j2-cuda + version: {{ version }} + +source: + git_url: https://github.com/lanl/Fierro.git + git_depth: 1 + +build: + number: 1 + noarch: False + script_env: + - PLATFORM={{ target_platform }} + skip: True # [osx] + skip: False # [linux] + +requirements: + build: + - cmake >=3.17.0 + - {{ compiler('c') }}={{ linux_compiler_version }} # [linux] + - {{ compiler('c') }}={{ macos_compiler_version }} # [osx] + - {{ compiler('cxx') }}={{ linux_compiler_version }} # [linux] + - {{ compiler('cxx') }}={{ macos_compiler_version }} # [osx] + - cuda-compiler + - openmpi + host: + - cuda-toolkit + - openmpi + - fierro-heffte-cuda + - hdf5=*=mpi_openmpi_h457a7a6_3 + - fierro-trilinos-cuda # Statically linked against Kokkos CUDA kernels from here. + - elements + run: + - openmpi + - fierro-heffte-cuda + - hdf5=*=mpi_openmpi_h457a7a6_3 + - elements + +about: + home: https://github.com/lanl/Fierro + license: BSD-3-Clause + license_family: BSD + license_file: LICENSE + summary: + description: + dev_url: https://github.com/lanl/Fierro + +extra: + recipe-maintainers: + - fierromechanics diff --git a/.conda/ls-evpfft/cpu/LICENSE b/.conda/ls-evpfft/cpu/LICENSE new file mode 100644 index 000000000..698d6edf2 --- /dev/null +++ b/.conda/ls-evpfft/cpu/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2021, Los Alamos National Laboratory +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/.conda/ls-evpfft/cpu/build.sh b/.conda/ls-evpfft/cpu/build.sh new file mode 100755 index 000000000..a1a9209fd --- /dev/null +++ b/.conda/ls-evpfft/cpu/build.sh @@ -0,0 +1,15 @@ +# Patch the cxx variables for cross-compilation +source "$RECIPE_DIR/../../cross-compile-setup.sh" + +cd src/LS-EVPFFT +mkdir build +cd build +cmake ../src/ \ + -D CMAKE_INSTALL_PREFIX:PATH=$PREFIX \ + -D USE_FFTW=1 \ + $CMAKE_ARGS \ + -D CMAKE_CXX_FLAGS="$PATCHED_CXXFLAGS" \ + -D CMAKE_CXX_COMPILER=$BUILD_PREFIX/bin/mpicxx \ + -D CMAKE_C_COMPILER=$BUILD_PREFIX/bin/mpicc \ + +make install diff --git a/.conda/ls-evpfft/cpu/meta.yaml b/.conda/ls-evpfft/cpu/meta.yaml new file mode 100644 index 000000000..d94646925 --- /dev/null +++ b/.conda/ls-evpfft/cpu/meta.yaml @@ -0,0 +1,55 @@ +{% set version = "1.0.0" %} +{% set linux_compiler_version = "10.4.0" %} +{% set macos_compiler_version = "16" %} + +package: + name: fierro-ls-evpfft-cpu + version: {{ version }} + +source: + git_url: https://github.com/lanl/Fierro.git + git_depth: 1 + +build: + number: 1 + script_env: + - PLATFORM={{ target_platform }} + +requirements: + build: + - cmake >=3.17.0 + - make + - {{ compiler('c') }}={{ linux_compiler_version }} # [linux] + - {{ compiler('c') }}={{ macos_compiler_version }} # [osx] + - {{ compiler('cxx') }}={{ linux_compiler_version }} # [linux] + - {{ compiler('cxx') }}={{ macos_compiler_version }} # [osx] + - openmpi + host: + - openmpi + - fierro-heffte + - fftw=*=mpi_openmpi_* + - kokkos=4.1 + - hdf5=*=mpi_openmpi_* + - elements + run: + - openmpi + - fierro-heffte + - fftw=*=mpi_openmpi_* + - kokkos=4.1 + - hdf5=*=mpi_openmpi_* + - elements + +#TODO: Add tests + +about: + home: https://github.com/lanl/Fierro + license: BSD-3-Clause + license_family: BSD + license_file: LICENSE + summary: + description: + dev_url: https://github.com/lanl/Fierro + +extra: + recipe-maintainers: + - fierromechanics diff --git a/.conda/ls-evpfft/cuda/LICENSE b/.conda/ls-evpfft/cuda/LICENSE new file mode 100644 index 000000000..698d6edf2 --- /dev/null +++ b/.conda/ls-evpfft/cuda/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2021, Los Alamos National Laboratory +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/.conda/ls-evpfft/cuda/build.sh b/.conda/ls-evpfft/cuda/build.sh new file mode 100755 index 000000000..913d55e1a --- /dev/null +++ b/.conda/ls-evpfft/cuda/build.sh @@ -0,0 +1,30 @@ +#### +## Notes: +## * You may need to run this with boa's "conda mambabuild" to correctly resolve the dependencies. +## * If you are compiling this on a non-cuda machine, to install the right kokkos package, you need to +## set the CONDA_OVERRIDE_CUDA flag to 12.0 . This will mark __cuda (the cuda virtual package) as installed. +#### + +# Patch the cxx variables for cross-compilation +source "$RECIPE_DIR/../../cross-compile-setup.sh" + +# MPICXX -> nvcc_wrapper -> nvcc -> $GXX +# ^ Passes $NVCC_WRAPPER_DEFAULT_COMPILER as the host compiler to nvcc +# Setting NVCC_WRAPPER_DEFAULT_COMPILER=$GXX enforces that +# nvcc gets the correct compiler for the target platform. +export OMPI_CXX=nvcc_wrapper +export NVCC_WRAPPER_DEFAULT_COMPILER=$GXX + +cd src/LS-EVPFFT-J2 +mkdir build +cd build +cmake ../src/ \ + -D CMAKE_INSTALL_PREFIX:PATH=$PREFIX \ + -D USE_CUFFT=1 \ + $CMAKE_ARGS \ + -D CMAKE_CXX_FLAGS="$PATCHED_CXXFLAGS" \ + -D CUDAToolkit_ROOT=$PREFIX/bin \ + -D CMAKE_CXX_COMPILER=$BUILD_PREFIX/bin/mpicxx \ + -D CMAKE_C_COMPILER=$BUILD_PREFIX/bin/mpicc \ + +make install diff --git a/.conda/ls-evpfft/cuda/meta.yaml b/.conda/ls-evpfft/cuda/meta.yaml new file mode 100644 index 000000000..39eac8223 --- /dev/null +++ b/.conda/ls-evpfft/cuda/meta.yaml @@ -0,0 +1,54 @@ +{% set version = "1.0.0" %} +{% set linux_compiler_version = "10.4.0" %} +{% set macos_compiler_version = "16" %} + +package: + name: fierro-ls-evpfft-cuda + version: {{ version }} + +source: + git_url: https://github.com/lanl/Fierro.git + git_depth: 1 + +build: + number: 1 + noarch: False + script_env: + - PLATFORM={{ target_platform }} + skip: True # [osx] + skip: False # [linux] + +requirements: + build: + - cmake >=3.17.0 + - {{ compiler('c') }}={{ linux_compiler_version }} # [linux] + - {{ compiler('c') }}={{ macos_compiler_version }} # [osx] + - {{ compiler('cxx') }}={{ linux_compiler_version }} # [linux] + - {{ compiler('cxx') }}={{ macos_compiler_version }} # [osx] + - cuda-compiler + - openmpi + host: + - cuda-toolkit + - openmpi + - fierro-heffte-cuda + - hdf5=*=mpi_openmpi_h457a7a6_3 + - fierro-trilinos-cuda # Statically linked against Kokkos CUDA kernels from here. + - elements + run: + - openmpi + - fierro-heffte-cuda + - hdf5=*=mpi_openmpi_h457a7a6_3 + - elements + +about: + home: https://github.com/lanl/Fierro + license: BSD-3-Clause + license_family: BSD + license_file: LICENSE + summary: + description: + dev_url: https://github.com/lanl/Fierro + +extra: + recipe-maintainers: + - fierromechanics diff --git a/.conda/matar/cpu/LICENSE b/.conda/matar/cpu/LICENSE new file mode 100644 index 000000000..698d6edf2 --- /dev/null +++ b/.conda/matar/cpu/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2021, Los Alamos National Laboratory +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/.conda/matar/cpu/build.sh b/.conda/matar/cpu/build.sh new file mode 100755 index 000000000..9bda39cb4 --- /dev/null +++ b/.conda/matar/cpu/build.sh @@ -0,0 +1,23 @@ +export SRC_DIR=$(pwd) +echo ${SRC_DIR} +mkdir -p build +cd build + +export MPI_FLAGS="--allow-run-as-root" + +if [ $(uname) == Linux ]; then + export MPI_FLAGS="$MPI_FLAGS;-mca;plm;isolated" +fi + +source "$RECIPE_DIR/../../cross-compile-setup.sh" + +cmake -D CMAKE_BUILD_TYPE:STRING=RELEASE \ + -D CMAKE_INSTALL_PREFIX:PATH=$PREFIX \ + -D CMAKE_CXX_STANDARD:STRING=17 \ + -D VECTOR_ARCH_FLAGS="$VECTOR_ARCH_FLAGS" \ + -D Matar_ENABLE_KOKKOS=ON \ + $CMAKE_ARGS \ + $SRC_DIR \ + -D CMAKE_CXX_FLAGS="$PATCHED_CXXFLAGS" \ + +make install diff --git a/.conda/matar/cpu/meta.yaml b/.conda/matar/cpu/meta.yaml new file mode 100644 index 000000000..5086bf6b0 --- /dev/null +++ b/.conda/matar/cpu/meta.yaml @@ -0,0 +1,47 @@ +{% set version = "1.0.0" %} +{% set linux_compiler_version = "10.4.0" %} +{% set macos_compiler_version = "16" %} + +package: + name: matar-cpu + version: {{ version }} + +source: + - git_url: https://github.com/lanl/MATAR.git + git_depth: 1 + +build: + number: 1 + script_env: + - PLATFORM={{ target_platform }} + +requirements: + build: + - cmake >=3.10.0 + - {{ compiler('cxx') }}={{ linux_compiler_version }} # [linux] + - {{ compiler('cxx') }}={{ macos_compiler_version }} # [osx] + - openmpi + host: + - openmpi + - kokkos=4.1 + run: + - openmpi + - kokkos=4.1 + + +about: + home: https://github.com/lanl/MATAR + license: BSD-3-Clause + license_family: BSD + license_file: LICENSE + summary: + LANL's performance portability library + description: + MATAR is a C++ library that addresses the need for simple, fast, and memory-efficient multi-dimensional data representations + for dense and sparse storage that arise with numerical methods and in software applications. The data representations are + designed to perform well across multiple computer architectures, including CPUs and GPUs. + dev_url: https://github.com/lanl/Fierro + +extra: + recipe-maintainers: + - fierromechanics diff --git a/.conda/matar/cuda/LICENSE b/.conda/matar/cuda/LICENSE new file mode 100644 index 000000000..698d6edf2 --- /dev/null +++ b/.conda/matar/cuda/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2021, Los Alamos National Laboratory +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/.conda/matar/cuda/build.sh b/.conda/matar/cuda/build.sh new file mode 100755 index 000000000..d660c3173 --- /dev/null +++ b/.conda/matar/cuda/build.sh @@ -0,0 +1,31 @@ +export SRC_DIR=$(pwd) +echo ${SRC_DIR} +mkdir -p build +cd build + +export MPI_FLAGS="--allow-run-as-root" + +if [ $(uname) == Linux ]; then + export MPI_FLAGS="$MPI_FLAGS;-mca;plm;isolated" + #export CUDACXX=$(which nvcc) +fi + +#export CXX="${SRC_DIR}/packages/kokkos/bin/nvcc_wrapper" +export LD_LIBRARY_PATH="$CONDA_PREFIX/lib" + +source "$RECIPE_DIR/../../cross-compile-setup.sh" + + #-D CUDAToolkit_ROOT=$PREFIX \ + #-D CMAKE_CUDA_COMPILER=${CUDACXX} \ + #-D CMAKE_CUDA_HOST_LINK_LAUNCHER=$CXX \ +cmake -D CMAKE_BUILD_TYPE:STRING=RELEASE \ + -D CMAKE_INSTALL_PREFIX:PATH=$PREFIX \ + -D CMAKE_CXX_STANDARD:STRING=17 \ + -D VECTOR_ARCH_FLAGS="$VECTOR_ARCH_FLAGS" \ + -D Matar_ENABLE_KOKKOS=ON \ + -D Matar_CUDA_BUILD=ON \ + $CMAKE_ARGS \ + $SRC_DIR \ + -D CMAKE_CXX_FLAGS="$PATCHED_CXXFLAGS" \ + +make install diff --git a/.conda/matar/cuda/conda_build_config.yaml b/.conda/matar/cuda/conda_build_config.yaml new file mode 100644 index 000000000..8ef61a34a --- /dev/null +++ b/.conda/matar/cuda/conda_build_config.yaml @@ -0,0 +1,8 @@ +c_compiler: + - gcc +cxx_compiler: + - gxx +target_platform: + - linux-64 + #- linux-aarch64 + #- linux-ppc64le diff --git a/.conda/matar/cuda/meta.yaml b/.conda/matar/cuda/meta.yaml new file mode 100644 index 000000000..f2f4b71c5 --- /dev/null +++ b/.conda/matar/cuda/meta.yaml @@ -0,0 +1,52 @@ +{% set version = "1.0.0" %} +{% set linux_compiler_version = "12" %} +{% set macos_compiler_version = "16" %} +#{% set cuda_version = "12" %} + +package: + name: matar-cuda + version: {{ version }} + +source: + - git_url: https://github.com/lanl/MATAR.git + git_depth: 1 + +build: + number: 1 + noarch: False + script_env: + - PLATFORM={{ target_platform }} # [linux] + +requirements: + build: + - cmake >=3.17.0 + - {{ compiler('cxx') }}={{ linux_compiler_version }} # [linux] + - {{ compiler('cxx') }}={{ macos_compiler_version }} # [osx] + - cuda-toolkit + - kokkos=4.1 + - openmpi + host: + - openmpi + - kokkos=4.1 + run: + - openmpi + - kokkos=4.1 + + +about: + home: https://github.com/lanl/Fierro + license: BSD-3-Clause + license_family: BSD + license_file: LICENSE + summary: + LANL's software for simulating quasi-static solid mechanics. + description: + Fierro (LANL code number C21030) is a modern C++ code designed to simulate quasi-static + solid mechanics problems and transient, compressible material dynamic problems with Lagrangian methods, + which have meshes with constant mass elements that move with the material, + or with Eulerian methods, which have stationary meshes. + dev_url: https://github.com/lanl/FierroMechanics + +extra: + recipe-maintainers: + - fierromechanics diff --git a/.conda/patch_conda_cxxflags.sh b/.conda/patch_conda_cxxflags.sh index a1ef967c4..31e7071ad 100644 --- a/.conda/patch_conda_cxxflags.sh +++ b/.conda/patch_conda_cxxflags.sh @@ -51,4 +51,4 @@ done PATCHED_CXXFLAGS+=(${arch_flags[@]}) PATCHED_CXXFLAGS=${PATCHED_CXXFLAGS[@]} -export PATCHED_CXXFLAGS \ No newline at end of file +export PATCHED_CXXFLAGS diff --git a/.conda/trilinos/cpu/build.sh b/.conda/trilinos/cpu/build.sh index cc89cb9f9..36760cff1 100755 --- a/.conda/trilinos/cpu/build.sh +++ b/.conda/trilinos/cpu/build.sh @@ -56,4 +56,4 @@ cmake -D CMAKE_BUILD_TYPE:STRING=RELEASE \ # exit codes of certain environment-probing binaries. # This is necessary when cross-compiling, and essentially ignores those tests. -make -j 10 install \ No newline at end of file +make install diff --git a/.conda/trilinos/cpu/meta.yaml b/.conda/trilinos/cpu/meta.yaml index 94d70de08..28eed1c1d 100644 --- a/.conda/trilinos/cpu/meta.yaml +++ b/.conda/trilinos/cpu/meta.yaml @@ -3,7 +3,7 @@ {% set macos_compiler_version = "16" %} package: - name: fierro-trilinos-cpu + name: trilinos-cpu version: {{ version }} source: @@ -31,10 +31,10 @@ requirements: - boost-cpp - libnetcdf - libmatio - - llvm-openmp # [osx] + # - llvm-openmp # [osx] run: - libblas - - llvm-openmp # [osx] + # - llvm-openmp # [osx] about: home: https://trilinos.org @@ -48,7 +48,7 @@ about: Fast, compiled object-oriented algorithms and enabling technologies that support the solution of large-scale, complex multi-physics engineering and scientific problems. - dev_url: https://github.com/trilinos/Trilinos + dev_url: https://github.com/lanl/Fierro extra: recipe-maintainers: diff --git a/.conda/trilinos/cuda/meta.yaml b/.conda/trilinos/cuda/meta.yaml index 23d9672e1..955f016c7 100644 --- a/.conda/trilinos/cuda/meta.yaml +++ b/.conda/trilinos/cuda/meta.yaml @@ -53,7 +53,7 @@ about: Fast, compiled object-oriented algorithms and enabling technologies that support the solution of large-scale, complex multi-physics engineering and scientific problems. - dev_url: https://github.com/trilinos/Trilinos + dev_url: https://github.com/lanl/Fierro extra: recipe-maintainers: diff --git a/.conda/voxelizer/README b/.conda/voxelizer/README new file mode 100644 index 000000000..b50bc14e8 --- /dev/null +++ b/.conda/voxelizer/README @@ -0,0 +1,2 @@ +need a setup.py file inside of Fierro/src/Voxelizer that looks similar to the one in Fierro/python/FIERRO_GUI/setup.py +need it for pip install diff --git a/.conda/voxelizer/build.sh b/.conda/voxelizer/build.sh index 673aea6f2..583dfbeec 100644 --- a/.conda/voxelizer/build.sh +++ b/.conda/voxelizer/build.sh @@ -2,9 +2,9 @@ source "$RECIPE_DIR/../cross-compile-setup.sh" export CMAKE_CXX_FLAGS=$PATCHED_CXXFLAGS -cd python/Voxelizer +cd src/Voxelizer # Use the --prefix flag here because we are # not using the *host* python to do this. We are (against Anaconda's recommendations) # using the *build* python here, since we actually need to do cross compilation # not really sure how to do the cross compilation with python. -pip install . --prefix=$PREFIX +pip install --prefix=$PREFIX diff --git a/.conda/voxelizer/meta.yaml b/.conda/voxelizer/meta.yaml index cfcbf40d6..7343ebf81 100644 --- a/.conda/voxelizer/meta.yaml +++ b/.conda/voxelizer/meta.yaml @@ -7,9 +7,9 @@ package: version: 2 source: - path: ../../ - # - git_url: https://github.com/lanl/Fierro.git - # depth: 1 + #path: ../../ + git_url: https://github.com/lanl/Fierro.git + depth: 1 requirements: build: @@ -30,3 +30,15 @@ requirements: test: imports: - fierro_voxelizer # [x86_64] + +about: + home: https://github.com/lanl/Fierro + license: BSD-3-Clause + license_family: BSD + summary: + Metapackage for consolidating development dependencies for fierro. + dev_url: https://github.com/lanl/Fierro + +extra: + recipe-maintainers: + - fierromechanics diff --git a/.github/workflows/publish-all.yml b/.github/workflows/publish-all.yml index dc98e0e29..6e195cd95 100644 --- a/.github/workflows/publish-all.yml +++ b/.github/workflows/publish-all.yml @@ -30,6 +30,18 @@ jobs: heffte-cuda: uses: ./.github/workflows/publish-heffte-cuda.yml + ls-evpfft-cpu: + uses: ./.github/workflows/publish-ls-evpfft-cpu.yml + + ls-evpfft-j2-cpu: + uses: ./.github/workflows/publish-ls-evpfft-j2-cpu.yml + + matar-cpu: + uses: ./.github/workflows/publish-matar-cpu.yml + + matar-cuda: + uses: ./.github/workflows/publish-matar-cuda.yml + trilinos: uses: ./.github/workflows/publish-trillinos.yml diff --git a/.github/workflows/publish-ls-evpfft-cpu.yaml b/.github/workflows/publish-ls-evpfft-cpu.yaml new file mode 100644 index 000000000..ffe5c50cc --- /dev/null +++ b/.github/workflows/publish-ls-evpfft-cpu.yaml @@ -0,0 +1,16 @@ +name: 'Publish LS-EVPFFT-CPU' + +on: + push: + paths: + - .conda/ls-evpfft/** + - src/LS-EVPFFT/src/** + - .github/workflows/publish-ls-evpfft-cpu.yaml + workflow_dispatch: + +jobs: + publish: + uses: ./.github/workflows/build-conda-package.yaml + with: + recipe_dir: .conda/ls-evpfft/cpu + secrets: inherit diff --git a/.github/workflows/publish-ls-evpfft-j2-cpu.yaml b/.github/workflows/publish-ls-evpfft-j2-cpu.yaml new file mode 100644 index 000000000..f6537cb61 --- /dev/null +++ b/.github/workflows/publish-ls-evpfft-j2-cpu.yaml @@ -0,0 +1,16 @@ +name: 'Publish LS-EVPFFT-J2-CPU' + +on: + push: + paths: + - .conda/ls-evpfft-j2/** + - src/LS-EVPFFT-J2/src/** + - .github/workflows/publish-ls-evpfft-j2-cpu.yaml + workflow_dispatch: + +jobs: + publish: + uses: ./.github/workflows/build-conda-package.yaml + with: + recipe_dir: .conda/ls-evpfft-j2/cpu + secrets: inherit diff --git a/.github/workflows/publish-matar-cpu.yaml b/.github/workflows/publish-matar-cpu.yaml new file mode 100644 index 000000000..9bd1b4fff --- /dev/null +++ b/.github/workflows/publish-matar-cpu.yaml @@ -0,0 +1,15 @@ +name: 'Publish MATAR-CPU' + +on: + push: + paths: + - .conda/matar/** + - .github/workflows/publish-matar-cpu.yaml + workflow_dispatch: + +jobs: + publish: + uses: ./.github/workflows/build-conda-package.yaml + with: + recipe_dir: .conda/matar/cpu + secrets: inherit diff --git a/.github/workflows/publish-matar-cuda.yaml b/.github/workflows/publish-matar-cuda.yaml new file mode 100644 index 000000000..26afd1219 --- /dev/null +++ b/.github/workflows/publish-matar-cuda.yaml @@ -0,0 +1,15 @@ +name: 'Publish MATAR-CUDA' + +on: + push: + paths: + - .conda/matar/** + - .github/workflows/publish-matar-cuda.yaml + workflow_dispatch: + +jobs: + publish: + uses: ./.github/workflows/build-conda-package.yaml + with: + recipe_dir: .conda/matar/cuda + secrets: inherit diff --git a/lib/Elements b/lib/Elements index 0de655cd2..19b5cad11 160000 --- a/lib/Elements +++ b/lib/Elements @@ -1 +1 @@ -Subproject commit 0de655cd260e60e4f037a78561dddfb9c8757fc7 +Subproject commit 19b5cad11d411a914cf188814afb2bd6180c85b7