Ticket #26715: pgfortran.patch

File pgfortran.patch, 2.0 KB (added by fbissey, 2 years ago)

patch to compile openblas properly with pgfortran

  • exports/Makefile

    diff --git a/exports/Makefile b/exports/Makefile
    index c053895..3cf9037 100644
    a b endif 
    138138ifneq ($(C_COMPILER), LSB)
    139139        $(CC) $(CFLAGS) $(LDFLAGS) -shared -o ../$(LIBSONAME) \
    140140        -Wl,--whole-archive $< -Wl,--no-whole-archive \
    141         -Wl,-soname,$(INTERNALNAME) $(EXTRALIB)
     141        -Wl,-soname,$(INTERNALNAME) $(EXTRALIB) $(FEXTRALIB)
    142142        $(CC) $(CFLAGS) $(LDFLAGS) -w -o linktest linktest.c ../$(LIBSONAME) $(FEXTRALIB) && echo OK.
    143143else
    144144#for LSB
    145145        env LSBCC_SHAREDLIBS=gfortran $(CC) $(CFLAGS) $(LDFLAGS) -shared -o ../$(LIBSONAME) \
    146146        -Wl,--whole-archive $< -Wl,--no-whole-archive \
    147         -Wl,-soname,$(INTERNALNAME) $(EXTRALIB)
     147        -Wl,-soname,$(INTERNALNAME) $(EXTRALIB) $(FEXTRALIB)
    148148        $(FC) $(CFLAGS) $(LDFLAGS) -w -o linktest linktest.c ../$(LIBSONAME) $(FEXTRALIB) && echo OK.
    149149endif
    150150        rm -f linktest
    ifeq ($(OSNAME), SunOS) 
    183183
    184184so : ../$(LIBSONAME)
    185185        $(CC) $(CFLAGS) $(LDFLAGS)  -shared -o ../$(LIBSONAME) \
    186         -Wl,--whole-archive ../$(LIBNAME) -Wl,--no-whole-archive $(EXTRALIB)
     186        -Wl,--whole-archive ../$(LIBNAME) -Wl,--no-whole-archive $(EXTRALIB) $(FEXTRALIB)
    187187        $(CC) $(CFLAGS) $(LDFLAGS) -w -o linktest linktest.c ../$(LIBSONAME) $(FEXTRALIB) && echo OK.
    188188        rm -f linktest
    189189
  • f_check

    diff --git a/f_check b/f_check
    index f438060..0b2472c 100644
    a b if ($link ne "") { 
    284284            && ($flags !~ /^-LIST:/)
    285285            && ($flags !~ /^-LANG:/)
    286286            ) {
    287             if ($vendor eq "PGI") {
    288                 $flags =~ s/lib$/libso/;
    289             }
    290287            $linker_L .= $flags . " ";
    291288        }
    292289
    if ($link ne "") { 
    311308
    312309        if ($flags =~ /^\-rpath-link\@/) {
    313310            $flags =~ s/\@/\,/g;
    314             if ($vendor eq "PGI") {
    315                 $flags =~ s/lib$/libso/;
    316             }
    317311            $linker_L .= "-Wl,". $flags . " " ;
    318312        }
    319313
    if ($link ne "") { 
    322316            && ($flags !~ /gfortranbegin/)
    323317            && ($flags !~ /frtbegin/)
    324318            && ($flags !~ /pathfstart/)
    325             && ($flags !~ /numa/)
    326319            && ($flags !~ /crt[0-9]/)
    327320            && ($flags !~ /gcc/)
    328321            && ($flags !~ /user32/)