aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaul Infante-Sainz <infantesainz@gmail.com>2020-12-09 20:09:43 +0000
committerMohammad Akhlaghi <mohammad@akhlaghi.org>2020-12-09 22:44:13 +0000
commitcce4016a516fcac50a71b78a0d0e66caed75ce5f (patch)
treec063235cf1ee3c494aa3e8b95fe614ffeddcc73e
parent021ff34c256e1a1eb9de3f80e0d27a5b3477a2e4 (diff)
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.
-rw-r--r--reproduce/software/make/high-level.mk11
1 files changed, 9 insertions, 2 deletions
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