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

BUILD: 1.25.0: make clobber errors #18455

Closed
tonycurtis opened this issue Sep 24, 2021 · 7 comments
Closed

BUILD: 1.25.0: make clobber errors #18455

tonycurtis opened this issue Sep 24, 2021 · 7 comments

Comments

@tonycurtis
Copy link

Summary of Problem

$ make clobber

...

cd qthread && make clobber
/bin/sh: /lustre/home/arcurtis/chapel/chapel-1.25.0/third-party/llvm/install/linux64-aarch64-gnu/bin/clang: No such file or directory
/bin/sh: /lustre/home/arcurtis/chapel/chapel-1.25.0/third-party/llvm/install/linux64-aarch64-gnu/bin/clang++: No such file or directory
/bin/sh: line 0: test: -lt: unary operator expected
/bin/sh: line 0: test: too many arguments
/bin/sh: line 0: test: -lt: unary operator expected
/bin/sh: line 0: test: -lt: unary operator expected

...

cd tools/mason && make clobber

Removing Mason...
rm -f /lustre/home/arcurtis/chapel/chapel-1.25.0/bin/linux64-aarch64/mason
cd tools/protoc-gen-chpl && make clobber
/bin/sh: line 0: cd: tools/protoc-gen-chpl: No such file or directory
make: *** [Makefile:196: clobber] Error 1

Steps to Reproduce

Compile command:

make clobber

Execution command:
N/A

Configuration Information

  • Output of chpl --version:
chpl version 1.25.0
  built with LLVM version 11.0.1
Copyright 2020-2021 Hewlett Packard Enterprise Development LP
Copyright 2004-2019 Cray Inc.
(See LICENSE file for more details)
  • Output of $CHPL_HOME/util/printchplenv --anonymize:
CHPL_TARGET_PLATFORM: linux64
CHPL_TARGET_COMPILER: llvm
CHPL_TARGET_ARCH: aarch64
CHPL_TARGET_CPU: unknown
CHPL_LOCALE_MODEL: numa +
CHPL_COMM: gasnet +
  CHPL_COMM_SUBSTRATE: ibv +
  CHPL_GASNET_SEGMENT: fast +
CHPL_TASKS: qthreads
CHPL_LAUNCHER: gasnetrun_ibv +
CHPL_TIMERS: generic
CHPL_UNWIND: none
CHPL_MEM: jemalloc
CHPL_ATOMICS: cstdlib
  CHPL_NETWORK_ATOMICS: none
CHPL_GMP: none
CHPL_HWLOC: bundled
CHPL_RE2: none
CHPL_LLVM: bundled +
CHPL_AUX_FILESYS: lustre +
  • Back-end compiler and version, e.g. gcc --version or clang --version:
$ gcc --version
gcc (GCC) 8.3.1 20191121 (Red Hat 8.3.1-5)
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@bradcray
Copy link
Member

Thanks for filing this @tonycurtis ! (I'm assuming that this is not holding you up in any way, but please give a shout if I'm incorrect in that).

@tonycurtis
Copy link
Author

tonycurtis commented Sep 24, 2021 via email

@bradcray
Copy link
Member

For the team, CHPL_LLVM=bundled seems to be the root of the problem here. Or, at least, starting from my default environment, setting that, and doing make clobber reproduced the issue for me.

@bradcray
Copy link
Member

@mppf: I believe that this behavior is because in these lines:

DEF_C_VER := $(shell echo __STDC_VERSION__ | $(CC) -E -x c - | sed -e '/^\#/d' -e 's/L$$//' -e 's/__STDC_VERSION__/0/')
DEF_CXX_VER := $(shell echo __cplusplus | $(CXX) -E -x c++ - | sed -e '/^\#/d' -e 's/L$$//' -e 's/__cplusplus/0/')

CC and CXX are referring to the bundled versions of clang/clang++ which have already been deleted due to the clobber. Based on other CC/CXX plumbing that you've done, do you have any thoughts about the best way to handle this? Part of me is tempted to just do something like make these macros no-op if test -x $(CC) fails, but maybe there'd be something smarter to do upstream where CC/CXX themselves are defined? Or to even move this logic out of the Makefiles and into the Python scripts?

@mppf
Copy link
Member

mppf commented Sep 24, 2021

Yes, I think a quick fix would be to adjust these to no-op if the command fails. However in fact I would advocate for moving this logic into the Python scripts.

mppf added a commit that referenced this issue Oct 12, 2021
Improve compiler configuration

This PR takes several steps to improve the configuration visible in `printchplenv`.

It is intended to resolve the following issues:
 * #18450 
 * Cray/chapel-private#2520
 * Cray/chapel-private#2529
 * #18455

It takes the following steps:
 * Adjusts make/compiler/Makefile.clang to avoid running the compiler when `CHPL_TARGET_COMPILER=llvm` in order to avoid problems with `make clobber` with `CHPL_LLVM=bundled`. We can avoid running the compiler since we only build with LLVM 11+ and the associated clang defaults to C17 and C++14. In the future, it would be nice to move this logic to the Python scripts, but I did not take that on here.
 * Removes CPU feature tables since these have not been properly updated in a long time and have limited benefit. This reduces maintenance and the likelihood a user will run into problems when using an architecture not specifically tested. However, removing these feature tables means we can no longer give warnings/errors when the configuration requested appears to be something that could not run.
 * Uses a simple table to map PrgEnv CPU names to clang/llvm architecture names. This is a stopgap solution until we find a better way.
  * Changes CC/CXX support (added in PR #17923) to make setting these variables have less of a confusing impact (per discussion in #18450):
    * they do not prevent `CHPL_TARGET_COMPILER` defaulting to `llvm` when that makes sense
    * they are unused if other `CHPL_*_COMPILER` / `CHPL_*_CC` / `CHPL_*_CXX` are set
    * they apply only to the host configuration when working on a system using a PrgEnv compiler

Reviewed by @daviditen - thanks!

- [x] test on a Cray PrgEnv system
- [x] full local testing
@mppf
Copy link
Member

mppf commented Oct 12, 2021

I've verified that PR #18485 fixes this issue for me so I'm closing it. We can reopen it / create a new issue if the issue appears in some configuration I haven't tested.

@mppf mppf closed this as completed Oct 12, 2021
@bradcray
Copy link
Member

Thanks, Michael!

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

3 participants