LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 02-03-2013, 02:07 PM   #1
saeedian
Member
 
Registered: Dec 2011
Posts: 32

Rep: Reputation: Disabled
Installing LAPACK on the ubuntu


Dear all
I want to Installing LAPACK on the ubuntu operating system. As mentioned on one manual, The three steps must be done in the following order:

1. Gunzip and tar the file.

2. Copy and edit the file LAPACK/make.inc.example to LAPACK/make.inc.

3. Edit the file LAPACK/Makefile and type make.

I had done step one and two but I cant figure out how should I edit those "make.inc" & "Makefile"(those files printed in the end of this post).

however,Despite all these, I did "make" to installation without editing those files, but it had given some error as below:
Code:
make[1]: Entering directory `/home/meghdad/lapack-3.4.2/BLAS/TESTING'
gfortran  sblat1.o  \
        ../../librefblas.a  -o ../xblat1s
gfortran: ../../librefblas.a: No such file or directory
make[1]: *** [../xblat1s] Error 1
make[1]: Leaving directory `/home/meghdad/lapack-3.4.2/BLAS/TESTING'
make: *** [blas_testing] Error 2
how can I manage this problem?
Thanks in advance

##################################################################################################


make.inc :
Code:
####################################################################
#  LAPACK make include file.                                       #
#  LAPACK, Version 3.4.0                                           #
#  April 2012                                                   #
####################################################################
#
SHELL = /bin/sh
#  
#  Modify the FORTRAN and OPTS definitions to refer to the
#  compiler and desired compiler options for your machine.  NOOPT
#  refers to the compiler options desired when NO OPTIMIZATION is
#  selected.  Define LOADER and LOADOPTS to refer to the loader and 
#  desired load options for your machine.
#
FORTRAN  = gfortran 
OPTS     = -O2
DRVOPTS  = $(OPTS)
NOOPT    = -O0
LOADER   = gfortran
LOADOPTS =
#
# Timer for the SECOND and DSECND routines
#
# Default : SECOND and DSECND will use a call to the EXTERNAL FUNCTION ETIME
#TIMER    = EXT_ETIME
# For RS6K : SECOND and DSECND will use a call to the EXTERNAL FUNCTION ETIME_
# TIMER    = EXT_ETIME_
# For gfortran compiler: SECOND and DSECND will use a call to the INTERNAL FUNCTION ETIME
TIMER    = INT_ETIME
# If your Fortran compiler does not provide etime (like Nag Fortran Compiler, etc...)
# SECOND and DSECND will use a call to the INTERNAL FUNCTION CPU_TIME
# TIMER    = INT_CPU_TIME
# If neither of this works...you can use the NONE value... In that case, SECOND and DSECND will always return 0
# TIMER     = NONE
#
#  Configuration LAPACKE: Native C interface to LAPACK
#  To generate LAPACKE library: type 'make lapackelib'
#  Configuration file: turned off (default)
#  Complex types: C99 (default)
#  Name pattern: mixed case (default)
#  (64-bit) Data model: LP64 (default)
#
# CC is the C compiler, normally invoked with options CFLAGS.
#
CC = gcc
CFLAGS = -O3
#
#  The archiver and the flag(s) to use when building archive (library)
#  If you system has no ranlib, set RANLIB = echo.
#
ARCH     = ar
ARCHFLAGS= cr
RANLIB   = ranlib
#
#  Location of the extended-precision BLAS (XBLAS) Fortran library
#  used for building and testing extended-precision routines.  The
#  relevant routines will be compiled and XBLAS will be linked only if
#  USEXBLAS is defined.
#
# USEXBLAS    = Yes
XBLASLIB     =
# XBLASLIB    = -lxblas
#
#  The location of the libraries to which you will link.  (The 
#  machine-specific, optimized BLAS library should be used whenever
#  possible.)
#
BLASLIB      = ../../librefblas.a
LAPACKLIB    = liblapack.a
TMGLIB       = libtmglib.a
LAPACKELIB   = liblapacke.a



Makefile :
Code:
#
#  Top Level Makefile for LAPACK
#  Version 3.4.1
#  April 2012
#

include make.inc

all: lapack_install lib blas_testing lapack_testing 

lib: lapacklib tmglib
#lib: blaslib variants lapacklib tmglib

clean: cleanlib cleantesting cleanblas_testing 

lapack_install:
	( cd INSTALL; $(MAKE); ./testlsame; ./testslamch; ./testdlamch; \
	./testsecond; ./testdsecnd; ./testieee; ./testversion )

blaslib:
	( cd BLAS/SRC; $(MAKE) )

lapacklib:	lapack_install
	( cd SRC; $(MAKE) )

lapackelib: lapacklib
	( cd lapacke; $(MAKE) )

lapacke_example: lapackelib
	( cd lapacke/example; $(MAKE) )

variants:
	( cd SRC/VARIANTS ; $(MAKE))
	
tmglib:
	( cd TESTING/MATGEN; $(MAKE) )

lapack_testing:	lib
	( cd TESTING ; $(MAKE) )
	./lapack_testing.py

variants_testing: lib variants
	( cd TESTING ; rm -f xlintst* ; $(MAKE)  VARLIB='SRC/VARIANTS/LIB/cholrl.a' ; \
	mv stest.out stest_cholrl.out ; mv dtest.out dtest_cholrl.out ; mv ctest.out ctest_cholrl.out ; mv ztest.out ztest_cholrl.out )
	( cd TESTING ; rm -f xlintst* ; $(MAKE)  VARLIB='SRC/VARIANTS/LIB/choltop.a' ; \
	mv stest.out stest_choltop.out ; mv dtest.out dtest_choltop.out ; mv ctest.out ctest_choltop.out ; mv ztest.out ztest_choltop.out )
	( cd TESTING ; rm -f xlintst* ; $(MAKE)  VARLIB='SRC/VARIANTS/LIB/lucr.a' ; \
	mv stest.out stest_lucr.out ; mv dtest.out dtest_lucr.out ; mv ctest.out ctest_lucr.out ; mv ztest.out ztest_lucr.out )
	( cd TESTING ;  rm -f xlintst* ; $(MAKE)  VARLIB='SRC/VARIANTS/LIB/lull.a' ; \
	mv stest.out stest_lull.out ; mv dtest.out dtest_lull.out ; mv ctest.out ctest_lull.out ; mv ztest.out ztest_lull.out )
	( cd TESTING ;  rm -f xlintst* ; $(MAKE)  VARLIB='SRC/VARIANTS/LIB/lurec.a' ; \
	mv stest.out stest_lurec.out ; mv dtest.out dtest_lurec.out ; mv ctest.out ctest_lurec.out ; mv ztest.out ztest_lurec.out )
	( cd TESTING ;  rm -f xlintst* ; $(MAKE)  VARLIB='SRC/VARIANTS/LIB/qrll.a' ; \
	mv stest.out stest_qrll.out ; mv dtest.out dtest_qrll.out ; mv ctest.out ctest_qrll.out ; mv ztest.out ztest_qrll.out )
		
blas_testing:
	( cd BLAS/TESTING; $(MAKE) -f Makeblat1 )
	( cd BLAS; ./xblat1s > sblat1.out    ; \
	           ./xblat1d > dblat1.out    ; \
	           ./xblat1c > cblat1.out    ; \
	           ./xblat1z > zblat1.out    ) 
	( cd BLAS/TESTING; $(MAKE) -f Makeblat2 )
	( cd BLAS; ./xblat2s < sblat2.in     ; \
	           ./xblat2d < dblat2.in     ; \
	           ./xblat2c < cblat2.in     ; \
	           ./xblat2z < zblat2.in     )
	( cd BLAS/TESTING; $(MAKE) -f Makeblat3 )
	( cd BLAS; ./xblat3s < sblat3.in     ; \
	           ./xblat3d < dblat3.in     ; \
	           ./xblat3c < cblat3.in     ; \
	           ./xblat3z < zblat3.in     ) 
