Bug 313517 - Not able to compile kstars on Ubuntu 12.04 (wcslib error)
Summary: Not able to compile kstars on Ubuntu 12.04 (wcslib error)
Status: RESOLVED FIXED
Alias: None
Product: kstars
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR critical
Target Milestone: ---
Assignee: Rishab Arora
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-19 18:11 UTC by Adam Garami
Modified: 2013-03-05 22:08 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Add link dependency for cmake library (438 bytes, patch)
2013-02-12 13:11 UTC, Nicolas Dubuit
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Garami 2013-01-19 18:11:16 UTC
Trying to compile kstars from source (git://anongit.kde.org/kstars) but I always get the following error message:

....
Linking CXX static library ../lib/libKStarsLib.a
[ 98%] Built target KStarsLib
[ 98%] Building CXX object kstars/CMakeFiles/kstars.dir/kstars.o
Linking CXX executable kstars
../lib/libKStarsLib.a(fitsimage.o): In function `FITSImage::checkWCS()':
/home/garamiad/DEV/kstars/kstars/fitsviewer/fitsimage.cpp:1043: undefined reference to `wcspih'
/home/garamiad/DEV/kstars/kstars/fitsviewer/fitsimage.cpp:1063: undefined reference to `wcsset'
/home/garamiad/DEV/kstars/kstars/fitsviewer/fitsimage.cpp:1082: undefined reference to `wcsp2s'
../lib/libKStarsLib.a(fitsimage.o): In function `fprintf':
/usr/include/i386-linux-gnu/bits/stdio2.h:99: undefined reference to `wcs_errmsg'
/usr/include/i386-linux-gnu/bits/stdio2.h:99: undefined reference to `wcshdr_errmsg'
/usr/include/i386-linux-gnu/bits/stdio2.h:99: undefined reference to `wcs_errmsg'
collect2: ld returned 1 exit status
make[2]: *** [kstars/kstars] Error 1
make[1]: *** [kstars/CMakeFiles/kstars.dir/all] Error 2
make: *** [all] Error 2
garamiad@sirius:~/DEV/kstars/build$ 

WCSLIB 4.16 is installed on the system from source but previously I've tried to use the wcslib packages included with Ubunut 12.04 and I got the same error above. Please help!

Reproducible: Always

Steps to Reproduce:
1. cmake .. -DCMAKE_INSTALL_PREFIX=/usr
2. make
Actual Results:  
See above.


Using ftp://ftp.atnf.csiro.au/pub/software/wcslib/wcslib.tar.bz2 on Xubuntu 12.04 (3.2.0-36-generic). WCSLIB is compiled with the following options: --prefix=/usr --with-cfitsioinc --with-cfitsiolib --with-pgplotinc --with-pgplotlib
Comment 1 Nicolas Dubuit 2013-02-12 13:11:39 UTC
Created attachment 77217 [details]
Add link dependency for cmake library
Comment 2 Nicolas Dubuit 2013-02-12 13:12:30 UTC
I also had this problem.

I could build it by adding (see attached diff)
    target_link_libraries(KStarsLib ${WCSLIB_LIBRARIES})
at line 481 of kstars/CMakeLists.txt

Could you please confirm that the above fix works for you?
Comment 3 Adam Garami 2013-02-12 16:09:32 UTC
Dear Nicolas,

your fix worked! I was able to compile kstars without errors! Thank you!
Comment 4 Jekyll Wu 2013-02-12 18:10:48 UTC
(In reply to comment #3)
> Dear Nicolas,
> 
> your fix worked! I was able to compile kstars without errors! Thank you!

Please do not close the report before the patch is really accepted and committed .
Comment 5 Adam Garami 2013-02-12 18:18:42 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > Dear Nicolas,
> > 
> > your fix worked! I was able to compile kstars without errors! Thank you!
> 
> Please do not close the report before the patch is really accepted and
> committed .

Ok, sorry for that!
Comment 6 Rishab Arora 2013-03-05 21:54:50 UTC
Thanks for the report and the patch. The target for the library was incorrect.
The committed patch is slightly different. This should fix this bug.
http://commits.kde.org/kstars/e25b3eea670c6e1b2555c2b67459b6ede4b25d2c