On Thu, 11 Jun 2015 11:18:37 +0200, Guenther Niess wrote:
> On 06/02/15 16:27, Pascal Stumpf wrote:
> > On Tue, 02 Jun 2015 16:20:06 +0200, Guenther Niess wrote:
> >> Hi,
> >> I wanted to compile and run a small simulation with OpenMP and applied
> >> the patch below to compile gcc 4.9 with libgomp. It seems very
> >> straightforward so I'm wondering why it is disabled in ports?
> >>
> >> I run a make test and what I can see the openmp test seems to have no
> >> problem..
> >>
> >> Running
> >> /home/ports/obj/gcc-4.9.2/gcc-4.9.2/gcc/testsuite/gcc.dg/format/format.exp
> >> ...
> >> Running
> >> /home/ports/obj/gcc-4.9.2/gcc-4.9.2/gcc/testsuite/gcc.dg/gomp/gomp.exp ...
> >> Running
> >> /home/ports/obj/gcc-4.9.2/gcc-4.9.2/gcc/testsuite/gcc.dg/graphite/graphite.exp
> >> ...
> >> Running
> >> /home/ports/obj/gcc-4.9.2/gcc-4.9.2/gcc/testsuite/gcc.dg/guality/guality.exp
> >> ...
> > 
> > Thanks; this was on my to-do list.  I'll test and commit as time
> > permits.
> > 
> 
> To test a little bit more I added an openmp flavor to rawtherapee and
> run the default benchmark from the tools directory with and without
> OpenMP. Here some results from -CURRENT and with my Core2 Quad CPU Q6600.
> 
> Without:
> Benchmark 01 "Neutral.pp3"........................ 13.433
> Benchmark 02 "Neutral.pp3"........................ 13.199
> Benchmark 03 "Neutral.pp3"........................ 13.160
> Benchmark 04 "Neutral.pp3"........................ 13.189
> Benchmark 05 "Neutral.pp3"........................ 13.152
> Benchmark "Neutral.pp3" average....................13.226
> 
> Benchmark 01 "Default.pp3"........................ 20.859
> Benchmark 02 "Default.pp3"........................ 20.891
> Benchmark 03 "Default.pp3"........................ 20.868
> Benchmark 04 "Default.pp3"........................ 20.904
> Benchmark 05 "Default.pp3"........................ 20.754
> Benchmark "Default.pp3" average....................20.855
> 
> Benchmark total.................................. 170.409
> 
> Average times for each tool:
> Default.pp3........................................20.855
> Neutral.pp3........................................13.226
> 
> 
> With enabled OpenMP:
> Benchmark 01 "Neutral.pp3"..........................4.668
> Benchmark 02 "Neutral.pp3"..........................4.664
> Benchmark 03 "Neutral.pp3"..........................4.652
> Benchmark 04 "Neutral.pp3"..........................4.659
> Benchmark 05 "Neutral.pp3"..........................4.687
> Benchmark "Neutral.pp3" average.................... 4.666
> 
> Benchmark 01 "Default.pp3"..........................6.838
> Benchmark 02 "Default.pp3"..........................7.506
> Benchmark 03 "Default.pp3"..........................7.007
> Benchmark 04 "Default.pp3"..........................6.776
> Benchmark 05 "Default.pp3"..........................6.815
> Benchmark "Default.pp3" average.................... 6.988
> 
> Benchmark total....................................58.272
> 
> Average times for each tool:
> Default.pp3........................................ 6.988
> Neutral.pp3........................................ 4.666
> 

I'm testing the GCC diff right now on various archs.  powerpc is fine,
hppa and sparc64 are compiling.  There is no arch restriction in
libgomp/configure.tgt, so the extra complication of PFRAG.GOMP is
probably not needed.  Diff below.

Though as your patch demonstrates, this needs more testing because some
ports will start to pick up libgomp once it's supported.  I can do an
audit of everything that uses ports gcc, but that may take some time.

zhuk@, can you tell me if KDE4 will make use of OpenMP if it's there?

Index: Makefile
===================================================================
RCS file: /cvs/ports/lang/gcc/4.9/Makefile,v
retrieving revision 1.13
diff -u -p -r1.13 Makefile
--- Makefile    22 May 2015 11:31:16 -0000      1.13
+++ Makefile    11 Jun 2015 09:33:03 -0000
@@ -33,13 +33,13 @@ PKGNAME-ada =   gnat-${FULL_PKGVERSION}
 #PKGNAME-go =  gccgo-${FULL_PKGVERSION}
 PKGSPEC-main = gcc->=4.9,<4.10
 
-REVISION-main =        3
-REVISION-libs =        1
-REVISION-c++ = 1
-REVISION-f95 = 1
-REVISION-java =        2
-REVISION-objc =        1
-REVISION-ada = 2
+REVISION-main =        4
+REVISION-libs =        2
+REVISION-c++ = 2
+REVISION-f95 = 2
+REVISION-java =        3
+REVISION-objc =        2
+REVISION-ada = 3
 
 SHARED_LIBS =  estdc++         17.0 \
                gfortran        6.0 \
