Skip to content

Commit

Permalink
Merge pull request #5 from natalie-perlin/feature/macos
Browse files Browse the repository at this point in the history
Updates and fixed for MacOS with M1 and x86_64
  • Loading branch information
natalie-perlin authored Nov 10, 2022
2 parents c680449 + f0afba1 commit 9ad36f5
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 788 deletions.
35 changes: 0 additions & 35 deletions config/config_mac_gnu.sh

This file was deleted.

24 changes: 14 additions & 10 deletions config/config_mac_m1_gnu.sh → config/config_macos_gnu.sh
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#!/bin/bash

# Use Lmod for modules definition
source /opt/homebrew/opt/lmod/init/profile
LMOD=$(brew --prefix lmod)
source $LMOD/init/profile

# Compiler/MPI combination
export HPC_COMPILER="gnu/11.2.0_3"
export HPC_COMPILER="gnu/11.3.0"
export HPC_MPI="openmpi/4.1.2"
export HPC_PYTHON="python/3.10.2"
export HPC_PYTHON="python/3.9.13"

# Build options
export USE_SUDO=N
Expand All @@ -19,17 +20,20 @@ export MAKE_VERBOSE=Y
export MAKE_CLEAN=N
export DOWNLOAD_ONLY=N
export STACK_EXIT_ON_FAIL=Y
export WGET="wget -nv --no-check-certificate "
export WGET="wget -nv "

#
# gfortran-10 needs the following
export STACK_FFLAGS="-fallow-argument-mismatch -fallow-invalid-boz"
export STACK_CXXFLAGS="-march=native"

export CC=/opt/homebrew/bin/gcc
export FC=/opt/homebrew/bin/gfortran
export CXX=/opt/homebrew/bin/g++
BREW=$(brew --prefix)

export SERIAL_CC=/opt/homebrew/bin/gcc
export SERIAL_FC=/opt/homebrew/bin/gfortran
export SERIAL_CXX=/opt/homebrew/bin/g++
export CC=$BREW/bin/gcc
export FC=$BREW/bin/gfortran
export CXX=$BREW/bin/g++

export SERIAL_CC=$BREW/bin/gcc
export SERIAL_FC=$BREW/bin/gfortran
export SERIAL_CXX=$BREW/bin/g++

8 changes: 8 additions & 0 deletions libs/build_libpng.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ URL="https://github.com/glennrp/libpng"
[[ ${DOWNLOAD_ONLY} =~ [yYtT] ]] && exit 0
[[ -d $software ]] && cd $software || ( echo "$software does not exist, ABORT!"; exit 1 )
sourceDir=$PWD

host=$(uname -s)
arch=$(uname -m)

if [[ $host == "Darwin" ]] && [[ $arch == "arm64" ]]; then
sed -i -e '/set(PNGLIB_VERSION*/a\'$'\n''set(PNG_ARM_NEON off CACHE INTERNAL "")'$'\n' ./CMakeLists.txt
fi

[[ -d build ]] && rm -rf build
mkdir -p build && cd build

Expand Down
Loading

0 comments on commit 9ad36f5

Please sign in to comment.