Errors when compiling gasnet - invalid param max-inline-insns and debug/optimization flags

Issue #441 resolved
Valentina Galata created an issue

Hello,

I have/had some trouble installing UPCXX: the GASNet step was failing with the following errors:

make[3]: *** [Makefile:93: do-gasnet-configure] Error 1
make[2]: *** [Makefile:163: do-gasnet-configure-debug] Error 2
make[1]: *** [Makefile:589: all] Error 2

********
UPC++ build failed. Please report the ENTIRE log above to: upcxx@googlegroups.com
********

make[1]: *** [/mnt/lscratch/users/vgalata/tools/upcxx-2020.10.0_failed/upcxx-2020.10.0/bld/Makefile.rules:96: failure] Error 1
make: *** [/mnt/lscratch/users/vgalata/tools/upcxx-2020.10.0_failed/upcxx-2020.10.0/bld/Makefile.rules:54: all] Error 2

From the output, the errors are:

  1. checking for C compiler flag --param max-inline-insns=100000... no/error: cc1: error: invalid --param name 'max-inline-insns'; did you mean 'max-combine-insns'?
  2. configure error: User requested --enable-debug but $CC has enabled optimization (-O) or disabled assertions (-DNDEBUG). Appending '-O0 -UNDEBUG' to $CC did not resolve this conflict. Try setting ...

(The output of .configure, the make stdout and stderr log, and the config.log are attached.)

I saw in Makefile.rules that debug can be disabled when using --enable-single=opt. So, I ran ./configure --prefix="." --enable-single=opt and only then everything compiled. Also, make check and make installed worked.

UPCXX version: 2020.10.0

Executed commands:

# after creating and activating a conda env (see below)
wget https://bitbucket.org/berkeleylab/upcxx/downloads/upcxx-2020.10.0.tar.gz
tar -xzvf upcxx-2020.10.0.tar.gz
cd upcxx-2020.10.0/
./configure --prefix="." # tried also with --enable-single=opt
make all 2>&1 > make.log

conda environment YAML:

channels:
  - conda-forge
  - defaults
dependencies:
  - gcc_linux-64=9.3.0=h7247604_29
  - gxx_linux-64=9.3.0=h0d07fa4_29
  - python=3.9.1 # >= 2.7.5
  - perl=5.32.0 # >= 5.005
  - bash=5.0.018 # >= 3.2
  - make=4.3 # >= 3.80
  - cmake=3.19.3

Comments (6)

  1. Paul Hargrove

    Valentina,

    Thanks for the report and for the attachments, which I believe are sufficient for me to understand your problem.

    First, I want to reassure you that the first "error" you report is not an error at all. This is simply the configure script determining that a certain compiler flag is not available. Such messages are a normal part of determining the capabilities of the compiler.

    However, the second error you report, regarding "User requested --enable-debug but ...", is a genuine problem.

    Looking over the configure.log you attached, I see -O2 appears in the values of the CFLAGS and CXXFLAGS environment variables. The variable CPPFLAGS contains both -O2 and -DNDEBUG. One or more of these flags are preventing GASNet (and thus UPC++) from building the debugging-enabled libraries to be used when -g is passed to the upcxx compiler wrapper (or similarly, then using UPCXX_CODEMODE=debug and upcxx-meta for settings).

    Issue 362 is similar to yours, and I believe the reporter of that issue found that not loading Anaconda while building/installing UPC++ was sufficient. So, that would my first suggestion.

    If not loading Anaconda for the duration of the UPC++ build/install is not an option for you, then I suggest that you retry, starting from the configure step, either without those three environment variables set, or else with them modified to remove -O2 and -DNDEBUG. I am unsure, but the -Wl,-O2 in LDFLAGS might also present a problem and need to be unset or modified as well. Alternatively, it may make sense to use the system compilers as CC and CXX (not the conda-specific ones) which I suspect might be done in a way which also removes the problematic environment settings.

    Even with these environment changes, UPC++ and GASNet libraries will be build with optimizations (just not the ones used for -g) and one still has complete control over the flags used to compile and link UPC++ code. So, those changes (only needed while configuring and building UPC++) should not reduce application performance.

    Please let us know if neither of these options (build without anaconda, or with adjustments to key environment variables) is sufficient and we see what else might be done.

    Two additional side notes:

    Please do not use --enable-single=opt. That is an option intended only for interaction with our CI/testing environment. I believe you should have received a warning from the configure script which contains "This mode is intended for maintainers only" and "Many make targets will fail and components will be missing". That second portion, in particular, means you did not produce a complete UPC++ installation when using that option.

    Please consider an alternate to --prefix=".". Use of the source directory as the installation prefix unnecessarily mixes the sources and installation such that running make distclean or re-running configure would partially erase or overwrite the installation.

    -Paul

  2. Valentina Galata reporter

    Dear @Paul Hargrove ,

    Thank you very much for the fast reply!

    I would really prefer to do the installation using the specific conda environment because I want to have the control over the used tool versions.

    I tried to remove the flags you mentioned above, but it still does not work. I will try again tomorrow using a different setup.

    Edit: I am aware that using --enable-single=opt is not a proper solution. That is why I opened this issue. Thank you pointing that out!

  3. Paul Hargrove

    Valentina,

    Please try the second option I describe in which the -O2 and -NDEBUG options are removed from the CFLAGS, CXXFLAGS and CPPFLAGS environment variables. This only needs to be done for the duration of the build and installation of UPC++, and you may return to using their original settings when the build is complete (including when compiling UPC++ applications). This retains use of the desired toolchain version, as you desire, but removes the conflicting optimization-related options.

    I was pretty sure you understood the --enable-single=... option was not the right choice, but since others may read these bug reports looking for help (and not necessarily read every word closely) I felt it best to make a clear statement.

  4. Valentina Galata reporter

    Dear @Paul Hargrove ,

    Please try the second option I describe in which the -O2 and -NDEBUG options are removed from the CFLAGSCXXFLAGS and CPPFLAGS environment variables.

    I did try that first but the compilation still failed. Yesterday, I just removed all the flags and the compilation using make worked fine. Tried it also by loading specific tool versions using EasyBuild instead of conda and it worked too. So, the issue was definitely caused by the default conda flags as you said in your first reply.

    Thank you very much for your support!

  5. Log in to comment