Shared library module problems

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Shared library module problems

Johnson, Hans J
Slicer shared library modules experts:

l-lnx011:Slicer3johnsonhj$ for i in *.so; do echo $i;  nm $i |grep Module; done

libCurvatureADLib.so
0000000000269a20 D XMLModuleDescription
0000000000028b70 T _Z16ModuleEntryPointiPPc
0000000000028220 T _Z23GetXMLModuleDescriptionv

libDOGLib.so
0000000000268960 D XMLModuleDescription
0000000000028a90 T _Z16ModuleEntryPointiPPc
0000000000028310 T _Z23GetXMLModuleDescriptionv

libGaussianLPFLib.so
000000000024e8c0 D XMLModuleDescription
000000000001cf60 T _Z16ModuleEntryPointiPPc
000000000001c7e0 T _Z23GetXMLModuleDescriptionv

libGradientADLib.so
0000000000269a00 D XMLModuleDescription
00000000000289e0 T _Z16ModuleEntryPointiPPc
0000000000028090 T _Z23GetXMLModuleDescriptionv

libSimpleThresholdLib.so
0000000000020da0 T GetXMLModuleDescription
0000000000021520 T ModuleEntryPoint
00000000002578e0 D XMLModuleDescription


I thought that these were all built in the same way on the same computer, but apparently there is something not quite consistent going on.

The only module that actually loads into Slicer3 is the last one libSimpleThresholdLib.so.



=======================
I can't figure out what the difference is between these libraries.  Any advice on how to debug this would be greatly appreciated.

Thanks,
Hans

-- 
Hans J. Johnson, Ph.D.
Assistant Professor of Psychiatry
University of Iowa Carver College of Medicine
W278 GH, 200 Hawkins Drive
Iowa City, Iowa 52242
Phone:  319-353-8587





Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged.  If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited.  Please reply to the sender that you have received the message in error, then delete it.  Thank you.

_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
Reply | Threaded
Open this post in threaded view
|

Re: Shared library module problems

Sharp, Gregory C.

Looks to me like libSimpleThresholdLib has C linkage and the others have
CXX linkage.  -Greg


-----Original Message-----
From: [hidden email] on behalf of Johnson, Hans J
Sent: Mon 2/21/2011 2:03 PM
To: Slicer Development
Subject: [slicer-devel] Shared library module problems
 
Slicer shared library modules experts:

l-lnx011:Slicer3johnsonhj$ for i in *.so; do echo $i;  nm $i |grep Module; done

libCurvatureADLib.so
0000000000269a20 D XMLModuleDescription
0000000000028b70 T _Z16ModuleEntryPointiPPc
0000000000028220 T _Z23GetXMLModuleDescriptionv

libDOGLib.so
0000000000268960 D XMLModuleDescription
0000000000028a90 T _Z16ModuleEntryPointiPPc
0000000000028310 T _Z23GetXMLModuleDescriptionv

libGaussianLPFLib.so
000000000024e8c0 D XMLModuleDescription
000000000001cf60 T _Z16ModuleEntryPointiPPc
000000000001c7e0 T _Z23GetXMLModuleDescriptionv

libGradientADLib.so
0000000000269a00 D XMLModuleDescription
00000000000289e0 T _Z16ModuleEntryPointiPPc
0000000000028090 T _Z23GetXMLModuleDescriptionv

libSimpleThresholdLib.so
0000000000020da0 T GetXMLModuleDescription
0000000000021520 T ModuleEntryPoint
00000000002578e0 D XMLModuleDescription


I thought that these were all built in the same way on the same computer, but
apparently there is something not quite consistent going on.

The only module that actually loads into Slicer3 is the last one
libSimpleThresholdLib.so.



=======================
I can't figure out what the difference is between these libraries.  Any advice
on how to debug this would be greatly appreciated.

Thanks,
Hans

--
Hans J. Johnson, Ph.D.
[hidden email]
Assistant Professor of Psychiatry
University of Iowa Carver College of Medicine
W278 GH, 200 Hawkins Drive
Iowa City, Iowa 52242
Phone:  319-353-8587




________________________________
Notice: This UI Health Care e-mail (including attachments) is covered by the
Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and
may be legally privileged.  If you are not the intended recipient, you are
hereby notified that any retention, dissemination, distribution, or copying of
this communication is strictly prohibited.  Please reply to the sender that you
have received the message in error, then delete it.  Thank you.
________________________________

_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
Reply | Threaded
Open this post in threaded view
|

Re: Shared library module problems

Johnson, Hans J
These are all ITK based programs compiled with the g++ compiler.  Is there
some way to specify the linkage type desired?

Thanks,
Hans

--
Hans J. Johnson, Ph.D.
[hidden email]
Assistant Professor of Psychiatry
University of Iowa Carver College of Medicine
W278 GH, 200 Hawkins Drive

Iowa City, Iowa 52242
Phone:  319-353-8587








-----Original Message-----
From: "Sharp, Gregory C." <[hidden email]>
Date: Mon, 21 Feb 2011 15:42:48 -0500
To: Hans Johnson <[hidden email]>, Slicer Development
<[hidden email]>
Subject: RE: [slicer-devel] Shared library module problems


Looks to me like libSimpleThresholdLib has C linkage and the others have
CXX linkage.  -Greg


-----Original Message-----
From: [hidden email] on behalf of Johnson, Hans J
Sent: Mon 2/21/2011 2:03 PM
To: Slicer Development
Subject: [slicer-devel] Shared library module problems

Slicer shared library modules experts:

l-lnx011:Slicer3johnsonhj$ for i in *.so; do echo $i;  nm $i |grep Module;
done

libCurvatureADLib.so
0000000000269a20 D XMLModuleDescription
0000000000028b70 T _Z16ModuleEntryPointiPPc
0000000000028220 T _Z23GetXMLModuleDescriptionv

libDOGLib.so
0000000000268960 D XMLModuleDescription
0000000000028a90 T _Z16ModuleEntryPointiPPc
0000000000028310 T _Z23GetXMLModuleDescriptionv

libGaussianLPFLib.so
000000000024e8c0 D XMLModuleDescription
000000000001cf60 T _Z16ModuleEntryPointiPPc
000000000001c7e0 T _Z23GetXMLModuleDescriptionv

libGradientADLib.so
0000000000269a00 D XMLModuleDescription
00000000000289e0 T _Z16ModuleEntryPointiPPc
0000000000028090 T _Z23GetXMLModuleDescriptionv

libSimpleThresholdLib.so
0000000000020da0 T GetXMLModuleDescription
0000000000021520 T ModuleEntryPoint
00000000002578e0 D XMLModuleDescription


I thought that these were all built in the same way on the same computer,
but
apparently there is something not quite consistent going on.

The only module that actually loads into Slicer3 is the last one
libSimpleThresholdLib.so.



=======================
I can't figure out what the difference is between these libraries.  Any
advice
on how to debug this would be greatly appreciated.

Thanks,
Hans

--
Hans J. Johnson, Ph.D.
[hidden email]
Assistant Professor of Psychiatry
University of Iowa Carver College of Medicine
W278 GH, 200 Hawkins Drive
Iowa City, Iowa 52242
Phone:  319-353-8587




________________________________
Notice: This UI Health Care e-mail (including attachments) is covered by
the
Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is
confidential and
may be legally privileged.  If you are not the intended recipient, you are
hereby notified that any retention, dissemination, distribution, or
copying of
this communication is strictly prohibited.  Please reply to the sender
that you
have received the message in error, then delete it.  Thank you.
________________________________



The information in this e-mail is intended only for the person to whom it
is
addressed. If you believe this e-mail was sent to you in error and the
e-mail
contains patient information, please contact the Partners Compliance
HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in
error
but does not contain patient information, please contact the sender and
properly
dispose of the e-mail.




________________________________
Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged.  If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited.  Please reply to the sender that you have received the message in error, then delete it.  Thank you.
________________________________
_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
Reply | Threaded
Open this post in threaded view
|

Re: Shared library module problems

Sharp, Gregory C.

Yeah, I'm not sure.  But here is what I do to force CXX linkage:

SET_TARGET_PROPERTIES (${TARGET_NAME} PROPERTIES LINKER_LANGUAGE CXX)


-----Original Message-----
From: Johnson, Hans J [mailto:[hidden email]]
Sent: Mon 2/21/2011 3:46 PM
To: Sharp, Gregory C.; Slicer Development
Subject: Re: [slicer-devel] Shared library module problems
 
These are all ITK based programs compiled with the g++ compiler.  Is there
some way to specify the linkage type desired?

Thanks,
Hans

--
Hans J. Johnson, Ph.D.
[hidden email]
Assistant Professor of Psychiatry
University of Iowa Carver College of Medicine
W278 GH, 200 Hawkins Drive

Iowa City, Iowa 52242
Phone:  319-353-8587








-----Original Message-----
From: "Sharp, Gregory C." <[hidden email]>
Date: Mon, 21 Feb 2011 15:42:48 -0500
To: Hans Johnson <[hidden email]>, Slicer Development
<[hidden email]>
Subject: RE: [slicer-devel] Shared library module problems


Looks to me like libSimpleThresholdLib has C linkage and the others have
CXX linkage.  -Greg


-----Original Message-----
From: [hidden email] on behalf of Johnson, Hans J
Sent: Mon 2/21/2011 2:03 PM
To: Slicer Development
Subject: [slicer-devel] Shared library module problems

Slicer shared library modules experts:

l-lnx011:Slicer3johnsonhj$ for i in *.so; do echo $i;  nm $i |grep Module;
done

libCurvatureADLib.so
0000000000269a20 D XMLModuleDescription
0000000000028b70 T _Z16ModuleEntryPointiPPc
0000000000028220 T _Z23GetXMLModuleDescriptionv

libDOGLib.so
0000000000268960 D XMLModuleDescription
0000000000028a90 T _Z16ModuleEntryPointiPPc
0000000000028310 T _Z23GetXMLModuleDescriptionv

libGaussianLPFLib.so
000000000024e8c0 D XMLModuleDescription
000000000001cf60 T _Z16ModuleEntryPointiPPc
000000000001c7e0 T _Z23GetXMLModuleDescriptionv

libGradientADLib.so
0000000000269a00 D XMLModuleDescription
00000000000289e0 T _Z16ModuleEntryPointiPPc
0000000000028090 T _Z23GetXMLModuleDescriptionv

libSimpleThresholdLib.so
0000000000020da0 T GetXMLModuleDescription
0000000000021520 T ModuleEntryPoint
00000000002578e0 D XMLModuleDescription


I thought that these were all built in the same way on the same computer,
but
apparently there is something not quite consistent going on.

The only module that actually loads into Slicer3 is the last one
libSimpleThresholdLib.so.



=======================
I can't figure out what the difference is between these libraries.  Any
advice
on how to debug this would be greatly appreciated.

Thanks,
Hans

--
Hans J. Johnson, Ph.D.
[hidden email]
Assistant Professor of Psychiatry
University of Iowa Carver College of Medicine
W278 GH, 200 Hawkins Drive
Iowa City, Iowa 52242
Phone:  319-353-8587




________________________________
Notice: This UI Health Care e-mail (including attachments) is covered by
the
Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is
confidential and
may be legally privileged.  If you are not the intended recipient, you are
hereby notified that any retention, dissemination, distribution, or
copying of
this communication is strictly prohibited.  Please reply to the sender
that you
have received the message in error, then delete it.  Thank you.
________________________________



The information in this e-mail is intended only for the person to whom it
is
addressed. If you believe this e-mail was sent to you in error and the
e-mail
contains patient information, please contact the Partners Compliance
HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in
error
but does not contain patient information, please contact the sender and
properly
dispose of the e-mail.




________________________________
Notice: This UI Health Care e-mail (including attachments) is covered by the
Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and
may be legally privileged.  If you are not the intended recipient, you are
hereby notified that any retention, dissemination, distribution, or copying of
this communication is strictly prohibited.  Please reply to the sender that you
have received the message in error, then delete it.  Thank you.
________________________________

_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
Reply | Threaded
Open this post in threaded view
|

Re: Shared library module problems

pieper
Administrator
Hi Hans and all -

Did anyone figure out why some of the ModuleEntryPoint symbols have C++
decorations and some do not?

By my calculation there are 8 modules that have this issue - nothing
jumps out at me in the CMakeLists.txt as to why they are different, but
the ones that do not have the decoration seem to follow the exact
pattern of the Applications/CLI/CMakeLists.txt, while the ones that do
have the decoration are in some ways customized (e.g. the BRAINS code
and DiffusionApplications).

If anyone sees the answer, please speak up and claim the glory that is
rightfully yours...

-Steve



> % for i in lib/Slicer3/Plugins/*.so; do echo "****** $i";  nm $i |grep "[^ ]ModuleEntryPoint"; done


> ****** lib/Slicer3/Plugins/libAddLib.so
> ****** lib/Slicer3/Plugins/libAffineRegistrationLib.so
> ****** lib/Slicer3/Plugins/libBRAINSDemonWarpCommonLib.so
> ****** lib/Slicer3/Plugins/libBRAINSDemonWarpLib.so
> 000000000001afdc T _Z16ModuleEntryPointiPPc
> ****** lib/Slicer3/Plugins/libBRAINSFitLib.so
> 00000000001a17bc T _Z16ModuleEntryPointiPPc
> ****** lib/Slicer3/Plugins/libBRAINSResampleLib.so
> 00000000000edf3c T _Z16ModuleEntryPointiPPc
> ****** lib/Slicer3/Plugins/libBRAINSROIAutoLib.so
> ****** lib/Slicer3/Plugins/libBSplineDeformableRegistrationLib.so
> ****** lib/Slicer3/Plugins/libBSplineToDeformationFieldLib.so
> ****** lib/Slicer3/Plugins/libCastLib.so
> ****** lib/Slicer3/Plugins/libCheckerBoardLib.so
> ****** lib/Slicer3/Plugins/libConfidenceConnectedLib.so
> ****** lib/Slicer3/Plugins/libCurvatureAnisotropicDiffusionLib.so
> ****** lib/Slicer3/Plugins/libDicomToNrrdConverterLib.so
> ****** lib/Slicer3/Plugins/libDiffusionTensorTestLib.so
> ****** lib/Slicer3/Plugins/libDiffusionWeightedTestLib.so
> ****** lib/Slicer3/Plugins/libdwiNoiseFilterLib.so
> 000000000000ed3c T _Z16ModuleEntryPointiPPKc
> ****** lib/Slicer3/Plugins/libExtractSkeletonModule.so
> ****** lib/Slicer3/Plugins/libGaussianBlurImageFilterLib.so
> ****** lib/Slicer3/Plugins/libGradientAnisotropicDiffusionLib.so
> ****** lib/Slicer3/Plugins/libGrayscaleFillHoleImageFilterLib.so
> ****** lib/Slicer3/Plugins/libGrayscaleGrindPeakImageFilterLib.so
> ****** lib/Slicer3/Plugins/libHistogramMatchingLib.so
> ****** lib/Slicer3/Plugins/libImageReadDicomWriteLib.so
> ****** lib/Slicer3/Plugins/libjointLMMSELib.so
> 000000000016048e T _Z16ModuleEntryPointiPPKc
> ****** lib/Slicer3/Plugins/libLabelMapSmoothingLib.so
> ****** lib/Slicer3/Plugins/libLinearRegistrationLib.so
> ****** lib/Slicer3/Plugins/libMaskLib.so
> ****** lib/Slicer3/Plugins/libMedianImageFilterLib.so
> ****** lib/Slicer3/Plugins/libMergeModelsLib.so
> ****** lib/Slicer3/Plugins/libMRIBiasFieldCorrectionModule.so
> ****** lib/Slicer3/Plugins/libMultiplyLib.so
> ****** lib/Slicer3/Plugins/libN4ITKBiasFieldCorrectionLib.so
> ****** lib/Slicer3/Plugins/libOrientImageLib.so
> ****** lib/Slicer3/Plugins/libOtsuThresholdImageFilterLib.so
> ****** lib/Slicer3/Plugins/libOtsuThresholdSegmentationLib.so
> ****** lib/Slicer3/Plugins/libPolyDataToLabelmapLib.so
> ****** lib/Slicer3/Plugins/libRealignLib.so
> ****** lib/Slicer3/Plugins/libRegisterImagesModule.so
> ****** lib/Slicer3/Plugins/libRegisterImagesMultiResModule.so
> 000000000025d460 r _ZZ16ModuleEntryPointE19__PRETTY_FUNCTION__
> ****** lib/Slicer3/Plugins/libResampleDTILib.so
> ****** lib/Slicer3/Plugins/libResampleVolume2Lib.so
> ****** lib/Slicer3/Plugins/libResampleVolumeLib.so
> ****** lib/Slicer3/Plugins/libRigidRegistrationLib.so
> ****** lib/Slicer3/Plugins/libSFLSRobustStat3DTestLib.so
> 00000000000c8c8c T _Z16ModuleEntryPointiPPc
> ****** lib/Slicer3/Plugins/libSparseFieldLevelSetContourLib.so
> ****** lib/Slicer3/Plugins/libSubtractLib.so
> ****** lib/Slicer3/Plugins/libTestGridTransformRegistrationLib.so
> ****** lib/Slicer3/Plugins/libThresholdLib.so
> ****** lib/Slicer3/Plugins/libTransformFromFiducialsModule.so
> ****** lib/Slicer3/Plugins/libVBRAINSDemonWarpLib.so
> 00000000002abd1c T _Z16ModuleEntryPointiPPc
> ****** lib/Slicer3/Plugins/libVotingBinaryHoleFillingImageFilterLib.so


On 02/21/2011 03:49 PM, Sharp, Gregory C. wrote:

>
> Yeah, I'm not sure.  But here is what I do to force CXX linkage:
>
> SET_TARGET_PROPERTIES (${TARGET_NAME} PROPERTIES LINKER_LANGUAGE CXX)
>
>
> -----Original Message-----
> From: Johnson, Hans J [mailto:[hidden email]]
> Sent: Mon 2/21/2011 3:46 PM
> To: Sharp, Gregory C.; Slicer Development
> Subject: Re: [slicer-devel] Shared library module problems
>
> These are all ITK based programs compiled with the g++ compiler.  Is there
> some way to specify the linkage type desired?
>
> Thanks,
> Hans
>
> --
> Hans J. Johnson, Ph.D.
> [hidden email]
> Assistant Professor of Psychiatry
> University of Iowa Carver College of Medicine
> W278 GH, 200 Hawkins Drive
>
> Iowa City, Iowa 52242
> Phone:  319-353-8587
>
>
>
>
>
>
>
>
> -----Original Message-----
> From: "Sharp, Gregory C."<[hidden email]>
> Date: Mon, 21 Feb 2011 15:42:48 -0500
> To: Hans Johnson<[hidden email]>, Slicer Development
> <[hidden email]>
> Subject: RE: [slicer-devel] Shared library module problems
>
>
> Looks to me like libSimpleThresholdLib has C linkage and the others have
> CXX linkage.  -Greg
>
>
> -----Original Message-----
> From: [hidden email] on behalf of Johnson, Hans J
> Sent: Mon 2/21/2011 2:03 PM
> To: Slicer Development
> Subject: [slicer-devel] Shared library module problems
>
> Slicer shared library modules experts:
>
> l-lnx011:Slicer3johnsonhj$ for i in *.so; do echo $i;  nm $i |grep Module;
> done
>
> libCurvatureADLib.so
> 0000000000269a20 D XMLModuleDescription
> 0000000000028b70 T _Z16ModuleEntryPointiPPc
> 0000000000028220 T _Z23GetXMLModuleDescriptionv
>
> libDOGLib.so
> 0000000000268960 D XMLModuleDescription
> 0000000000028a90 T _Z16ModuleEntryPointiPPc
> 0000000000028310 T _Z23GetXMLModuleDescriptionv
>
> libGaussianLPFLib.so
> 000000000024e8c0 D XMLModuleDescription
> 000000000001cf60 T _Z16ModuleEntryPointiPPc
> 000000000001c7e0 T _Z23GetXMLModuleDescriptionv
>
> libGradientADLib.so
> 0000000000269a00 D XMLModuleDescription
> 00000000000289e0 T _Z16ModuleEntryPointiPPc
> 0000000000028090 T _Z23GetXMLModuleDescriptionv
>
> libSimpleThresholdLib.so
> 0000000000020da0 T GetXMLModuleDescription
> 0000000000021520 T ModuleEntryPoint
> 00000000002578e0 D XMLModuleDescription
>
>
> I thought that these were all built in the same way on the same computer,
> but
> apparently there is something not quite consistent going on.
>
> The only module that actually loads into Slicer3 is the last one
> libSimpleThresholdLib.so.
>
>
>
> =======================
> I can't figure out what the difference is between these libraries.  Any
> advice
> on how to debug this would be greatly appreciated.
>
> Thanks,
> Hans
>
> --
> Hans J. Johnson, Ph.D.
> [hidden email]
> Assistant Professor of Psychiatry
> University of Iowa Carver College of Medicine
> W278 GH, 200 Hawkins Drive
> Iowa City, Iowa 52242
> Phone:  319-353-8587
>
>
>
>
> ________________________________
> Notice: This UI Health Care e-mail (including attachments) is covered by
> the
> Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is
> confidential and
> may be legally privileged.  If you are not the intended recipient, you are
> hereby notified that any retention, dissemination, distribution, or
> copying of
> this communication is strictly prohibited.  Please reply to the sender
> that you
> have received the message in error, then delete it.  Thank you.
> ________________________________
>
>
>
> The information in this e-mail is intended only for the person to whom it
> is
> addressed. If you believe this e-mail was sent to you in error and the
> e-mail
> contains patient information, please contact the Partners Compliance
> HelpLine at
> http://www.partners.org/complianceline . If the e-mail was sent to you in
> error
> but does not contain patient information, please contact the sender and
> properly
> dispose of the e-mail.
>
>
>
>
> ________________________________
> Notice: This UI Health Care e-mail (including attachments) is covered by the
> Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and
> may be legally privileged.  If you are not the intended recipient, you are
> hereby notified that any retention, dissemination, distribution, or copying of
> this communication is strictly prohibited.  Please reply to the sender that you
> have received the message in error, then delete it.  Thank you.
> ________________________________
>
> _______________________________________________
> slicer-devel mailing list
> [hidden email]
> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
> To unsubscribe: send email to [hidden email] with unsubscribe as the subject
_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
Reply | Threaded
Open this post in threaded view
|

Re: Shared library module problems

Sharp, Gregory C.

Hi Steve,

The *CLP.h file defines ModuleEntryPoint with C linkage.

If you don't include that file, you get CXX linkage for that symbol.

-Greg


On Thu, 03 Mar 2011 09:16:47 -0500
Steve Pieper <[hidden email]> wrote:

> Hi Hans and all -
>
> Did anyone figure out why some of the ModuleEntryPoint symbols have C++
> decorations and some do not?
>
> By my calculation there are 8 modules that have this issue - nothing
> jumps out at me in the CMakeLists.txt as to why they are different, but
> the ones that do not have the decoration seem to follow the exact
> pattern of the Applications/CLI/CMakeLists.txt, while the ones that do
> have the decoration are in some ways customized (e.g. the BRAINS code
> and DiffusionApplications).
>
> If anyone sees the answer, please speak up and claim the glory that is
> rightfully yours...
>
> -Steve
>
>
>
> > % for i in lib/Slicer3/Plugins/*.so; do echo "****** $i";  nm $i |grep
> > "[^ ]ModuleEntryPoint"; done
>
>
> > ****** lib/Slicer3/Plugins/libAddLib.so
> > ****** lib/Slicer3/Plugins/libAffineRegistrationLib.so
> > ****** lib/Slicer3/Plugins/libBRAINSDemonWarpCommonLib.so
> > ****** lib/Slicer3/Plugins/libBRAINSDemonWarpLib.so
> > 000000000001afdc T _Z16ModuleEntryPointiPPc
> > ****** lib/Slicer3/Plugins/libBRAINSFitLib.so
> > 00000000001a17bc T _Z16ModuleEntryPointiPPc
> > ****** lib/Slicer3/Plugins/libBRAINSResampleLib.so
> > 00000000000edf3c T _Z16ModuleEntryPointiPPc
> > ****** lib/Slicer3/Plugins/libBRAINSROIAutoLib.so
> > ****** lib/Slicer3/Plugins/libBSplineDeformableRegistrationLib.so
> > ****** lib/Slicer3/Plugins/libBSplineToDeformationFieldLib.so
> > ****** lib/Slicer3/Plugins/libCastLib.so
> > ****** lib/Slicer3/Plugins/libCheckerBoardLib.so
> > ****** lib/Slicer3/Plugins/libConfidenceConnectedLib.so
> > ****** lib/Slicer3/Plugins/libCurvatureAnisotropicDiffusionLib.so
> > ****** lib/Slicer3/Plugins/libDicomToNrrdConverterLib.so
> > ****** lib/Slicer3/Plugins/libDiffusionTensorTestLib.so
> > ****** lib/Slicer3/Plugins/libDiffusionWeightedTestLib.so
> > ****** lib/Slicer3/Plugins/libdwiNoiseFilterLib.so
> > 000000000000ed3c T _Z16ModuleEntryPointiPPKc
> > ****** lib/Slicer3/Plugins/libExtractSkeletonModule.so
> > ****** lib/Slicer3/Plugins/libGaussianBlurImageFilterLib.so
> > ****** lib/Slicer3/Plugins/libGradientAnisotropicDiffusionLib.so
> > ****** lib/Slicer3/Plugins/libGrayscaleFillHoleImageFilterLib.so
> > ****** lib/Slicer3/Plugins/libGrayscaleGrindPeakImageFilterLib.so
> > ****** lib/Slicer3/Plugins/libHistogramMatchingLib.so
> > ****** lib/Slicer3/Plugins/libImageReadDicomWriteLib.so
> > ****** lib/Slicer3/Plugins/libjointLMMSELib.so
> > 000000000016048e T _Z16ModuleEntryPointiPPKc
> > ****** lib/Slicer3/Plugins/libLabelMapSmoothingLib.so
> > ****** lib/Slicer3/Plugins/libLinearRegistrationLib.so
> > ****** lib/Slicer3/Plugins/libMaskLib.so
> > ****** lib/Slicer3/Plugins/libMedianImageFilterLib.so
> > ****** lib/Slicer3/Plugins/libMergeModelsLib.so
> > ****** lib/Slicer3/Plugins/libMRIBiasFieldCorrectionModule.so
> > ****** lib/Slicer3/Plugins/libMultiplyLib.so
> > ****** lib/Slicer3/Plugins/libN4ITKBiasFieldCorrectionLib.so
> > ****** lib/Slicer3/Plugins/libOrientImageLib.so
> > ****** lib/Slicer3/Plugins/libOtsuThresholdImageFilterLib.so
> > ****** lib/Slicer3/Plugins/libOtsuThresholdSegmentationLib.so
> > ****** lib/Slicer3/Plugins/libPolyDataToLabelmapLib.so
> > ****** lib/Slicer3/Plugins/libRealignLib.so
> > ****** lib/Slicer3/Plugins/libRegisterImagesModule.so
> > ****** lib/Slicer3/Plugins/libRegisterImagesMultiResModule.so
> > 000000000025d460 r _ZZ16ModuleEntryPointE19__PRETTY_FUNCTION__
> > ****** lib/Slicer3/Plugins/libResampleDTILib.so
> > ****** lib/Slicer3/Plugins/libResampleVolume2Lib.so
> > ****** lib/Slicer3/Plugins/libResampleVolumeLib.so
> > ****** lib/Slicer3/Plugins/libRigidRegistrationLib.so
> > ****** lib/Slicer3/Plugins/libSFLSRobustStat3DTestLib.so
> > 00000000000c8c8c T _Z16ModuleEntryPointiPPc
> > ****** lib/Slicer3/Plugins/libSparseFieldLevelSetContourLib.so
> > ****** lib/Slicer3/Plugins/libSubtractLib.so
> > ****** lib/Slicer3/Plugins/libTestGridTransformRegistrationLib.so
> > ****** lib/Slicer3/Plugins/libThresholdLib.so
> > ****** lib/Slicer3/Plugins/libTransformFromFiducialsModule.so
> > ****** lib/Slicer3/Plugins/libVBRAINSDemonWarpLib.so
> > 00000000002abd1c T _Z16ModuleEntryPointiPPc
> > ****** lib/Slicer3/Plugins/libVotingBinaryHoleFillingImageFilterLib.so
>
>
> On 02/21/2011 03:49 PM, Sharp, Gregory C. wrote:
> >
> > Yeah, I'm not sure.  But here is what I do to force CXX linkage:
> >
> > SET_TARGET_PROPERTIES (${TARGET_NAME} PROPERTIES LINKER_LANGUAGE CXX)
> >
> >
> > -----Original Message-----
> > From: Johnson, Hans J [mailto:[hidden email]]
> > Sent: Mon 2/21/2011 3:46 PM
> > To: Sharp, Gregory C.; Slicer Development
> > Subject: Re: [slicer-devel] Shared library module problems
> >
> > These are all ITK based programs compiled with the g++ compiler.  Is there
> > some way to specify the linkage type desired?
> >
> > Thanks,
> > Hans
> >
> > --
> > Hans J. Johnson, Ph.D.
> > [hidden email]
> > Assistant Professor of Psychiatry
> > University of Iowa Carver College of Medicine
> > W278 GH, 200 Hawkins Drive
> >
> > Iowa City, Iowa 52242
> > Phone:  319-353-8587
> >
> >
> >
> >
> >
> >
> >
> >
> > -----Original Message-----
> > From: "Sharp, Gregory C."<[hidden email]>
> > Date: Mon, 21 Feb 2011 15:42:48 -0500
> > To: Hans Johnson<[hidden email]>, Slicer Development
> > <[hidden email]>
> > Subject: RE: [slicer-devel] Shared library module problems
> >
> >
> > Looks to me like libSimpleThresholdLib has C linkage and the others have
> > CXX linkage.  -Greg
> >
> >
> > -----Original Message-----
> > From: [hidden email] on behalf of Johnson, Hans J
> > Sent: Mon 2/21/2011 2:03 PM
> > To: Slicer Development
> > Subject: [slicer-devel] Shared library module problems
> >
> > Slicer shared library modules experts:
> >
> > l-lnx011:Slicer3johnsonhj$ for i in *.so; do echo $i;  nm $i |grep Module;
> > done
> >
> > libCurvatureADLib.so
> > 0000000000269a20 D XMLModuleDescription
> > 0000000000028b70 T _Z16ModuleEntryPointiPPc
> > 0000000000028220 T _Z23GetXMLModuleDescriptionv
> >
> > libDOGLib.so
> > 0000000000268960 D XMLModuleDescription
> > 0000000000028a90 T _Z16ModuleEntryPointiPPc
> > 0000000000028310 T _Z23GetXMLModuleDescriptionv
> >
> > libGaussianLPFLib.so
> > 000000000024e8c0 D XMLModuleDescription
> > 000000000001cf60 T _Z16ModuleEntryPointiPPc
> > 000000000001c7e0 T _Z23GetXMLModuleDescriptionv
> >
> > libGradientADLib.so
> > 0000000000269a00 D XMLModuleDescription
> > 00000000000289e0 T _Z16ModuleEntryPointiPPc
> > 0000000000028090 T _Z23GetXMLModuleDescriptionv
> >
> > libSimpleThresholdLib.so
> > 0000000000020da0 T GetXMLModuleDescription
> > 0000000000021520 T ModuleEntryPoint
> > 00000000002578e0 D XMLModuleDescription
> >
> >
> > I thought that these were all built in the same way on the same computer,
> > but
> > apparently there is something not quite consistent going on.
> >
> > The only module that actually loads into Slicer3 is the last one
> > libSimpleThresholdLib.so.
> >
> >
> >
> > =======================
> > I can't figure out what the difference is between these libraries.  Any
> > advice
> > on how to debug this would be greatly appreciated.
> >
> > Thanks,
> > Hans
> >
> > --
> > Hans J. Johnson, Ph.D.
> > [hidden email]
> > Assistant Professor of Psychiatry
> > University of Iowa Carver College of Medicine
> > W278 GH, 200 Hawkins Drive
> > Iowa City, Iowa 52242
> > Phone:  319-353-8587
> >
> >
> >
> >
> > ________________________________
> > Notice: This UI Health Care e-mail (including attachments) is covered by
> > the
> > Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is
> > confidential and
> > may be legally privileged.  If you are not the intended recipient, you are
> > hereby notified that any retention, dissemination, distribution, or
> > copying of
> > this communication is strictly prohibited.  Please reply to the sender
> > that you
> > have received the message in error, then delete it.  Thank you.
> > ________________________________
> >
> >
> >
> > The information in this e-mail is intended only for the person to whom it
> > is
> > addressed. If you believe this e-mail was sent to you in error and the
> > e-mail
> > contains patient information, please contact the Partners Compliance
> > HelpLine at
> > http://www.partners.org/complianceline . If the e-mail was sent to you in
> > error
> > but does not contain patient information, please contact the sender and
> > properly
> > dispose of the e-mail.
> >
> >
> >
> >
> > ________________________________
> > Notice: This UI Health Care e-mail (including attachments) is covered by
> > the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is
> > confidential and may be legally privileged.  If you are not the intended
> > recipient, you are hereby notified that any retention, dissemination,
> > distribution, or copying of this communication is strictly prohibited.
> > Please reply to the sender that you have received the message in error,
> > then delete it.  Thank you. ________________________________
> >
> > _______________________________________________
> > slicer-devel mailing list
> > [hidden email]
> > http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
> > To unsubscribe: send email to
> > [hidden email] with unsubscribe as the
> > subject


--
Greg Sharp, PhD
Department of Radiation Oncology
Massachusetts General Hospital
_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
Reply | Threaded
Open this post in threaded view
|

Re: Shared library module problems

Johnson, Hans J
In reply to this post by pieper
Yes, I did figure out the problem.  I also know how to get to a solution,
but I need time to get it implemented.  I'll try to work on it this week.

The problem is exactly like Greg Sharp pointed out.  There needs to be "C"
linkage rather than C++ linkage.  The problem is that the generateCLP
program does the magic "C" linkage stuff in the header ${PROJECT}CLP.h
file, and that file also has functions, so if you try to include the
header file in more than one compilation unit, the program won't link.

You need some stuff in the  ${PROJECT}CLP.h to do the magic for "C"
linkage, and other suff in the compilation unit that parses the command
line, AND it can not be included in both places.

The proper thing to do would be to re-write GenerateCLP to have a separate
compilation unit from the header and macro definitions, but that is beyond
the scope of what I can accomplish with given reasources.

I'll likely just have to add 10 minutes to each compilation unit and
compile everything in the main program rather than having modular reusable
builds components.  This is so that all the magic is allowed to live in
the same compilation unit.

Hans


-----Original Message-----
From: Steve Pieper <[hidden email]>
Date: Thu, 3 Mar 2011 09:16:47 -0500
To: "Sharp, Gregory C." <[hidden email]>
Cc: Hans Johnson <[hidden email]>, Slicer Development
<[hidden email]>
Subject: Re: [slicer-devel] Shared library module problems

Hi Hans and all -

Did anyone figure out why some of the ModuleEntryPoint symbols have C++
decorations and some do not?

By my calculation there are 8 modules that have this issue - nothing
jumps out at me in the CMakeLists.txt as to why they are different, but
the ones that do not have the decoration seem to follow the exact
pattern of the Applications/CLI/CMakeLists.txt, while the ones that do
have the decoration are in some ways customized (e.g. the BRAINS code
and DiffusionApplications).

If anyone sees the answer, please speak up and claim the glory that is
rightfully yours...

-Steve



> % for i in lib/Slicer3/Plugins/*.so; do echo "****** $i";  nm $i |grep
>"[^ ]ModuleEntryPoint"; done


> ****** lib/Slicer3/Plugins/libAddLib.so
> ****** lib/Slicer3/Plugins/libAffineRegistrationLib.so
> ****** lib/Slicer3/Plugins/libBRAINSDemonWarpCommonLib.so
> ****** lib/Slicer3/Plugins/libBRAINSDemonWarpLib.so
> 000000000001afdc T _Z16ModuleEntryPointiPPc
> ****** lib/Slicer3/Plugins/libBRAINSFitLib.so
> 00000000001a17bc T _Z16ModuleEntryPointiPPc
> ****** lib/Slicer3/Plugins/libBRAINSResampleLib.so
> 00000000000edf3c T _Z16ModuleEntryPointiPPc
> ****** lib/Slicer3/Plugins/libBRAINSROIAutoLib.so
> ****** lib/Slicer3/Plugins/libBSplineDeformableRegistrationLib.so
> ****** lib/Slicer3/Plugins/libBSplineToDeformationFieldLib.so
> ****** lib/Slicer3/Plugins/libCastLib.so
> ****** lib/Slicer3/Plugins/libCheckerBoardLib.so
> ****** lib/Slicer3/Plugins/libConfidenceConnectedLib.so
> ****** lib/Slicer3/Plugins/libCurvatureAnisotropicDiffusionLib.so
> ****** lib/Slicer3/Plugins/libDicomToNrrdConverterLib.so
> ****** lib/Slicer3/Plugins/libDiffusionTensorTestLib.so
> ****** lib/Slicer3/Plugins/libDiffusionWeightedTestLib.so
> ****** lib/Slicer3/Plugins/libdwiNoiseFilterLib.so
> 000000000000ed3c T _Z16ModuleEntryPointiPPKc
> ****** lib/Slicer3/Plugins/libExtractSkeletonModule.so
> ****** lib/Slicer3/Plugins/libGaussianBlurImageFilterLib.so
> ****** lib/Slicer3/Plugins/libGradientAnisotropicDiffusionLib.so
> ****** lib/Slicer3/Plugins/libGrayscaleFillHoleImageFilterLib.so
> ****** lib/Slicer3/Plugins/libGrayscaleGrindPeakImageFilterLib.so
> ****** lib/Slicer3/Plugins/libHistogramMatchingLib.so
> ****** lib/Slicer3/Plugins/libImageReadDicomWriteLib.so
> ****** lib/Slicer3/Plugins/libjointLMMSELib.so
> 000000000016048e T _Z16ModuleEntryPointiPPKc
> ****** lib/Slicer3/Plugins/libLabelMapSmoothingLib.so
> ****** lib/Slicer3/Plugins/libLinearRegistrationLib.so
> ****** lib/Slicer3/Plugins/libMaskLib.so
> ****** lib/Slicer3/Plugins/libMedianImageFilterLib.so
> ****** lib/Slicer3/Plugins/libMergeModelsLib.so
> ****** lib/Slicer3/Plugins/libMRIBiasFieldCorrectionModule.so
> ****** lib/Slicer3/Plugins/libMultiplyLib.so
> ****** lib/Slicer3/Plugins/libN4ITKBiasFieldCorrectionLib.so
> ****** lib/Slicer3/Plugins/libOrientImageLib.so
> ****** lib/Slicer3/Plugins/libOtsuThresholdImageFilterLib.so
> ****** lib/Slicer3/Plugins/libOtsuThresholdSegmentationLib.so
> ****** lib/Slicer3/Plugins/libPolyDataToLabelmapLib.so
> ****** lib/Slicer3/Plugins/libRealignLib.so
> ****** lib/Slicer3/Plugins/libRegisterImagesModule.so
> ****** lib/Slicer3/Plugins/libRegisterImagesMultiResModule.so
> 000000000025d460 r _ZZ16ModuleEntryPointE19__PRETTY_FUNCTION__
> ****** lib/Slicer3/Plugins/libResampleDTILib.so
> ****** lib/Slicer3/Plugins/libResampleVolume2Lib.so
> ****** lib/Slicer3/Plugins/libResampleVolumeLib.so
> ****** lib/Slicer3/Plugins/libRigidRegistrationLib.so
> ****** lib/Slicer3/Plugins/libSFLSRobustStat3DTestLib.so
> 00000000000c8c8c T _Z16ModuleEntryPointiPPc
> ****** lib/Slicer3/Plugins/libSparseFieldLevelSetContourLib.so
> ****** lib/Slicer3/Plugins/libSubtractLib.so
> ****** lib/Slicer3/Plugins/libTestGridTransformRegistrationLib.so
> ****** lib/Slicer3/Plugins/libThresholdLib.so
> ****** lib/Slicer3/Plugins/libTransformFromFiducialsModule.so
> ****** lib/Slicer3/Plugins/libVBRAINSDemonWarpLib.so
> 00000000002abd1c T _Z16ModuleEntryPointiPPc
> ****** lib/Slicer3/Plugins/libVotingBinaryHoleFillingImageFilterLib.so


On 02/21/2011 03:49 PM, Sharp, Gregory C. wrote:

>
> Yeah, I'm not sure.  But here is what I do to force CXX linkage:
>
> SET_TARGET_PROPERTIES (${TARGET_NAME} PROPERTIES LINKER_LANGUAGE CXX)
>
>
> -----Original Message-----
> From: Johnson, Hans J [mailto:[hidden email]]
> Sent: Mon 2/21/2011 3:46 PM
> To: Sharp, Gregory C.; Slicer Development
> Subject: Re: [slicer-devel] Shared library module problems
>
> These are all ITK based programs compiled with the g++ compiler.  Is
>there
> some way to specify the linkage type desired?
>
> Thanks,
> Hans
>
> --
> Hans J. Johnson, Ph.D.
> [hidden email]
> Assistant Professor of Psychiatry
> University of Iowa Carver College of Medicine
> W278 GH, 200 Hawkins Drive
>
> Iowa City, Iowa 52242
> Phone:  319-353-8587
>
>
>
>
>
>
>
>
> -----Original Message-----
> From: "Sharp, Gregory C."<[hidden email]>
> Date: Mon, 21 Feb 2011 15:42:48 -0500
> To: Hans Johnson<[hidden email]>, Slicer Development
> <[hidden email]>
> Subject: RE: [slicer-devel] Shared library module problems
>
>
> Looks to me like libSimpleThresholdLib has C linkage and the others have
> CXX linkage.  -Greg
>
>
> -----Original Message-----
> From: [hidden email] on behalf of Johnson, Hans J
> Sent: Mon 2/21/2011 2:03 PM
> To: Slicer Development
> Subject: [slicer-devel] Shared library module problems
>
> Slicer shared library modules experts:
>
> l-lnx011:Slicer3johnsonhj$ for i in *.so; do echo $i;  nm $i |grep
>Module;
> done
>
> libCurvatureADLib.so
> 0000000000269a20 D XMLModuleDescription
> 0000000000028b70 T _Z16ModuleEntryPointiPPc
> 0000000000028220 T _Z23GetXMLModuleDescriptionv
>
> libDOGLib.so
> 0000000000268960 D XMLModuleDescription
> 0000000000028a90 T _Z16ModuleEntryPointiPPc
> 0000000000028310 T _Z23GetXMLModuleDescriptionv
>
> libGaussianLPFLib.so
> 000000000024e8c0 D XMLModuleDescription
> 000000000001cf60 T _Z16ModuleEntryPointiPPc
> 000000000001c7e0 T _Z23GetXMLModuleDescriptionv
>
> libGradientADLib.so
> 0000000000269a00 D XMLModuleDescription
> 00000000000289e0 T _Z16ModuleEntryPointiPPc
> 0000000000028090 T _Z23GetXMLModuleDescriptionv
>
> libSimpleThresholdLib.so
> 0000000000020da0 T GetXMLModuleDescription
> 0000000000021520 T ModuleEntryPoint
> 00000000002578e0 D XMLModuleDescription
>
>
> I thought that these were all built in the same way on the same computer,
> but
> apparently there is something not quite consistent going on.
>
> The only module that actually loads into Slicer3 is the last one
> libSimpleThresholdLib.so.
>
>
>
> =======================
> I can't figure out what the difference is between these libraries.  Any
> advice
> on how to debug this would be greatly appreciated.
>
> Thanks,
> Hans
>
> --
> Hans J. Johnson, Ph.D.
> [hidden email]
> Assistant Professor of Psychiatry
> University of Iowa Carver College of Medicine
> W278 GH, 200 Hawkins Drive
> Iowa City, Iowa 52242
> Phone:  319-353-8587
>
>
>
>
> ________________________________
> Notice: This UI Health Care e-mail (including attachments) is covered by
> the
> Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is
> confidential and
> may be legally privileged.  If you are not the intended recipient, you
>are
> hereby notified that any retention, dissemination, distribution, or
> copying of
> this communication is strictly prohibited.  Please reply to the sender
> that you
> have received the message in error, then delete it.  Thank you.
> ________________________________
>
>
>
> The information in this e-mail is intended only for the person to whom it
> is
> addressed. If you believe this e-mail was sent to you in error and the
> e-mail
> contains patient information, please contact the Partners Compliance
> HelpLine at
> http://www.partners.org/complianceline . If the e-mail was sent to you in
> error
> but does not contain patient information, please contact the sender and
> properly
> dispose of the e-mail.
>
>
>
>
> ________________________________
> Notice: This UI Health Care e-mail (including attachments) is covered by
>the
> Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is
>confidential and
> may be legally privileged.  If you are not the intended recipient, you
>are
> hereby notified that any retention, dissemination, distribution, or
>copying of
> this communication is strictly prohibited.  Please reply to the sender
>that you
> have received the message in error, then delete it.  Thank you.
> ________________________________
>
> _______________________________________________
> slicer-devel mailing list
> [hidden email]
> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
> To unsubscribe: send email to
>[hidden email] with unsubscribe as the
>subject



________________________________
Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged.  If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited.  Please reply to the sender that you have received the message in error, then delete it.  Thank you.
________________________________
_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
Reply | Threaded
Open this post in threaded view
|

Re: Shared library module problems

pieper
Administrator
That is starting to make sense - I think Jim will be on the phone call
at 3:00 today and we can run this by him for comments...

Thanks Hans,
-Steve

On 03/03/2011 02:05 PM, Johnson, Hans J wrote:

> Yes, I did figure out the problem.  I also know how to get to a solution,
> but I need time to get it implemented.  I'll try to work on it this week.
>
> The problem is exactly like Greg Sharp pointed out.  There needs to be "C"
> linkage rather than C++ linkage.  The problem is that the generateCLP
> program does the magic "C" linkage stuff in the header ${PROJECT}CLP.h
> file, and that file also has functions, so if you try to include the
> header file in more than one compilation unit, the program won't link.
>
> You need some stuff in the  ${PROJECT}CLP.h to do the magic for "C"
> linkage, and other suff in the compilation unit that parses the command
> line, AND it can not be included in both places.
>
> The proper thing to do would be to re-write GenerateCLP to have a separate
> compilation unit from the header and macro definitions, but that is beyond
> the scope of what I can accomplish with given reasources.
>
> I'll likely just have to add 10 minutes to each compilation unit and
> compile everything in the main program rather than having modular reusable
> builds components.  This is so that all the magic is allowed to live in
> the same compilation unit.
>
> Hans
>
>
> -----Original Message-----
> From: Steve Pieper<[hidden email]>
> Date: Thu, 3 Mar 2011 09:16:47 -0500
> To: "Sharp, Gregory C."<[hidden email]>
> Cc: Hans Johnson<[hidden email]>, Slicer Development
> <[hidden email]>
> Subject: Re: [slicer-devel] Shared library module problems
>
> Hi Hans and all -
>
> Did anyone figure out why some of the ModuleEntryPoint symbols have C++
> decorations and some do not?
>
> By my calculation there are 8 modules that have this issue - nothing
> jumps out at me in the CMakeLists.txt as to why they are different, but
> the ones that do not have the decoration seem to follow the exact
> pattern of the Applications/CLI/CMakeLists.txt, while the ones that do
> have the decoration are in some ways customized (e.g. the BRAINS code
> and DiffusionApplications).
>
> If anyone sees the answer, please speak up and claim the glory that is
> rightfully yours...
>
> -Steve
>
>
>
>> % for i in lib/Slicer3/Plugins/*.so; do echo "****** $i";  nm $i |grep
>> "[^ ]ModuleEntryPoint"; done
>
>
>> ****** lib/Slicer3/Plugins/libAddLib.so
>> ****** lib/Slicer3/Plugins/libAffineRegistrationLib.so
>> ****** lib/Slicer3/Plugins/libBRAINSDemonWarpCommonLib.so
>> ****** lib/Slicer3/Plugins/libBRAINSDemonWarpLib.so
>> 000000000001afdc T _Z16ModuleEntryPointiPPc
>> ****** lib/Slicer3/Plugins/libBRAINSFitLib.so
>> 00000000001a17bc T _Z16ModuleEntryPointiPPc
>> ****** lib/Slicer3/Plugins/libBRAINSResampleLib.so
>> 00000000000edf3c T _Z16ModuleEntryPointiPPc
>> ****** lib/Slicer3/Plugins/libBRAINSROIAutoLib.so
>> ****** lib/Slicer3/Plugins/libBSplineDeformableRegistrationLib.so
>> ****** lib/Slicer3/Plugins/libBSplineToDeformationFieldLib.so
>> ****** lib/Slicer3/Plugins/libCastLib.so
>> ****** lib/Slicer3/Plugins/libCheckerBoardLib.so
>> ****** lib/Slicer3/Plugins/libConfidenceConnectedLib.so
>> ****** lib/Slicer3/Plugins/libCurvatureAnisotropicDiffusionLib.so
>> ****** lib/Slicer3/Plugins/libDicomToNrrdConverterLib.so
>> ****** lib/Slicer3/Plugins/libDiffusionTensorTestLib.so
>> ****** lib/Slicer3/Plugins/libDiffusionWeightedTestLib.so
>> ****** lib/Slicer3/Plugins/libdwiNoiseFilterLib.so
>> 000000000000ed3c T _Z16ModuleEntryPointiPPKc
>> ****** lib/Slicer3/Plugins/libExtractSkeletonModule.so
>> ****** lib/Slicer3/Plugins/libGaussianBlurImageFilterLib.so
>> ****** lib/Slicer3/Plugins/libGradientAnisotropicDiffusionLib.so
>> ****** lib/Slicer3/Plugins/libGrayscaleFillHoleImageFilterLib.so
>> ****** lib/Slicer3/Plugins/libGrayscaleGrindPeakImageFilterLib.so
>> ****** lib/Slicer3/Plugins/libHistogramMatchingLib.so
>> ****** lib/Slicer3/Plugins/libImageReadDicomWriteLib.so
>> ****** lib/Slicer3/Plugins/libjointLMMSELib.so
>> 000000000016048e T _Z16ModuleEntryPointiPPKc
>> ****** lib/Slicer3/Plugins/libLabelMapSmoothingLib.so
>> ****** lib/Slicer3/Plugins/libLinearRegistrationLib.so
>> ****** lib/Slicer3/Plugins/libMaskLib.so
>> ****** lib/Slicer3/Plugins/libMedianImageFilterLib.so
>> ****** lib/Slicer3/Plugins/libMergeModelsLib.so
>> ****** lib/Slicer3/Plugins/libMRIBiasFieldCorrectionModule.so
>> ****** lib/Slicer3/Plugins/libMultiplyLib.so
>> ****** lib/Slicer3/Plugins/libN4ITKBiasFieldCorrectionLib.so
>> ****** lib/Slicer3/Plugins/libOrientImageLib.so
>> ****** lib/Slicer3/Plugins/libOtsuThresholdImageFilterLib.so
>> ****** lib/Slicer3/Plugins/libOtsuThresholdSegmentationLib.so
>> ****** lib/Slicer3/Plugins/libPolyDataToLabelmapLib.so
>> ****** lib/Slicer3/Plugins/libRealignLib.so
>> ****** lib/Slicer3/Plugins/libRegisterImagesModule.so
>> ****** lib/Slicer3/Plugins/libRegisterImagesMultiResModule.so
>> 000000000025d460 r _ZZ16ModuleEntryPointE19__PRETTY_FUNCTION__
>> ****** lib/Slicer3/Plugins/libResampleDTILib.so
>> ****** lib/Slicer3/Plugins/libResampleVolume2Lib.so
>> ****** lib/Slicer3/Plugins/libResampleVolumeLib.so
>> ****** lib/Slicer3/Plugins/libRigidRegistrationLib.so
>> ****** lib/Slicer3/Plugins/libSFLSRobustStat3DTestLib.so
>> 00000000000c8c8c T _Z16ModuleEntryPointiPPc
>> ****** lib/Slicer3/Plugins/libSparseFieldLevelSetContourLib.so
>> ****** lib/Slicer3/Plugins/libSubtractLib.so
>> ****** lib/Slicer3/Plugins/libTestGridTransformRegistrationLib.so
>> ****** lib/Slicer3/Plugins/libThresholdLib.so
>> ****** lib/Slicer3/Plugins/libTransformFromFiducialsModule.so
>> ****** lib/Slicer3/Plugins/libVBRAINSDemonWarpLib.so
>> 00000000002abd1c T _Z16ModuleEntryPointiPPc
>> ****** lib/Slicer3/Plugins/libVotingBinaryHoleFillingImageFilterLib.so
>
>
> On 02/21/2011 03:49 PM, Sharp, Gregory C. wrote:
>>
>> Yeah, I'm not sure.  But here is what I do to force CXX linkage:
>>
>> SET_TARGET_PROPERTIES (${TARGET_NAME} PROPERTIES LINKER_LANGUAGE CXX)
>>
>>
>> -----Original Message-----
>> From: Johnson, Hans J [mailto:[hidden email]]
>> Sent: Mon 2/21/2011 3:46 PM
>> To: Sharp, Gregory C.; Slicer Development
>> Subject: Re: [slicer-devel] Shared library module problems
>>
>> These are all ITK based programs compiled with the g++ compiler.  Is
>> there
>> some way to specify the linkage type desired?
>>
>> Thanks,
>> Hans
>>
>> --
>> Hans J. Johnson, Ph.D.
>> [hidden email]
>> Assistant Professor of Psychiatry
>> University of Iowa Carver College of Medicine
>> W278 GH, 200 Hawkins Drive
>>
>> Iowa City, Iowa 52242
>> Phone:  319-353-8587
>>
>>
>>
>>
>>
>>
>>
>>
>> -----Original Message-----
>> From: "Sharp, Gregory C."<[hidden email]>
>> Date: Mon, 21 Feb 2011 15:42:48 -0500
>> To: Hans Johnson<[hidden email]>, Slicer Development
>> <[hidden email]>
>> Subject: RE: [slicer-devel] Shared library module problems
>>
>>
>> Looks to me like libSimpleThresholdLib has C linkage and the others have
>> CXX linkage.  -Greg
>>
>>
>> -----Original Message-----
>> From: [hidden email] on behalf of Johnson, Hans J
>> Sent: Mon 2/21/2011 2:03 PM
>> To: Slicer Development
>> Subject: [slicer-devel] Shared library module problems
>>
>> Slicer shared library modules experts:
>>
>> l-lnx011:Slicer3johnsonhj$ for i in *.so; do echo $i;  nm $i |grep
>> Module;
>> done
>>
>> libCurvatureADLib.so
>> 0000000000269a20 D XMLModuleDescription
>> 0000000000028b70 T _Z16ModuleEntryPointiPPc
>> 0000000000028220 T _Z23GetXMLModuleDescriptionv
>>
>> libDOGLib.so
>> 0000000000268960 D XMLModuleDescription
>> 0000000000028a90 T _Z16ModuleEntryPointiPPc
>> 0000000000028310 T _Z23GetXMLModuleDescriptionv
>>
>> libGaussianLPFLib.so
>> 000000000024e8c0 D XMLModuleDescription
>> 000000000001cf60 T _Z16ModuleEntryPointiPPc
>> 000000000001c7e0 T _Z23GetXMLModuleDescriptionv
>>
>> libGradientADLib.so
>> 0000000000269a00 D XMLModuleDescription
>> 00000000000289e0 T _Z16ModuleEntryPointiPPc
>> 0000000000028090 T _Z23GetXMLModuleDescriptionv
>>
>> libSimpleThresholdLib.so
>> 0000000000020da0 T GetXMLModuleDescription
>> 0000000000021520 T ModuleEntryPoint
>> 00000000002578e0 D XMLModuleDescription
>>
>>
>> I thought that these were all built in the same way on the same computer,
>> but
>> apparently there is something not quite consistent going on.
>>
>> The only module that actually loads into Slicer3 is the last one
>> libSimpleThresholdLib.so.
>>
>>
>>
>> =======================
>> I can't figure out what the difference is between these libraries.  Any
>> advice
>> on how to debug this would be greatly appreciated.
>>
>> Thanks,
>> Hans
>>
>> --
>> Hans J. Johnson, Ph.D.
>> [hidden email]
>> Assistant Professor of Psychiatry
>> University of Iowa Carver College of Medicine
>> W278 GH, 200 Hawkins Drive
>> Iowa City, Iowa 52242
>> Phone:  319-353-8587
>>
>>
>>
>>
>> ________________________________
>> Notice: This UI Health Care e-mail (including attachments) is covered by
>> the
>> Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is
>> confidential and
>> may be legally privileged.  If you are not the intended recipient, you
>> are
>> hereby notified that any retention, dissemination, distribution, or
>> copying of
>> this communication is strictly prohibited.  Please reply to the sender
>> that you
>> have received the message in error, then delete it.  Thank you.
>> ________________________________
>>
>>
>>
>> The information in this e-mail is intended only for the person to whom it
>> is
>> addressed. If you believe this e-mail was sent to you in error and the
>> e-mail
>> contains patient information, please contact the Partners Compliance
>> HelpLine at
>> http://www.partners.org/complianceline . If the e-mail was sent to you in
>> error
>> but does not contain patient information, please contact the sender and
>> properly
>> dispose of the e-mail.
>>
>>
>>
>>
>> ________________________________
>> Notice: This UI Health Care e-mail (including attachments) is covered by
>> the
>> Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is
>> confidential and
>> may be legally privileged.  If you are not the intended recipient, you
>> are
>> hereby notified that any retention, dissemination, distribution, or
>> copying of
>> this communication is strictly prohibited.  Please reply to the sender
>> that you
>> have received the message in error, then delete it.  Thank you.
>> ________________________________
>>
>> _______________________________________________
>> slicer-devel mailing list
>> [hidden email]
>> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
>> To unsubscribe: send email to
>> [hidden email] with unsubscribe as the
>> subject
>
>
>
> ________________________________
> Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged.  If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited.  Please reply to the sender that you have received the message in error, then delete it.  Thank you.
> ________________________________
_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
Reply | Threaded
Open this post in threaded view
|

Re: Shared library module problems

Johnson, Hans J
I'll be there too.

Hans


-----Original Message-----
From: Steve Pieper <[hidden email]>
Date: Thu, 3 Mar 2011 14:21:06 -0500
To: Hans Johnson <[hidden email]>
Cc: "Sharp, Gregory C." <[hidden email]>, Mark Scully
<[hidden email]>, Slicer Development <[hidden email]>
Subject: Re: [slicer-devel] Shared library module problems

That is starting to make sense - I think Jim will be on the phone call
at 3:00 today and we can run this by him for comments...

Thanks Hans,
-Steve

On 03/03/2011 02:05 PM, Johnson, Hans J wrote:

> Yes, I did figure out the problem.  I also know how to get to a solution,
> but I need time to get it implemented.  I'll try to work on it this week.
>
> The problem is exactly like Greg Sharp pointed out.  There needs to be
>"C"
> linkage rather than C++ linkage.  The problem is that the generateCLP
> program does the magic "C" linkage stuff in the header ${PROJECT}CLP.h
> file, and that file also has functions, so if you try to include the
> header file in more than one compilation unit, the program won't link.
>
> You need some stuff in the  ${PROJECT}CLP.h to do the magic for "C"
> linkage, and other suff in the compilation unit that parses the command
> line, AND it can not be included in both places.
>
> The proper thing to do would be to re-write GenerateCLP to have a
>separate
> compilation unit from the header and macro definitions, but that is
>beyond
> the scope of what I can accomplish with given reasources.
>
> I'll likely just have to add 10 minutes to each compilation unit and
> compile everything in the main program rather than having modular
>reusable
> builds components.  This is so that all the magic is allowed to live in
> the same compilation unit.
>
> Hans
>
>
> -----Original Message-----
> From: Steve Pieper<[hidden email]>
> Date: Thu, 3 Mar 2011 09:16:47 -0500
> To: "Sharp, Gregory C."<[hidden email]>
> Cc: Hans Johnson<[hidden email]>, Slicer Development
> <[hidden email]>
> Subject: Re: [slicer-devel] Shared library module problems
>
> Hi Hans and all -
>
> Did anyone figure out why some of the ModuleEntryPoint symbols have C++
> decorations and some do not?
>
> By my calculation there are 8 modules that have this issue - nothing
> jumps out at me in the CMakeLists.txt as to why they are different, but
> the ones that do not have the decoration seem to follow the exact
> pattern of the Applications/CLI/CMakeLists.txt, while the ones that do
> have the decoration are in some ways customized (e.g. the BRAINS code
> and DiffusionApplications).
>
> If anyone sees the answer, please speak up and claim the glory that is
> rightfully yours...
>
> -Steve
>
>
>
>> % for i in lib/Slicer3/Plugins/*.so; do echo "****** $i";  nm $i |grep
>> "[^ ]ModuleEntryPoint"; done
>
>
>> ****** lib/Slicer3/Plugins/libAddLib.so
>> ****** lib/Slicer3/Plugins/libAffineRegistrationLib.so
>> ****** lib/Slicer3/Plugins/libBRAINSDemonWarpCommonLib.so
>> ****** lib/Slicer3/Plugins/libBRAINSDemonWarpLib.so
>> 000000000001afdc T _Z16ModuleEntryPointiPPc
>> ****** lib/Slicer3/Plugins/libBRAINSFitLib.so
>> 00000000001a17bc T _Z16ModuleEntryPointiPPc
>> ****** lib/Slicer3/Plugins/libBRAINSResampleLib.so
>> 00000000000edf3c T _Z16ModuleEntryPointiPPc
>> ****** lib/Slicer3/Plugins/libBRAINSROIAutoLib.so
>> ****** lib/Slicer3/Plugins/libBSplineDeformableRegistrationLib.so
>> ****** lib/Slicer3/Plugins/libBSplineToDeformationFieldLib.so
>> ****** lib/Slicer3/Plugins/libCastLib.so
>> ****** lib/Slicer3/Plugins/libCheckerBoardLib.so
>> ****** lib/Slicer3/Plugins/libConfidenceConnectedLib.so
>> ****** lib/Slicer3/Plugins/libCurvatureAnisotropicDiffusionLib.so
>> ****** lib/Slicer3/Plugins/libDicomToNrrdConverterLib.so
>> ****** lib/Slicer3/Plugins/libDiffusionTensorTestLib.so
>> ****** lib/Slicer3/Plugins/libDiffusionWeightedTestLib.so
>> ****** lib/Slicer3/Plugins/libdwiNoiseFilterLib.so
>> 000000000000ed3c T _Z16ModuleEntryPointiPPKc
>> ****** lib/Slicer3/Plugins/libExtractSkeletonModule.so
>> ****** lib/Slicer3/Plugins/libGaussianBlurImageFilterLib.so
>> ****** lib/Slicer3/Plugins/libGradientAnisotropicDiffusionLib.so
>> ****** lib/Slicer3/Plugins/libGrayscaleFillHoleImageFilterLib.so
>> ****** lib/Slicer3/Plugins/libGrayscaleGrindPeakImageFilterLib.so
>> ****** lib/Slicer3/Plugins/libHistogramMatchingLib.so
>> ****** lib/Slicer3/Plugins/libImageReadDicomWriteLib.so
>> ****** lib/Slicer3/Plugins/libjointLMMSELib.so
>> 000000000016048e T _Z16ModuleEntryPointiPPKc
>> ****** lib/Slicer3/Plugins/libLabelMapSmoothingLib.so
>> ****** lib/Slicer3/Plugins/libLinearRegistrationLib.so
>> ****** lib/Slicer3/Plugins/libMaskLib.so
>> ****** lib/Slicer3/Plugins/libMedianImageFilterLib.so
>> ****** lib/Slicer3/Plugins/libMergeModelsLib.so
>> ****** lib/Slicer3/Plugins/libMRIBiasFieldCorrectionModule.so
>> ****** lib/Slicer3/Plugins/libMultiplyLib.so
>> ****** lib/Slicer3/Plugins/libN4ITKBiasFieldCorrectionLib.so
>> ****** lib/Slicer3/Plugins/libOrientImageLib.so
>> ****** lib/Slicer3/Plugins/libOtsuThresholdImageFilterLib.so
>> ****** lib/Slicer3/Plugins/libOtsuThresholdSegmentationLib.so
>> ****** lib/Slicer3/Plugins/libPolyDataToLabelmapLib.so
>> ****** lib/Slicer3/Plugins/libRealignLib.so
>> ****** lib/Slicer3/Plugins/libRegisterImagesModule.so
>> ****** lib/Slicer3/Plugins/libRegisterImagesMultiResModule.so
>> 000000000025d460 r _ZZ16ModuleEntryPointE19__PRETTY_FUNCTION__
>> ****** lib/Slicer3/Plugins/libResampleDTILib.so
>> ****** lib/Slicer3/Plugins/libResampleVolume2Lib.so
>> ****** lib/Slicer3/Plugins/libResampleVolumeLib.so
>> ****** lib/Slicer3/Plugins/libRigidRegistrationLib.so
>> ****** lib/Slicer3/Plugins/libSFLSRobustStat3DTestLib.so
>> 00000000000c8c8c T _Z16ModuleEntryPointiPPc
>> ****** lib/Slicer3/Plugins/libSparseFieldLevelSetContourLib.so
>> ****** lib/Slicer3/Plugins/libSubtractLib.so
>> ****** lib/Slicer3/Plugins/libTestGridTransformRegistrationLib.so
>> ****** lib/Slicer3/Plugins/libThresholdLib.so
>> ****** lib/Slicer3/Plugins/libTransformFromFiducialsModule.so
>> ****** lib/Slicer3/Plugins/libVBRAINSDemonWarpLib.so
>> 00000000002abd1c T _Z16ModuleEntryPointiPPc
>> ****** lib/Slicer3/Plugins/libVotingBinaryHoleFillingImageFilterLib.so
>
>
> On 02/21/2011 03:49 PM, Sharp, Gregory C. wrote:
>>
>> Yeah, I'm not sure.  But here is what I do to force CXX linkage:
>>
>> SET_TARGET_PROPERTIES (${TARGET_NAME} PROPERTIES LINKER_LANGUAGE CXX)
>>
>>
>> -----Original Message-----
>> From: Johnson, Hans J [mailto:[hidden email]]
>> Sent: Mon 2/21/2011 3:46 PM
>> To: Sharp, Gregory C.; Slicer Development
>> Subject: Re: [slicer-devel] Shared library module problems
>>
>> These are all ITK based programs compiled with the g++ compiler.  Is
>> there
>> some way to specify the linkage type desired?
>>
>> Thanks,
>> Hans
>>
>> --
>> Hans J. Johnson, Ph.D.
>> [hidden email]
>> Assistant Professor of Psychiatry
>> University of Iowa Carver College of Medicine
>> W278 GH, 200 Hawkins Drive
>>
>> Iowa City, Iowa 52242
>> Phone:  319-353-8587
>>
>>
>>
>>
>>
>>
>>
>>
>> -----Original Message-----
>> From: "Sharp, Gregory C."<[hidden email]>
>> Date: Mon, 21 Feb 2011 15:42:48 -0500
>> To: Hans Johnson<[hidden email]>, Slicer Development
>> <[hidden email]>
>> Subject: RE: [slicer-devel] Shared library module problems
>>
>>
>> Looks to me like libSimpleThresholdLib has C linkage and the others have
>> CXX linkage.  -Greg
>>
>>
>> -----Original Message-----
>> From: [hidden email] on behalf of Johnson, Hans J
>> Sent: Mon 2/21/2011 2:03 PM
>> To: Slicer Development
>> Subject: [slicer-devel] Shared library module problems
>>
>> Slicer shared library modules experts:
>>
>> l-lnx011:Slicer3johnsonhj$ for i in *.so; do echo $i;  nm $i |grep
>> Module;
>> done
>>
>> libCurvatureADLib.so
>> 0000000000269a20 D XMLModuleDescription
>> 0000000000028b70 T _Z16ModuleEntryPointiPPc
>> 0000000000028220 T _Z23GetXMLModuleDescriptionv
>>
>> libDOGLib.so
>> 0000000000268960 D XMLModuleDescription
>> 0000000000028a90 T _Z16ModuleEntryPointiPPc
>> 0000000000028310 T _Z23GetXMLModuleDescriptionv
>>
>> libGaussianLPFLib.so
>> 000000000024e8c0 D XMLModuleDescription
>> 000000000001cf60 T _Z16ModuleEntryPointiPPc
>> 000000000001c7e0 T _Z23GetXMLModuleDescriptionv
>>
>> libGradientADLib.so
>> 0000000000269a00 D XMLModuleDescription
>> 00000000000289e0 T _Z16ModuleEntryPointiPPc
>> 0000000000028090 T _Z23GetXMLModuleDescriptionv
>>
>> libSimpleThresholdLib.so
>> 0000000000020da0 T GetXMLModuleDescription
>> 0000000000021520 T ModuleEntryPoint
>> 00000000002578e0 D XMLModuleDescription
>>
>>
>> I thought that these were all built in the same way on the same
>>computer,
>> but
>> apparently there is something not quite consistent going on.
>>
>> The only module that actually loads into Slicer3 is the last one
>> libSimpleThresholdLib.so.
>>
>>
>>
>> =======================
>> I can't figure out what the difference is between these libraries.  Any
>> advice
>> on how to debug this would be greatly appreciated.
>>
>> Thanks,
>> Hans
>>
>> --
>> Hans J. Johnson, Ph.D.
>> [hidden email]
>> Assistant Professor of Psychiatry
>> University of Iowa Carver College of Medicine
>> W278 GH, 200 Hawkins Drive
>> Iowa City, Iowa 52242
>> Phone:  319-353-8587
>>
>>
>>
>>
>> ________________________________
>> Notice: This UI Health Care e-mail (including attachments) is covered by
>> the
>> Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is
>> confidential and
>> may be legally privileged.  If you are not the intended recipient, you
>> are
>> hereby notified that any retention, dissemination, distribution, or
>> copying of
>> this communication is strictly prohibited.  Please reply to the sender
>> that you
>> have received the message in error, then delete it.  Thank you.
>> ________________________________
>>
>>
>>
>> The information in this e-mail is intended only for the person to whom
>>it
>> is
>> addressed. If you believe this e-mail was sent to you in error and the
>> e-mail
>> contains patient information, please contact the Partners Compliance
>> HelpLine at
>> http://www.partners.org/complianceline . If the e-mail was sent to you
>>in
>> error
>> but does not contain patient information, please contact the sender and
>> properly
>> dispose of the e-mail.
>>
>>
>>
>>
>> ________________________________
>> Notice: This UI Health Care e-mail (including attachments) is covered by
>> the
>> Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is
>> confidential and
>> may be legally privileged.  If you are not the intended recipient, you
>> are
>> hereby notified that any retention, dissemination, distribution, or
>> copying of
>> this communication is strictly prohibited.  Please reply to the sender
>> that you
>> have received the message in error, then delete it.  Thank you.
>> ________________________________
>>
>> _______________________________________________
>> slicer-devel mailing list
>> [hidden email]
>> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
>> To unsubscribe: send email to
>> [hidden email] with unsubscribe as the
>> subject
>
>
>
> ________________________________
> Notice: This UI Health Care e-mail (including attachments) is covered by
>the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is
>confidential and may be legally privileged.  If you are not the intended
>recipient, you are hereby notified that any retention, dissemination,
>distribution, or copying of this communication is strictly prohibited.
>Please reply to the sender that you have received the message in error,
>then delete it.  Thank you.
> ________________________________



________________________________
Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged.  If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited.  Please reply to the sender that you have received the message in error, then delete it.  Thank you.
________________________________
_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
Reply | Threaded
Open this post in threaded view
|

Re: Shared library module problems

Miller, James V (GE Global Research)
In reply to this post by Johnson, Hans J
Would making the functions have local file scope help here? i.e. an anonymous namespace or static declaration?


On Mar 3, 2011, at 2:05 PM, Johnson, Hans J wrote:

Yes, I did figure out the problem.  I also know how to get to a solution,
but I need time to get it implemented.  I'll try to work on it this week.

The problem is exactly like Greg Sharp pointed out.  There needs to be "C"
linkage rather than C++ linkage.  The problem is that the generateCLP
program does the magic "C" linkage stuff in the header ${PROJECT}CLP.h
file, and that file also has functions, so if you try to include the
header file in more than one compilation unit, the program won't link.

You need some stuff in the  ${PROJECT}CLP.h to do the magic for "C"
linkage, and other suff in the compilation unit that parses the command
line, AND it can not be included in both places.

The proper thing to do would be to re-write GenerateCLP to have a separate
compilation unit from the header and macro definitions, but that is beyond
the scope of what I can accomplish with given reasources.

I'll likely just have to add 10 minutes to each compilation unit and
compile everything in the main program rather than having modular reusable
builds components.  This is so that all the magic is allowed to live in
the same compilation unit.

Hans


-----Original Message-----
From: Steve Pieper <[hidden email]>
Date: Thu, 3 Mar 2011 09:16:47 -0500
To: "Sharp, Gregory C." <[hidden email]>
Cc: Hans Johnson <[hidden email]>, Slicer Development
<[hidden email]>
Subject: Re: [slicer-devel] Shared library module problems

Hi Hans and all -

Did anyone figure out why some of the ModuleEntryPoint symbols have C++
decorations and some do not?

By my calculation there are 8 modules that have this issue - nothing
jumps out at me in the CMakeLists.txt as to why they are different, but
the ones that do not have the decoration seem to follow the exact
pattern of the Applications/CLI/CMakeLists.txt, while the ones that do
have the decoration are in some ways customized (e.g. the BRAINS code
and DiffusionApplications).

If anyone sees the answer, please speak up and claim the glory that is
rightfully yours...

-Steve



% for i in lib/Slicer3/Plugins/*.so; do echo "****** $i";  nm $i |grep
"[^ ]ModuleEntryPoint"; done


****** lib/Slicer3/Plugins/libAddLib.so
****** lib/Slicer3/Plugins/libAffineRegistrationLib.so
****** lib/Slicer3/Plugins/libBRAINSDemonWarpCommonLib.so
****** lib/Slicer3/Plugins/libBRAINSDemonWarpLib.so
000000000001afdc T _Z16ModuleEntryPointiPPc
****** lib/Slicer3/Plugins/libBRAINSFitLib.so
00000000001a17bc T _Z16ModuleEntryPointiPPc
****** lib/Slicer3/Plugins/libBRAINSResampleLib.so
00000000000edf3c T _Z16ModuleEntryPointiPPc
****** lib/Slicer3/Plugins/libBRAINSROIAutoLib.so
****** lib/Slicer3/Plugins/libBSplineDeformableRegistrationLib.so
****** lib/Slicer3/Plugins/libBSplineToDeformationFieldLib.so
****** lib/Slicer3/Plugins/libCastLib.so
****** lib/Slicer3/Plugins/libCheckerBoardLib.so
****** lib/Slicer3/Plugins/libConfidenceConnectedLib.so
****** lib/Slicer3/Plugins/libCurvatureAnisotropicDiffusionLib.so
****** lib/Slicer3/Plugins/libDicomToNrrdConverterLib.so
****** lib/Slicer3/Plugins/libDiffusionTensorTestLib.so
****** lib/Slicer3/Plugins/libDiffusionWeightedTestLib.so
****** lib/Slicer3/Plugins/libdwiNoiseFilterLib.so
000000000000ed3c T _Z16ModuleEntryPointiPPKc
****** lib/Slicer3/Plugins/libExtractSkeletonModule.so
****** lib/Slicer3/Plugins/libGaussianBlurImageFilterLib.so
****** lib/Slicer3/Plugins/libGradientAnisotropicDiffusionLib.so
****** lib/Slicer3/Plugins/libGrayscaleFillHoleImageFilterLib.so
****** lib/Slicer3/Plugins/libGrayscaleGrindPeakImageFilterLib.so
****** lib/Slicer3/Plugins/libHistogramMatchingLib.so
****** lib/Slicer3/Plugins/libImageReadDicomWriteLib.so
****** lib/Slicer3/Plugins/libjointLMMSELib.so
000000000016048e T _Z16ModuleEntryPointiPPKc
****** lib/Slicer3/Plugins/libLabelMapSmoothingLib.so
****** lib/Slicer3/Plugins/libLinearRegistrationLib.so
****** lib/Slicer3/Plugins/libMaskLib.so
****** lib/Slicer3/Plugins/libMedianImageFilterLib.so
****** lib/Slicer3/Plugins/libMergeModelsLib.so
****** lib/Slicer3/Plugins/libMRIBiasFieldCorrectionModule.so
****** lib/Slicer3/Plugins/libMultiplyLib.so
****** lib/Slicer3/Plugins/libN4ITKBiasFieldCorrectionLib.so
****** lib/Slicer3/Plugins/libOrientImageLib.so
****** lib/Slicer3/Plugins/libOtsuThresholdImageFilterLib.so
****** lib/Slicer3/Plugins/libOtsuThresholdSegmentationLib.so
****** lib/Slicer3/Plugins/libPolyDataToLabelmapLib.so
****** lib/Slicer3/Plugins/libRealignLib.so
****** lib/Slicer3/Plugins/libRegisterImagesModule.so
****** lib/Slicer3/Plugins/libRegisterImagesMultiResModule.so
000000000025d460 r _ZZ16ModuleEntryPointE19__PRETTY_FUNCTION__
****** lib/Slicer3/Plugins/libResampleDTILib.so
****** lib/Slicer3/Plugins/libResampleVolume2Lib.so
****** lib/Slicer3/Plugins/libResampleVolumeLib.so
****** lib/Slicer3/Plugins/libRigidRegistrationLib.so
****** lib/Slicer3/Plugins/libSFLSRobustStat3DTestLib.so
00000000000c8c8c T _Z16ModuleEntryPointiPPc
****** lib/Slicer3/Plugins/libSparseFieldLevelSetContourLib.so
****** lib/Slicer3/Plugins/libSubtractLib.so
****** lib/Slicer3/Plugins/libTestGridTransformRegistrationLib.so
****** lib/Slicer3/Plugins/libThresholdLib.so
****** lib/Slicer3/Plugins/libTransformFromFiducialsModule.so
****** lib/Slicer3/Plugins/libVBRAINSDemonWarpLib.so
00000000002abd1c T _Z16ModuleEntryPointiPPc
****** lib/Slicer3/Plugins/libVotingBinaryHoleFillingImageFilterLib.so


On 02/21/2011 03:49 PM, Sharp, Gregory C. wrote:

Yeah, I'm not sure.  But here is what I do to force CXX linkage:

SET_TARGET_PROPERTIES (${TARGET_NAME} PROPERTIES LINKER_LANGUAGE CXX)


-----Original Message-----
From: Johnson, Hans J [mailto:[hidden email]]
Sent: Mon 2/21/2011 3:46 PM
To: Sharp, Gregory C.; Slicer Development
Subject: Re: [slicer-devel] Shared library module problems

These are all ITK based programs compiled with the g++ compiler.  Is
there
some way to specify the linkage type desired?

Thanks,
Hans

--
Hans J. Johnson, Ph.D.
[hidden email]
Assistant Professor of Psychiatry
University of Iowa Carver College of Medicine
W278 GH, 200 Hawkins Drive

Iowa City, Iowa 52242
Phone:  319-353-8587








-----Original Message-----
From: "Sharp, Gregory C."<[hidden email]>
Date: Mon, 21 Feb 2011 15:42:48 -0500
To: Hans Johnson<[hidden email]>, Slicer Development
<[hidden email]>
Subject: RE: [slicer-devel] Shared library module problems


Looks to me like libSimpleThresholdLib has C linkage and the others have
CXX linkage.  -Greg


-----Original Message-----
From: [hidden email] on behalf of Johnson, Hans J
Sent: Mon 2/21/2011 2:03 PM
To: Slicer Development
Subject: [slicer-devel] Shared library module problems

Slicer shared library modules experts:

l-lnx011:Slicer3johnsonhj$ for i in *.so; do echo $i;  nm $i |grep
Module;
done

libCurvatureADLib.so
0000000000269a20 D XMLModuleDescription
0000000000028b70 T _Z16ModuleEntryPointiPPc
0000000000028220 T _Z23GetXMLModuleDescriptionv

libDOGLib.so
0000000000268960 D XMLModuleDescription
0000000000028a90 T _Z16ModuleEntryPointiPPc
0000000000028310 T _Z23GetXMLModuleDescriptionv

libGaussianLPFLib.so
000000000024e8c0 D XMLModuleDescription
000000000001cf60 T _Z16ModuleEntryPointiPPc
000000000001c7e0 T _Z23GetXMLModuleDescriptionv

libGradientADLib.so
0000000000269a00 D XMLModuleDescription
00000000000289e0 T _Z16ModuleEntryPointiPPc
0000000000028090 T _Z23GetXMLModuleDescriptionv

libSimpleThresholdLib.so
0000000000020da0 T GetXMLModuleDescription
0000000000021520 T ModuleEntryPoint
00000000002578e0 D XMLModuleDescription


I thought that these were all built in the same way on the same computer,
but
apparently there is something not quite consistent going on.

The only module that actually loads into Slicer3 is the last one
libSimpleThresholdLib.so.



=======================
I can't figure out what the difference is between these libraries.  Any
advice
on how to debug this would be greatly appreciated.

Thanks,
Hans

--
Hans J. Johnson, Ph.D.
[hidden email]
Assistant Professor of Psychiatry
University of Iowa Carver College of Medicine
W278 GH, 200 Hawkins Drive
Iowa City, Iowa 52242
Phone:  319-353-8587




________________________________
Notice: This UI Health Care e-mail (including attachments) is covered by
the
Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is
confidential and
may be legally privileged.  If you are not the intended recipient, you
are
hereby notified that any retention, dissemination, distribution, or
copying of
this communication is strictly prohibited.  Please reply to the sender
that you
have received the message in error, then delete it.  Thank you.
________________________________



The information in this e-mail is intended only for the person to whom it
is
addressed. If you believe this e-mail was sent to you in error and the
e-mail
contains patient information, please contact the Partners Compliance
HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in
error
but does not contain patient information, please contact the sender and
properly
dispose of the e-mail.




________________________________
Notice: This UI Health Care e-mail (including attachments) is covered by
the
Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is
confidential and
may be legally privileged.  If you are not the intended recipient, you
are
hereby notified that any retention, dissemination, distribution, or
copying of
this communication is strictly prohibited.  Please reply to the sender
that you
have received the message in error, then delete it.  Thank you.
________________________________

_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to
[hidden email] with unsubscribe as the
subject



________________________________
Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged.  If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited.  Please reply to the sender that you have received the message in error, then delete it.  Thank you.
________________________________
_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject

Jim Miller
Senior Scientist
GE Research 
Interventional and Therapy

GE imagination at work


_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Shared library module problems

Johnson, Hans J
I don't think so.  

ld: duplicate symbol GetModuleLogo(int*, int*, int*, unsigned long*)in CMakeFiles/BRAINSFit.dir/BRAINSFitPrimary.cxx.o and CMakeFiles/BRAINSFit.dir/BRAINSFit.cxx.o
collect2: ld returned 1 exit status


extern "C" {
  Module_EXPORT char *GetXMLModuleDescription();
  Module_EXPORT int ModuleEntryPoint(int, char*[]);
  Module_EXPORT unsigned char *GetModuleLogo(int *width, int *height, int *pixel_size, unsigned long *bufferLength);
}


Making them static is contrary to making them extern "C". 

Hans


From: Jim Miller <[hidden email]>
Date: Thu, 3 Mar 2011 16:04:01 -0500
To: Hans Johnson <[hidden email]>
Cc: Steve Pieper <[hidden email]>, "Sharp, Gregory C." <[hidden email]>, Mark Scully <[hidden email]>, Slicer Development <[hidden email]>
Subject: Re: [slicer-devel] Shared library module problems

Would making the functions have local file scope help here? i.e. an anonymous namespace or static declaration?


On Mar 3, 2011, at 2:05 PM, Johnson, Hans J wrote:

Yes, I did figure out the problem.  I also know how to get to a solution,
but I need time to get it implemented.  I'll try to work on it this week.

The problem is exactly like Greg Sharp pointed out.  There needs to be "C"
linkage rather than C++ linkage.  The problem is that the generateCLP
program does the magic "C" linkage stuff in the header ${PROJECT}CLP.h
file, and that file also has functions, so if you try to include the
header file in more than one compilation unit, the program won't link.

You need some stuff in the  ${PROJECT}CLP.h to do the magic for "C"
linkage, and other suff in the compilation unit that parses the command
line, AND it can not be included in both places.

The proper thing to do would be to re-write GenerateCLP to have a separate
compilation unit from the header and macro definitions, but that is beyond
the scope of what I can accomplish with given reasources.

I'll likely just have to add 10 minutes to each compilation unit and
compile everything in the main program rather than having modular reusable
builds components.  This is so that all the magic is allowed to live in
the same compilation unit.

Hans


-----Original Message-----
From: Steve Pieper <[hidden email]>
Date: Thu, 3 Mar 2011 09:16:47 -0500
To: "Sharp, Gregory C." <[hidden email]>
Cc: Hans Johnson <[hidden email]>, Slicer Development
<[hidden email]>
Subject: Re: [slicer-devel] Shared library module problems

Hi Hans and all -

Did anyone figure out why some of the ModuleEntryPoint symbols have C++
decorations and some do not?

By my calculation there are 8 modules that have this issue - nothing
jumps out at me in the CMakeLists.txt as to why they are different, but
the ones that do not have the decoration seem to follow the exact
pattern of the Applications/CLI/CMakeLists.txt, while the ones that do
have the decoration are in some ways customized (e.g. the BRAINS code
and DiffusionApplications).

If anyone sees the answer, please speak up and claim the glory that is
rightfully yours...

-Steve



% for i in lib/Slicer3/Plugins/*.so; do echo "****** $i";  nm $i |grep
"[^ ]ModuleEntryPoint"; done


****** lib/Slicer3/Plugins/libAddLib.so
****** lib/Slicer3/Plugins/libAffineRegistrationLib.so
****** lib/Slicer3/Plugins/libBRAINSDemonWarpCommonLib.so
****** lib/Slicer3/Plugins/libBRAINSDemonWarpLib.so
000000000001afdc T _Z16ModuleEntryPointiPPc
****** lib/Slicer3/Plugins/libBRAINSFitLib.so
00000000001a17bc T _Z16ModuleEntryPointiPPc
****** lib/Slicer3/Plugins/libBRAINSResampleLib.so
00000000000edf3c T _Z16ModuleEntryPointiPPc
****** lib/Slicer3/Plugins/libBRAINSROIAutoLib.so
****** lib/Slicer3/Plugins/libBSplineDeformableRegistrationLib.so
****** lib/Slicer3/Plugins/libBSplineToDeformationFieldLib.so
****** lib/Slicer3/Plugins/libCastLib.so
****** lib/Slicer3/Plugins/libCheckerBoardLib.so
****** lib/Slicer3/Plugins/libConfidenceConnectedLib.so
****** lib/Slicer3/Plugins/libCurvatureAnisotropicDiffusionLib.so
****** lib/Slicer3/Plugins/libDicomToNrrdConverterLib.so
****** lib/Slicer3/Plugins/libDiffusionTensorTestLib.so
****** lib/Slicer3/Plugins/libDiffusionWeightedTestLib.so
****** lib/Slicer3/Plugins/libdwiNoiseFilterLib.so
000000000000ed3c T _Z16ModuleEntryPointiPPKc
****** lib/Slicer3/Plugins/libExtractSkeletonModule.so
****** lib/Slicer3/Plugins/libGaussianBlurImageFilterLib.so
****** lib/Slicer3/Plugins/libGradientAnisotropicDiffusionLib.so
****** lib/Slicer3/Plugins/libGrayscaleFillHoleImageFilterLib.so
****** lib/Slicer3/Plugins/libGrayscaleGrindPeakImageFilterLib.so
****** lib/Slicer3/Plugins/libHistogramMatchingLib.so
****** lib/Slicer3/Plugins/libImageReadDicomWriteLib.so
****** lib/Slicer3/Plugins/libjointLMMSELib.so
000000000016048e T _Z16ModuleEntryPointiPPKc
****** lib/Slicer3/Plugins/libLabelMapSmoothingLib.so
****** lib/Slicer3/Plugins/libLinearRegistrationLib.so
****** lib/Slicer3/Plugins/libMaskLib.so
****** lib/Slicer3/Plugins/libMedianImageFilterLib.so
****** lib/Slicer3/Plugins/libMergeModelsLib.so
****** lib/Slicer3/Plugins/libMRIBiasFieldCorrectionModule.so
****** lib/Slicer3/Plugins/libMultiplyLib.so
****** lib/Slicer3/Plugins/libN4ITKBiasFieldCorrectionLib.so
****** lib/Slicer3/Plugins/libOrientImageLib.so
****** lib/Slicer3/Plugins/libOtsuThresholdImageFilterLib.so
****** lib/Slicer3/Plugins/libOtsuThresholdSegmentationLib.so
****** lib/Slicer3/Plugins/libPolyDataToLabelmapLib.so
****** lib/Slicer3/Plugins/libRealignLib.so
****** lib/Slicer3/Plugins/libRegisterImagesModule.so
****** lib/Slicer3/Plugins/libRegisterImagesMultiResModule.so
000000000025d460 r _ZZ16ModuleEntryPointE19__PRETTY_FUNCTION__
****** lib/Slicer3/Plugins/libResampleDTILib.so
****** lib/Slicer3/Plugins/libResampleVolume2Lib.so
****** lib/Slicer3/Plugins/libResampleVolumeLib.so
****** lib/Slicer3/Plugins/libRigidRegistrationLib.so
****** lib/Slicer3/Plugins/libSFLSRobustStat3DTestLib.so
00000000000c8c8c T _Z16ModuleEntryPointiPPc
****** lib/Slicer3/Plugins/libSparseFieldLevelSetContourLib.so
****** lib/Slicer3/Plugins/libSubtractLib.so
****** lib/Slicer3/Plugins/libTestGridTransformRegistrationLib.so
****** lib/Slicer3/Plugins/libThresholdLib.so
****** lib/Slicer3/Plugins/libTransformFromFiducialsModule.so
****** lib/Slicer3/Plugins/libVBRAINSDemonWarpLib.so
00000000002abd1c T _Z16ModuleEntryPointiPPc
****** lib/Slicer3/Plugins/libVotingBinaryHoleFillingImageFilterLib.so


On 02/21/2011 03:49 PM, Sharp, Gregory C. wrote:

Yeah, I'm not sure.  But here is what I do to force CXX linkage:

SET_TARGET_PROPERTIES (${TARGET_NAME} PROPERTIES LINKER_LANGUAGE CXX)


-----Original Message-----
From: Johnson, Hans J [[hidden email]]
Sent: Mon 2/21/2011 3:46 PM
To: Sharp, Gregory C.; Slicer Development
Subject: Re: [slicer-devel] Shared library module problems

These are all ITK based programs compiled with the g++ compiler.  Is
there
some way to specify the linkage type desired?

Thanks,
Hans

--
Hans J. Johnson, Ph.D.
[hidden email]
Assistant Professor of Psychiatry
University of Iowa Carver College of Medicine
W278 GH, 200 Hawkins Drive

Iowa City, Iowa 52242
Phone:  319-353-8587








-----Original Message-----
From: "Sharp, Gregory C."<[hidden email]>
Date: Mon, 21 Feb 2011 15:42:48 -0500
To: Hans Johnson<[hidden email]>, Slicer Development
<[hidden email]>
Subject: RE: [slicer-devel] Shared library module problems


Looks to me like libSimpleThresholdLib has C linkage and the others have
CXX linkage.  -Greg


-----Original Message-----
From: [hidden email] on behalf of Johnson, Hans J
Sent: Mon 2/21/2011 2:03 PM
To: Slicer Development
Subject: [slicer-devel] Shared library module problems

Slicer shared library modules experts:

l-lnx011:Slicer3johnsonhj$ for i in *.so; do echo $i;  nm $i |grep
Module;
done

libCurvatureADLib.so
0000000000269a20 D XMLModuleDescription
0000000000028b70 T _Z16ModuleEntryPointiPPc
0000000000028220 T _Z23GetXMLModuleDescriptionv

libDOGLib.so
0000000000268960 D XMLModuleDescription
0000000000028a90 T _Z16ModuleEntryPointiPPc
0000000000028310 T _Z23GetXMLModuleDescriptionv

libGaussianLPFLib.so
000000000024e8c0 D XMLModuleDescription
000000000001cf60 T _Z16ModuleEntryPointiPPc
000000000001c7e0 T _Z23GetXMLModuleDescriptionv

libGradientADLib.so
0000000000269a00 D XMLModuleDescription
00000000000289e0 T _Z16ModuleEntryPointiPPc
0000000000028090 T _Z23GetXMLModuleDescriptionv

libSimpleThresholdLib.so
0000000000020da0 T GetXMLModuleDescription
0000000000021520 T ModuleEntryPoint
00000000002578e0 D XMLModuleDescription


I thought that these were all built in the same way on the same computer,
but
apparently there is something not quite consistent going on.

The only module that actually loads into Slicer3 is the last one
libSimpleThresholdLib.so.



=======================
I can't figure out what the difference is between these libraries.  Any
advice
on how to debug this would be greatly appreciated.

Thanks,
Hans

--
Hans J. Johnson, Ph.D.
[hidden email]
Assistant Professor of Psychiatry
University of Iowa Carver College of Medicine
W278 GH, 200 Hawkins Drive
Iowa City, Iowa 52242
Phone:  319-353-8587




________________________________
Notice: This UI Health Care e-mail (including attachments) is covered by
the
Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is
confidential and
may be legally privileged.  If you are not the intended recipient, you
are
hereby notified that any retention, dissemination, distribution, or
copying of
this communication is strictly prohibited.  Please reply to the sender
that you
have received the message in error, then delete it.  Thank you.
________________________________



The information in this e-mail is intended only for the person to whom it
is
addressed. If you believe this e-mail was sent to you in error and the
e-mail
contains patient information, please contact the Partners Compliance
HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in
error
but does not contain patient information, please contact the sender and
properly
dispose of the e-mail.




________________________________
Notice: This UI Health Care e-mail (including attachments) is covered by
the
Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is
confidential and
may be legally privileged.  If you are not the intended recipient, you
are
hereby notified that any retention, dissemination, distribution, or
copying of
this communication is strictly prohibited.  Please reply to the sender
that you
have received the message in error, then delete it.  Thank you.
________________________________

_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to
[hidden email] with unsubscribe as the
subject



________________________________
Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged.  If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited.  Please reply to the sender that you have received the message in error, then delete it.  Thank you.
________________________________
_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject

Jim Miller
Senior Scientist
GE Research 
Interventional and Therapy

GE imagination at work




Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged.  If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited.  Please reply to the sender that you have received the message in error, then delete it.  Thank you.

_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
Reply | Threaded
Open this post in threaded view
|

Re: Shared library module problems

Johnson, Hans J
Jim,

I'd like to make something work for the BRAINSTools in the next two weeks.  Could you please let me know what the status breaking the autogenerated SEM files into two sections is?

Thanks,
Hans


From: Hans Johnson <[hidden email]>
Date: Thu, 3 Mar 2011 15:10:18 -0600
To: Jim Miller <[hidden email]>
Cc: Steve Pieper <[hidden email]>, "Sharp, Gregory C." <[hidden email]>, Mark Scully <[hidden email]>, Slicer Development <[hidden email]>
Subject: Re: [slicer-devel] Shared library module problems

I don't think so.  

ld: duplicate symbol GetModuleLogo(int*, int*, int*, unsigned long*)in CMakeFiles/BRAINSFit.dir/BRAINSFitPrimary.cxx.o and CMakeFiles/BRAINSFit.dir/BRAINSFit.cxx.o
collect2: ld returned 1 exit status


extern "C" {
  Module_EXPORT char *GetXMLModuleDescription();
  Module_EXPORT int ModuleEntryPoint(int, char*[]);
  Module_EXPORT unsigned char *GetModuleLogo(int *width, int *height, int *pixel_size, unsigned long *bufferLength);
}


Making them static is contrary to making them extern "C". 

Hans


From: Jim Miller <[hidden email]>
Date: Thu, 3 Mar 2011 16:04:01 -0500
To: Hans Johnson <[hidden email]>
Cc: Steve Pieper <[hidden email]>, "Sharp, Gregory C." <[hidden email]>, Mark Scully <[hidden email]>, Slicer Development <[hidden email]>
Subject: Re: [slicer-devel] Shared library module problems

Would making the functions have local file scope help here? i.e. an anonymous namespace or static declaration?


On Mar 3, 2011, at 2:05 PM, Johnson, Hans J wrote:

Yes, I did figure out the problem.  I also know how to get to a solution,
but I need time to get it implemented.  I'll try to work on it this week.

The problem is exactly like Greg Sharp pointed out.  There needs to be "C"
linkage rather than C++ linkage.  The problem is that the generateCLP
program does the magic "C" linkage stuff in the header ${PROJECT}CLP.h
file, and that file also has functions, so if you try to include the
header file in more than one compilation unit, the program won't link.

You need some stuff in the  ${PROJECT}CLP.h to do the magic for "C"
linkage, and other suff in the compilation unit that parses the command
line, AND it can not be included in both places.

The proper thing to do would be to re-write GenerateCLP to have a separate
compilation unit from the header and macro definitions, but that is beyond
the scope of what I can accomplish with given reasources.

I'll likely just have to add 10 minutes to each compilation unit and
compile everything in the main program rather than having modular reusable
builds components.  This is so that all the magic is allowed to live in
the same compilation unit.

Hans


-----Original Message-----
From: Steve Pieper <[hidden email]>
Date: Thu, 3 Mar 2011 09:16:47 -0500
To: "Sharp, Gregory C." <[hidden email]>
Cc: Hans Johnson <[hidden email]>, Slicer Development
<[hidden email]>
Subject: Re: [slicer-devel] Shared library module problems

Hi Hans and all -

Did anyone figure out why some of the ModuleEntryPoint symbols have C++
decorations and some do not?

By my calculation there are 8 modules that have this issue - nothing
jumps out at me in the CMakeLists.txt as to why they are different, but
the ones that do not have the decoration seem to follow the exact
pattern of the Applications/CLI/CMakeLists.txt, while the ones that do
have the decoration are in some ways customized (e.g. the BRAINS code
and DiffusionApplications).

If anyone sees the answer, please speak up and claim the glory that is
rightfully yours...

-Steve



% for i in lib/Slicer3/Plugins/*.so; do echo "****** $i";  nm $i |grep
"[^ ]ModuleEntryPoint"; done


****** lib/Slicer3/Plugins/libAddLib.so
****** lib/Slicer3/Plugins/libAffineRegistrationLib.so
****** lib/Slicer3/Plugins/libBRAINSDemonWarpCommonLib.so
****** lib/Slicer3/Plugins/libBRAINSDemonWarpLib.so
000000000001afdc T _Z16ModuleEntryPointiPPc
****** lib/Slicer3/Plugins/libBRAINSFitLib.so
00000000001a17bc T _Z16ModuleEntryPointiPPc
****** lib/Slicer3/Plugins/libBRAINSResampleLib.so
00000000000edf3c T _Z16ModuleEntryPointiPPc
****** lib/Slicer3/Plugins/libBRAINSROIAutoLib.so
****** lib/Slicer3/Plugins/libBSplineDeformableRegistrationLib.so
****** lib/Slicer3/Plugins/libBSplineToDeformationFieldLib.so
****** lib/Slicer3/Plugins/libCastLib.so
****** lib/Slicer3/Plugins/libCheckerBoardLib.so
****** lib/Slicer3/Plugins/libConfidenceConnectedLib.so
****** lib/Slicer3/Plugins/libCurvatureAnisotropicDiffusionLib.so
****** lib/Slicer3/Plugins/libDicomToNrrdConverterLib.so
****** lib/Slicer3/Plugins/libDiffusionTensorTestLib.so
****** lib/Slicer3/Plugins/libDiffusionWeightedTestLib.so
****** lib/Slicer3/Plugins/libdwiNoiseFilterLib.so
000000000000ed3c T _Z16ModuleEntryPointiPPKc
****** lib/Slicer3/Plugins/libExtractSkeletonModule.so
****** lib/Slicer3/Plugins/libGaussianBlurImageFilterLib.so
****** lib/Slicer3/Plugins/libGradientAnisotropicDiffusionLib.so
****** lib/Slicer3/Plugins/libGrayscaleFillHoleImageFilterLib.so
****** lib/Slicer3/Plugins/libGrayscaleGrindPeakImageFilterLib.so
****** lib/Slicer3/Plugins/libHistogramMatchingLib.so
****** lib/Slicer3/Plugins/libImageReadDicomWriteLib.so
****** lib/Slicer3/Plugins/libjointLMMSELib.so
000000000016048e T _Z16ModuleEntryPointiPPKc
****** lib/Slicer3/Plugins/libLabelMapSmoothingLib.so
****** lib/Slicer3/Plugins/libLinearRegistrationLib.so
****** lib/Slicer3/Plugins/libMaskLib.so
****** lib/Slicer3/Plugins/libMedianImageFilterLib.so
****** lib/Slicer3/Plugins/libMergeModelsLib.so
****** lib/Slicer3/Plugins/libMRIBiasFieldCorrectionModule.so
****** lib/Slicer3/Plugins/libMultiplyLib.so
****** lib/Slicer3/Plugins/libN4ITKBiasFieldCorrectionLib.so
****** lib/Slicer3/Plugins/libOrientImageLib.so
****** lib/Slicer3/Plugins/libOtsuThresholdImageFilterLib.so
****** lib/Slicer3/Plugins/libOtsuThresholdSegmentationLib.so
****** lib/Slicer3/Plugins/libPolyDataToLabelmapLib.so
****** lib/Slicer3/Plugins/libRealignLib.so
****** lib/Slicer3/Plugins/libRegisterImagesModule.so
****** lib/Slicer3/Plugins/libRegisterImagesMultiResModule.so
000000000025d460 r _ZZ16ModuleEntryPointE19__PRETTY_FUNCTION__
****** lib/Slicer3/Plugins/libResampleDTILib.so
****** lib/Slicer3/Plugins/libResampleVolume2Lib.so
****** lib/Slicer3/Plugins/libResampleVolumeLib.so
****** lib/Slicer3/Plugins/libRigidRegistrationLib.so
****** lib/Slicer3/Plugins/libSFLSRobustStat3DTestLib.so
00000000000c8c8c T _Z16ModuleEntryPointiPPc
****** lib/Slicer3/Plugins/libSparseFieldLevelSetContourLib.so
****** lib/Slicer3/Plugins/libSubtractLib.so
****** lib/Slicer3/Plugins/libTestGridTransformRegistrationLib.so
****** lib/Slicer3/Plugins/libThresholdLib.so
****** lib/Slicer3/Plugins/libTransformFromFiducialsModule.so
****** lib/Slicer3/Plugins/libVBRAINSDemonWarpLib.so
00000000002abd1c T _Z16ModuleEntryPointiPPc
****** lib/Slicer3/Plugins/libVotingBinaryHoleFillingImageFilterLib.so


On 02/21/2011 03:49 PM, Sharp, Gregory C. wrote:

Yeah, I'm not sure.  But here is what I do to force CXX linkage:

SET_TARGET_PROPERTIES (${TARGET_NAME} PROPERTIES LINKER_LANGUAGE CXX)


-----Original Message-----
From: Johnson, Hans J [[hidden email]]
Sent: Mon 2/21/2011 3:46 PM
To: Sharp, Gregory C.; Slicer Development
Subject: Re: [slicer-devel] Shared library module problems

These are all ITK based programs compiled with the g++ compiler.  Is
there
some way to specify the linkage type desired?

Thanks,
Hans

--
Hans J. Johnson, Ph.D.
[hidden email]
Assistant Professor of Psychiatry
University of Iowa Carver College of Medicine
W278 GH, 200 Hawkins Drive

Iowa City, Iowa 52242
Phone:  319-353-8587








-----Original Message-----
From: "Sharp, Gregory C."<[hidden email]>
Date: Mon, 21 Feb 2011 15:42:48 -0500
To: Hans Johnson<[hidden email]>, Slicer Development
<[hidden email]>
Subject: RE: [slicer-devel] Shared library module problems


Looks to me like libSimpleThresholdLib has C linkage and the others have
CXX linkage.  -Greg


-----Original Message-----
From: [hidden email] on behalf of Johnson, Hans J
Sent: Mon 2/21/2011 2:03 PM
To: Slicer Development
Subject: [slicer-devel] Shared library module problems

Slicer shared library modules experts:

l-lnx011:Slicer3johnsonhj$ for i in *.so; do echo $i;  nm $i |grep
Module;
done

libCurvatureADLib.so
0000000000269a20 D XMLModuleDescription
0000000000028b70 T _Z16ModuleEntryPointiPPc
0000000000028220 T _Z23GetXMLModuleDescriptionv

libDOGLib.so
0000000000268960 D XMLModuleDescription
0000000000028a90 T _Z16ModuleEntryPointiPPc
0000000000028310 T _Z23GetXMLModuleDescriptionv

libGaussianLPFLib.so
000000000024e8c0 D XMLModuleDescription
000000000001cf60 T _Z16ModuleEntryPointiPPc
000000000001c7e0 T _Z23GetXMLModuleDescriptionv

libGradientADLib.so
0000000000269a00 D XMLModuleDescription
00000000000289e0 T _Z16ModuleEntryPointiPPc
0000000000028090 T _Z23GetXMLModuleDescriptionv

libSimpleThresholdLib.so
0000000000020da0 T GetXMLModuleDescription
0000000000021520 T ModuleEntryPoint
00000000002578e0 D XMLModuleDescription


I thought that these were all built in the same way on the same computer,
but
apparently there is something not quite consistent going on.

The only module that actually loads into Slicer3 is the last one
libSimpleThresholdLib.so.



=======================
I can't figure out what the difference is between these libraries.  Any
advice
on how to debug this would be greatly appreciated.

Thanks,
Hans

--
Hans J. Johnson, Ph.D.
[hidden email]
Assistant Professor of Psychiatry
University of Iowa Carver College of Medicine
W278 GH, 200 Hawkins Drive
Iowa City, Iowa 52242
Phone:  319-353-8587




________________________________
Notice: This UI Health Care e-mail (including attachments) is covered by
the
Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is
confidential and
may be legally privileged.  If you are not the intended recipient, you
are
hereby notified that any retention, dissemination, distribution, or
copying of
this communication is strictly prohibited.  Please reply to the sender
that you
have received the message in error, then delete it.  Thank you.
________________________________



The information in this e-mail is intended only for the person to whom it
is
addressed. If you believe this e-mail was sent to you in error and the
e-mail
contains patient information, please contact the Partners Compliance
HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in
error
but does not contain patient information, please contact the sender and
properly
dispose of the e-mail.




________________________________
Notice: This UI Health Care e-mail (including attachments) is covered by
the
Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is
confidential and
may be legally privileged.  If you are not the intended recipient, you
are
hereby notified that any retention, dissemination, distribution, or
copying of
this communication is strictly prohibited.  Please reply to the sender
that you
have received the message in error, then delete it.  Thank you.
________________________________

_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to
[hidden email] with unsubscribe as the
subject



________________________________
Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged.  If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited.  Please reply to the sender that you have received the message in error, then delete it.  Thank you.
________________________________
_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject

Jim Miller
Senior Scientist
GE Research 
Interventional and Therapy

GE imagination at work




Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged.  If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited.  Please reply to the sender that you have received the message in error, then delete it.  Thank you.

_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject