[Kst] CFITSIO Problem

Nicholas Chapman nchapman at u.northwestern.edu
Fri Aug 2 22:44:22 UTC 2013


Hi, no, I haven't solved the problem yet.  After talking to someone
here and spending some time searching on the internet, my best guess
is that it is a problem with linking a c library (cfitsio) into a c++
program (kst).  That would explain why the linker complains about an
undefined symbol _ffclos, when cfitsio defines ffclos.  See the
following for a description on how to link c programs into c++:
http://stackoverflow.com/questions/4598308/how-do-i-compile-and-link-c-code-with-compiled-c-code

I've tried the solutions suggested there in just about every possible
place (such as wrapping the #include statement directly in my plugin,
then editing longnam.h (called by fitsio.h) and fitsio.h in various
ways with 'extern' commands.)  None of these have worked.

Peter, I tried adding the command you suggested to the CMake Wizard
dialog, but I get the following error:
CMake Error: The source directory
"/Users/chapman/data1/Applications/ksttmp/--Dkst_3rdparty_build=1"
does not exist.

I am building the code in a separate directory named ksttmp, so
perhaps I just need to modify the path appropriately (from ../kst to
something else), but it isn't obvious to me what that should be.

One option I haven't tried yet is to re-write my plugin to use ccfits
instead of cfitsio.  ccfits is a c++ version of cfitsio.

Nicholas Chapman

On 8/2/13, Peter Kümmel <syntheticpp at gmx.net> wrote:
> On 26.07.2013 18:29, Nicholas Chapman wrote:
>> Hello, I am working on writing a plugin to read binary FITS tables,
>> specifically for HAWCPol, an instrument which will fly on SOFIA,
>> http://www.sofia.usra.edu/.  Currently I am testing by attempting to
>> read data from a different instrument called SHARP (hence the name
>> SHARP appearing in the output below).
>>
>> I downloaded the kst source code using git (and just confirmed with a
>> 'git pull' that this is the most current version).  I have written a
>> plugin, however I cannot compile kst with my new plugin to test it.
>> Based on the errors in the compile output, I think the problem is with
>> linking to the CFITSIO library.  However, when I ran cmake, it seemed
>> to find the CFITSIO library, so I am baffled.  I would appreciate any
>> suggestions on what might be causing this problem.  Details on my
>> steps taken are below.
>
> I assume the installed cfitsio doesn't work with kst. You could try to
> also build cfitsio while building kst:
>
> cmake -G"CodeBlocks - Unix Makefiles" ../kst --Dkst_3rdparty_build=1
>
>
>>
>> I am running Mac OS X 10.6.8 and I am using QtCreator 4.8.4.  I have
>> enabled my plugin by editing kst/cmake/src/datasources/CMakeLists.txt
>> as follows:
>> kst_add_plugin(. sharp)
>> if(sharp) # NLC - Added to support raw sharp data
>> 	include_directories(${SHARP_INCLUDE_DIR} ${CFITSIO_INCLUDE_DIR})
>> 	kst_add_plugin(. sharp)
>> 	kst_link(${SHARP_LIBRARIES} ${CFITSIO_LIBRARIES})
>> endif()
>>
>> Now, to compile kst, I started Qt Creator and opened the project by
>> selecting kst/cmake/CMakeLists.txt.  I then ran cmake.  Part of the
>> output contains:
>> Found CFITSIO:
>> --      includes : /opt/local/include;/opt/local/include/..
>> --      libraries: /opt/local/lib/libcfitsio.a;m
>>
>
> _______________________________________________
> Kst mailing list
> Kst at kde.org
> https://mail.kde.org/mailman/listinfo/kst
>


More information about the Kst mailing list