Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#89 build error on OS X, xspect.h not found

open
nobody
5
2012-08-13
2012-08-13
ronsf
No

Hi there,

lprof has been recommended to me as the profiler to use, so after a clean install of Xcode 4.4.1 and macports 2.1.2 on OS X "Lion" 10.7.4, attempting to run
sudo port -d install lprof
got me a lot of output indicating that all is well, and then this:

In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_graphics_lprof/lprof/work/lprof/src/liblprof/cmslm.c:31:
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_graphics_lprof/lprof/work/lprof/src/liblprof/lcmsprf.h:55:10: fatal error: 'xspect.h' file not found
#include "xspect.h"
^

More context:
[skipping lots of debug info indicating that all is well]
[ 47%] Built target lcmslocal
/opt/local/bin/cmake -E cmake_progress_report /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_graphics_lprof/lprof/work/lprof/CMakeFiles
[ 47%] Building C object src/liblprof/CMakeFiles/liblprof.dir/cmslm.o
cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_graphics_lprof/lprof/work/lprof/src/liblprof && /usr/bin/clang -DQT3_SUPPORT -DQT_3SUPPORT_LIB -DQT_ASSISTANT_LIB -DQT_GUI_LIB -DQT_XML_LIB -DQT_SQL_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DNON_WINDOWS -DUSE_FLOAT -DLPROF_ERROR_TRAP -DUNIX -DQT_NO_DEBUG -pipe -O2 -arch x86_64 -O3 -DNDEBUG -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_graphics_lprof/lprof/work/lprof/src/liblprof -I/opt/local/include -I/opt/local/include/Qt3Support -I/opt/local/include/QtAssistant -I/opt/local/include/QtGui -I/opt/local/include/QtXml -I/opt/local/include/QtSql -I/opt/local/include/QtNetwork -I/opt/local/include/QtCore -o CMakeFiles/liblprof.dir/cmslm.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_graphics_lprof/lprof/work/lprof/src/liblprof/cmslm.c
In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_graphics_lprof/lprof/work/lprof/src/liblprof/cmslm.c:31:
In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_graphics_lprof/lprof/work/lprof/src/liblprof/lcmsprf.h:37:
/opt/local/include/lcms.h:1418:14: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
if (size < 0) return NULL; // Prevent signed size_t exploits
In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_graphics_lprof/lprof/work/lprof/src/liblprof/cmshull.c:33:
In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_graphics_lprof/lprof/work/lprof/src/liblprof/lcmsprf.h:37:
/opt/local/include/lcms.h:1418:14: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
if (size < 0) return NULL; // Prevent signed size_t exploits
In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_graphics_lprof/lprof/work/lprof/src/liblprof/cmslm.c:31:
In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_graphics_lprof/lprof/work/lprof/src/liblprof/lcmsprf.h:55:10: fatal error: 'xspect.h' file not found
#include "xspect.h"
^
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_graphics_lprof/lprof/work/lprof/src/liblprof/cmshull.c:33:
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_graphics_lprof/lprof/work/lprof/src/liblprof/lcmsprf.h:55:10: fatal error: 'xspect.h' file not found
#include "xspect.h"
^
1 warning and 1 error generated.
make[2]: *** [src/liblprof/CMakeFiles/liblprof.dir/cmslm.o] Error 1
make[2]: *** Waiting for unfinished jobs....
1 warning and 1 error generated.
make[2]: *** [src/liblprof/CMakeFiles/liblprof.dir/cmshull.o] Error 1
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_graphics_lprof/lprof/work/lprof'
make[1]: *** [src/liblprof/CMakeFiles/liblprof.dir/all] Error 2
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_graphics_lprof/lprof/work/lprof'
make: *** [all] Error 2
make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_graphics_lprof/lprof/work/lprof'
Command failed: cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_graphics_lprof/lprof/work/lprof" && /usr/bin/make -j2 -w all
Exit code: 2
Error: org.macports.build for port lprof returned: command execution failed
DEBUG: Error code: CHILDSTATUS 36399 2
DEBUG: Backtrace: command execution failed
while executing
"system -nice 0 $fullcmdstring"
("eval" body line 1)
invoked from within
"eval system $notty $nice \$fullcmdstring"
invoked from within
"command_exec build"
(procedure "portbuild::build_main" line 8)
invoked from within
"$procedure $targetname"
Warning: targets not executed for lprof: org.macports.activate org.macports.build org.macports.destroot org.macports.install
Please see the log file for port lprof for details:
/opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_graphics_lprof/lprof/main.log
To report a bug, follow the instructions in the guide:
http://guide.macports.org/#project.tickets
Error: Processing of port lprof failed

