Message: cmake on Mac OS X and DYLD_LIBRARY_PATH (bug?) Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Warning cmake on Mac OS X and DYLD_LIBRARY_PATH (bug?) 

Forum: Installation and Configuration
Date: 14 Jul, 2011
From: Mojca Miklavec <Mojca Miklavec>

Hello,

I'm trying to use cmake to compile example N02. I have created CMakeLists.txt:

cmake_minimum_required(VERSION 2.6.4 FATAL_ERROR)
project(exampleN02)
find_package(Geant4 REQUIRED COMPONENTS qt)
include(${Geant4_USE_FILE})
GEANT4_COLLATE_APPLICATION_SOURCES(EXAMPLEN02_SOURCES)
add_executable(exampleN02 ${EXAMPLEN02_SOURCES})
target_link_libraries(exampleN02 ${Geant4_LIBRARIES})

which I can configure in two different ways:
    cmake -DGeant4_DIR=/geant4/geant4.9.5.b01-build/ /path/to/novice/N02
    cmake -DGeant4_DIR=/geant4/geant4.9.5.b01-inst/lib/Geant4-9.5.0 /path/to/novice/N02

The first approach works perfect. I can run exampleN02 from anywhere, without any additional setting. The library dependencies have complete static paths included (except for Qt):

> otool -L exampleN02
exampleN02:
    /geant4/geant4.9.5.b01-build/outputs/library/Darwin-g++/libG4Tree.dylib (compatibility version 0.0.0, current version 0.0.0)
    ... (many lines) ...
    /geant4/geant4.9.5.b01-build/outputs/library/Darwin-g++/libG4zlib.dylib (compatibility version 0.0.0, current version 0.0.0)
    /System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0)
    /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
    QtOpenGL.framework/Versions/4/QtOpenGL (compatibility version 4.7.0, current version 4.7.3)
    QtGui.framework/Versions/4/QtGui (compatibility version 4.7.0, current version 4.7.3)
    QtCore.framework/Versions/4/QtCore (compatibility version 4.7.0, current version 4.7.3)
    /usr/lib/libexpat.1.dylib (compatibility version 7.0.0, current version 7.2.0)
    /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 52.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.0.0)

However the second approach results in:

> otool -L exampleN02
exampleN02:
    libG4Tree.dylib (compatibility version 0.0.0, current version 0.0.0)
    ...
    libG4zlib.dylib (compatibility version 0.0.0, current version 0.0.0)
    /System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current 
    ... (and everything else the same)

This means that I cannot run the resulting binary without explicitly setting DYLD_LIBRARY_PATH which is bad. There is a workaround, so I can live with that, but this should probably be fixed.

(However I still don't know how to use the Qt user interface with cmake.)

Mojca

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 News: Re: cmake on Mac OS X and DYLD_LIBRARY_PATH (bug?)   (Ben Morgan - 15 Jul, 2011)
(_ Ok: Re: cmake on Mac OS X and DYLD_LIBRARY_PATH (bug?)   (Mojca Miklavec - 18 Jul, 2011)
 Add Message Add Message
to: "cmake on Mac OS X and DYLD_LIBRARY_PATH (bug?)"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]