html:
	@echo "LAPACK HTML PAGES GENRATION with Doxygen"
	doxygen DOCS/Doxyfile
	@echo "=================="	
	@echo "LAPACK HTML PAGES GENRATED in DOCS/explore-html"
	@echo "Usage: open DOCS/explore-html/index.html"
	@echo "Online version available at http://www.netlib.org/lapack/explore-html/"
	@echo "=================="

man:
	@echo "LAPACK MAN PAGES GENRATION with Doxygen"
	doxygen DOCS/Doxyfile_man
	@echo "=================="
	@echo "LAPACK MAN PAGES GENRATED in DOCS/MAN"
	@echo "Set your MANPATH env variable accordingly"
	@echo "Usage: man dgetrf.f"
	@echo "=================="

cleanlib:
	( cd INSTALL; $(MAKE) clean )
	( cd BLAS/SRC; $(MAKE) clean )
	( cd SRC; $(MAKE) clean )
	( cd SRC/VARIANTS; $(MAKE) clean )
	( cd TESTING/MATGEN; $(MAKE) clean )
	( cd lapacke; $(MAKE) clean )
	

cleanblas_testing:	
	( cd BLAS/TESTING; $(MAKE) -f Makeblat1 clean )
	( cd BLAS/TESTING; $(MAKE) -f Makeblat2 clean )
	( cd BLAS/TESTING; $(MAKE) -f Makeblat3 clean )
	( cd BLAS; rm -f xblat* )

cleantesting:
	( cd TESTING/LIN; $(MAKE) clean )
	( cd TESTING/EIG; $(MAKE) clean )
	( cd TESTING; rm -f xlin* xeig* )

cleanall: cleanlib cleanblas_testing cleantesting 
	rm -f *.a TESTING/*.out INSTALL/test*  BLAS/*.out

Last edited by saeedian; 02-05-2013 at 12:55 PM.
 
Old 02-03-2013, 02:25 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,522

Rep: Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503
Quote:
I want to Installing LAPACK on .. ubuntu
That's usually done this way : sudo apt-get install liblapack-dev
( Will install lapack 3.4.1, if it's Ubuntu 12.10 ).


If you want version 3.4.2 as a manual build, please do :

cd lapack-3.4.2/ && mkdir build && cd build/ && cmake ../ && make

-
 
Old 02-03-2013, 03:19 PM   #3
saeedian
Member
 
Registered: Dec 2011
Posts: 32

Original Poster
Rep: Reputation: Disabled
Dear

During installation of "cmake" by "sudo apt-get install cmake" it give this error:

Install these packages without verification [y/N]? y
Err http://ir.archive.ubuntu.com/ubuntu/ maverick-updates/main cmake-data all 2.8.2-2ubuntu0.1
404 Not Found [IP: 91.189.92.201 80]
Err http://ir.archive.ubuntu.com/ubuntu/ maverick-updates/main cmake i386 2.8.2-2ubuntu0.1
404 Not Found [IP: 91.189.92.201 80]
Failed to fetch http://ir.archive.ubuntu.com/ubuntu/...ntu0.1_all.deb 404 Not Found [IP: 91.189.92.201 80]
Failed to fetch http://ir.archive.ubuntu.com/ubuntu/...tu0.1_i386.deb 404 Not Found [IP: 91.189.92.201 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?


It seems that the related link doesnt work. What do I do now?
Many Thanks
 
Old 02-04-2013, 06:43 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,522

Rep: Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503
# 3 : Ubuntu 10.10 Maverick is obsolete, has been moved to the old archive.

Please replace /etc/apt/sources.list with this new "sources.list" :
Code:
deb http://old-releases.ubuntu.com/ubuntu/ maverick main restricted
deb http://old-releases.ubuntu.com/ubuntu/ maverick multiverse universe
deb http://old-releases.ubuntu.com/ubuntu/ maverick-updates main restricted
deb http://old-releases.ubuntu.com/ubuntu/ maverick-updates multiverse universe
deb http://old-releases.ubuntu.com/ubuntu/ maverick-backports main restricted
deb http://old-releases.ubuntu.com/ubuntu/ maverick-backports multiverse universe
deb http://old-releases.ubuntu.com/ubuntu/ maverick-security main restricted
deb http://old-releases.ubuntu.com/ubuntu/ maverick-security multiverse universe
But : You will still get a reduced result, when you do a manual build.
For a complete lapack library, please do : sudo apt-get install liblapack-dev

-
 
Old 02-04-2013, 12:54 PM   #5
saeedian
Member
 
Registered: Dec 2011
Posts: 32

Original Poster
Rep: Reputation: Disabled
I have erased completely all content of "sources.list" and paste those lines which you had listed in previous post in the "sources.list".
but it give this error:

root@meghdad-Vostro-1320:/etc/apt# apt-get install cmake
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package cmake


beside that, I did another suggestion you had given:
Code:
sudo apt-get install liblapack-dev
but it give some line as follow:

meghdad@meghdad-Vostro-1320:~$ sudo apt-get install liblapack-dev
[sudo] password for meghdad:
Reading package lists... Done
Building dependency tree
Reading state information... Done
liblapack-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
meghdad@meghdad-Vostro-1320:~$

Last edited by saeedian; 02-05-2013 at 04:46 AM.
 
Old 02-04-2013, 03:49 PM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,522

Rep: Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503
# 5 . Please edit post # 1 to use code tags :
http://www.linuxquestions.org/questi....php?do=bbcode
+ The # button in the 'Advanced Editor will create code tags too.


Your error : "E: Unable to locate package cmake".
When changes are made to the 'sources.list', you must run $ sudo apt-get update
.. to update the "Package Lists". Then you can install packages.

-
 
Old 02-05-2013, 05:32 AM   #7
saeedian
Member
 
Registered: Dec 2011
Posts: 32

Original Poster
Rep: Reputation: Disabled
now "cmake" is working but it needs some commands.
however I do "make" to installation but it gives same errors as before.

Code:
meghdad@meghdad-Vostro-1320:~/lapack-3.4.2/build$ cmake 
cmake version 2.8.3
Usage

  cmake [options] <path-to-source>
  cmake [options] <path-to-existing-build>

Options
  -C <initial-cache>          = Pre-load a script to populate the cache.
  -D <var>:<type>=<value>     = Create a cmake cache entry.
  -U <globbing_expr>          = Remove matching entries from CMake cache.
  -G <generator-name>         = Specify a makefile generator.
  -Wno-dev                    = Suppress developer warnings.
  -Wdev                       = Enable developer warnings.
  -E                          = CMake command mode.
  -i                          = Run in wizard mode.
  -L[A][H]                    = List non-advanced cached variables.
  --build <dir>               = Build a CMake-generated project binary tree.
  -N                          = View mode only.
  -P <file>                   = Process script mode.
  --graphviz=[file]           = Generate graphviz of dependencies.
  --system-information [file] = Dump information about this system.
  --debug-trycompile          = Do not delete the try compile directories..
  --debug-output              = Put cmake in a debug mode.
  --trace                     = Put cmake in trace mode.
  --help-command cmd [file]   = Print help for a single command and exit.
  --help-command-list [file]  = List available listfile commands and exit.
  --help-commands [file]      = Print help for all commands and exit.
  --help-compatcommands [file]= Print help for compatibility commands.
  --help-module module [file] = Print help for a single module and exit.
  --help-module-list [file]   = List available modules and exit.
  --help-modules [file]       = Print help for all modules and exit.
  --help-custom-modules [file]= Print help for all custom modules and exit.
  --help-policy cmp [file]    = Print help for a single policy and exit.
  --help-policies [file]      = Print help for all policies and exit.
  --help-property prop [file] = Print help for a single property and exit.
  --help-property-list [file] = List available properties and exit.
  --help-properties [file]    = Print help for all properties and exit.
  --help-variable var [file]  = Print help for a single variable and exit.
  --help-variable-list [file] = List documented variables and exit.
  --help-variables [file]     = Print help for all variables and exit.
  --copyright [file]          = Print the CMake copyright and exit.
  --help                      = Print usage information and exit.
  --help-full [file]          = Print full help and exit.
  --help-html [file]          = Print full help in HTML format.
  --help-man [file]           = Print full help as a UNIX man page and exit.
  --version [file]            = Show program name/version banner and exit.

Generators

The following generators are available on this platform:
  Unix Makefiles              = Generates standard UNIX makefiles.
  CodeBlocks - Unix Makefiles = Generates CodeBlocks project files.
  Eclipse CDT4 - Unix Makefiles
                              = Generates Eclipse CDT 4.0 project files.
  KDevelop3                   = Generates KDevelop 3 project files.
  KDevelop3 - Unix Makefiles  = Generates KDevelop 3 project files.
 
Old 02-05-2013, 07:35 AM   #8
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,522

Rep: Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503
# 7

Please read post # 2 : The command is not $ 'cmake', but $ 'cmake ../'.
Or 'cmake ..'. I.e. the file cmake is using, is one level up.


Repeat : Please edit post # 1 to use 'code tags', for better readability.


-
 
Old 02-05-2013, 01:09 PM   #9
saeedian
Member
 
Registered: Dec 2011
Posts: 32

Original Poster
Rep: Reputation: Disabled
I did but its configuration remain incomplete as below:

Code:
meghdad@meghdad-Vostro-1320:~/lapack-3.4.2/build$ cmake ../
-- Looking for Python found - TRUE
-- Using Python version 
-- Looking for Fortran NONE - found
-- Looking for Fortran INT_CPU_TIME - found
-- Looking for Fortran EXT_ETIME - not found
-- Looking for Fortran EXT_ETIME_ - not found
-- Looking for Fortran INT_ETIME - found
-- --> Will use second_INT_ETIME.f and dsecnd_INT_ETIME.f as timing function.
-- Using supplied NETLIB BLAS implementation
-- Using supplied NETLIB LAPACK implementation
-- Building Single Precision
-- Building Double Precision
-- Building Complex Precision
-- Building Double Complex Precision
CMake Error at TESTING/CMakeLists.txt:313 (add_test):
  add_test given unknown argument:

    WORKING_DIRECTORY



-- Configuring incomplete, errors occurred!
meghdad@meghdad-Vostro-1320:~/lapack-3.4.2/build$
 
Old 02-09-2013, 05:53 AM   #10
saeedian
Member
 
Registered: Dec 2011
Posts: 32

Original Poster
Rep: Reputation: Disabled
I had done the suggested command line in post 2 for ubuntu 12.10 :
Code:
sudo apt-get install liblapack-dev
the results printed in terminal is as below:
Code:
meghdad@Persepolis:~$ sudo apt-get install liblapack-dev
[sudo] password for meghdad: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  calligra-l10n-engb cdparanoia k3b k3b-data k3b-i18n kde-l10n-engb
  kde-l10n-zhcn language-pack-kde-en libflac++6 libk3b6 libkcddb4
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  libblas-dev libblas3 libgfortran3 liblapack3
The following NEW packages will be installed:
  libblas-dev libblas3 libgfortran3 liblapack-dev liblapack3
0 upgraded, 5 newly installed, 0 to remove and 227 not upgraded.
Need to get 7,630 kB of archives.
After this operation, 21.7 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://ir.archive.ubuntu.com/ubuntu/ quantal/main libgfortran3 i386 4.7.2-2ubuntu1 [332 kB]
Get:2 http://ir.archive.ubuntu.com/ubuntu/ quantal/main libblas3 i386 1.2.20110419-5 [205 kB]
Get:3 http://ir.archive.ubuntu.com/ubuntu/ quantal/main libblas-dev i386 1.2.20110419-5 [202 kB]
Get:4 http://ir.archive.ubuntu.com/ubuntu/ quantal/main liblapack3 i386 3.4.1-6 [3,264 kB]
Get:5 http://ir.archive.ubuntu.com/ubuntu/ quantal/main liblapack-dev i386 3.4.1-6 [3,627 kB]
Fetched 7,630 kB in 7min 27s (17.0 kB/s)                                       
Selecting previously unselected package libgfortran3:i386.
(Reading database ... 174038 files and directories currently installed.)
Unpacking libgfortran3:i386 (from .../libgfortran3_4.7.2-2ubuntu1_i386.deb) ...
Selecting previously unselected package libblas3.
Unpacking libblas3 (from .../libblas3_1.2.20110419-5_i386.deb) ...
Selecting previously unselected package libblas-dev.
Unpacking libblas-dev (from .../libblas-dev_1.2.20110419-5_i386.deb) ...
Selecting previously unselected package liblapack3.
Unpacking liblapack3 (from .../liblapack3_3.4.1-6_i386.deb) ...
Selecting previously unselected package liblapack-dev.
Unpacking liblapack-dev (from .../liblapack-dev_3.4.1-6_i386.deb) ...
Setting up libgfortran3:i386 (4.7.2-2ubuntu1) ...
Setting up libblas3 (1.2.20110419-5) ...
update-alternatives: using /usr/lib/libblas/libblas.so.3 to provide /usr/lib/libblas.so.3 (libblas.so.3) in auto mode
Setting up libblas-dev (1.2.20110419-5) ...
update-alternatives: using /usr/lib/libblas/libblas.so to provide /usr/lib/libblas.so (libblas.so) in auto mode
Setting up liblapack3 (3.4.1-6) ...
update-alternatives: using /usr/lib/lapack/liblapack.so.3 to provide /usr/lib/liblapack.so.3 (liblapack.so.3) in auto mode
Setting up liblapack-dev (3.4.1-6) ...
update-alternatives: using /usr/lib/lapack/liblapack.so to provide /usr/lib/liblapack.so (liblapack.so) in auto mode
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
meghdad@Persepolis:~$
and the lapack file created in the /usr/lib as below:
Code:
meghdad@Persepolis:/usr/lib/lapack$ ls
liblapack.a  liblapack.so  liblapack.so.3  liblapack.so.3.0
meghdad@Persepolis:/usr/lib/lapack$
now how can I find those routins?
 
Old 02-09-2013, 11:36 AM   #11
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,522

Rep: Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503
# 10
Quote:
how can I find those routines ?
Which routines ?
 
Old 02-10-2013, 03:04 AM   #12
saeedian
Member
 
Registered: Dec 2011
Posts: 32

Original Poster
Rep: Reputation: Disabled
#11

I need to use zgesvd.

Last edited by saeedian; 02-10-2013 at 03:24 AM.
 
Old 02-10-2013, 05:20 AM   #13
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,522

Rep: Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503
# 12

The object / symbol *zgesvdis is present in liblapack.so*.

Example, a random liblapack :
Code:
$ readelf -s /usr/lib/liblapack.so.3.1.1 | grep -i zgesvd
  1464: 003a06f0 58207 FUNC    GLOBAL DEFAULT   10 zgesvd_


$ readelf -s /usr/lib/liblapack.so | grep -i zgesvd
  1464: 003a06f0 58207 FUNC    GLOBAL DEFAULT   10 zgesvd_
 
Old 02-15-2013, 05:02 PM   #14
saeedian
Member
 
Registered: Dec 2011
Posts: 32

Original Poster
Rep: Reputation: Disabled
#13

I had installed lapack and it seems 'zgeev' installed correctly as well:
Code:
meghdad@meghdad-Vostro-1320:~/Desktop$ readelf -s /usr/lib/liblapack.so | grep -i zgeev
   647: 0056db10  5077 FUNC    GLOBAL DEFAULT   12 zgeev_
  1064: 0056eef0  6845 FUNC    GLOBAL DEFAULT   12 zgeevx_

meghdad@meghdad-Vostro-1320:~/Desktop$ readelf -s /usr/lib/liblapack.so.3gf | grep -i zgeev
   730: 00599e30  6845 FUNC    GLOBAL DEFAULT    9 zgeevx_
  1464: 00598a50  5077 FUNC    GLOBAL DEFAULT    9 zgeev_
and in the google search I had found a routine for using the zgeev as follow:
Code:
/* finding the eigenvalues of a complex matrix */

