Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 27 Nov 2014 10:58:04 -0800
From: Dennis Glatting <dg@...2.com>
To: Patrick Proniewski <patpro@...pro.net>
Cc: john-users@...ts.openwall.com
Subject: Re: OpenMP on FreeBSD ?

On Thu, 2014-11-27 at 19:14 +0100, Patrick Proniewski wrote:
> On 27 nov. 2014, at 17:09, Dennis Glatting wrote:
> 
> >> Any idea why the FreeBSD port fails using OpenMP code?
> > 
> > Compile with GCC5. Clang does not support OpenMP.
> 
> Thank you, it worked (almost). Compilation is ok and openmp is properly taken into account. Unfortunately when I try the binary, an error occurs:
> 
> 	john --test
> 	/usr/lib/libgomp.so.1: version GOMP_4.0 required by /usr/ports/security/john/work/john-1.7.9-jumbo-7/run/john not found
> 
> Of course. 
> /usr/lib/libgomp.so.1 is in the base system and provides GOMP_1.
> /usr/local/lib/gcc5/libgomp.so.1 is installed with gcc5 port and provides GOMP_4.0.1. 
> 
> I'll have to tweak settings at compile time to use library provided with gcc5 at runtime automatically. In the mean time, using LD_LIBRARY_PATH helps:
> 
> 	LD_LIBRARY_PATH=/usr/local/lib/gcc5 john --format=des --test
> 	Benchmarking: Traditional DES [128/128 BS SSE2-16]... (2xOMP) DONE
> 	Many salts:	3129K c/s real, 1641K c/s virtual
> 	Only one salt:	2991K c/s real, 1587K c/s virtual
> 
> 
> patpro

You need to either set LD_LIBRARY_PATH to where the library resides or
include something like this is LDFLAGS (against GCC 4.9).

-Wl,-rpath=/usr/local/lib -Wl,-rpath=/usr/local/lib/gcc49 

I have OpenMP under FreeBSD running on several servers but I am also
using bleeding edge (1Sep2014) from the git hub and cobbled
Makefile.legacy (Kerberos has to be explicitly disabled and it is better
if a few other things are explicitly specified).

Below is a couple of items from my Makefile.legacy. There's probably a
few things I forgot to include here.

For performance reasons you should try various compilation flags and run
speed tests. I also recommend testing different versions of GCC. Flags
specific to your processor helps too.

CC = gcc49
CXX = g++49
OMPFLAGS = -fopenmp -msse4.2 -g -Ofast
HAVE_LIBGMP = -DHAVE_LIBGMP
GMP_LDFLAGS = -lgmp
HAVE_KRB5 =
KRB5_LDFLAGS =
LDFLAGS = -L/usr/local/lib -L/usr/local/ssl/lib -lssl -lcrypto -lm -lz \
        $(OMPFLAGS) $(NSS_LDFLAGS) $(GMP_LDFLAGS) $(KRB5_LDFLAGS) \
        $(JOHN_LDFLAGS) $(REXGEN_LDFLAGS) \
        -g -Wl,-rpath=/usr/local/lib -Wl,-rpath=/usr/local/lib/gcc49


freebsd-x86-64-dpg:
        $(LN) x86-64.h arch.h
        @echo "#define JOHN_BLD" '"'$@'"' > john_build_rule.h
        $(MAKE_ORIG) $(PROJ) \
                JOHN_OBJS="$(JOHN_OBJS) \
                        c3_fmt.o x86-64.o sse-intrinsics-64.o " \
                CFLAGS="${CFLAGS} -D__BSD_VISIBLE -DHAVE_CRYPT \
                        -DUSING_ICC_S_FILE -mxop -mavx -march=native " \
        ASFLAGS="$(ASFLAGS) -mxop -mavx -march=bdver2 " \
        LDFLAGS="$(LDFLAGS) -lcrypt " \
        AESNI_ARCH=64
        @echo "Failing after this point just means some helper tools did
not bui
ld:"
        $(MAKE_ORIG)
        @echo "All done"





-- 
Dennis Glatting <dg@...2.com>

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.