Any hints as to how to resolve this would be much appreciated indeed!

Thanks,
Ronald

Discussion

  • ronsf
    ronsf
    2012-08-13

    I found the file, it's in argyll/xicc, which doesn't seem to be one of the include paths. Since I know nil about cmake, I have no idea how to add that path to the list to be included.

     

  • Anonymous
    2012-12-14

    Besides scons build works just fine for me i make quick and dirty hack to resolve cmake build problem for xspect.h.
    To make it works add this to CMAKE_C_FLAGS:
    -I/home/bartus/_src/lprof/src/argyll/xicc -I/home/bartus/_src/lprof/src/argyll/icc -I/home/bartus/_src/lprof/src/argyll/spectro -I/home/bartus/_src/lprof/src
    For me it works fine when building from cmake without local liblcms installed.
    Unfortunetly distrib package is to new for lprof and i can't get cmake to include heder form its source tree insteda of /usr/inclde one :?

     
    Last edit: Anonymous 2013-11-21
  • ronsf
    ronsf
    2013-01-24

    Thanks for the tips, bartus, and apologies for my slow response!

    I've had another go at this.

    - with the scons install it doesn't find the dependencies (which are in the macports tree) and so far I haven't managed to get past that (tried a number of variations on "qt_directory=/opt/local/xyz" to no avail).

    - with macports I got quite a bit further after adding those include paths (to CMakeCache.txt in the lprof build root), but now keep running into this:

    /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_graphics_lprof/lprof/work/lprof/src/liblprof/cmsmntr.c:339:5: error: use of undeclared identifier 'LPVCGTTABLES'
    LPVCGTTABLES data;
    ^
    /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_graphics_lprof/lprof/work/lprof/src/liblprof/cmsmntr.c:348:23: error: use of undeclared identifier 'VCGTTABLES'
    size = sizeof(VCGTTABLES) + ((int) rampsize * 3) * sizeof (unsigned short);
    ^
    /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_graphics_lprof/lprof/work/lprof/src/liblprof/cmsmntr.c:349:9: error: use of undeclared identifier 'data'
    data = malloc(size);
    ^

    (etc, more of the same)

    Not sure why this happens - cmsmntr.c includes lcmsprf.h, which includes lcms.h, which defines those two data types.
    At least that's what it looks like to me, though the compiler seems to think differently and it's usually right. Not sure what's happening there.

     
  • ronsf
    ronsf
    2013-01-24

    As it goes, just then I managed to get around that—had the hunch that it might just not be including those files and for some reason not throwing an error, and that seems to have been the case.

    There were a couple more errors like that, so what I ended up doing is to include this line (as line 2) in CMakeList.txt:

    include_directories(src/lprof src/lcms/include src/argyll/xicc src/argyll/icc src/argyll/rspl src/argyll/numlib src/argyll/spectro src/libqtlcmswidgets src/liblprof src/lprofqt src/monqt src/moncalqt src/argyll/h src/argyll/gamut src/argyll/cgats src/moncalcontrolqt src/videoLUTutils src/gammaqt src/parmsqt src/checkerqt src/IDqt src/reference_inst_qt src)

    Which got me past those "missing file" errors and got me a new one, which looks nastier:

    [ 74%] Building CXX object src/CMakeFiles/lprof.dir/qrc_lprof.o
    Linking CXX executable lprof
    Undefined symbols for architecture x86_64:
    "_CGDisplayGammaTableCapacity", referenced from:
    gamma_ramp::getGammaRampSize() in LUTutil-OSX.o
    "_CGGetDisplayTransferByTable", referenced from:
    gamma_ramp::getGammaRamp() in LUTutil-OSX.o
    "_CGGetDisplaysWithPoint", referenced from:
    getDisplay() in LUTutil-OSX.o
    "_CGSetDisplayTransferByTable", referenced from:
    gamma_ramp::setGammaRamp() in LUTutil-OSX.o
    "_SysBeep", referenced from:
    _msec_beep in libargyll.a(unixio.o)
    _delayed_beep in libargyll.a(unixio.o)
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    make[2]: *** [src/lprof] Error 1
    make[1]: *** [src/CMakeFiles/lprof.dir/all] Error 2
    make: *** [all] Error 2

    Any idea how to approach those?

     
  • ronsf
    ronsf
    2013-01-24

    Wow, I got lucky!

    After some fussing about, this worked for me:

    # make sure Xcode is current, and Xcode command line tools are installed
    roger:~ root# port install lprof # produces errors
    roger:~ root# cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_graphics_lprof/lprof/work/lprof
    roger:lprof root# patch # hit control-D ("^d") where indicated
    --- CMakeLists.txt.orig 2013-01-24 22:59:30.000000000 +1100
    +++ CMakeLists.txt 2013-01-24 22:59:47.000000000 +1100
    @@ -1,4 +1,5 @@
    CMAKE_MINIMUM_REQUIRED(VERSION 2.4.7 FATAL_ERROR)
    +include_directories(src/lprof src/lcms/include src/argyll/xicc src/argyll/icc src/argyll/rspl src/argyll/numlib src/argyll/spectro src/libqtlcmswidgets src/liblprof src/lprofqt src/monqt src/moncalqt src/argyll/h src/argyll/gamut src/argyll/cgats src/moncalcontrolqt src/videoLUTutils src/gammaqt src/parmsqt src/checkerqt src/IDqt src/reference_inst_qt src)

    SET(CMAKE_COLOR_MAKEFILE ON)
    SET(CMAKE_VERBOSE_MAKEFILE OFF)
    ^d # meaning hit ctrl-d here (do not type or copy any text here)
    roger:lprof root# cmake .
    roger:lprof root# cmake --build .

    Notes:
    * I've run all commands as root (via 'sudo -i'); alternatively one could prepend every individual command with 'sudo '
    * when I say this worked, I mean that the buld process finished without errors, stating that executables have been created. Whether it all works I will yet have to see
    * I'm sure there are better ways to do this, as in fix the port itself, but I haven't got the first clue how to go about that
    * I should also mention that I'm now on OS X 10.8.2 (Mountain Lion), with Xcode 4.5.2

     
  • ronsf
    ronsf
    2013-01-24

    Well, it doesn't seem to be working, at least not in its current state.

    I guess I'm missing a step anyway, such as actual installation as this is surely meant to live somewhere else in the file system, like /opt/local/bin or the like?

    Not sure how to do that; will keep digging (any hints welcome!), but running it as it is now gets me this:

    roger:lprof root# src/lprof
    Something wrong with call to coms -> get_paths(coms)
    lprof(6403,0x7fff7c4ed180) malloc: *** error for object 0x7f8a4221d768: incorrect checksum for freed object - object was probably modified after being freed.
    *** set a breakpoint in malloc_error_break to debug
    Abort trap: 6

    It does actually come up with a start screen, and then a dialog box with the text
    "This means that something is wrong with the LProf installation. LProf may not fuction correctly. Please contact LProf support for assitance in correcting the problem."

    Here I am... ;-)

     
  • ronsf
    ronsf
    2013-01-24

    As for installation, I tried the obvious one:

    roger:lprof root# make install

    and that seems to actually have worked.

    Still getting the same error when running as root, however when I run it as myself, I get this instead:

    $ lprof
    Something wrong with call to coms -> get_paths(coms)

    but it keeps running, and gives me two dialog boxes, stating

    "The QAssistantClient executable was not found. Make sure that assistant(.exe)is located either in your PATH or in the $QTDIR/bin directory. Help will not be availble until this is corrected."

    and

    "Please use the reference file installer to install one or more reference files. You will not be able to use the Camera/Scanner profiler until at least one reference file is installed."

    As for the first one:

    $ which assistant
    /opt/local/bin/assistant

    $ assistant
    Could not load translation file assistant_en_AU in directory /opt/local/share/qt4/translations.
    Could not load translation file qt_en_AU in directory /opt/local/share/qt4/translations.
    Could not load translation file qt_help_en_AU in directory /opt/local/share/qt4/translations.
    QSqlDatabase: QSQLITE driver not loaded
    QSqlDatabase: available drivers:
    Error reading collection file '/Users/ronald/Library/Application Support/Trolltech/Assistant/qthelpcollection_4.8.4.qhc': Cannot load sqlite database driver!.

    roger:bin root# cd /opt/local/share/qt4/translations/
    roger:translations root# ls ass*
    assistant_cs.qm assistant_de.qm assistant_hu.qm assistant_ko.qm assistant_ru.qm assistant_uk.qm assistant_zh_TW.qm
    assistant_da.qm assistant_fr.qm assistant_ja.qm assistant_pl.qm assistant_sl.qm assistant_zh_CN.qm

    roger:translations root# ls *_uk.qm
    assistant_uk.qm designer_uk.qm linguist_uk.qm qt_help_uk.qm qt_uk.qm qtconfig_uk.qm qvfb_uk.qm

    roger:translations root# for i in assistant designer linguist qt_help qt qtconfig qvfb
    > do
    > ln -s ${i}_uk.qm ${i}_en_AU.qm
    > done
    roger:translations root# ls *_AU.qm
    assistant_en_AU.qm designer_en_AU.qm linguist_en_AU.qm qt_en_AU.qm qt_help_en_AU.qm qtconfig_en_AU.qm qvfb_en_AU.qm

    $ assistant
    Could not load translation file assistant_en_AU in directory /opt/local/share/qt4/translations.
    Could not load translation file qt_en_AU in directory /opt/local/share/qt4/translations.
    Could not load translation file qt_help_en_AU in directory /opt/local/share/qt4/translations.
    QSqlDatabase: QSQLITE driver not loaded
    QSqlDatabase: available drivers:
    Error reading collection file '/Users/ronald/Library/Application Support/Trolltech/Assistant/qthelpcollection_4.8.4.qhc': Cannot load sqlite database driver!.
    roger:lprof-1.11.4.1 ronald$ assistant
    QSqlDatabase: QSQLITE driver not loaded
    QSqlDatabase: available drivers:
    Помилка читання файлу колекції '/Users/ronald/Library/Application Support/Trolltech/Assistant/qthelpcollection_4.8.4.qhc': Неможливо завантажити драйвер бази даних sqlite!.

    That didn't really help.

    Stumped again...

     
  • ronsf
    ronsf
    2013-01-24

    Only slightly better:

    roger:translations root# for i in assistant designer linguist qt_help qt qtconfig qvfb; do rm ${i}_en_AU.qm; ln ${i}_uk.qm ${i}_en_AU.qm; done
    roger:translations root# assistant
    QSqlDatabase: QSQLITE driver not loaded
    QSqlDatabase: available drivers:
    Помилка читання файлу колекції '/private/var/root/Library/Application Support/Trolltech/Assistant/qthelpcollection_4.8.4.qhc': Неможливо завантажити драйвер бази даних sqlite!.

    Shaving Yaks.