lingtikong / fix-phonon

Automatically exported from code.google.com/p/fix-phonon
6 stars 4 forks source link

postprocess compilation #7

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Compilation of spglib-0.7.1
2. compilation of postproc code
3.

What is the expected output? What do you see instead?
Seems there is linking issue. Please see the output below

What version of the product are you using? On what operating system?
I am using same version as given in this project. I am using Mac OS 10.7

Please provide any additional information below.

For compilation of spglib-0.7.1:

Making install in src
test -z "/opt/spglib/0.7.1/lib" || .././install-sh -c -d "/opt/spglib/0.7.1/lib"
 /bin/sh ../libtool   --mode=install /usr/bin/install -c  'libsymspg.la' '/opt/spglib/0.7.1/lib/libsymspg.la'
libtool: install: /usr/bin/install -c .libs/libsymspg.0.dylib 
/opt/spglib/0.7.1/lib/libsymspg.0.dylib
libtool: install: (cd /opt/spglib/0.7.1/lib && { ln -s -f libsymspg.0.dylib 
libsymspg.dylib || { rm -f libsymspg.dylib && ln -s libsymspg.0.dylib 
libsymspg.dylib; }; })
libtool: install: /usr/bin/install -c .libs/libsymspg.lai 
/opt/spglib/0.7.1/lib/libsymspg.la
libtool: install: /usr/bin/install -c .libs/libsymspg.a 
/opt/spglib/0.7.1/lib/libsymspg.a
libtool: install: chmod 644 /opt/spglib/0.7.1/lib/libsymspg.a
libtool: install: ranlib /opt/spglib/0.7.1/lib/libsymspg.a
ranlib: file: /opt/spglib/0.7.1/lib/libsymspg.a(debug.o) has no symbols
----------------------------------------------------------------------
Libraries have been installed in:
   /opt/spglib/0.7.1/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `DYLD_LIBRARY_PATH' environment variable
     during execution

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
make[2]: Nothing to be done for `install-data-am'.
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
=====================================================

For postproc:

g++ -O3  -DUseSPG -I/opt/clapack/3.2.1/include -I/opt/tricubic/1.0/include 
-I/opt/spglib/0.7.1/include "spglib.h"  -c dynmat.cpp
g++ -O3  -DUseSPG -I/opt/clapack/3.2.1/include -I/opt/tricubic/1.0/include 
-I/opt/spglib/0.7.1/include "spglib.h"  -c green.cpp
g++ -O3  -DUseSPG -I/opt/clapack/3.2.1/include -I/opt/tricubic/1.0/include 
-I/opt/spglib/0.7.1/include "spglib.h"  -c interpolate.cpp
g++ -O3  -DUseSPG -I/opt/clapack/3.2.1/include -I/opt/tricubic/1.0/include 
-I/opt/spglib/0.7.1/include "spglib.h"  -c main.cpp
g++ -O3  -DUseSPG -I/opt/clapack/3.2.1/include -I/opt/tricubic/1.0/include 
-I/opt/spglib/0.7.1/include "spglib.h"  -c memory.cpp
g++ -O3  -DUseSPG -I/opt/clapack/3.2.1/include -I/opt/tricubic/1.0/include 
-I/opt/spglib/0.7.1/include "spglib.h"  -c phonon.cpp
g++ -O3  -DUseSPG -I/opt/clapack/3.2.1/include -I/opt/tricubic/1.0/include 
-I/opt/spglib/0.7.1/include "spglib.h"  -c timer.cpp
g++ -static -O3  dynmat.o green.o interpolate.o main.o memory.o phonon.o 
timer.o -L/opt/clapack/3.2.1/lib -lclapack -lblas -lf2c  
-L/opt/tricubic/1.0/lib -ltricubic -L/opt/spglib/0.7.1/lib -lsymspg -o phana
ld: library not found for -lcrt0.o
collect2: ld returned 1 exit status
make: *** [phana] Error 1

Original issue reported on code.google.com by crajib2...@gmail.com on 15 Feb 2012 at 1:22

GoogleCodeExporter commented 9 years ago
Well, it seems that your compiler g++ cannot find a library named libcrt0.o, 
which is related to Mac. As I don't have access to mac machines, I cannot try 
this out. But you can google it and try to pass the path of that library to the 
compiler, then the problem should be solved.

Original comment by kon...@gmail.com on 16 Feb 2012 at 1:36

GoogleCodeExporter commented 9 years ago
Check this:

https://discussions.apple.com/thread/2252567?start=15&tstart=0

Someone says by replacing -static by -Bstatic in the makefile can solve the 
problem. Perhaps worth a try.

Original comment by kon...@gmail.com on 16 Feb 2012 at 1:38