@@ -53,7 +53,8 @@ SHARED_LIBS = estdc++         17.0 \
                itm             2.0 \
                atomic          1.0 \
                quadmath        1.0 \
-               cilkrts         0.0
+               cilkrts         0.0 \
+               gomp            0.0
 
 
 PSEUDO_FLAVORS = no_c++ no_f95 no_objc no_java no_ada no_go full
@@ -146,7 +147,6 @@ CONFIGURE_ARGS += \
        --disable-nls  \
        --with-system-zlib \
        --disable-libmudflap \
-       --disable-libgomp \
        --disable-tls \
        --with-as=/usr/bin/as \
        --with-ld=/usr/bin/ld \
Index: patches/patch-libgomp_Makefile_in
===================================================================
RCS file: patches/patch-libgomp_Makefile_in
diff -N patches/patch-libgomp_Makefile_in
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-libgomp_Makefile_in   11 Jun 2015 09:33:03 -0000
@@ -0,0 +1,22 @@
+$OpenBSD$
+--- libgomp/Makefile.in.orig   Thu Jun 11 10:37:14 2015
++++ libgomp/Makefile.in        Thu Jun 11 10:38:25 2015
+@@ -287,6 +287,9 @@ toolexeclibdir = @toolexeclibdir@
+ top_build_prefix = @top_build_prefix@
+ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
++
++include $(top_srcdir)/../libversions
++
+ ACLOCAL_AMFLAGS = -I .. -I ../config
+ SUBDIRS = testsuite
+ gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
+@@ -308,7 +311,7 @@ nodist_toolexeclib_HEADERS = libgomp.spec
+ @LIBGOMP_BUILD_VERSIONED_SHLIB_FALSE@libgomp_version_dep = 
+ 
@LIBGOMP_BUILD_VERSIONED_SHLIB_GNU_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@libgomp_version_dep
 = libgomp.ver
+ 
@LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@libgomp_version_dep
 = libgomp.ver-sun
+-libgomp_version_info = -version-info $(libtool_VERSION)
++libgomp_version_info = $(LIBgomp_LTVERSION)
+ libgomp_la_LDFLAGS = $(libgomp_version_info) $(libgomp_version_script) \
+         $(lt_host_flags)
+ 
Index: pkg/PLIST-libs
===================================================================
RCS file: /cvs/ports/lang/gcc/4.9/pkg/PLIST-libs,v
retrieving revision 1.2
diff -u -p -r1.2 PLIST-libs
--- pkg/PLIST-libs      3 Feb 2015 20:32:12 -0000       1.2
+++ pkg/PLIST-libs      11 Jun 2015 09:33:03 -0000
@@ -4,6 +4,7 @@
 @lib lib/libatomic.so.${LIBatomic_VERSION}
 @lib lib/libestdc++.so.${LIBestdc++_VERSION}
 @lib lib/libgfortran.so.${LIBgfortran_VERSION}
+@lib lib/libgomp.so.${LIBgomp_VERSION}
 @lib lib/libobjc.so.${LIBobjc_VERSION}
 %%CILKRTS%%
 %%ITM%%
Index: pkg/PLIST-main
===================================================================
RCS file: /cvs/ports/lang/gcc/4.9/pkg/PLIST-main,v
retrieving revision 1.5
diff -u -p -r1.5 PLIST-main
--- pkg/PLIST-main      10 Feb 2015 22:04:54 -0000      1.5
+++ pkg/PLIST-main      11 Jun 2015 09:33:03 -0000
@@ -16,6 +16,7 @@
 @info info/gcc.info
 @info info/gccinstall.info
 @info info/gccint.info
+@info info/libgomp.info
 lib/gcc/
 lib/gcc/${CONFIG}/
 lib/gcc/${CONFIG}/${V}/
@@ -24,6 +25,7 @@ lib/gcc/${CONFIG}/${V}/include-fixed/REA
 lib/gcc/${CONFIG}/${V}/include-fixed/limits.h
 lib/gcc/${CONFIG}/${V}/include-fixed/syslimits.h
 lib/gcc/${CONFIG}/${V}/include/
+lib/gcc/${CONFIG}/${V}/include/omp.h
 lib/gcc/${CONFIG}/${V}/include/ssp/
 lib/gcc/${CONFIG}/${V}/include/ssp/ssp.h
 lib/gcc/${CONFIG}/${V}/include/ssp/stdio.h
@@ -240,6 +242,9 @@ lib/gcc/${CONFIG}/${V}/plugin/include/ve
 lib/gcc/${CONFIG}/${V}/plugin/include/version.h
 lib/libatomic.a
 lib/libatomic.la
+lib/libgomp.a
+lib/libgomp.la
+lib/libgomp.spec
 lib/libssp.a
 lib/libssp.la
 @lib lib/libssp.so.${LIBssp_VERSION}

Reply via email to