` bt-blog: How to install it++ on Mac OS X 10.4.9

PAGE HAS MOVED AGAIN

NOTE : This is no longer being maintained -- go to http://research.tannerpages.com


In fact, it's worse than not being maintained... I actually moved the content. So just come over!

May 7, 2007

How to install it++ on Mac OS X 10.4.9

Note: Thanks to Alex Alvarado for pointing out a small error with the instructions. Also thanks to Brad Joyce for pointing our numerous other leaps in the directions.

There is some cool software called it++ which lets you write and do Matlab/Octave-like things in C++. So far I've had some trouble getting it installed.

You see, it uses blas, cblas, LAPACK, and fftw (and maybe some other stuff). Generally you'd want to have all these installed yourself before using it++, but on Mac OS X (since 10.2 I think), everything except fftw comes in the vecLib framework (which comes WITH OS X).

So, how do you get this thing running?

1) You need a fortran compiler, and apparently you won't have one by default. In theory, you can install it with Fink. That didn't work for me. I went to http://hpc.sourceforge.net/ and used his binaries . You're looking for g77 3.4. There are instructions there on exactly how to unpack the archive so that everything goes to the right place. Works great. Make sure that you add it to your path in ~/.profile and that you restart terminal (so that the changes take effect). G77 will go in /usr/local/bin, so you should add a line to your ~/.profile like:
export PATH=/usr/local/bin:$PATH

2) You need fftw. I just downloaded, did a ./configure , make, sudo make install and it went off without a hitch.

3) Now you want to install it++. First, go download and unpack it. Then, you should be able to:
./configure

You'll see this (hopefully)
------------------------------------------------------------------------------
itpp-3.10.10 library configuration:
------------------------------------------------------------------------------

Directories:
- prefix ......... : /usr/local
- exec_prefix .... : ${prefix}
- includedir ..... : ${prefix}/include
- libdir ......... : ${exec_prefix}/lib
- docdir ......... : ${datarootdir}/doc/itpp-3.10.10

Switches:
- debug .......... : no
- exceptions ..... : no
- html-doc ....... : no
- shared ......... : yes
- static ......... : no

Documentation tools:
- doxygen ........ : no
- latex .......... : yes
- dvips .......... : yes
- ghostscript .... : yes

Testing tools:
- diff ........... : yes
- sed ............ : yes

External libs:
- BLAS ........... : yes
* MKL .......... : no
* ACML ......... : no
* ATLAS ........ : no
- CBLAS .......... : yes
- LAPACK ......... : yes
- FFT ............ : yes
* MKL .......... : no
* ACML ......... : no
* FFTW ......... : yes

Compiler/linker flags/libs/defs:
- CXX ............ : g++
- F77 ............ : g77
- CXXFLAGS ....... : -DASSERT_LEVEL=1 -O3 -fno-exceptions -pipe
- CXXFLAGS_DEBUG . :
- CPPFLAGS ....... :
- LDFLAGS ........ :
- LIBS ........... : -lfftw3 -llapack -lblas

Note: If y ou didn't install fortran (g77), it WONT FIND LAPACK OR BLAS. That took me a long time to sort out. You've been warned.

Now, if everything went according to plan, you can do:
make
make check

This will run some checks to make sure things are working ok.

sudo make install

That's it, now you're done. Great work. Watch for a follow up post of how to use it++!

6 comments:

Cosmin said...

Thanks!

Cosmin said...

Also, Brad and Andrew helped me get it working with xcode, I just added /usr/local/include to the Header Search Paths, /usr/local/lib to the Library Search Paths and disabled the ZeroLink option. So now I can compile and run their matrix inversion example

Cosmin said...

Almost forgot, I also had to add -litpp -lfftw3 -llapack -lblas to "Other Link Flags"

Anonymous said...

Just typing "./configure" didn't do the trick for me, I had to explicitely specify to use the vecLib framework: "./configure --with-blas='-framework vecLib'".

Anonymous said...

I got it to work with fftw3 and g77 from Fink using...

setenv LDFLAGS "-L/sw/lib"
setenv CPPFLAGS "-I/sw/include"
./configure --with-blas='-framework vecLib'
make
make check
sudo make install

Thanks!

lisa said...

I installed fftw3 and it++ pacakges and followed all the instructions described, but I'm unable to compile Fortran programs invoking lapack/blas routines. The error message is as follows:
/usr/bin/ld: can't locate file for: -llapack
collect2: ld returned 1 exit status