Re: [easybuild] undefined reference to 'omp_get_num_threads' despite openmp=True

2020-03-25 Thread Loris Bennett
Hi Alan,

Thanks, setting preconfigopts did the trick.

Cheers,

Loris

Alan O'Cais  writes:

> Yeah, something like 
> preconfigopts = 'export LDFLAGS="-fopenmp $LDFLAGS" && '  
>
> On Mon, 23 Mar 2020 at 14:18, Ward Poelmans  wrote:
>
>  On 23/03/2020 14:08, Loris Bennett wrote:
>  > So the libraries seem to get build OK, but linking the client against
>  > them seems to fail, despite the fact that all the calls to 'gcc' seem to
>  > have the option '-fopenmp' set.
>
>  The issue is that the last one (--mode=link) does not have -fopenmp.
>  Either you need to add it to the link flags or manually add -lgomp to
>  the libraries to link to.
>
>  Ward
-- 
Dr. Loris Bennett (Mr.)
ZEDAT, Freie Universität Berlin Email loris.benn...@fu-berlin.de


Re: [easybuild] undefined reference to 'omp_get_num_threads' despite openmp=True

2020-03-23 Thread Alan O'Cais
Yeah, something like
preconfigopts = 'export LDFLAGS="-fopenmp $LDFLAGS" && '

On Mon, 23 Mar 2020 at 14:18, Ward Poelmans 
mailto:wpoel...@gmail.com>> wrote:
On 23/03/2020 14:08, Loris Bennett wrote:
> So the libraries seem to get build OK, but linking the client against
> them seems to fail, despite the fact that all the calls to 'gcc' seem to
> have the option '-fopenmp' set.

The issue is that the last one (--mode=link) does not have -fopenmp.
Either you need to add it to the link flags or manually add -lgomp to
the libraries to link to.

Ward


--
Dr. Alan O'Cais
E-CAM Software Manager
Juelich Supercomputing Centre
Forschungszentrum Juelich GmbH
52425 Juelich, Germany

Phone: +49 2461 61 5213
Fax: +49 2461 61 6656
E-mail: a.oc...@fz-juelich.de
WWW:http://www.fz-juelich.de/ias/jsc/EN




Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Volker Rieke
Geschaeftsfuehrung: Prof. Dr.-Ing. Wolfgang Marquardt (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt





Re: [easybuild] undefined reference to 'omp_get_num_threads' despite openmp=True

2020-03-23 Thread Ward Poelmans
On 23/03/2020 14:08, Loris Bennett wrote:
> So the libraries seem to get build OK, but linking the client against
> them seems to fail, despite the fact that all the calls to 'gcc' seem to
> have the option '-fopenmp' set.

The issue is that the last one (--mode=link) does not have -fopenmp.
Either you need to add it to the link flags or manually add -lgomp to
the libraries to link to.

Ward


Re: [easybuild] undefined reference to 'omp_get_num_threads' despite openmp=True

2020-03-23 Thread Loris Bennett
Hi Ward,

Ward Poelmans  writes:

> Hi Loris,
>
> On 23/03/2020 13:25, Loris Bennett wrote:
>> 
>> ../lib/.libs/libgretl-1.0.so: error: undefined reference to 
>> 'omp_get_num_threads'
>> ../lib/.libs/libgretl-1.0.so: error: undefined reference to 'GOMP_barrier'
>> ../lib/.libs/libgretl-1.0.so: error: undefined reference to 
>> 'omp_get_thread_num'
>> ../lib/.libs/libgretl-1.0.so: error: undefined reference to 'GOMP_parallel'
>> ../lib/.libs/libgretl-1.0.so: error: undefined reference to 'omp_get_wtime'
>> ../lib/.libs/libgretl-1.0.so: error: undefined reference to 
>> 'omp_set_num_threads'
>> collect2: error: ld returned 1 exit status
>
> This means the linker is not pulling in `-lgomp`. I guess because
> `-fopenmp` is not used? The lines you show here above the errors are
> probably unrelated (can happen if you're not using -j1).

Thanks for the hint.  Here's the part of the log with --parallel=1:

libtool: link: (cd ".libs" && rm -f "libgretl-1.0.so.32" && ln -s 
"libgretl-1.0.so.32.0.0" "libgretl-1.0.so.32")
libtool: link: (cd ".libs" && rm -f "libgretl-1.0.so" && ln -s 
"libgretl-1.0.so.32.0.0" "libgretl-1.0.so")
libtool: link: ( cd ".libs" && rm -f "libgretl-1.0.la" && ln -s 
"../libgretl-1.0.la" "libgretl-1.0.la" )
make[1]: Leaving directory 
`/trinity/shared/easybuild/build/gretl/2020a/foss-2019a/gretl-2020a/lib'
make -C cli
make[1]: Entering directory 
`/trinity/shared/easybuild/build/gretl/2020a/foss-2019a/gretl-2020a/cli'
mkdir .deps
gcc -c -O2 -ftree-vectorize -march=native -fno-math-errno -fopenmp -I.. -I.. 
-I../lib/src  
-I/trinity/shared/easybuild/software/GLib/2.60.1-GCCcore-8.2.0/include/glib-2.0 
-I/trinity/shared/easybuild/software/GLib/2.60.1-GCCcore-8.2.0/lib/glib-2.0/include
 -I/trinity/shared/easybuild/software/PCRE/8.43-GCCcore-8.2.0/include   
-DLOCALEDIR=\"/trinity/shared/easybuild/software/gretl/2020a-foss-2019a/share/locale\"
 -DHAVE_CONFIG_H gretlcli.c
gcc -O2 -ftree-vectorize -march=native -fno-math-errno -fopenmp -I.. -I.. 
-I../lib/src  
-I/trinity/shared/easybuild/software/GLib/2.60.1-GCCcore-8.2.0/include/glib-2.0 
-I/trinity/shared/easybuild/software/GLib/2.60.1-GCCcore-8.2.0/lib/glib-2.0/include
 -I/trinity/shared/easybuild/software/PCRE/8.43-GCCcore-8.2.0/include   
-DLOCALEDIR=\"/trinity/shared/easybuild/software/gretl/2020a-foss-2019a/share/locale\"
 -DHAVE_CONFIG_H -MM gretlcli.c > .deps/gretlcli.d
gcc -c -O2 -ftree-vectorize -march=native -fno-math-errno -fopenmp -I.. -I.. 
-I../lib/src  
-I/trinity/shared/easybuild/software/GLib/2.60.1-GCCcore-8.2.0/include/glib-2.0 
-I/trinity/shared/easybuild/software/GLib/2.60.1-GCCcore-8.2.0/lib/glib-2.0/include
 -I/trinity/shared/easybuild/software/PCRE/8.43-GCCcore-8.2.0/include   
-DLOCALEDIR=\"/trinity/shared/easybuild/software/gretl/2020a-foss-2019a/share/locale\"
 -DHAVE_CONFIG_H complete.c
gcc -O2 -ftree-vectorize -march=native -fno-math-errno -fopenmp -I.. -I.. 
-I../lib/src  
-I/trinity/shared/easybuild/software/GLib/2.60.1-GCCcore-8.2.0/include/glib-2.0 
-I/trinity/shared/easybuild/software/GLib/2.60.1-GCCcore-8.2.0/lib/glib-2.0/include
 -I/trinity/shared/easybuild/software/PCRE/8.43-GCCcore-8.2.0/include   
-DLOCALEDIR=\"/trinity/shared/easybuild/software/gretl/2020a-foss-2019a/share/locale\"
 -DHAVE_CONFIG_H -MM complete.c > .deps/complete.d
../libtool --mode=link gcc -mavx -Winline  
-L/trinity/shared/easybuild/software/MPFR/4.0.2-GCCcore-8.2.0/lib 
-L/trinity/shared/easybuild/software/ImageMagick/7.0.8-46-GCCcore-8.2.0/lib 
-L/trinity/shared/easybuild/software/GtkSourceView/3.24.11-GCCcore-8.2.0/lib 
-L/trinity/shared/easybuild/software/GMP/6.1.2-GCCcore-8.2.0/lib 
-L/trinity/shared/easybuild/software/libxml2/2.9.8-GCCcore-8.2.0/lib 
-L/trinity/shared/easybuild/software/FFTW/3.3.8-gompi-2019a/lib 
-L/trinity/shared/easybuild/software/ScaLAPACK/2.0.2-gompi-2019a-OpenBLAS-0.3.5/lib
 -L/trinity/shared/easybuild/software/OpenBLAS/0.3.5-GCC-8.2.0-2.31.1/lib 
-L/trinity/shared/easybuild/software/GCCcore/8.2.0/lib64 
-L/trinity/shared/easybuild/software/GCCcore/8.2.0/lib -o gretlcli gretlcli.o 
complete.o \
../lib/libgretl-1.0.la -lreadline -lncurses
libtool: link: gcc -mavx -Winline -o .libs/gretlcli gretlcli.o complete.o  
-L/trinity/shared/easybuild/software/MPFR/4.0.2-GCCcore-8.2.0/lib 
-L/trinity/shared/easybuild/software/ImageMagick/7.0.8-46-GCCcore-8.2.0/lib 
-L/trinity/shared/easybuild/software/GtkSourceView/3.24.11-GCCcore-8.2.0/lib 
-L/trinity/shared/easybuild/software/GMP/6.1.2-GCCcore-8.2.0/lib 
-L/trinity/shared/easybuild/software/libxml2/2.9.8-GCCcore-8.2.0/lib 
-L/trinity/shared/easybuild/software/FFTW/3.3.8-gompi-2019a/lib 
-L/trinity/shared/easybuild/software/ScaLAPACK/2.0.2-gompi-2019a-OpenBLAS-0.3.5/lib
 -L/trinity/shared/easybuild/software/OpenBLAS/0.3.5-GCC-8.2.0-2.31.1/lib 
-L/trinity/shared/easybuild/software/GCCcore/8.2.0/lib64 
-L/trinity/shared/easybuild/software/GCCcore/8.2.0/lib 
../lib/.libs/libgretl-1.0.so 
-L/trinity/shared/easybuild/software/XZ/5.2.4-GCCcore-8.2.0/lib 

Re: [easybuild] undefined reference to 'omp_get_num_threads' despite openmp=True

2020-03-23 Thread Ward Poelmans
Hi Loris,

On 23/03/2020 13:25, Loris Bennett wrote:
> 
> ../lib/.libs/libgretl-1.0.so: error: undefined reference to 
> 'omp_get_num_threads'
> ../lib/.libs/libgretl-1.0.so: error: undefined reference to 'GOMP_barrier'
> ../lib/.libs/libgretl-1.0.so: error: undefined reference to 
> 'omp_get_thread_num'
> ../lib/.libs/libgretl-1.0.so: error: undefined reference to 'GOMP_parallel'
> ../lib/.libs/libgretl-1.0.so: error: undefined reference to 'omp_get_wtime'
> ../lib/.libs/libgretl-1.0.so: error: undefined reference to 
> 'omp_set_num_threads'
> collect2: error: ld returned 1 exit status

This means the linker is not pulling in `-lgomp`. I guess because
`-fopenmp` is not used? The lines you show here above the errors are
probably unrelated (can happen if you're not using -j1).

Ward


[easybuild] undefined reference to 'omp_get_num_threads' despite openmp=True

2020-03-23 Thread Loris Bennett
Hi,

I'm trying to write an easyconfig for gretl[1].  I have

  toolchain = {'name': 'foss', 'version': '2019a'}
  toolchainopts = {'openmp': True}

but I am getting the following error:

libtool: compile:  gcc -mavx -Winline -c -O2 -ftree-vectorize -march=native 
-fno-math-errno -fopenmp -I.. -I../gui -DHAVE_CONFIG_H -I../lib/src -pthread 
-I/trinity/shared/easybuild/software/
GTK+/3.24.8-GCCcore-8.2.0/include/gtk-3.0 
-I/trinity/shared/easybuild/software/libepoxy/1.5.3-GCCcore-8.2.0/include 
-I/trinity/shared/easybuild/software/Gdk-Pixbuf/2.38.1-GCCcore-8.2.0/inclu
de/gdk-pixbuf-2.0 
-I/trinity/shared/easybuild/software/at-spi2-atk/2.32.0-GCCcore-8.2.0/include/at-spi2-atk/2.0
 -I/trinity/shared/easybuild/software/at-spi2-core/2.32.0-GCCcore-8.2.0/include
/at-spi-2.0 
-I/trinity/shared/easybuild/software/ATK/2.32.0-GCCcore-8.2.0/include/atk-1.0 
-I/trinity/shared/easybuild/software/Mesa/19.0.1-GCCcore-8.2.0/include 
-I/trinity/shared/easybuild/s
oftware/libdrm/2.4.97-GCCcore-8.2.0/include 
-I/trinity/shared/easybuild/software/libdrm/2.4.97-GCCcore-8.2.0/include/libdrm 
-I/trinity/shared/easybuild/software/DBus/1.13.8-GCCcore-8.2.0/inc
lude/dbus-1.0 
-I/trinity/shared/easybuild/software/DBus/1.13.8-GCCcore-8.2.0/lib/dbus-1.0/include
 
-I/trinity/shared/easybuild/software/Pango/1.43.0-GCCcore-8.2.0/include/pango-1.0
 -I/trinity
/shared/easybuild/software/FriBidi/1.0.5-GCCcore-8.2.0/include/fribidi 
-I/trinity/shared/easybuild/software/HarfBuzz/2.4.0-GCCcore-8.2.0/include/harfbuzz
 -I/trinity/shared/easybuild/software
/cairo/1.16.0-GCCcore-8.2.0/include/cairo 
-I/trinity/shared/easybuild/software/X11/20190311-GCCcore-8.2.0/include 
-I/trinity/shared/easybuild/software/fontconfig/2.13.1-GCCcore-8.2.0/include
 
-I/trinity/shared/easybuild/software/GLib/2.60.1-GCCcore-8.2.0/include/gio-unix-2.0
 -I/trinity/shared/easybuild/software/GLib/2.60.1-GCCcore-8.2.0/include 
-I/trinity/shared/easybuild/softwa
re/GLib/2.60.1-GCCcore-8.2.0/include/glib-2.0 
-I/trinity/shared/easybuild/software/GLib/2.60.1-GCCcore-8.2.0/lib/glib-2.0/include
 -I/trinity/shared/easybuild/software/util-linux/2.33-GCCcore
-8.2.0/include/uuid 
-I/trinity/shared/easybuild/software/util-linux/2.33-GCCcore-8.2.0/include/libmount
 
-I/trinity/shared/easybuild/software/util-linux/2.33-GCCcore-8.2.0/include/blkid
 -I/tr
inity/shared/easybuild/software/PCRE/8.43-GCCcore-8.2.0/include 
-I/trinity/shared/easybuild/software/libffi/3.2.1-GCCcore-8.2.0/include 
-I/trinity/shared/easybuild/software/expat/2.2.6-GCCco
re-8.2.0/include 
-I/trinity/shared/easybuild/software/pixman/0.38.0-GCCcore-8.2.0/include/pixman-1
 
-I/trinity/shared/easybuild/software/freetype/2.9.1-GCCcore-8.2.0/include/freetype2
 -I/trin
ity/shared/easybuild/software/libpng/1.6.36-GCCcore-8.2.0/include/libpng16 
-I/trinity/shared/easybuild/software/bzip2/1.0.6-GCCcore-8.2.0/include 
-I/trinity/shared/easybuild/software/zlib/1.
2.11-GCCcore-8.2.0/include 
-I/trinity/shared/easybuild/software/libxml2/2.9.8-GCCcore-8.2.0/include/libxml2
 -I../plugin 
-I/trinity/shared/easybuild/software/GLib/2.60.1-GCCcore-8.2.0/include
/glib-2.0 
-I/trinity/shared/easybuild/software/GLib/2.60.1-GCCcore-8.2.0/lib/glib-2.0/include
 -I/trinity/shared/easybuild/software/PCRE/8.43-GCCcore-8.2.0/include 
-I../plugin/zipunzip -I/tri
nity/shared/easybuild/software/GLib/2.60.1-GCCcore-8.2.0/include/glib-2.0 
-I/trinity/shared/easybuild/software/GLib/2.60.1-GCCcore-8.2.0/lib/glib-2.0/include
 -I/trinity/shared/easybuild/soft
ware/PCRE/8.43-GCCcore-8.2.0/include -I../plugin/libsvm 
-Wno-deprecated-declarations -I. vif.c  -fPIC -DPIC -o .libs/vif.o
../lib/.libs/libgretl-1.0.so: error: undefined reference to 
'omp_get_num_threads'
../lib/.libs/libgretl-1.0.so: error: undefined reference to 'GOMP_barrier'
../lib/.libs/libgretl-1.0.so: error: undefined reference to 'omp_get_thread_num'
../lib/.libs/libgretl-1.0.so: error: undefined reference to 'GOMP_parallel'
../lib/.libs/libgretl-1.0.so: error: undefined reference to 'omp_get_wtime'
../lib/.libs/libgretl-1.0.so: error: undefined reference to 
'omp_set_num_threads'
collect2: error: ld returned 1 exit status

Any ideas what I'm doing wrong?

Cheers,

Loris

Footnotes: 
[1]  http://gretl.sourceforge.net/

-- 
Dr. Loris Bennett (Mr.)
ZEDAT, Freie Universität Berlin Email loris.benn...@fu-berlin.de