Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Environment variables not honored in some Makefiles #87

Open
TannerFirl opened this issue Sep 13, 2023 · 1 comment
Open

Environment variables not honored in some Makefiles #87

TannerFirl opened this issue Sep 13, 2023 · 1 comment

Comments

@TannerFirl
Copy link

TannerFirl commented Sep 13, 2023

There's a handful of CC = lines in Makefiles that should be CC ?= so it may be properly overridden by a user's CC environment variable. Examples:

src/components/host_micpower/utils/Makefile:1:CC = gcc
src/components/powercap/utils/Makefile:1:CC = gcc
src/components/rapl/utils/Makefile:1:CC = gcc
src/examples/Makefile:3:CC = gcc
src/examples/Makefile:17:   CC = xlc
src/examples/Makefile.AIX:3:CC = xlc
src/examples/Makefile.IRIX64:3:CC = gcc
src/examples/Makefile.OSF1:3:CC = gcc
src/libperfnec/config.mk:77:#CC=icc
src/libperfnec/config.mk:103:CC=craynv-cray-linux-gnu-gcc
src/libpfm-3.y/config.mk:164:#CC=icc
src/libpfm-3.y/config.mk:190:CC=craynv-cray-linux-gnu-gcc
src/libpfm4/config.mk:189:#CC=icc
src/libpfm4/config.mk:206:CC=clang
src/perfctr-2.6.x/examples/global/Makefile:5:CC=gcc
src/perfctr-2.6.x/examples/perfex/Makefile:5:CC=gcc
src/perfctr-2.6.x/examples/self/Makefile:5:CC=gcc
src/perfctr-2.6.x/examples/signal/Makefile:5:CC=gcc
src/perfctr-2.6.x/usr.lib/Makefile:5:CC=gcc
src/perfctr-2.7.x/examples/global/Makefile:5:CC=gcc
src/perfctr-2.7.x/examples/perfex/Makefile:5:CC=$(CROSS_COMPILE)gcc
src/perfctr-2.7.x/examples/self/Makefile:5:CC=$(CROSS_COMPILE)gcc
src/perfctr-2.7.x/examples/signal/Makefile:5:CC=$(CROSS_COMPILE)gcc
src/perfctr-2.7.x/usr.lib/Makefile:5:CC=$(CROSS_COMPILE)gcc

In addition, fortran tests are not honoring the FFLAGS environment variable. Adding FFLAGS = @FFLAGS@ to src/components/Makefile_comp_tests.target.in appears to fix this issue.

Somewhat related, these 2 conditional blocks in src/components/sde/tests/Makefile and src/components/sysdetect/tests/Makefile could be made more robust by adding an else ifeq check for gfortran-12

ifeq ($(notdir $(F77)),gfortran)
    FFLAGS +=-ffree-form -ffree-line-length-none
else ifeq ($(notdir $(F77)),flang)
    FFLAGS +=-ffree-form
else ifeq ($(findstring $(notdir $(F77)), $(intel_compilers)),)
    FFLAGS +=-free
else ifeq ($(findstring $(notdir $(F77)), $(cray_compilers)),)
    FFLAGS +=-ffree
endif
@gcongiu
Copy link
Contributor

gcongiu commented Oct 24, 2023

This is a known issue that is not easy to resolve as it would require changing a myriad of files in the build system. Note that the sysdetect test Makefile has been amended to fix a bug with intel and cray fortran compiler flags (see #96)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants