how to deal with 'undefined reference' while running ./build.sh

26 views
Skip to first unread message

Wu Chaofu

unread,
Sep 15, 2015, 5:12:07 AM9/15/15
to votca
Dear votca-ers,
I try to install votca with the following command lines

./build.sh --prefix ${prefix} tools cg -DEXPAT_LIBRARY=/usr/local/expat/lib/libexpat.a -DEXPAT_INCLUDE_DIR=/usr/local/expat/include -DFFTW3_LIBRARY=/usr/local/fftw/lib/libfftw3.a -DFFTW3_INCLUDE_DIR=/usr/local/fftw/include -DGSL_LIBRARY=/usr/local/gsl/lib/libgsl.a -DGSL_INCLUDE_DIR=/usr/local/gsl/include/ -DGSLCBLAS_LIBRARY=/usr/local/gsl/lib/libgslcblas.a -DSQLITE3_LIBRARY=/usr/local/sqlite/lib/libsqlite3.a -DSQLITE3_INCLUDE_DIR=/usr/local/sqlite/include

But the process interrupts with a few outputs

Linking CXX shared library libvotca_tools.so                                                 
[ 94%] Built target votca_tools                                                              
Scanning dependencies of target votca_property
[ 97%] Building CXX object src/tools/CMakeFiles/votca_property.dir/votca_property.cc.o       
Linking CXX executable votca_property                                                        
../libtools/libvotca_tools.so.3: undefined reference to `dlsym'                              
../libtools/libvotca_tools.so.3: undefined reference to `dlerror'
../libtools/libvotca_tools.so.3: undefined reference to `dlopen'
../libtools/libvotca_tools.so.3: undefined reference to `dlclose'
collect2: ld returned 1 exit status
make[2]: *** [src/tools/votca_property] Error 1
make[1]: *** [src/tools/CMakeFiles/votca_property.dir/all] Error 2
make: *** [all] Error 2

How to deal with this issue, please? Thanks a lot for any reply.
Yours sincerely,
Chaofu Wu

xiaowu759

unread,
Sep 15, 2015, 8:58:27 AM9/15/15
to vo...@googlegroups.com
Either of the following solutions posted previously can not deal with it

install/build a shared version of fftw;
specify a shared fftw to -DFFTW3_LIBRARY;
add libm.so to -DFFTW3_LIBRARY



--
View this message in context: http://votca.966470.n3.nabble.com/how-to-deal-with-undefined-reference-while-running-build-sh-tp4024971p4024972.html
Sent from the votca mailing list archive at Nabble.com.

Sikandar Mashayak

unread,
Sep 15, 2015, 11:00:08 AM9/15/15
to vo...@googlegroups.com
Hi Chaofu Wu,

Try linking to shared libraries .so instead of static (.a). See if that helps.

Best,
Sikandar


--
You received this message because you are subscribed to the Google Groups "votca" group.
To unsubscribe from this group and stop receiving emails from it, send an email to votca+un...@googlegroups.com.
To post to this group, send email to vo...@googlegroups.com.
Visit this group at http://groups.google.com/group/votca.
For more options, visit https://groups.google.com/d/optout.

Christoph Junghans

unread,
Sep 15, 2015, 12:39:26 PM9/15/15
to vo...@googlegroups.com
2015-09-15 9:00 GMT-06:00 Sikandar Mashayak <symas...@gmail.com>:
> Hi Chaofu Wu,
>
> Try linking to shared libraries .so instead of static (.a). See if that
> helps.
Yes, that would be my suggestion, too. If you don't have shared
libraries in /usr/local/ you could try to build VOTCA statically by
adding -DBUILD_SHARED_LIBS=OFF as option to build.sh.

Christoph
--
Christoph Junghans
Web: http://www.compphys.de
Reply all
Reply to author
Forward
0 new messages