Error during UPC-to-C translation: DeclBase.cpp

24 views
Skip to first unread message

stur...@gmail.com

unread,
Apr 3, 2019, 8:43:01 PM4/3/19
to upc-users
Dear all,

I am not sure if this is the right discussion forum for this, but here it goes.

I am having trouble compiling a file with the following command:

/home/redacted_dir/usr/bin/upcc -DCONFIG_CHECK_SEQS -DCONFIG_SHOW_PROGRESS -DHAS_SCHED -DHIPMER_EMBED_HMMER=1 -DKSEQ_BUFFER_SIZE=1048576 -DLIB_NAME_LEN=15 -DMAX_FILE_PATH=256 -DMAX_LIBRARIES=128 -DMAX_READ_NAME_LEN=14 -DNO_AVX512F -DNO_PAD -DPROFILE -DUSE_BUPC -cupc2c  -pthreads=0 -DNDEBUG -O   -I/home/redacted_dir/builds/hipmer/redacted-hipmer-build-Linux/libhmmer/include -I/home/redacted_dir/usr/include -I/home/redacted_dir/usr/include/clang/AST -I/home/redacted_dir/src/HipMer-v1.0/src/optlist -I/home/redacted_dir/src/HipMer-v1.0/src/hipmer/common  -o CMakeFiles/upc_common.dir/upc_output.o -c /home/redacted_dir/src/HipMer-v1.0/src/hipmer/common/upc_output.upc

The command is issued as part of compilation of the genome assembly pipeline found here: https://sourceforge.net/projects/hipmer/

The error shown is:
clang-upc2c: /home/redacted_dir/src/llvm/tools/clang/lib/AST/DeclBase.cpp:1234: void clang::DeclContext::addHiddenDecl(clang::Decl*): Assertion `D->getLexicalDeclContext() == this && "Decl inserted into wrong lexical context"' failed.

Can someone point me in the right direction on how to attempt to resolve this? Can I somehow track down the issue to a particular line of code in upc_output.upc?

Note that I have installed clang-upc2c in my home directory and I am not experienced in doing that kind of thing, so it is very possible that I messed that up. That said, clang and bupc tests seem to pass (except for some that are expected to fail?) Any ideas would be appreciated.

Paul Hargrove

unread,
Apr 5, 2019, 12:37:56 PM4/5/19
to stur...@gmail.com, upc-users
Salomon,

Sorry for the delay in responding.  I had to do some checking before I could reply with confidence.

First, regarding your doubt if this is the right forum:
I am not aware of a forum specific to supporting HipMer users.
The Berkeley UPC developers work closely with the HipMer developers, and your posting has been forwarded to the latter.
Additionally, the developers of clang-upc2c are members of this forum.
So, this is as good a place as any.

The problem you are seeing is a crash of the clang-upc2c compiler.
It looks very similar to one I submitted back in December:  https://github.com/Intrepid/upc2c/issues/117
The asserting line number is not the same, but that could just be due to different versions.
I have updated that issue with a link to your upc-users posting.

The problem in that issue is that the clang-upc2c internals are having problems with a declaration used in the system header sys/wait.h.  Since a cursory examination of the HipMer source does not show that header included, it is either possible that (a) it is included indirectly or (b) that your compiler crash is triggered by some *other* system header.  Either way, I don't believe that this is triggered by any specific C or UPC code in HipMer or it would be a more widely known issue.

Unfortunately, this all means I don't know of any simple/reliable work-around for the problem.
If you can narrow down which header (or headers) in upc_output.upc cause the problem (by selectively removing #include lines until this error is replaced by one related to the header's omission), then it *might* be helpful to add that information to the clang-upc2c issue I linked above.  However, I don't think it is critical that you do so.

It is thought that this problem is specific to the version of glibc used (2.17 and higher).
So, you might have better luck using a system with an older Linux distribution.

I have not tested this idea, but if the problem is the same declaration in sys/wait.h, then it might be possible to ensure it is omitted at pre-process time by adding `-U__GNUC__` to the problematic compilation command.  However, there is a risk that could cause different problems.

As I noted above, the HipMer and clang-upc2c developers are also now aware of your problem report.
So, it is also possible that they will respond with additional suggestions or with follow-up questions.

Finally, could you please provide the output of the following two commands?
    /home/[redacted_dir]/usr/bin/upcc -cupc2c --version
    grep '#define.__GLIBC' /usr/include/features.h
This information may help me or others to reproduce your problem.

-Paul


--
You received this message because you are subscribed to the Google Groups "upc-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to upc-users+...@lbl.gov.
To post to this group, send email to upc-...@lbl.gov.
Visit this group at https://groups.google.com/a/lbl.gov/group/upc-users/.


--
Paul H. Hargrove <PHHar...@lbl.gov>
Computer Languages & Systems Software (CLaSS) Group
Computer Science Department
Lawrence Berkeley National Laboratory

Salomon Turgman

unread,
Apr 5, 2019, 3:33:19 PM4/5/19
to upc-users
Dear Paul,

Thank you for the detailed and kind response. While I explore some of your pointers, below is the output you requested.I want to emphasize that I have compiled llvm, clang-upc, the translator, and bupc manually and installed them in a location in my HOME folder. So there may be something I am doing wrong as well (I am in particular suspicious of my environment variables). I also want to emphasize that, since I have sent that email, I rebuilt the upcc command with different settings and compilers and the output below is not using the same installation as I used for the original post. The error message is exactly the same, though. Since my original message (as you can see below) I started using spack to see if I could setup the required packages before compiling HipMer, but I get the same error.

output of upcc command:
This is upcc (the Berkeley Unified Parallel C compiler), v. 2.28.0
----------------------+---------------------------------------------------------
 UPC Runtime          | v. 2.28.0, built on Apr  5 2019 at 10:08:46
----------------------+---------------------------------------------------------
 UPC-to-C translator  | 3.9.1-0 20170320, built on Apr 4 2019 at 21:48:32
----------------------+---------------------------------------------------------
 Translator location  | /home/redacteddir/usr/bin/clang-upc2c
----------------------+---------------------------------------------------------
 networks supported   | smp ofi udp mpi
----------------------+---------------------------------------------------------
 default network      | smp
----------------------+---------------------------------------------------------
 pthreads support     | available (if used, default is 2 pthreads per process)
----------------------+---------------------------------------------------------
 Configured with      | '--with-clang-upc2c=/home/redacteddir/usr/bin
                      | /clang-upc2c'
                      | '--with-multiconf-file=multiconf_cupc2c.conf.in'
                      | '--enable-ofi' '--disable-psm' '--disable-ibv'
                      | '--enable-pthreads' '--enable-udp' '--enable-smp'
                      | '--with-default-network=smp' '--enable-pshm'
                      | '--disable-aligned-segments'
                      | '--prefix=/home/redacteddir/usr/opt_cupc2c'
                      | '--with-multiconf-magic=opt_cupc2c'
----------------------+---------------------------------------------------------
 Configure features   | trans_cupc2c,driver_upcc,runtime_upcr,gasnet,
                      | upc_collective,upc_io,upc_memcpy_async,upc_memcpy_vis,
                      | upc_ptradd,upc_thread_distance,upc_tick,upc_sem,
                      | upc_dump_shared,upc_trace_printf,upc_trace_mask,
                      | upc_local_to_shared,upc_all_free,pupc,upc_types,
                      | upc_castable,upc_nb,nodebug,notrace,nostats,
                      | nodebugmalloc,nogasp,nothrille,segment_fast,os_linux,
                      | cpu_x86_64,cpu_64,cc_gnu,packedsptr,upc_io_64
----------------------+---------------------------------------------------------
 Configure id         | gateway01.cluster Fri Apr  5 09:46:55 EDT 2019
                      | sturgmancohen
----------------------+---------------------------------------------------------
 Binary interface     | 64-bit x86_64-unknown-linux-gnu
----------------------+---------------------------------------------------------
 Runtime interface #  | Runtime supports 3.0 -> 3.12: Translator uses (unknown)
----------------------+---------------------------------------------------------
                      |  --- BACKEND SETTINGS (for smp network) ---
----------------------+---------------------------------------------------------
 C compiler           | /home/redacteddir/spack/opt/spack/linux-cento
                      | s7-x86_64/gcc-4.8.5/gcc-8.2.0-sxbf4jq6ghmoybsjlpqz2dm2q
                      | bbxzfyn/bin/gcc
                      |   GNU/8.2.0/8.2.0
                      |   gcc (GCC) 8.2.0 Copyright (C) 2018 Free Software
                      |   Foundation, Inc.
----------------------+---------------------------------------------------------
 C compiler flags     | -O3 --param max-inline-insns-single=35000 --param
                      | inline-unit-growth=10000 --param
                      | large-function-growth=200000 -Wno-unused
                      | -Wunused-result -Wno-unused-parameter -Wno-address
----------------------+---------------------------------------------------------
 linker               | /home/redacteddir/spack/opt/spack/linux-cento
                      | s7-x86_64/gcc-4.8.5/gcc-8.2.0-sxbf4jq6ghmoybsjlpqz2dm2q
                      | bbxzfyn/bin/gcc
                      |   GNU/8.2.0/8.2.0
                      |   gcc (GCC) 8.2.0 Copyright (C) 2018 Free Software
                      |   Foundation, Inc.
----------------------+---------------------------------------------------------
 linker flags         | -O3 --param max-inline-insns-single=35000 --param
                      | inline-unit-growth=10000 --param
                      | large-function-growth=200000 -Wno-unused
                      | -Wunused-result -Wno-unused-parameter -Wno-address
                      | -L/home/redacteddir/usr/opt_cupc2c/lib
                      | -lupcr-smp-seq -lumalloc
                      | -L/home/redacteddir/usr/opt_cupc2c/lib
                      | -lgasnet-smp-seq -lrt
                      | -L/home/redacteddir/spack/opt/spack/linux-cen
                      | tos7-x86_64/gcc-4.8.5/gcc-8.2.0-sxbf4jq6ghmoybsjlpqz2dm
                      | 2qbbxzfyn/lib/gcc/x86_64-pc-linux-gnu/8.2.0 -lgcc -lm
----------------------+---------------------------------------------------------
Output for the grep command grep '#define.__GLIBC' /usr/include/features.h:
#define __GLIBC__       2
#define __GLIBC_MINOR__ 17
#define __GLIBC_PREREQ(maj, min) \

Thanks again for your help. I will try to identify where are things going rogue in upc_output

stur...@gmail.com

unread,
Apr 10, 2019, 4:06:31 PM4/10/19
to upc-users
Dear All,

Since I posted my message, I have been able to build Hipmer. A key difference between a successful build and the build with the error stated in my original post is that:

* When I compile with a self-built (by following instructions) bupc and clang-upc2c the error message above appears.
* When I compile with the bupc and clang-upc2c installed by a script in the Hipmer distribution, things worked ok.

I am working through the options used in the install script and how they are different from the ones I used to see if I can pinpoint what exactly in my method is breaking things. I will update this post when/if I find the culprit.

-s-

Paul Hargrove

unread,
Apr 10, 2019, 4:10:44 PM4/10/19
to Salomon Turgman, upc-users
Salomon,

I am glad to hear that things are now working for you.
Thank you so much for you patience.

We look forward to hearing from you regarding the difference between a working and non-working clang-upc2c.

-Paul

--
You received this message because you are subscribed to the Google Groups "upc-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to upc-users+...@lbl.gov.
To post to this group, send email to upc-...@lbl.gov.
Visit this group at https://groups.google.com/a/lbl.gov/group/upc-users/.
Reply all
Reply to author
Forward
0 new messages