GCC not detecting plasma.h

Open forum for general discussions relating to PLASMA.

GCC not detecting plasma.h

Postby ashishpaliwal » Wed Nov 16, 2011 2:45 pm

Hi, I am a computer Science student from Indian Institute of Technology, India. I installed PLASMA along with gotoblas2.
While installing I gave the command

Code: Select all
./setup.py --cc=gcc --fc=gfortran --blaslib="GotoBLAS2-1.13_bsd/GotoBLAS2/libgoto2_penryn-r1.13.a"


And the installation was successful. But now when I am running example code for checking Cholesky factorization, gcc is not able to detect plasma.h.

Code: Select all
$gcc -o cholesky example_cposv.c
example_cposv.c:22:20: fatal error: plasma.h: No such file or directory
compilation terminated.


What is going wrong?

Thank You

Ashish
ashishpaliwal
 
Posts: 8
Joined: Wed Nov 16, 2011 2:38 pm

Re: GCC not detecting plasma.h

Postby admin » Wed Nov 16, 2011 4:14 pm

Use the -I flag when compiling your code to point to the location of the plasma.h file.
Best,
Jakub
admin
Site Admin
 
Posts: 79
Joined: Wed May 13, 2009 1:27 pm

Re: GCC not detecting plasma.h

Postby ashishpaliwal » Thu Nov 17, 2011 12:02 am

Thank you sir,

I had to include many directories. I installed PLASMA in some folder of my choice. Should I install it in some standard folder so these linking problems will not occur. AS of now I had to provide paths to include folders of plasma, quark and lapacke.

$gcc -I /home/ashish/Documents/DDP/Papers/Parallel_programming_models/plasma-installer_2.4.2/build/plasma_2.4.2/include/ -I ~/Documents/DDP/Papers/Parallel_programming_models/plasma-installer_2.4.2/build/plasma_2.4.2/quark -I /home/ashish/Documents/DDP/Papers/Parallel_programming_models/plasma-installer_2.4.2/build/lapacke-3.3.0/include -o chol example_cposv.c


I am trying to run example code example_cposv.c and it is giving error like

/tmp/ccjnDbTQ.o: In function `main':
example_cposv.c:(.text+0x110): undefined reference to `PLASMA_Init'
example_cposv.c:(.text+0x14a): undefined reference to `LAPACKE_slarnv_work'
example_cposv.c:(.text+0x18e): undefined reference to `claghe'
example_cposv.c:(.text+0x2a8): undefined reference to `LAPACKE_clarnv_work'
example_cposv.c:(.text+0x348): undefined reference to `PLASMA_cposv'
example_cposv.c:(.text+0x40a): undefined reference to `PLASMA_Finalize'
/tmp/ccjnDbTQ.o: In function `check_solution':
example_cposv.c:(.text+0x439): undefined reference to `LAPACKE_slamch_work'
example_cposv.c:(.text+0x461): undefined reference to `plasma_lapack_constants'
example_cposv.c:(.text+0x49a): undefined reference to `LAPACKE_clange_work'
example_cposv.c:(.text+0x4a2): undefined reference to `plasma_lapack_constants'
example_cposv.c:(.text+0x4db): undefined reference to `LAPACKE_clange_work'
example_cposv.c:(.text+0x4e3): undefined reference to `plasma_lapack_constants'
example_cposv.c:(.text+0x51c): undefined reference to `LAPACKE_clange_work'
example_cposv.c:(.text+0x588): undefined reference to `cblas_cgemm'
example_cposv.c:(.text+0x58d): undefined reference to `plasma_lapack_constants'
example_cposv.c:(.text+0x5c6): undefined reference to `LAPACKE_clange_work'


Have I done installation wrong or something? It seems gcc is totally unaware about the things in PLASMA.
ashishpaliwal
 
Posts: 8
Joined: Wed Nov 16, 2011 2:38 pm

Re: GCC not detecting plasma.h

Postby admin » Thu Nov 17, 2011 2:21 am

-I to point to the header files.
-L to point to the libraries.
Jakub
:roll:
admin
Site Admin
 
Posts: 79
Joined: Wed May 13, 2009 1:27 pm

Re: GCC not detecting plasma.h

Postby ashishpaliwal » Thu Nov 17, 2011 4:40 am

Nope.. it shows the same error!
ashishpaliwal
 
Posts: 8
Joined: Wed Nov 16, 2011 2:38 pm

Re: GCC not detecting plasma.h

Postby mateo70 » Thu Nov 17, 2011 2:20 pm

Hello,

It's just that when you install your own library without your package installer (apt, aptitude, or else), the libraries and include files are installed in the directory you specified with the option usually called prefix.

So, once your new package is installe you need to add to your environment the path to the include file and to the library. Or for the compilation, as Jakub mentionned by option to the compiler.
To add the directoies to your environment use the following command:

export INCLUDE_PATH=$INCLUDE_PATH:__prefix__/include
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:__prefix__/lib

where you replace __prefix__ by the directory where you installe the libs.
Otherwise google and man are your frineds :).

Regards,
Mathieu
mateo70
 
Posts: 92
Joined: Fri May 07, 2010 3:48 pm


Return to User discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron