Skip to content

Commit

Permalink
Merge pull request #46 from zerothi/main-gcc10
Browse files Browse the repository at this point in the history
added gcc10 support
  • Loading branch information
zerothi authored Nov 1, 2023
2 parents 37d9e02 + 70009c0 commit 1df72df
Show file tree
Hide file tree
Showing 14 changed files with 94 additions and 63 deletions.
1 change: 0 additions & 1 deletion .azure-pipelines/azure-pipelines-linux.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions .ci_support/linux_64_mpimpich.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,3 @@ target_platform:
zip_keys:
- - c_compiler_version
- fortran_compiler_version
zlib:
- '1.2'
2 changes: 0 additions & 2 deletions .ci_support/linux_64_mpinompi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,3 @@ target_platform:
zip_keys:
- - c_compiler_version
- fortran_compiler_version
zlib:
- '1.2'
2 changes: 0 additions & 2 deletions .ci_support/linux_64_mpiopenmpi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,3 @@ target_platform:
zip_keys:
- - c_compiler_version
- fortran_compiler_version
zlib:
- '1.2'
4 changes: 1 addition & 3 deletions .ci_support/osx_64_mpimpich.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ MACOSX_DEPLOYMENT_TARGET:
c_compiler:
- clang
c_compiler_version:
- '15'
- '16'
channel_sources:
- conda-forge
channel_targets:
Expand Down Expand Up @@ -35,5 +35,3 @@ target_platform:
zip_keys:
- - c_compiler_version
- fortran_compiler_version
zlib:
- '1.2'
4 changes: 1 addition & 3 deletions .ci_support/osx_64_mpinompi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ MACOSX_DEPLOYMENT_TARGET:
c_compiler:
- clang
c_compiler_version:
- '15'
- '16'
channel_sources:
- conda-forge
channel_targets:
Expand Down Expand Up @@ -35,5 +35,3 @@ target_platform:
zip_keys:
- - c_compiler_version
- fortran_compiler_version
zlib:
- '1.2'
4 changes: 1 addition & 3 deletions .ci_support/osx_64_mpiopenmpi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ MACOSX_DEPLOYMENT_TARGET:
c_compiler:
- clang
c_compiler_version:
- '15'
- '16'
channel_sources:
- conda-forge
channel_targets:
Expand Down Expand Up @@ -35,5 +35,3 @@ target_platform:
zip_keys:
- - c_compiler_version
- fortran_compiler_version
zlib:
- '1.2'
12 changes: 7 additions & 5 deletions .scripts/build_steps.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .scripts/logging_utils.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions .scripts/run_osx_build.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 15 additions & 15 deletions README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions conda-forge.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
conda_forge_output_validation: true
#build_platform:
# osx_arm64: osx_64
test: native_and_emulated
test_on_native_only: true
github:
branch_name: main
tooling_branch_name: main
Expand Down
66 changes: 53 additions & 13 deletions recipe/build.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,56 @@
#!/bin/bash

# error on faulty execution
set -ex

# Remove __FILE__ lines in utils file.
sed -i -e "s:__FILE__:'fdf/utils.F90':g" Src/fdf/utils.F90

echo "Runing with mpi=$mpi and blas=$blas_impl"
echo "Build on target_platform=$target_platform"
echo "Build on uname=$(uname)"

# Use the default utilities, for now.
cd Obj
../Src/obj_setup.sh

# In 4.0 we do not use OpenMP!
if [[ -n "$GCC" ]]; then
repl="s:%CC%:$GCC:g"
#if [[ "$target_platform" == linux-* || "$target_platform" == "osx-arm64" ]]; then
# Workaround for https://github.com/conda-forge/scalapack-feedstock/pull/30#issuecomment-1061196317
export FFLAGS="$FFLAGS -fallow-argument-mismatch"
export DEBUG_FFLAGS="$DEBUG_FFLAGS -fallow-argument-mismatch"
export OMPI_FCFLAGS="$FFLAGS"
#fi

if [[ "$CONDA_BUILD_CROSS_COMPILATION" == "1" ]]; then
# This is only used by open-mpi's mpicc
# ignored in other cases
export OMPI_CC=$CC
export OMPI_CXX=$CXX
export OMPI_FC=$FC
export OPAL_PREFIX=$PREFIX
fi

if [[ "$(uname)" == "Darwin" ]]; then
# Fix headerpad-max-install-error
# install_name_tool: changing install names or rpaths can't be redone for
# (for architecture x86_64) because larger updated load commands do not fit (the program must be relinked, and you may need to use -headerpad or -headerpad_max_install_names)
export SONAME="-Wl,-install_name,@rpath/"
export LDFLAGS="${LDFLAGS} -headerpad_max_install_names"
else
repl="s:%CC%:$CC:g"
export SONAME="-Wl,-soname,"
fi
repl="$repl;s:%CFLAGS%:${CFLAGS//-fopenmp/}:g"

if [[ "$mpi" != "nompi" ]]; then
# This is not necessary as the arch.make files
# handles this correctly
echo "passing on setting CC and FC for non-mpi"
#export CC=mpicc
#export FC=mpifort
fi

# Get the version
echo "CC version string: $($CC --version | head -1)"

if [[ -n "$GCC_AR" ]]; then
repl="$repl;s:%AR%:$GCC_AR:g"
else
Expand All @@ -26,16 +61,19 @@ if [[ -n "$GCC_RANLIB" ]]; then
else
repl="$repl;s:%RANLIB%:$RANLIB:g"
fi
repl="$repl;s:%CC%:$CC:g"
repl="$repl;s:%FC%:$FC:g"
# No OpenMP!
repl="$repl;s:%CFLAGS%:${CFLAGS//-fopenmp/}:g"
repl="$repl;s:%FFLAGS%:${FFLAGS//-fopenmp/}:g"
repl="$repl;s:%FFLAGS_DEBUG%:${DEBUG_FFLAGS//-fopenmp/}:g"
repl="$repl;s:%INCFLAGS%:-I$PREFIX/include:g"
repl="$repl;s:%LDFLAGS%:-L$PREFIX/lib:g"
repl="$repl;s:%LDFLAGS%:-L$PREFIX/lib $LDFLAGS:g"

if [[ "$mpi" == "nompi" ]]; then
sed -e "$repl" $RECIPE_DIR/arch.make.SEQ > arch.make
sed -e "$repl" $RECIPE_DIR/arch.make.SEQ > arch.make
else
sed -e "$repl" $RECIPE_DIR/arch.make.MPI > arch.make
sed -e "$repl" $RECIPE_DIR/arch.make.MPI > arch.make
fi
echo "<<< arch.make >>>"
cat arch.make
Expand All @@ -46,13 +84,12 @@ function mkcp {
shift
local exe=$target
if [ $# -ge 1 ]; then
exe=$1
shift
exe=$1
shift
fi
echo "RUNNING: make $target"
make $target
[ -e compinfo.F90 ] && cat compinfo.F90
cp $target $PREFIX/bin/$exe
cp -av $target $PREFIX/bin/$exe
make clean
}

Expand All @@ -61,7 +98,6 @@ make libxmlparser.a
# Try and build FoX to catch any debugs
# make FoX/.config || cat FoX/config.log

set -x
ls -l
make version
cat compinfo.F90
Expand Down Expand Up @@ -96,6 +132,10 @@ mkcp grid2cube
mkcp grid_rotate
mkcp grid_supercell

cd ../Optical
mkcp optical
mkcp optical_input

cd ../TBTrans
mkcp tbtrans tbtrans_old
cd ../TBTrans_rep
Expand Down
10 changes: 2 additions & 8 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ source:
- patches/makefile_conda-clean.patch

# Default build version to be stepped with every new build!
{% set build = 12 %}
{% set build = 13 %}

# Define build matrix for MPI vs. non-mpi
## ensure mpi is defined (needed for conda-smithy recipe-lint)
Expand All @@ -38,20 +38,16 @@ build:

string: "{{ mpi_prefix }}_h{{ PKG_HASH }}_{{ build }}"

run_exports:
- {{ name }}

requirements:
build:
- {{ compiler('fortran') }}
- {{ compiler('c') }}
- openmpi-mpifort # [mpi == 'openmpi']
- make # [not win]
host:
- libblas
- liblapack
- {{ mpi }} # [mpi != 'nompi']
- zlib
- fox
- scalapack # [mpi != 'nompi']
# need to list hdf5, libnetcdf and netcdf-fortran twice to get version
# pinning from conda_build_config and build pinning from {{ mpi_prefix }}
Expand All @@ -63,8 +59,6 @@ requirements:
- netcdf-fortran * {{ mpi_prefix }}_*
run:
- {{ mpi }} # [mpi != 'nompi']
- zlib
- fox
- scalapack # [mpi != 'nompi']
- hdf5 * {{ mpi_prefix }}_*
- libnetcdf * {{ mpi_prefix }}_*
Expand Down

0 comments on commit 1df72df

Please sign in to comment.