[petsc-users] linking PETSC with SSL

Satish Balay balay at mcs.anl.gov
Wed Nov 8 09:51:05 CST 2017


Glad it works! Thanks for the update.

Satish

On Wed, 8 Nov 2017, Lukas van de Wiel wrote:

> Ah, never mind, It works in 3.8.1!
> Had to change my makefile also, of course... :-\
> 
> Thanks and have a great day!
> 
> Lukas
> 
> 
> On 11/8/17, Lukas van de Wiel <lukas.drinkt.thee at gmail.com> wrote:
> > Hi Satish,
> >
> > thank you for your quick reply!
> >
> > I have installed 3.8.1, but the problem persists.
> > I have attached configure.log and test.log.
> >
> > Does that reveal anything?
> >
> > Cheers and thanks again
> >
> > Lukas
> >
> > On 11/8/17, Satish Balay <balay at mcs.anl.gov> wrote:
> >> Hm --with-ssl=0 should work. Can you do a fresh/clean build and see if
> >> the
> >> problem persists?
> >>
> >> If so send configure.log make.log and test.log for this build.
> >>
> >> BTW: 3.8 has better support for fortran usage - so you might consider
> >> upgrading all the way to it.
> >>
> >> https://www.mcs.anl.gov/petsc/documentation/changes/38.html
> >> http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/UsingFortran.html#UsingFortran
> >>
> >> Satish
> >>
> >> On Wed, 8 Nov 2017, Lukas van de Wiel wrote:
> >>
> >>> Good day,
> >>>
> >>> during an upgrade of PETSc (from 3.4.2 to 3.7.7) and some changes
> >>> needed to use MUMPs I ran into a problem with SSL that I could not
> >>> really figure out.
> >>>
> >>> ********************************************************
> >>> I have configured PETSc 3.7.7 using: (explicitly note the option
> >>> --with-ssl=0  )
> >>>
> >>>
> >>> ./configure  \
> >>> COPTFLAGS='-O3 -march=native -mtune=native' \
> >>> CXXOPTFLAGS='-O3 -march=native -mtune=native' \
> >>> FOPTFLAGS='-O3 -march=native -mtune=native' \
> >>> --with-debugging=0 \
> >>> --with-x=0 \
> >>> --with-ssl=0 \
> >>> --with-shared-libraries=0 \
> >>> --download-metis \
> >>> --download-parmetis \
> >>> --download-fblaslapack \
> >>> --download-scalapack \
> >>> --download-openmpi \
> >>> --download-mumps \
> >>> --download-hypre \
> >>> --download-ptscotch
> >>>
> >>>
> >>> ********************************************************
> >>> Next I have a tiny Fortran program to illustrate the problem:
> >>>
> >>>
> >>> program sslhuh
> >>> implicit none
> >>> #include "petsc/finclude/petscsys.h"
> >>> write(*,*) "Hello World"
> >>> end program
> >>>
> >>>
> >>>
> >>> ********************************************************
> >>> I compile it using makefile:
> >>>
> >>>
> >>> petscDir = /net/home/gtecton/sw_dev/petsc-3.7.7
> >>>
> >>> all: compile link
> >>>
> >>> compile: sslhuh.F
> >>>     $(petscDir)/linux-gnu-x86_64/bin/mpif90 \
> >>>     -c \
> >>>     -o sslhuh.o \
> >>>     -std=f2008 \
> >>>     -ffree-form \
> >>>     -I$(petscDir)/include \
> >>>     -I$(petscDir)/include/petsc/finclude \
> >>>     sslhuh.F
> >>>
> >>> link: sslhuh.o
> >>>     $(petscDir)/linux-gnu-x86_64/bin/mpif90 \
> >>>     -o sslhuh \
> >>>     sslhuh.o \
> >>>     $(petscDir)/linux-gnu-x86_64/lib/libpetsc.a \
> >>>     $(petscDir)/linux-gnu-x86_64/lib/libHYPRE.a \
> >>>     $(petscDir)/linux-gnu-x86_64/lib/libzmumps.a \
> >>>     $(petscDir)/linux-gnu-x86_64/lib/libsmumps.a \
> >>>     $(petscDir)/linux-gnu-x86_64/lib/libdmumps.a \
> >>>     $(petscDir)/linux-gnu-x86_64/lib/libcmumps.a \
> >>>     $(petscDir)/linux-gnu-x86_64/lib/libmumps_common.a \
> >>>     $(petscDir)/linux-gnu-x86_64/lib/libesmumps.a \
> >>>     $(petscDir)/linux-gnu-x86_64/lib/libparmetis.a \
> >>>     $(petscDir)/linux-gnu-x86_64/lib/libmetis.a \
> >>>     $(petscDir)/linux-gnu-x86_64/lib/libpord.a \
> >>>     $(petscDir)/linux-gnu-x86_64/lib/libscalapack.a \
> >>>     $(petscDir)/linux-gnu-x86_64/lib/libflapack.a \
> >>>     $(petscDir)/linux-gnu-x86_64/lib/libfblas.a \
> >>>     $(petscDir)/linux-gnu-x86_64/lib/libptscotch.a \
> >>>     $(petscDir)/linux-gnu-x86_64/lib/libptscotcherr.a \
> >>>     $(petscDir)/linux-gnu-x86_64/lib/libptscotcherrexit.a \
> >>>     $(petscDir)/linux-gnu-x86_64/lib/libptscotchparmetis.a \
> >>>     $(petscDir)/linux-gnu-x86_64/lib/libscotch.a \
> >>>     $(petscDir)/linux-gnu-x86_64/lib/libscotcherr.a \
> >>>     $(petscDir)/linux-gnu-x86_64/lib/libscotcherrexit.a \
> >>>     $(petscDir)/linux-gnu-x86_64/lib/libscotchmetis.a \
> >>>     -ldl
> >>>
> >>>
> >>> ********************************************************
> >>> Compiling works fine.
> >>> Linking gives me the error:
> >>>
> >>>
> >>> /net/home/gtecton/sw_dev/petsc-3.7.7/linux-gnu-x86_64/lib/libpetsc.a(client.o):
> >>> In function `PetscSSLInitializeContext':
> >>> client.c:(.text+0x3b): undefined reference to `SSLv23_method'
> >>> client.c:(.text+0x43): undefined reference to `SSL_CTX_new'
> >>> client.c:(.text+0x5a): undefined reference to `SSL_CTX_ctrl'
> >>> client.c:(.text+0x79): undefined reference to `SSL_library_init'
> >>> client.c:(.text+0x7e): undefined reference to `SSL_load_error_strings'
> >>> client.c:(.text+0x8c): undefined reference to `BIO_new_fp'
> >>> /net/home/gtecton/sw_dev/petsc-3.7.7/linux-gnu-x86_64/lib/libpetsc.a(client.o):
> >>> In function `PetscSSLDestroyContext':
> >>> client.c:(.text+0xa5): undefined reference to `SSL_CTX_free'
> >>> /net/home/gtecton/sw_dev/petsc-3.7.7/linux-gnu-x86_64/lib/libpetsc.a(client.o):
> >>> In function `PetscHTTPSRequest':
> >>> client.c:(.text+0xa9e): undefined reference to `SSL_write'
> >>> client.c:(.text+0xaab): undefined reference to `SSL_get_error'
> >>> client.c:(.text+0xb40): undefined reference to `SSL_read'
> >>> client.c:(.text+0xb50): undefined reference to `SSL_get_error'
> >>> client.c:(.text+0xbde): undefined reference to `SSL_free'
> >>> client.c:(.text+0xc74): undefined reference to `SSL_shutdown'
> >>> /net/home/gtecton/sw_dev/petsc-3.7.7/linux-gnu-x86_64/lib/libpetsc.a(client.o):
> >>> In function `PetscHTTPSConnect':
> >>> client.c:(.text+0x105c): undefined reference to `SSL_new'
> >>> client.c:(.text+0x106a): undefined reference to `BIO_new_socket'
> >>> client.c:(.text+0x1079): undefined reference to `SSL_set_bio'
> >>> client.c:(.text+0x1082): undefined reference to `SSL_connect'
> >>> collect2: ld returned 1 exit status
> >>> make: *** [link] Error 1
> >>>
> >>>
> >>> ******************************************************
> >>>
> >>> From what I see, the SSL functionality is in client.o, which is part
> >>> of libpetsc.a, which is included in the linking.
> >>>
> >>> There is no difference in whether I turn --with-ssl on or off...
> >>>
> >>> Does anybody have an idea what I am doing wrong?
> >>>
> >>> Best wishes and thank you for your time!
> >>>
> >>> Lukas
> >>>
> >>
> >>
> >
> 



More information about the petsc-users mailing list