SebWouters / CheMPS2

CheMPS2: a spin-adapted implementation of DMRG for ab initio quantum chemistry
GNU General Public License v2.0
70 stars 34 forks source link

Compilation problem on Mac OS Yosemite with newest version #19

Closed kannon92 closed 8 years ago

kannon92 commented 8 years ago

I did a git clone of the CHEMPS2 library. I am able to configure the code.

When I try and compile the code, I get this error:

/Users/kevinhannon/Programs/CheMPS2/CheMPS2/DMRGtechnics.cpp:27:10: fatal error:       
'gsl/gsl_sf_coupling.h' file not found
#include <gsl/gsl_sf_coupling.h>
     ^
1 error generated.

I thought this was a problem with not finding GSL, but this appears in the configuration:

GSL_DEFINITIONS=
GSL_INCLUDE_DIRS=/usr/local/Cellar/gsl/1.16/include
GSL_CFLAGS=-I/usr/local/Cellar/gsl/1.16/include
-- Using GSL from 
-- FindGSL: Found both GSL headers and library
-- Configuring done

I have GSL and HDF in my path.

A coworker of mine has a much older version of this code and his config script is exactly the same. His code compiles fine. Is there anything else I need to do to properly link GSL?

SebWouters commented 8 years ago

Hi Kevin,

It should be fixed with commit 1b8fb1fca2a0f8a081f4daaf0d82b73c2e814e39. Can you confirm?

kannon92 commented 8 years ago

Thank you for that fix. The code compiles now.

kannon92 commented 8 years ago

I am still having some trouble with compiling the library.

I am having trouble with linking with the hdf5 library (I think).

undef: _inflate
undef: _inflateInit_
undef: _compress2
undef: _inflateEnd
Undefined symbols for architecture x86_64:
    "_inflate", referenced from:
   _H5Z_filter_deflate in libhdf5.a(H5Zdeflate.o)
   "_inflateInit_", referenced from:
   _H5Z_filter_deflate in libhdf5.a(H5Zdeflate.o)
"_compress2", referenced from:
  _H5Z_filter_deflate in libhdf5.a(H5Zdeflate.o)
"_inflateEnd", referenced from:
  _H5Z_filter_deflate in libhdf5.a(H5Zdeflate.o)
ld: symbol(s) not found for architecture x86_64

After a quick google search, I am thinking it is a problem with not having the zlib for compression linked with hdf5. What were some of specifics that you used to compile hdf5? I tried using a installation manager, but it does not require a dependency on zlib, but only on slib.

What is necessary for linking with hdf5? It seems that you need to link more than just hdf5.

loriab commented 8 years ago

You could give precompiled hdf5, zlib, etc. from conda a try if you want another alternative.

kannon92 commented 8 years ago

Yea, it was actually finding that hdf5 library first. I had some problems with including the shared libraries from conda into my path. When I added those libraries to find DYLD_LIBRARY_PATH, I found that cmake was no longer working.

I was able to get the code to compile and run successfully. I had to specify the zlib, hdf5, and szlip libraries in the HDF5_INCLUDE and HDF5_LIBRARIES CMAGE flag.