[Kst] CFITSIO Problem
Nicholas Chapman
nchapman at u.northwestern.edu
Fri Jul 26 16:29:06 UTC 2013
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 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
--
Therefore, kst does seem to know about CFITSIO, and found it in the
correct location. I installed CFITSIO using macports and have
successfully used this library to compile other programs. I did make
sure to put "#include <fitsio.h>" in my sharp.h header file.
However, when I select build, the compile output ends with errors that
suggest the CFITSIO library is not being linked properly:
src/datasources/CMakeFiles/kst2_datasource_sharp.dir/__/__/__/src/datasources/sharp/moc_sharp.cxx.o
Linking CXX shared module
../../build/bin/kst2.app/Contents/plugins/libkst2_datasource_sharp.so
Undefined symbols:
"_ffclos", referenced from:
SharpSourcePlugin::understands(QSettings*, QString const&)
constin sharp.cpp.o
SharpSource::init() in sharp.cpp.o
SharpSource::reset() in sharp.cpp.o
SharpSource::~SharpSource()in sharp.cpp.o
SharpSource::~SharpSource()in sharp.cpp.o
SharpSource::~SharpSource()in sharp.cpp.o
"_ffmahd", referenced from:
SharpSource::init() in sharp.cpp.o
"_ffgcnn", referenced from:
SharpSource::init() in sharp.cpp.o
"_ffgcno", referenced from:
SharpSource::readString(QString*, QString const&)in sharp.cpp.o
SharpSource::readScalar(double*, QString const&)in sharp.cpp.o
SharpSource::readMatrix(double*, QString const&)in sharp.cpp.o
SharpSource::readField(double*, QString const&, int, int)in sharp.cpp.o
"_ffopentest", referenced from:
SharpSourcePlugin::understands(QSettings*, QString const&)
constin sharp.cpp.o
SharpSource::init() in sharp.cpp.o
"_ffgcv", referenced from:
SharpSource::readString(QString*, QString const&)in sharp.cpp.o
SharpSource::readScalar(double*, QString const&)in sharp.cpp.o
SharpSource::readMatrix(double*, QString const&)in sharp.cpp.o
SharpSource::readField(double*, QString const&, int, int)in sharp.cpp.o
SharpSource::init() in sharp.cpp.o
"_ffrprt", referenced from:
SharpSource::readString(QString*, QString const&)in sharp.cpp.o
SharpSource::readString(QString*, QString const&)in sharp.cpp.o
SharpSource::readScalar(double*, QString const&)in sharp.cpp.o
SharpSource::readScalar(double*, QString const&)in sharp.cpp.o
SharpSource::readScalar(double*, QString const&)in sharp.cpp.o
SharpSource::readMatrix(double*, QString const&)in sharp.cpp.o
SharpSource::readMatrix(double*, QString const&)in sharp.cpp.o
SharpSource::readMatrix(double*, QString const&)in sharp.cpp.o
SharpSource::readMatrix(double*, QString const&)in sharp.cpp.o
SharpSource::readField(double*, QString const&, int, int)in sharp.cpp.o
SharpSource::readField(double*, QString const&, int, int)in sharp.cpp.o
SharpSource::readField(double*, QString const&, int, int)in sharp.cpp.o
SharpSource::init() in sharp.cpp.o
SharpSource::init() in sharp.cpp.o
SharpSource::init() in sharp.cpp.o
"_ffgnrw", referenced from:
SharpSource::readMatrix(double*, QString const&)in sharp.cpp.o
SharpSource::init() in sharp.cpp.o
"_ffgtcl", referenced from:
SharpSource::readScalar(double*, QString const&)in sharp.cpp.o
SharpSource::readMatrix(double*, QString const&)in sharp.cpp.o
SharpSource::readField(double*, QString const&, int, int)in sharp.cpp.o
SharpSource::init() in sharp.cpp.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[2]: *** [build/bin/kst2.app/Contents/plugins/libkst2_datasource_sharp.so]
Error 1
make[1]: *** [src/datasources/CMakeFiles/kst2_datasource_sharp.dir/all] Error 2
make: *** [all] Error 2
10:25:42: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project Kst (kit: Desktop)
When executing step 'Make'
10:25:42: Elapsed time: 13:43.
Thanks,
Nicholas Chapman
Dept of Physics & Astronomy
Northwestern University
More information about the Kst
mailing list