Skip to content

Commit 0b8a436

Browse files
authored
Add mixed clang/ifort build on OSX to Azure CI (#3185)
* Add mixed clang/ifort build on OSX to the Azure CI config based on https://github.com/oneapi-src/oneapi-ci (and remove debugging tools from the clang+gfortran job) * Remove extraneous libgfortran dependency of ifort builds * remove FEXTRALIB from link line of shared library as ifort keeps track of dependencies (and they are different for a .dylib than what f_check got for an executable)
1 parent 4855af0 commit 0b8a436

File tree

3 files changed

+48
-9
lines changed

3 files changed

+48
-9
lines changed

azure-pipelines.yml

Lines changed: 44 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,15 @@ trigger:
44
branches:
55
include:
66
- develop
7-
7+
resources:
8+
containers:
9+
- container: oneapi-hpckit
10+
image: intel/oneapi-hpckit:latest
11+
options: '-v /usr/bin/sudo:/usr/bin/sudo -v /usr/lib/sudo/libsudo_util.so.0:/usr/lib/sudo/libsudo_util.so.0 -v /usr/lib/sudo/sudoers.so:/usr/lib/sudo/sudoers.so'
12+
- container: oneapi-basekit
13+
image: intel/oneapi-basekit:latest
14+
options: '-v /usr/bin/sudo:/usr/bin/sudo -v /usr/lib/sudo/libsudo_util.so.0:/usr/lib/sudo/libsudo_util.so.0 -v /usr/lib/sudo/sudoers.so:/usr/lib/sudo/sudoers.so'
15+
816
jobs:
917
# manylinux1 is useful to test because the
1018
# standard Docker container uses an old version
@@ -94,7 +102,38 @@ jobs:
94102
- script: |
95103
brew update
96104
brew install llvm libomp
97-
brew tap LouisBrunner/valgrind
98-
brew install --HEAD LouisBrunner/valgrind/valgrind
99-
make TARGET=SANDYBRIDGE NO_AVX512=1 USE_OPENMP=1 INTERFACE64=1 DYNAMIC_ARCH=1 DYNAMIC_LIST=SANDYBRIDGE DEBUG=1 NO_PARALLEL_MAKE=1 CC=/usr/local/opt/llvm/bin/clang FC=gfortran-10
100-
cd ctest; OMP_NUM_THREADS=1 valgrind ./xscblat2 <sin2
105+
make TARGET=CORE2 USE_OPENMP=1 INTERFACE64=1 DYNAMIC_ARCH=1 CC=/usr/local/opt/llvm/bin/clang FC=gfortran-10
106+
107+
- job: OSX_Ifort_Clang
108+
pool:
109+
vmImage: 'macOS-10.15'
110+
variables:
111+
LD_LIBRARY_PATH: /usr/local/opt/llvm/lib
112+
MACOS_HPCKIT_URL: https://registrationcenter-download.intel.com/akdlm/irc_nas/17643/m_HPCKit_p_2021.2.0.2903_offline.dmg
113+
LIBRARY_PATH: /usr/local/opt/llvm/lib
114+
MACOS_FORTRAN_COMPONENTS: intel.oneapi.mac.ifort-compiler
115+
steps:
116+
- script: |
117+
brew update
118+
brew install llvm libomp
119+
sudo mkdir -p /opt/intel
120+
sudo chown $USER /opt/intel
121+
displayName: prepare for cache restore
122+
- task: Cache@2
123+
inputs:
124+
path: /opt/intel/oneapi
125+
key: '"install" | "$(MACOS_HPCKIT_URL)" | "$(MACOS_FORTRAN_COMPONENTS)"'
126+
cacheHitVar: CACHE_RESTORED
127+
- script: |
128+
curl --output webimage.dmg --url $(MACOS_HPCKIT_URL) --retry 5 --retry-delay 5
129+
hdiutil attach webimage.dmg
130+
sudo /Volumes/"$(basename "$(MACOS_HPCKIT_URL)" .dmg)"/bootstrapper.app/Contents/MacOS/bootstrapper -s --action install --components="$(MACOS_FORTRAN_COMPONENTS)" --eula=accept --continue-with-optional-error=yes --log-dir=.
131+
installer_exit_code=$?
132+
hdiutil detach /Volumes/"$(basename "$URL" .dmg)" -quiet
133+
exit $installer_exit_code
134+
displayName: install
135+
condition: ne(variables.CACHE_RESTORED, 'true')
136+
- script: |
137+
source /opt/intel/oneapi/setvars.sh
138+
make CC=/usr/local/opt/llvm/bin/clang FC=ifort
139+

exports/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,13 @@ endif
139139
ifneq (,$(filter 1 2,$(NOFORTRAN)))
140140
#only build without Fortran
141141
$(CC) $(CFLAGS) $(LDFLAGS) -all_load -headerpad_max_install_names -install_name "$(CURDIR)/../$(INTERNALNAME)" -dynamiclib -o ../$(LIBDYNNAME) $< -Wl,-exported_symbols_list,osx.def $(FEXTRALIB)
142+
else
143+
ifeq ($(F_COMPILER), INTEL)
144+
$(FC) $(FFLAGS) $(LDFLAGS) -all-load -headerpad_max_install_names -install_name "$(CURDIR)/../$(INTERNALNAME)" -dynamiclib -o ../$(LIBDYNNAME) $< -Wl,-exported_symbols_list,osx.def
142145
else
143146
$(FC) $(FFLAGS) $(LDFLAGS) -all_load -headerpad_max_install_names -install_name "$(CURDIR)/../$(INTERNALNAME)" -dynamiclib -o ../$(LIBDYNNAME) $< -Wl,-exported_symbols_list,osx.def $(FEXTRALIB)
144147
endif
148+
endif
145149

146150
dllinit.$(SUFFIX) : dllinit.c
147151
$(CC) $(CFLAGS) -c -o $(@F) -s $<

f_check

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -391,10 +391,6 @@ if ($link ne "") {
391391

392392
}
393393

394-
if ($vendor eq "INTEL"){
395-
$linker_a .= "-lgfortran"
396-
}
397-
398394
if ($vendor eq "FLANG"){
399395
$linker_a .= "-lflang"
400396
}

0 commit comments

Comments
 (0)