#include 
#define size 3				/* dimension of matrix */

struct complex {double re; double im;};  	/* a complex number */

main()
{
struct complex A[3][3], b[3], DUMMY[1][1], WORK[6];
double AT[2*size*size];			/* for transformed matrix */
int i, j, ok, c1, c2, c3;
char c4;

A[0][0].re=3.1;A[0][0].im=-1.8;		/* the input matrix */
A[0][1].re=1.3;A[0][1].im=0.2;
A[0][2].re=-5.7;A[0][2].im=-4.3;
A[1][0].re=1.0;A[1][0].im=0;
A[1][1].re=-6.9;A[1][1].im=3.2;
A[1][2].re=5.8;A[1][2].im=2.2;
A[2][0].re=3.4;A[2][0].im=-4;
A[2][1].re=7.2;A[2][1].im=2.9;
A[2][2].re=-8.8;A[2][2].im=3.2;

for (i=0; i<size; i++)		/* to call a Fortran routine from C we */
{				/* have to transform the matrix */
  for(j=0; j<2*size; j++) 
  {
     AT[2*(j+size*i)]=A[j][i].re;
     AT[2*(j+size*i)+1]=A[j][i].im;
  }		
}

c1=size;			/* and put all numbers and characters */ 
c2=2*size;    			/* we want to pass */
c3=1;				/* to the routine in variables */
c4='N';

/* find solution using LAPACK routine ZGEEV, all the arguments have to */
/* be pointers and you have to add an underscore to the routine name */
zgeev_(&c4, &c4,&c1, AT, &c1, b, DUMMY, &c3, DUMMY, &c3, WORK, &c2, WORK, &ok);      

/*
 parameters in the order as they appear in the function call
    no left eigenvectors, no right eigenvectors, order of input matrix A,
    input matrix A, leading dimension of A, array for eigenvalues, 
    array for left eigenvalue, leading dimension of DUMMY, 
    array for right eigenvalues, leading dimension of DUMMY,
    workspace array dim>=2*order of A, dimension of WORK
    workspace array dim=2*order of A, return value */

if (ok==0)				/* output of eigenvalues */
{
   for (i=0; i<size; i++)
   {
      printf("%f\t%f\n", b[i].re, b[i].im);
   }
}
else printf("An error occured");
}
Question:
How should I address the lib for #include in line 3 ?

Thanks

Last edited by saeedian; 02-15-2013 at 05:11 PM.
 
Old 02-16-2013, 03:28 AM   #15
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,522

Rep: Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503
# 14

#include :
Is for headers only. Like #include "file.hpp", #include <file.hpp>, #include <iostream>,
etc. etc.

Libraries are to be added in the Makefile or at the command line with, example :
-llapack


-
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Installing LAPACK on OSX. Fortran90. C.L. Other *NIX 4 11-09-2011 02:00 AM
Lapack soltanloo Linux - Software 1 10-01-2009 04:41 AM
ARPACK vs. LAPACK mkrems Programming 3 05-15-2008 01:00 PM
greenie over his head with installing lapack munichtexan Programming 0 05-13-2008 04:09 AM


All times are GMT -5. The time now is 11:08 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration