Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime error on MacOSX #18

Closed
tpaviot opened this issue May 27, 2011 · 2 comments
Closed

Runtime error on MacOSX #18

tpaviot opened this issue May 27, 2011 · 2 comments
Milestone

Comments

@tpaviot
Copy link
Owner

tpaviot commented May 27, 2011

On my machine, the small test I uploaded to tp/ctest-experiments segfaults. The same code for the example and the oce library, compiled with autotools works fine. What is werid is that the CMake generated oce library perfectly works on tog's OSX machine. Anyway, since the same code fails with CMake and runs with autotools, since the compiler is the same (gcc-4.2.1), then I had a look at the flags/definitions to check the differences with both.

This is the log with autotools:

Making all in adm/make
Making all in TKernel
/bin/sh ../../../libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../../inc           -I../../../inc -I../../../drv/FSD -I../../../src/FSD -I../../../drv/MMgt -I../../../src/MMgt -I../../../drv/OSD -I../../../src/OSD -I../../../drv/Plugin -I../../../src/Plugin -I../../../drv/Quantity -I../../../src/Quantity -I../../../drv/Resource -I../../../src/Resource -I../../../drv/SortTools -I../../../src/SortTools -I../../../drv/Standard -I../../../src/Standard -I../../../drv/StdFail -I../../../src/StdFail -I../../../drv/Storage -I../../../src/Storage -I../../../drv/TColStd -I../../../src/TColStd -I../../../drv/TCollection -I../../../src/TCollection -I../../../drv/TShort -I../../../src/TShort -I../../../drv/Units -I../../../src/Units -I../../../drv/UnitsAPI -I../../../src/UnitsAPI -I../../../drv/IncludeLibrary -I../../../src/IncludeLibrary -I../../../drv/Dico -I../../../src/Dico -I../../../drv/NCollection -I../../../src/NCollection -I../../../drv/Message -I../../../src/Message  -D_OCC64 -DNDEBUG  -DNo_Exception  -g -O2 -DCSFDB -DOCC_CONVERT_SIGNALS -O2 -MT Dico_DictionaryOfInteger_0.lo -MD -MP -MF .deps/Dico_DictionaryOfInteger_0.Tpo -c -o Dico_DictionaryOfInteger_0.lo `test -f '../../../drv/Dico/Dico_DictionaryOfInteger_0.cxx' || echo './'`../../../drv/Dico/Dico_DictionaryOfInteger_0.cxx

And the log with CMake, RelWithDebInfo:

[  0%] Building CXX object adm/cmake/TKernel/CMakeFiles/TKernel.dir/__/__/__/src/FSD/FSD_BinaryFile.cxx.o
cd /Users/thomas/Devel/oce/cmake-build/adm/cmake/TKernel && /usr/bin/c++   -DTKernel_EXPORTS -D_OCC64 -DHAVE_CONFIG_H -DCSFDB -DLIN -DOCC_CONVERT_SIGNALS -O2 -g -fPIC -I/Users/thomas/Devel/oce/cmake-build/build_inc -I/Users/thomas/Devel/oce/inc -I/Users/thomas/Devel/oce/src/FSD -I/Users/thomas/Devel/oce/drv/FSD -I/Users/thomas/Devel/oce/src/MMgt -I/Users/thomas/Devel/oce/drv/MMgt -I/Users/thomas/Devel/oce/src/OSD -I/Users/thomas/Devel/oce/drv/OSD -I/Users/thomas/Devel/oce/src/Plugin -I/Users/thomas/Devel/oce/drv/Plugin -I/Users/thomas/Devel/oce/src/Quantity -I/Users/thomas/Devel/oce/drv/Quantity -I/Users/thomas/Devel/oce/src/Resource -I/Users/thomas/Devel/oce/drv/Resource -I/Users/thomas/Devel/oce/src/SortTools -I/Users/thomas/Devel/oce/drv/SortTools -I/Users/thomas/Devel/oce/src/Standard -I/Users/thomas/Devel/oce/drv/Standard -I/Users/thomas/Devel/oce/src/StdFail -I/Users/thomas/Devel/oce/drv/StdFail -I/Users/thomas/Devel/oce/src/Storage -I/Users/thomas/Devel/oce/drv/Storage -I/Users/thomas/Devel/oce/src/TColStd -I/Users/thomas/Devel/oce/drv/TColStd -I/Users/thomas/Devel/oce/src/TCollection -I/Users/thomas/Devel/oce/drv/TCollection -I/Users/thomas/Devel/oce/src/TShort -I/Users/thomas/Devel/oce/drv/TShort -I/Users/thomas/Devel/oce/src/Units -I/Users/thomas/Devel/oce/drv/Units -I/Users/thomas/Devel/oce/src/UnitsAPI -I/Users/thomas/Devel/oce/drv/UnitsAPI -I/Users/thomas/Devel/oce/src/IncludeLibrary -I/Users/thomas/Devel/oce/drv/IncludeLibrary -I/Users/thomas/Devel/oce/src/Dico -I/Users/thomas/Devel/oce/drv/Dico -I/Users/thomas/Devel/oce/src/NCollection -I/Users/thomas/Devel/oce/drv/NCollection -I/Users/thomas/Devel/oce/src/Message -I/Users/thomas/Devel/oce/drv/Message   -o CMakeFiles/TKernel.dir/__/__/__/src/FSD/FSD_BinaryFile.cxx.o -c /Users/thomas/Devel/oce/src/FSD/FSD_BinaryFile.cxx

Just removing the -DLIN fixes the error.

A possible fix, among others is (CMakeList.txt):

IF(UNIX)
  IF(APPLE)
    ######### MacOSX ###########
    MESSAGE(STATUS "MacOSX platform detected")
    SET(PLATFORM Darwin)
  ELSE(APPLE)
    ######### Unix/Linux ###########
    MESSAGE(STATUS "Unix/Linux platform detected")
    SET(PLATFORM Unix)
  ENDIF(APPLE)
  - ADD_DEFINITIONS(-DHAVE_CONFIG_H -DCSFDB -DLIN -DOCC_CONVERT_SIGNALS)
  + ADD_DEFINITIONS(-DHAVE_CONFIG_H -DCSFDB -DOCC_CONVERT_SIGNALS)
ELSE(UNIX)
@dbarbier
Copy link
Collaborator

+1 for dropping -DLIN, Linux does not need it.

@tpaviot
Copy link
Owner Author

tpaviot commented May 28, 2011

Fixed by commit 4811d37

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants