public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* RE: external BLAS library with gfortran 4.1 or 4.4 on rhel5
       [not found] <C41074942BD67545B9BC85748B2D38D31671B5A9@EX-MBX-PRO-03.mcs.usyd.edu.au>
@ 2012-03-14  2:44 ` Matthew Hobbs
  2012-03-14  5:39   ` Shakthi Kannan
                     ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Matthew Hobbs @ 2012-03-14  2:44 UTC (permalink / raw)
  To: gcc-help

Hi,

I want to be able to use an external BLAS library with some Fortran programs we are using. I am using a rhel5 system with two versions of gfortran available:

1)  GNU Fortran (GCC) 4.1.2 20080704 (Red Hat 4.1.2-52) - this does not have the "-fexternal-blas" option so am I right to think that with this version it is not possible to use an external blas library (provided by e.g. atlas)?

2) GNU Fortran (GCC) 4.4.4 20100726 (Red Hat 4.4.4-13) ("gfortran44") - this has the "-fexternal-blas" option but unfortunately I cannot find any RHEL5 package that provides an external BLAS library that can be used with this version (correct me if I'm wrong).  I have tried installing netlib blas, atlas, goto2 from source to get something that will work with gfortran44 but have been unsuccessful.

Please can someone give me some guidance?


Thanks for your suggestions.



Matthew















^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: external BLAS library with gfortran 4.1 or 4.4 on rhel5
  2012-03-14  2:44 ` external BLAS library with gfortran 4.1 or 4.4 on rhel5 Matthew Hobbs
@ 2012-03-14  5:39   ` Shakthi Kannan
  2012-03-14  6:43     ` Matthew Hobbs
  2012-03-14  8:47   ` Jonathan Wakely
  2012-03-14 11:22   ` Tim Prince
  2 siblings, 1 reply; 8+ messages in thread
From: Shakthi Kannan @ 2012-03-14  5:39 UTC (permalink / raw)
  To: Matthew Hobbs; +Cc: gcc-help

Hi Matthew:

--- On Wed, Mar 14, 2012 at 8:12 AM, Matthew Hobbs
<matthew.hobbs@sydney.edu.au> wrote:
| I cannot find any RHEL5 package that provides an
| external BLAS library that can be used with this version (correct me
if I'm wrong).
| I have tried installing netlib blas, atlas, goto2 from source to
| get something that will work
\--

Can you try the atlas, atlas-devel packages from the EPEL repo?

  http://fedoraproject.org/wiki/EPEL

  http://dl.fedoraproject.org/pub/epel/5/x86_64/repoview/letter_a.group.html

SK

-- 
Shakthi Kannan
http://www.shakthimaan.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: external BLAS library with gfortran 4.1 or 4.4 on rhel5
  2012-03-14  5:39   ` Shakthi Kannan
@ 2012-03-14  6:43     ` Matthew Hobbs
  2012-03-14  7:11       ` Shakthi Kannan
  0 siblings, 1 reply; 8+ messages in thread
From: Matthew Hobbs @ 2012-03-14  6:43 UTC (permalink / raw)
  To: Shakthi Kannan; +Cc: gcc-help

Thanks you so much for replying to me. Here is some more information.

Firstly, I am using a test fortran 90 program called matmultest.f90 which just does a single matmul operation. On a fedora 15 system (my laptop) I can see a definite increase in speed if I use an external blas library:

# ----------------------------------
# fedora system:

matrix: gfortran --version
GNU Fortran (GCC) 4.6.0 20110603 (Red Hat 4.6.0-10)

gfortran matmultest.f90 -o matmultest
gfortran -L/usr/lib/atlas -fexternal-blas -lblas matmultest.f90 -o matmultest_blas
gfortran -L/usr/lib/atlas -fexternal-blas -lf77blas matmultest.f90 -o matmultest_f77blas

#baseline:
time ./matmultest

real	0m13.853s
user	0m13.759s
sys	0m0.066s

#no speed up here (why?):
time ./matmultest_blas

real	0m13.883s
user	0m13.701s
sys	0m0.126s

#but this is good:
time ./matmultest_f77blas 

real	0m7.663s
user	0m7.595s
sys	0m0.060s
# ----------------------------------

So I try achieving the same sort of thing with the test program on my RHEL5 system:

gfortran --version
GNU Fortran (GCC) 4.1.2 20080704 (Red Hat 4.1.2-52)

gfortran matmultest.f90 -o matmultest

time ./matmultest

real	0m33.158s
user	0m33.074s
sys	0m0.075s

gfortran -L/usr/lib64/atlas -fexternal-blas -lf77blas matmultest.f90 -o matmultest_f77blas
f951: error: unrecognized command line option "-fexternal-blas"

SInce this version of gfortran doesn't have the required option, try gfortran44:

gfortran44 -L/usr/lib64/atlas -fexternal-blas -lf77blas matmultest.f90 -o matmultest_f77blas
/usr/bin/ld: warning: libgfortran.so.1, needed by /usr/lib64/atlas/libf77blas.so, may conflict with libgfortran.so.3

My vague understanding of this is that /usr/lib64/atlas/libf77blas.so was not built with gfortran 4.4 and so can't be used by my gfortran44 program in this way.

The epel repo is enabled and the packages you suggest are installed:

Installed Packages
Name       : atlas
Arch       : x86_64
Version    : 3.8.3
Release    : 1.el5
Size       : 11 M
Repo       : installed

Name       : atlas-devel
Arch       : x86_64
Version    : 3.8.3
Release    : 1.el5
Size       : 23 M
Repo       : installed

Hope that clarifies my problem.

I look forward to hearing back from you (or anyone else kind enough to help!)

Thanks again,

Matthew


________________________________________
From: Shakthi Kannan [shakthimaan@gmail.com]
Sent: Wednesday, March 14, 2012 4:39 PM
To: Matthew Hobbs
Cc: gcc-help@gcc.gnu.org
Subject: Re: external BLAS library with gfortran 4.1 or 4.4 on rhel5

Hi Matthew:

--- On Wed, Mar 14, 2012 at 8:12 AM, Matthew Hobbs
<matthew.hobbs@sydney.edu.au> wrote:
| I cannot find any RHEL5 package that provides an
| external BLAS library that can be used with this version (correct me
if I'm wrong).
| I have tried installing netlib blas, atlas, goto2 from source to
| get something that will work
\--

Can you try the atlas, atlas-devel packages from the EPEL repo?

  http://fedoraproject.org/wiki/EPEL

  http://dl.fedoraproject.org/pub/epel/5/x86_64/repoview/letter_a.group.html

SK

--
Shakthi Kannan
http://www.shakthimaan.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: external BLAS library with gfortran 4.1 or 4.4 on rhel5
  2012-03-14  6:43     ` Matthew Hobbs
@ 2012-03-14  7:11       ` Shakthi Kannan
  2012-03-14  8:35         ` Matthew Hobbs
  0 siblings, 1 reply; 8+ messages in thread
From: Shakthi Kannan @ 2012-03-14  7:11 UTC (permalink / raw)
  To: Matthew Hobbs; +Cc: gcc-help

Hi Matthew:

--- On Wed, Mar 14, 2012 at 12:13 PM, Matthew Hobbs
<matthew.hobbs@sydney.edu.au> wrote:
| gfortran44 -L/usr/lib64/atlas -fexternal-blas -lf77blas
matmultest.f90 -o matmultest_f77blas
| /usr/bin/ld: warning: libgfortran.so.1, needed by
/usr/lib64/atlas/libf77blas.so
| may conflict with libgfortran.so.3
\--

Could you try installing and using the compat-libgfortran-41 package
that provides libgfortran.so.1?

SK

-- 
Shakthi Kannan
http://www.shakthimaan.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: external BLAS library with gfortran 4.1 or 4.4 on rhel5
  2012-03-14  7:11       ` Shakthi Kannan
@ 2012-03-14  8:35         ` Matthew Hobbs
  0 siblings, 0 replies; 8+ messages in thread
From: Matthew Hobbs @ 2012-03-14  8:35 UTC (permalink / raw)
  To: Shakthi Kannan; +Cc: gcc-help

Hi SK,

On our RHEL5 system we have:

/usr/lib64/libgfortran.so.1 which is provided by package libgfortran-4.1.2-52.el5.x86_64
/usr/lib64/libgfortran.so.3 which is provided by package libgfortran44-4.4.6-3.el5.1.x86_64 

Both packages installed and up to date. I can't find a package called  compat-libgfortran-41.

Thanks,

Matthew




________________________________________
From: Shakthi Kannan [shakthimaan@gmail.com]
Sent: Wednesday, March 14, 2012 6:11 PM
To: Matthew Hobbs
Cc: gcc-help@gcc.gnu.org
Subject: Re: external BLAS library with gfortran 4.1 or 4.4 on rhel5

Hi Matthew:

--- On Wed, Mar 14, 2012 at 12:13 PM, Matthew Hobbs
<matthew.hobbs@sydney.edu.au> wrote:
| gfortran44 -L/usr/lib64/atlas -fexternal-blas -lf77blas
matmultest.f90 -o matmultest_f77blas
| /usr/bin/ld: warning: libgfortran.so.1, needed by
/usr/lib64/atlas/libf77blas.so
| may conflict with libgfortran.so.3
\--

Could you try installing and using the compat-libgfortran-41 package
that provides libgfortran.so.1?

SK

--
Shakthi Kannan
http://www.shakthimaan.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: external BLAS library with gfortran 4.1 or 4.4 on rhel5
  2012-03-14  2:44 ` external BLAS library with gfortran 4.1 or 4.4 on rhel5 Matthew Hobbs
  2012-03-14  5:39   ` Shakthi Kannan
@ 2012-03-14  8:47   ` Jonathan Wakely
  2012-03-15  0:17     ` Matthew Hobbs
  2012-03-14 11:22   ` Tim Prince
  2 siblings, 1 reply; 8+ messages in thread
From: Jonathan Wakely @ 2012-03-14  8:47 UTC (permalink / raw)
  To: Matthew Hobbs; +Cc: gcc-help

On 14 March 2012 02:42, Matthew Hobbs wrote:
> Hi,
>
> I want to be able to use an external BLAS library with some Fortran programs we are using. I am using a rhel5 system with two versions of gfortran available:
>
> 1)  GNU Fortran (GCC) 4.1.2 20080704 (Red Hat 4.1.2-52) - this does not have the "-fexternal-blas" option so am I right to think that with this version it is not possible to use an external blas library (provided by e.g. atlas)?
>
> 2) GNU Fortran (GCC) 4.4.4 20100726 (Red Hat 4.4.4-13) ("gfortran44") - this has the "-fexternal-blas" option but unfortunately I cannot find any RHEL5 package that provides an external BLAS library that can be used with this version (correct me if I'm wrong).  I have tried installing netlib blas, atlas, goto2 from source to get something that will work with gfortran44 but have been unsuccessful.
>
> Please can someone give me some guidance?

You should be able to get the source code for atlas and build it
yourself with gfortran44, installing it to a different location (e.g.
/usr/local or /opt)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: external BLAS library with gfortran 4.1 or 4.4 on rhel5
  2012-03-14  2:44 ` external BLAS library with gfortran 4.1 or 4.4 on rhel5 Matthew Hobbs
  2012-03-14  5:39   ` Shakthi Kannan
  2012-03-14  8:47   ` Jonathan Wakely
@ 2012-03-14 11:22   ` Tim Prince
  2 siblings, 0 replies; 8+ messages in thread
From: Tim Prince @ 2012-03-14 11:22 UTC (permalink / raw)
  To: gcc-help

On 3/13/2012 10:42 PM, Matthew Hobbs wrote:

>
> I want to be able to use an external BLAS library with some Fortran programs we are using. I am using a rhel5 system with two versions of gfortran available:
>
> 1)  GNU Fortran (GCC) 4.1.2 20080704 (Red Hat 4.1.2-52) - this does not have the "-fexternal-blas" option so am I right to think that with this version it is not possible to use an external blas library (provided by e.g. atlas)?
>
-fexternal-blas does nothing more than translate MATMUL into a BLAS 
?GEMM call.  It has no effect on explicit BLAS function calls.  Either 
way, you can use any BLAS-compatible library, such as libblas which 
comes with linux, Atlas, Intel MKL, AMD BLAS, ...
You really should upgrade to a more recent gfortran.




