[Insight-users] Re: WrapITK on Solaris

Michael Bell michael.bell at acm.org
Fri Aug 4 15:34:33 EDT 2006


Gaetan,

Yes, I set them by hand in cmake. With ITK's wrappers, this works
fine. With WrapITK, the values are not used for some reason.

I'm looking more deeply now. In
WrapITK/Build_SunOS/Java/CWD/CMakeFiles/SwigRuntimeJava.dir, there is
a file called build.make which has the command to make
libSwigRuntimeJava.so:
SwigRuntimeJava_EXTERNAL_OBJECTS =

lib/libSwigRuntimeJava.so:
Java/CWD/CMakeFiles/SwigRuntimeJava.dir/__/__/SwigRuntime/JavaCWDJava.o
lib/libSwigRuntimeJava.so: Java/CWD/CMakeFiles/SwigRuntimeJava.dir/JavaCWD.o
lib/libSwigRuntimeJava.so: Java/CWD/CMakeFiles/SwigRuntimeJava.dir/build.make
    @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --red
--bold "Linking CXX shared module ../../lib/libSwigRuntimeJava.so"
    cd /net/numbers/data/WrapITK/Build_SunOS/Java/CWD &&
$(CMAKE_COMMAND) -P
CMakeFiles/SwigRuntimeJava.dir/cmake_clean_target.cmake
    cd /net/numbers/data/WrapITK/Build_SunOS/Java/CWD &&
$(CMAKE_COMMAND) -E cmake_link_script
CMakeFiles/SwigRuntimeJava.dir/link.txt --verbose=$(VERBOSE)
**this last line is the most important

link.txt contains:
gcc  -fPIC -lstdc++  -shared  -Wl,-hlibSwigRuntimeJava.so -o
../../lib/libSwigRuntimeJava.so
"CMakeFiles/SwigRuntimeJava.dir/__/__/SwigRuntime/JavaCWDJava.o"
"CMakeFiles/SwigRuntimeJava.dir/JavaCWD.o"
-L/net/numbers/data/InsightToolkit-2.8.1/Build_SunOS/bin

And stdc++ is there! If I run this gcc line by hand, the library is
created, with stdc++ linked in correctly. However, if I just use make,
stdc++ does not get linked in. What is happening here?

michael

On 8/4/06, Gaëtan Lehmann <gaetan.lehmann at jouy.inra.fr> wrote:
>
> Hi,
>
> If I remember correctly, you had to set them by hand also with ITK
> wrappers don't you ?
> You should be able to set those values by toggling ccmake to advanced
> mode, or by using the following cmake command in your build tree:
>
>    cmake
> -DCMAKE_EXE_LINKER_FLAGS:STRING=-lstdc++ -DCMAKE_MODULE_LINKER_FLAG:STRING=-lstdc++ .
>
> Let me know if it work that way
>
> Gaetan
>
>
> Le Fri, 04 Aug 2006 19:54:36 +0200, Michael Bell <michael.bell at acm.org> a
> écrit:
>
> > Gaetan,
> >
> >
> > I'm trying to compile WrapITK on solaris. I need to have the following
> > set in cmake in order for everything to work right:
> > CMAKE_EXE_LINKER_FLAGS           -lstdc++
> > CMAKE_MODULE_LINKER_FLAGS        -lstdc++
> >
> > In ITK's wrapping, these flags are used correctly:
> > ./SwigRuntime/CMakeFiles/SwigRuntimeJava.dir/build.make:
> > gcc  -fPIC -lstdc++  -shared  -Wl,-hlibSwigRuntimeJava.so -o
> > ../../../bin/libSwigRuntimeJava.so $(SwigRuntimeJava_OBJECTS)
> > $(SwigRuntimeJava_EXTERNAL_OBJECTS) -L.
> >
> >
> > In WrapITK, I can't find the above file, or anyplace where stdc++ is
> > linked. As a result, I get a linker error in java:
> > java.lang.UnsatisfiedLinkError: libSwigRuntimeJava.so: ld.so.1: java:
> > fatal: relocation error:  symbol __gxx_personality_v0: referenced
> > symbol not found
> >
> > How can I get stdc++ linked in correctly?
> >
> > thanks,
> > michael
> >
> >
>
>
>
> --
> Gaëtan Lehmann
> Biologie du Développement et de la Reproduction
> INRA de Jouy-en-Josas (France)
> tel: +33 1 34 65 29 66    fax: 01 34 65 29 09
> http://voxel.jouy.inra.fr
>


-- 
michael.bell at acm.org


More information about the Insight-users mailing list