From cce4016a516fcac50a71b78a0d0e66caed75ce5f Mon Sep 17 00:00:00 2001 From: Raul Infante-Sainz Date: Wed, 9 Dec 2020 20:09:43 +0000 Subject: Configuration: not settting C_INCLUDE_PATH on macOS Until now, when building the high-level (optional) software, we would give both 'CPPFLAGS' and 'C_INCLUDE_PATH' the same value/directory in 'high-level.mk'. But we recently found that on macOS's C compiler ('clang'), if a directory is included in both 'CPPFLAGS' and 'C_INCLUDE_PATH', then that directory is ignored in 'CPPFLAGS' (which has higher priority). This caused linking problems when the version of a software on the host was different from the Maneage version. With this commit, 'C_INCLUDE_PATH' is not set on macOS any more and this fixed the problem on the reported systems. This bug was fixed with the help of Mohammad Akhlaghi and Mahdieh Navabi. --- reproduce/software/make/high-level.mk | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'reproduce/software/make') diff --git a/reproduce/software/make/high-level.mk b/reproduce/software/make/high-level.mk index c3bda3e..bd9a61f 100644 --- a/reproduce/software/make/high-level.mk +++ b/reproduce/software/make/high-level.mk @@ -135,11 +135,18 @@ export PKG_CONFIG_PATH := $(ildir)/pkgconfig:$(idir)/share/pkgconfig export CC := $(ibdir)/gcc export CXX := $(ibdir)/g++ export F77 := $(ibdir)/gfortran -export C_INCLUDE_PATH := $(iidir) -export CPLUS_INCLUDE_PATH := $(iidir) export LD_RUN_PATH := $(ildir):$(il64dir) export LD_LIBRARY_PATH := $(ildir):$(il64dir) +# In macOS, if a directory exists in both 'C_INCLUDE_PATH' and 'CPPFLAGS' +# it will be ignored in 'CPPFLAGS' (which has higher precedence). So, we +# should not define 'C_INCLUDE_PATH' on macOS. This happened with clang +# (Apple LLVM version 10.0.0, clang-1000.11.45.5) +ifneq ($(on_mac_os),yes) +export C_INCLUDE_PATH := $(iidir) +export CPLUS_INCLUDE_PATH := $(iidir) +endif + # Recipe startup script, see `reproduce/software/shell/bashrc.sh'. export PROJECT_STATUS := configure_highlevel export BASH_ENV := $(shell pwd)/reproduce/software/shell/bashrc.sh -- cgit v1.2.1