-- 
Tim Prince

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: external BLAS library with gfortran 4.1 or 4.4 on rhel5
  2012-03-14  8:47   ` Jonathan Wakely
@ 2012-03-15  0:17     ` Matthew Hobbs
  0 siblings, 0 replies; 8+ messages in thread
From: Matthew Hobbs @ 2012-03-15  0:17 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: gcc-help

As suggested I have managed to build and install atlas libraries that gfortran44 can use. For the record the process briefly was:

-- downloaded and unpacked atlas3.8.4

-- ran configure with options -C ic gcc44 -C if gfortran44 -Fa alg -fPIC

-- ran make and (in lib directory) make shared

-- installed into /usr/local/atlas/lib and /usr/local/atlas/include

-- copied .so files into  /usr/local/atlas/lib

Now I can compile and link my test program like this:

export LD_LIBRARY_PATH=/usr/local/atlas/lib
gfortran44  -L/usr/local/atlas/lib -fexternal-blas -latlas -lf77blas matmultest.f90 -o matmultest_atlas

There is now no inapropriate link to libgfortran.so.1:

ldd matmultest_atlas
	linux-vdso.so.1 =>  (0x00007fffe29fd000)
	libatlas.so => /usr/local/atlas/lib/libatlas.so (0x00002ab82712d000)
	libf77blas.so => /usr/local/atlas/lib/libf77blas.so (0x00002ab827a14000)
	libgfortran.so.3 => /usr/lib64/libgfortran.so.3 (0x00002ab827c4b000)
	libm.so.6 => /lib64/libm.so.6 (0x0000003191200000)
	libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000003f75800000)
	libc.so.6 => /lib64/libc.so.6 (0x0000003190e00000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003191a00000)
	/lib64/ld-linux-x86-64.so.2 (0x0000003190a00000)

