HPC/Applications/fftw3: Difference between revisions
< HPC | Applications
Jump to navigation
Jump to search
(Created page with "== Linking FFTW3 == Load the module in your .bashrc or simply on the command line. Then, to link, you typically need to pass to make(1) or configure where to find include and...") |
m (→Linking FFTW3) |
||
Line 5: | Line 5: | ||
In the simplest case, simply pass on the command line 3 items: | In the simplest case, simply pass on the command line 3 items: | ||
# path to include files <code>-I</code>, | # path to include files <code>-I''path''</code>, | ||
# path to library files <code>-L</code>, | # path to library files <code>-L''path''</code>, | ||
# the actual link request <code>-l''libname''</code>. (lowercase L) | |||
For example, for a standalone C program: | |||
icc … your obj files and flags … '''-I$FFTW3_HOME/include -L$FFTW3_HOME/lib -lfftw3''' | icc … your obj files and flags … '''-I$FFTW3_HOME/include -L$FFTW3_HOME/lib -lfftw3''' | ||
For | For MPI, simply replace <code>icc</code> by <code>mpicc</code>. | ||
Sometimes application makefiles use variables to handle the paths, e.g. for LAMMPS, the following is needed: | |||
make … \ | make … \ | ||
FFT_PATH="-L$FFTW3_HOME" \ | FFT_PATH="-L$FFTW3_HOME/lib" \ | ||
FFT_LIB="-lfftw3" \ | FFT_LIB="-lfftw3" \ | ||
… | … |
Revision as of 16:09, December 19, 2013
Linking FFTW3
Load the module in your .bashrc or simply on the command line.
Then, to link, you typically need to pass to make(1) or configure where to find include and library files.
In the simplest case, simply pass on the command line 3 items:
- path to include files
-Ipath
, - path to library files
-Lpath
, - the actual link request
-llibname
. (lowercase L)
For example, for a standalone C program:
icc … your obj files and flags … -I$FFTW3_HOME/include -L$FFTW3_HOME/lib -lfftw3
For MPI, simply replace icc
by mpicc
.
Sometimes application makefiles use variables to handle the paths, e.g. for LAMMPS, the following is needed:
make … \ FFT_PATH="-L$FFTW3_HOME/lib" \ FFT_LIB="-lfftw3" \ …