public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* gcc-7.3.0: ptxas lib_a-hash_func.o, line 11; fatal : Invalid initial value expression
@ 2018-02-24 16:20 Siegmar Gross
  2018-02-24 22:18 ` Thomas Schwinge
  0 siblings, 1 reply; 3+ messages in thread
From: Siegmar Gross @ 2018-02-24 16:20 UTC (permalink / raw)
  To: gcc

Hi,

today I tried to install gcc-7.3.0 with accelerator support
on my "SUSE Linux Enterprise Server 12.3 (x86_64)" with
gcc-6.4.0. I used the following commands to download and build
everything.

setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/usr/local/cuda/lib64
setenv CUDA_INC_PATH /usr/local/cuda/include
setenv CUDA_LIB_PATH /usr/local/cuda/lib64
set path = ( ${path} /usr/local/cuda/bin )

git clone https://github.com/MentorEmbedded/nvptx-tools
git clone https://github.com/MentorEmbedded/nvptx-newlib

wget ftp://ftp.gwdg.de/pub/misc/gcc/releases/gcc-7.3.0/gcc-7.3.0.tar.xz
tar xf gcc-7.3.0.tar.xz
cd gcc-7.3.0
ln -s ../nvptx-newlib/newlib newlib
cd ..

mkdir make_nvptx-tools
cd make_nvptx-tools
../nvptx-tools/configure --prefix=/usr/local/gcc-7.3.0 \
   |& tee log.configure
make |& tee log.make
make install |& tee log.make-install
cd ..

mkdir gcc-7.3.0_build
cd gcc-7.3.0_build
../gcc-7.3.0/configure --prefix=/usr/local/gcc-7.3.0 \
   --target=nvptx-none \
   --enable-as-accelerator-for=x86_64-pc-linux-gnu \
   --with-build-time-tools=/usr/local/gcc-7.3.0/nvptx-none/bin \
   --disable-sjlj-exceptions \
   --with-newlib \
   --enable-newlib-io-long-long \
   --enable-languages=c,c++,fortran,lto \
   |& tee log.configure
make |& tee log.make


Unfortunately, "make" breaks with the following error.

loki gcc-7.3.0_build 117 tail -31 log.make
/export2/src/gcc-7.3.0/gcc-7.3.0_build/./gcc/xgcc -B/export2/src/gcc-7.3.0/gcc-7.3.0_build/./gcc/ -nostdinc 
-B/export2/src/gcc-7.3.0/gcc-7.3.0_build/nvptx-none/mgomp/newlib/ -isystem /export2/src/gcc-7.3.0/gcc-7.3.0_build/nvptx-none/mgomp/newlib/targ-include -isystem 
/export2/src/gcc-7.3.0/gcc-7.3.0/newlib/libc/include -B/usr/local/gcc-7.3.0/nvptx-none/bin/ -B/usr/local/gcc-7.3.0/nvptx-none/lib/ -isystem 
/usr/local/gcc-7.3.0/nvptx-none/include -isystem /usr/local/gcc-7.3.0/nvptx-none/sys-include  -mgomp -DPACKAGE_NAME=\"newlib\" -DPACKAGE_TARNAME=\"newlib\" 
-DPACKAGE_VERSION=\"2.1.0\" -DPACKAGE_STRING=\"newlib\ 2.1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -I. -I../../../../../../gcc-7.3.0/newlib/libc/search 
-DMALLOC_PROVIDED -DMISSING_SYSCALL_NAMES -fno-builtin      -g -O2  -mgomp -c -o lib_a-hash_buf.o `test -f 'hash_buf.c' || echo 
'../../../../../../gcc-7.3.0/newlib/libc/search/'`hash_buf.c
/export2/src/gcc-7.3.0/gcc-7.3.0_build/./gcc/xgcc -B/export2/src/gcc-7.3.0/gcc-7.3.0_build/./gcc/ -nostdinc 
-B/export2/src/gcc-7.3.0/gcc-7.3.0_build/nvptx-none/mgomp/newlib/ -isystem /export2/src/gcc-7.3.0/gcc-7.3.0_build/nvptx-none/mgomp/newlib/targ-include -isystem 
/export2/src/gcc-7.3.0/gcc-7.3.0/newlib/libc/include -B/usr/local/gcc-7.3.0/nvptx-none/bin/ -B/usr/local/gcc-7.3.0/nvptx-none/lib/ -isystem 
/usr/local/gcc-7.3.0/nvptx-none/include -isystem /usr/local/gcc-7.3.0/nvptx-none/sys-include  -mgomp -DPACKAGE_NAME=\"newlib\" -DPACKAGE_TARNAME=\"newlib\" 
-DPACKAGE_VERSION=\"2.1.0\" -DPACKAGE_STRING=\"newlib\ 2.1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -I. -I../../../../../../gcc-7.3.0/newlib/libc/search 
-DMALLOC_PROVIDED -DMISSING_SYSCALL_NAMES -fno-builtin      -g -O2  -mgomp -c -o lib_a-hash_func.o `test -f 'hash_func.c' || echo 
'../../../../../../gcc-7.3.0/newlib/libc/search/'`hash_func.c
ptxas lib_a-hash_func.o, line 11; fatal   : Invalid initial value expression
ptxas fatal   : Ptx assembly aborted due to errors
nvptx-as: ptxas returned 255 exit status
Makefile:413: recipe for target 'lib_a-hash_func.o' failed
make[8]: *** [lib_a-hash_func.o] Error 1
make[8]: Leaving directory '/export2/src/gcc-7.3.0/gcc-7.3.0_build/nvptx-none/mgomp/newlib/libc/search'
Makefile:635: recipe for target 'all-recursive' failed
make[7]: *** [all-recursive] Error 1
make[7]: Leaving directory '/export2/src/gcc-7.3.0/gcc-7.3.0_build/nvptx-none/mgomp/newlib/libc'
Makefile:627: recipe for target 'all-recursive' failed
make[6]: *** [all-recursive] Error 1
make[6]: Leaving directory '/export2/src/gcc-7.3.0/gcc-7.3.0_build/nvptx-none/mgomp/newlib'
Makefile:450: recipe for target 'all' failed
make[5]: *** [all] Error 2
make[5]: Leaving directory '/export2/src/gcc-7.3.0/gcc-7.3.0_build/nvptx-none/mgomp/newlib'
Makefile:1188: recipe for target 'multi-do' failed
make[4]: *** [multi-do] Error 1
make[4]: Leaving directory '/export2/src/gcc-7.3.0/gcc-7.3.0_build/nvptx-none/newlib'
Makefile:1104: recipe for target 'all-multi' failed
make[3]: *** [all-multi] Error 2
make[3]: Leaving directory '/export2/src/gcc-7.3.0/gcc-7.3.0_build/nvptx-none/newlib'
Makefile:450: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/export2/src/gcc-7.3.0/gcc-7.3.0_build/nvptx-none/newlib'
Makefile:11097: recipe for target 'all-target-newlib' failed
make[1]: *** [all-target-newlib] Error 2
make[1]: Leaving directory '/export2/src/gcc-7.3.0/gcc-7.3.0_build'
Makefile:873: recipe for target 'all' failed
make: *** [all] Error 2
loki gcc-7.3.0_build 118

I was able to build that part for gcc-7.2.0 with the same commands.

/export2/src/gcc-7.2.0/gcc-7.2.0_build/./gcc/xgcc -B/export2/src/gcc-7.2.0/gcc-7.2.0_build/./gcc/ -nostdinc -B/export2/s
rc/gcc-7.2.0/gcc-7.2.0_build/nvptx-none/mgomp/newlib/ -isystem /export2/src/gcc-7.2.0/gcc-7.2.0_build/nvptx-none/mgomp/n
ewlib/targ-include -isystem /export2/src/gcc-7.2.0/gcc-7.2.0/newlib/libc/include -B/usr/local/gcc-7.2.0/nvptx-none/bin/
-B/usr/local/gcc-7.2.0/nvptx-none/lib/ -isystem /usr/local/gcc-7.2.0/nvptx-none/include -isystem /usr/local/gcc-7.2.0/nv
ptx-none/sys-include  -mgomp -DPACKAGE_NAME=\"newlib\" -DPACKAGE_TARNAME=\"newlib\" -DPACKAGE_VERSION=\"2.1.0\" -DPACKAG
E_STRING=\"newlib\ 2.1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -I. -I../../../../../../gcc-7.2.0/newlib/libc/sea
rch -DMALLOC_PROVIDED -DMISSING_SYSCALL_NAMES -fno-builtin      -g -O2  -mgomp -c -o lib_a-hash_func.o `test -f 'hash_fu
nc.c' || echo '../../../../../../gcc-7.2.0/newlib/libc/search/'`hash_func.c
/export2/src/gcc-7.2.0/gcc-7.2.0_build/./gcc/xgcc -B/export2/src/gcc-7.2.0/gcc-7.2.0_build/./gcc/ -nostdinc -B/export2/s
rc/gcc-7.2.0/gcc-7.2.0_build/nvptx-none/mgomp/newlib/ -isystem /export2/src/gcc-7.2.0/gcc-7.2.0_build/nvptx-none/mgomp/n
ewlib/targ-include -isystem /export2/src/gcc-7.2.0/gcc-7.2.0/newlib/libc/include -B/usr/local/gcc-7.2.0/nvptx-none/bin/
-B/usr/local/gcc-7.2.0/nvptx-none/lib/ -isystem /usr/local/gcc-7.2.0/nvptx-none/include -isystem /usr/local/gcc-7.2.0/nv
ptx-none/sys-include  -mgomp -DPACKAGE_NAME=\"newlib\" -DPACKAGE_TARNAME=\"newlib\" -DPACKAGE_VERSION=\"2.1.0\" -DPACKAG
E_STRING=\"newlib\ 2.1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -I. -I../../../../../../gcc-7.2.0/newlib/libc/sea
rch -DMALLOC_PROVIDED -DMISSING_SYSCALL_NAMES -fno-builtin      -g -O2  -mgomp -c -o lib_a-hash_log2.o `test -f 'hash_lo
g2.c' || echo '../../../../../../gcc-7.2.0/newlib/libc/search/'`hash_log2.c


loki gcc-7.3.0 143 diff nvptx-newlib/newlib/libc/search/hash_func.c ../gcc-7.2.0/nvptx-newlib/newlib/libc/search/hash_func.c
loki gcc-7.3.0 144

I would be grateful, if somebody knows a solution or can fix the
problem. Do you need anything else? Thank you very much for any
help in advance.


Kind regards

Siegmar

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: gcc-7.3.0: ptxas lib_a-hash_func.o, line 11; fatal : Invalid initial value expression
  2018-02-24 16:20 gcc-7.3.0: ptxas lib_a-hash_func.o, line 11; fatal : Invalid initial value expression Siegmar Gross
@ 2018-02-24 22:18 ` Thomas Schwinge
  2018-02-25 12:47   ` Siegmar Gross
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Schwinge @ 2018-02-24 22:18 UTC (permalink / raw)
  To: Siegmar Gross; +Cc: gcc, Tom de Vries, Cesar Philippidis

Hi!

On Sat, 24 Feb 2018 17:20:13 +0100, Siegmar Gross <siegmar.gross@informatik.hs-fulda.de> wrote:
> today I tried to install gcc-7.3.0 with accelerator support

Thanks for giving that a try and reporting back!

> on my "SUSE Linux Enterprise Server 12.3 (x86_64)" with
> gcc-6.4.0. I used the following commands to download and build
> everything.

Thanks for providing these (but I have not yet reviewed them in detail,
because the problem might be solved already, see below).

> '../../../../../../gcc-7.3.0/newlib/libc/search/'`hash_func.c
> ptxas lib_a-hash_func.o, line 11; fatal   : Invalid initial value expression
> ptxas fatal   : Ptx assembly aborted due to errors
> nvptx-as: ptxas returned 255 exit status
> Makefile:413: recipe for target 'lib_a-hash_func.o' failed
> make[8]: *** [lib_a-hash_func.o] Error 1

Am I right guessing that you're using CUDA 9?  Then it'd most likely be
the issue discussed in <https://gcc.gnu.org/PR83790> "Update nvptx target
to work with cuda 9".  By now, there has a fix been committed to GCC
trunk, and I assume the same would also work on earlier GCC
releases/branches.

> I was able to build that part for gcc-7.2.0 with the same commands.

Interesting.  Or, maybe you've not been using CUDA 9 in that build?


Grüße
 Thomas

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: gcc-7.3.0: ptxas lib_a-hash_func.o, line 11; fatal : Invalid initial value expression
  2018-02-24 22:18 ` Thomas Schwinge
@ 2018-02-25 12:47   ` Siegmar Gross
  0 siblings, 0 replies; 3+ messages in thread
From: Siegmar Gross @ 2018-02-25 12:47 UTC (permalink / raw)
  To: gcc

Hi Thomas,

thank you very much for your help. I applied the patch to nvptx.c
and was able to build everything. The compiler works for my small
accelerator programs.

loki nvptx 147 diff nvptx.c nvptx.c.orig
1878,1881c1878
<       bool function = SYMBOL_REF_DECL (sym)
<       && (TREE_CODE (SYMBOL_REF_DECL (sym)) == FUNCTION_DECL);
<       if (!function)
<       fprintf (asm_out_file, "generic(");
---
 >       fprintf (asm_out_file, "generic(");
1883,1886c1880
<       if (!function)
<       fprintf (asm_out_file, val ? ") + " : ")");
<       else if (val)
<       fprintf (asm_out_file, " + ");
---
 >       fprintf (asm_out_file, val ? ") + " : ")");
loki nvptx 148


I'm not sure if I used CUDA 8 or CUDA 9 to build gcc-7.2.0, but I
assume it was already CUDA 9.

loki nvptx 148 ls -ld /usr/local/gcc-7.2.0/ /usr/local/cuda
lrwxrwxrwx 1 root root    8 Sep 27 09:15 /usr/local/cuda -> cuda-9.0
drwxr-xr-x 9 root root 4096 Nov  2 12:07 /usr/local/gcc-7.2.0/
loki nvptx 149


Thank you very much once more

Siegmar


Am 24.02.2018 um 23:18 schrieb Thomas Schwinge:
> Hi!
> 
> On Sat, 24 Feb 2018 17:20:13 +0100, Siegmar Gross <siegmar.gross@informatik.hs-fulda.de> wrote:
>> today I tried to install gcc-7.3.0 with accelerator support
> 
> Thanks for giving that a try and reporting back!
> 
>> on my "SUSE Linux Enterprise Server 12.3 (x86_64)" with
>> gcc-6.4.0. I used the following commands to download and build
>> everything.
> 
> Thanks for providing these (but I have not yet reviewed them in detail,
> because the problem might be solved already, see below).
> 
>> '../../../../../../gcc-7.3.0/newlib/libc/search/'`hash_func.c
>> ptxas lib_a-hash_func.o, line 11; fatal   : Invalid initial value expression
>> ptxas fatal   : Ptx assembly aborted due to errors
>> nvptx-as: ptxas returned 255 exit status
>> Makefile:413: recipe for target 'lib_a-hash_func.o' failed
>> make[8]: *** [lib_a-hash_func.o] Error 1
> 
> Am I right guessing that you're using CUDA 9?  Then it'd most likely be
> the issue discussed in <https://gcc.gnu.org/PR83790> "Update nvptx target
> to work with cuda 9".  By now, there has a fix been committed to GCC
> trunk, and I assume the same would also work on earlier GCC
> releases/branches.
> 
>> I was able to build that part for gcc-7.2.0 with the same commands.
> 
> Interesting.  Or, maybe you've not been using CUDA 9 in that build?
> 
> 
> Grüße
>   Thomas

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-02-25 12:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-24 16:20 gcc-7.3.0: ptxas lib_a-hash_func.o, line 11; fatal : Invalid initial value expression Siegmar Gross
2018-02-24 22:18 ` Thomas Schwinge
2018-02-25 12:47   ` Siegmar Gross

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).