Skip to content

Commit

Permalink
add macos build (#7)
Browse files Browse the repository at this point in the history
* add macos build
* don't link librt (does not exist on macos)
* add link option to fix link problem using CFLAGS_FORGA
   workaround for conda-forge/gfortran_osx-64-feedstock#11 (comment)
* add patch to fix detection of gfortran version
* MNT: Re-rendered with conda-build 3.21.4, conda-smithy 3.10.1, and conda-forge-pinning 2021.05.18.06.34.34

Co-authored-by: conda-forge-linter <[email protected]>
Co-authored-by: Edoardo Aprà <[email protected]>
  • Loading branch information
3 people authored May 19, 2021
1 parent 165e7a3 commit 10b4a6e
Show file tree
Hide file tree
Showing 12 changed files with 324 additions and 20 deletions.
37 changes: 37 additions & 0 deletions .azure-pipelines/azure-pipelines-osx.yml

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

37 changes: 37 additions & 0 deletions .ci_support/osx_64_python3.6.____cpython.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
MACOSX_DEPLOYMENT_TARGET:
- '10.9'
c_compiler:
- clang
c_compiler_version:
- '11'
channel_sources:
- conda-forge,defaults
channel_targets:
- conda-forge main
fortran_compiler:
- gfortran
fortran_compiler_version:
- '9'
liblapack:
- 3.8 *netlib
macos_machine:
- x86_64-apple-darwin13.4.0
mpi:
- openmpi
openblas:
- 0.3.*
perl:
- 5.26.2
pin_run_as_build:
perl:
max_pin: x.x.x
python:
min_pin: x.x
max_pin: x.x
python:
- 3.6.* *_cpython
target_platform:
- osx-64
zip_keys:
- - c_compiler_version
- fortran_compiler_version
37 changes: 37 additions & 0 deletions .ci_support/osx_64_python3.7.____cpython.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
MACOSX_DEPLOYMENT_TARGET:
- '10.9'
c_compiler:
- clang
c_compiler_version:
- '11'
channel_sources:
- conda-forge,defaults
channel_targets:
- conda-forge main
fortran_compiler:
- gfortran
fortran_compiler_version:
- '9'
liblapack:
- 3.8 *netlib
macos_machine:
- x86_64-apple-darwin13.4.0
mpi:
- openmpi
openblas:
- 0.3.*
perl:
- 5.26.2
pin_run_as_build:
perl:
max_pin: x.x.x
python:
min_pin: x.x
max_pin: x.x
python:
- 3.7.* *_cpython
target_platform:
- osx-64
zip_keys:
- - c_compiler_version
- fortran_compiler_version
37 changes: 37 additions & 0 deletions .ci_support/osx_64_python3.8.____cpython.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
MACOSX_DEPLOYMENT_TARGET:
- '10.9'
c_compiler:
- clang
c_compiler_version:
- '11'
channel_sources:
- conda-forge,defaults
channel_targets:
- conda-forge main
fortran_compiler:
- gfortran
fortran_compiler_version:
- '9'
liblapack:
- 3.8 *netlib
macos_machine:
- x86_64-apple-darwin13.4.0
mpi:
- openmpi
openblas:
- 0.3.*
perl:
- 5.26.2
pin_run_as_build:
perl:
max_pin: x.x.x
python:
min_pin: x.x
max_pin: x.x
python:
- 3.8.* *_cpython
target_platform:
- osx-64
zip_keys:
- - c_compiler_version
- fortran_compiler_version
37 changes: 37 additions & 0 deletions .ci_support/osx_64_python3.9.____cpython.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
MACOSX_DEPLOYMENT_TARGET:
- '10.9'
c_compiler:
- clang
c_compiler_version:
- '11'
channel_sources:
- conda-forge,defaults
channel_targets:
- conda-forge main
fortran_compiler:
- gfortran
fortran_compiler_version:
- '9'
liblapack:
- 3.8 *netlib
macos_machine:
- x86_64-apple-darwin13.4.0
mpi:
- openmpi
openblas:
- 0.3.*
perl:
- 5.26.2
pin_run_as_build:
perl:
max_pin: x.x.x
python:
min_pin: x.x
max_pin: x.x
python:
- 3.9.* *_cpython
target_platform:
- osx-64
zip_keys:
- - c_compiler_version
- fortran_compiler_version
69 changes: 69 additions & 0 deletions .scripts/run_osx_build.sh

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

28 changes: 28 additions & 0 deletions README.md

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

3 changes: 2 additions & 1 deletion azure-pipelines.yml

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

29 changes: 18 additions & 11 deletions recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export USE_MPI="y"
export USE_MPIF="y"
export USE_MPIF4="y"

export MPI_LOC="$PREFIX" #location of openmpi installation
#export MPI_LOC="$PREFIX" #location of openmpi installation
#export FC="${FC}"
export _FC=gfortran
#export CC="${CC}"
Expand All @@ -20,16 +20,19 @@ export _CC=gcc
#=================================================
export NWCHEM_TOP="$SRC_DIR"

if [[ $ARCH = 64 ]]; then
export TARGET=LINUX64
export NWCHEM_TARGET=LINUX64
# select ARCH file and version
if [[ -z "$MACOSX_DEPLOYMENT_TARGET" ]]; then
export TARGET=LINUX64
export NWCHEM_TARGET=LINUX64
else
export TARGET=LINUX
export NWCHEM_TARGET=LINUX
export TARGET=MACX64
export NWCHEM_TARGET=MACX64
fi

#export NWCHEM_MODULES="all python nwxc"

export NWCHEM_MODULES="all python"
#faster build
#export NWCHEM_MODULES="nwdft driver solvation hessian property vib"
export NWCHEM_LONG_PATHS=y
export USE_NOFSCHECK=Y

Expand All @@ -38,11 +41,11 @@ export USE_NOFSCHECK=Y
#export PYTHONVERSION="2.7"
#export USE_PYTHONCONFIG=y

export BLASOPT="-L$PREFIX/lib -lopenblas -lpthread -lrt"
export BLASOPT="-L$PREFIX/lib -lopenblas -lpthread"
export BLAS_SIZE=4
export USE_64TO32=y

export LAPACK_LIB="-lopenblas"
export LAPACK_LIB="$BLASOPT"

export SCALAPACK_SIZE=4
export SCALAPACK_LIB="-L$PREFIX/lib -lscalapack"
Expand All @@ -52,10 +55,14 @@ export SCALAPACK_LIB="-L$PREFIX/lib -lscalapack"
#=================================================

cd "$NWCHEM_TOP"/src
# show compiler versions
${CC} -v
${FC} -v
#
make CC=${CC} _CC=${_CC} FC=${FC} _FC=${_FC} DEPEND_CC=${CC} nwchem_config
cat ${SRC_DIR}/src/config/nwchem_config.h
make DEPEND_CC=${CC} CC=${CC} _CC=${CC} 64_to_32
make CC=${CC} DEPEND_CC=${CC} _CC=${_CC} FC=${FC} _FC=${_FC} V=1
make DEPEND_CC=${CC} CC=${CC} _CC=${CC} 64_to_32
make DEPEND_CC=${CC} CC=${CC} _CC=${_CC} FC=${FC} _FC=${_FC} V=1 CFLAGS_FORGA="-fPIC -Wl,-rpath,${PREFIX}/lib -L${PREFIX}/lib"

#=================================================
#=Install=NWChem
Expand Down
18 changes: 18 additions & 0 deletions recipe/make_config.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
diff --git a/src/config/makefile.h b/src/config/makefile.h
index 7beab60bb7..2baf7eb7da 100644
--- a/src/config/makefile.h
+++ b/src/config/makefile.h
@@ -1195,9 +1195,11 @@ endif
#
FOPTIMIZE+= -funroll-all-loops -mtune=native
FVECTORIZE=-O3 -ffast-math -mtune=native -mfpmath=sse -msse3 -ftree-vectorize -ftree-vectorizer-verbose=1 -fprefetch-loop-arrays -funroll-all-loops
- GNUMAJOR=$(shell $(_FC) -dM -E - < /dev/null 2> /dev/null | grep __GNUC__ |cut -c18-)
+# GNUMAJOR=$(shell $(_FC) -dM -E - < /dev/null 2> /dev/null | grep __GNUC__ |cut -c18-)
+ GNUMAJOR=$(shell cat /dev/null>0.f90; $(FC) -cpp -dM -E 0.f90 2> /dev/null | grep __GNUC__ |cut -c18-)
ifneq ($(strip $(GNUMAJOR)),)
- GNUMINOR=$(shell $(_FC) -dM -E - < /dev/null 2> /dev/null | egrep __GNUC_MINOR | cut -c24)
+# GNUMINOR=$(shell $(_FC) -dM -E - < /dev/null 2> /dev/null | egrep __GNUC_MINOR | cut -c24)
+ GNUMINOR=$(shell cat /dev/null>0.f90; $(FC) -cpp -dM -E 0.f90 2> /dev/null | grep __GNUC_MINOR |cut -c24)
GNU_GE_4_6 = $(shell [ $(GNUMAJOR) -gt 4 -o \( $(GNUMAJOR) -eq 4 -a $(GNUMINOR) -ge 6 \) ] && echo true)
GNU_GE_4_8 = $(shell [ $(GNUMAJOR) -gt 4 -o \( $(GNUMAJOR) -eq 4 -a $(GNUMINOR) -ge 8 \) ] && echo true)
GNU_GE_6 = $(shell [ $(GNUMAJOR) -ge 6 ] && echo true)
Loading

0 comments on commit 10b4a6e

Please sign in to comment.