It runs much faster than a version that doesn't use atlas:

time ./matmultest_atlas

real	0m2.426s
user	0m2.349s
sys	0m0.077s


In fact I had tried to install atlas like this earlier but had not been successful - I don't know why.

Thanks Shakthi and Jonathan for taking the time to respond.


Matthew
________________________________________
From: Jonathan Wakely [jwakely.gcc@gmail.com]
Sent: Wednesday, March 14, 2012 7:47 PM
To: Matthew Hobbs
Cc: gcc-help@gcc.gnu.org
Subject: Re: external BLAS library with gfortran 4.1 or 4.4 on rhel5

On 14 March 2012 02:42, Matthew Hobbs wrote:
> Hi,
>
> I want to be able to use an external BLAS library with some Fortran programs we are using. I am using a rhel5 system with two versions of gfortran available:
>
> 1)  GNU Fortran (GCC) 4.1.2 20080704 (Red Hat 4.1.2-52) - this does not have the "-fexternal-blas" option so am I right to think that with this version it is not possible to use an external blas library (provided by e.g. atlas)?
>
> 2) GNU Fortran (GCC) 4.4.4 20100726 (Red Hat 4.4.4-13) ("gfortran44") - this has the "-fexternal-blas" option but unfortunately I cannot find any RHEL5 package that provides an external BLAS library that can be used with this version (correct me if I'm wrong).  I have tried installing netlib blas, atlas, goto2 from source to get something that will work with gfortran44 but have been unsuccessful.
>
> Please can someone give me some guidance?

You should be able to get the source code for atlas and build it
yourself with gfortran44, installing it to a different location (e.g.
/usr/local or /opt)

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-03-15  0:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <C41074942BD67545B9BC85748B2D38D31671B5A9@EX-MBX-PRO-03.mcs.usyd.edu.au>
2012-03-14  2:44 ` external BLAS library with gfortran 4.1 or 4.4 on rhel5 Matthew Hobbs
2012-03-14  5:39   ` Shakthi Kannan
2012-03-14  6:43     ` Matthew Hobbs
2012-03-14  7:11       ` Shakthi Kannan
2012-03-14  8:35         ` Matthew Hobbs
2012-03-14  8:47   ` Jonathan Wakely
2012-03-15  0:17     ` Matthew Hobbs
2012-03-14 11:22   ` Tim Prince

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).