[Insight-users] SimpleITK Build Issues VS 2008 (x64)

Scott Johnson Scott.Johnson at neuwave.com
Tue Apr 3 11:48:08 EDT 2012


At this point I don't have a working copy of SimpleITK.  I don't believe that Dan has had the opportunity to put up the version he was able to build.  I won't be able to get to it until next week anyway.

I appreciate everyone's help.

                                -- Scott

From: Bradley Lowekamp [mailto:blowekamp at mail.nih.gov]
Sent: Tuesday, April 03, 2012 9:06 AM
To: Scott Johnson
Cc: itk (Insight-users at itk.org)
Subject: Re: [Insight-users] SimpleITK Build Issues VS 2008 (x64)

Hello Scott,

This is most definitely progress! I'll update the FAQ to include this very important note about SP1, and recommend installing SP1 over TR1 feature pack.

When we have addressed this bug in the repository you will be ready to go to compile SimpleITK. Until then I hope you have gotten the version compiled with VS10 either from Dan, or compiling yourself. I hope that this is enough to get going with SimpleITK until this compilation issue is resolved. Please let up know if you need further help.

Thanks,
Brad

On Apr 2, 2012, at 4:29 PM, Scott Johnson wrote:


An update.

I'm now up to the point where I'm getting the errors called out in the bug.  i.e. the size of the .lib is too large.  I haven't decided if that is progress or not.

I also believe I have solved the issue with VC2008FeaturePack.exe not installing.  The short answer is that it isn't supposed to.  Everything in the feature pack is included in SP1 including TR1. (http://blogs.msdn.com/b/vcblog/archive/2008/08/11/tr1-fixes-in-vc9-sp1.aspx)

Thanks

                                -- Scott

From: insight-users-bounces at itk.org<mailto:insight-users-bounces at itk.org> [mailto:insight-users-bounces at itk.org] On Behalf Of Scott Johnson
Sent: Monday, April 02, 2012 9:24 AM
To: Bradley Lowekamp
Cc: itk (Insight-users at itk.org<mailto:Insight-users at itk.org>)
Subject: Re: [Insight-users] SimpleITK Build Issues VS 2008 (x64)

Thanks Brad.  That got me a lot further.  I'm through CMake configuration and generation and it's building now.  I'll keep you posted on my progress.

                                -- Scott

From: Bradley Lowekamp [mailto:blowekamp at mail.nih.gov]
Sent: Monday, April 02, 2012 9:01 AM
To: Scott Johnson
Cc: Dan Mueller; itk (Insight-users at itk.org<mailto:Insight-users at itk.org>)
Subject: Re: [Insight-users] SimpleITK Build Issues VS 2008 (x64)

Scott,

I just checked my 64-bit VS installation and the path is slightly different:

C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include

I have updated the FAQ with this change.

Brad

On Apr 2, 2012, at 9:42 AM, Scott Johnson wrote:

Hello Bradley,

Thanks for the pointers.

I checked the naming of my C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdint.h and it is correct.

I'm running the "Professional Edition" of Visual Studio 2008 if that makes a difference.  I am also attempting to build the shared libraries but haven't been able to get past CMake.  I need to figure out why the FeaturePack install is failing.  Dan also gave me some pointers on how to build the libraries with 2010 and run with 2008.

Thanks again for your help.

                                -- Scott

From: Bradley Lowekamp [mailto:blowekamp at mail.nih.gov]
Sent: Saturday, March 31, 2012 1:06 PM
To: Scott Johnson
Cc: Dan Mueller; itk (Insight-users at itk.org<mailto:Insight-users at itk.org>)
Subject: Re: [Insight-users] SimpleITK Build Issues VS 2008 (x64)

Hello Scott,

Getting stdint.h and TR1 should be the easy part. I unfortunately don't have access to VS 2009 until Monday, so I can't double check these things for you. I have installed and configured virtual machines many times with VS 2008. I never had trouble installing the TR1 feature pack. The only time I had trouble with stdint, was when the web browser added an extensions. So please right-click on the file and look at the properties to verify it has the correct name. The check_include_file_cxx cmake function performs a try_compile on a cxx file to check if the header is found. The compiler should not be invoked with additional include paths at this point, so it's just going to looking in the standard system locations.

The hard part... As Dan pointed to in the fact, we are having problems compiling with VS9 handling the size of the intermediate static libraries. There are some heroic efforts people have gone to get it work with this compiler[1]. Additionally in the experimental developmental branch we are trying different ways to break up the libraries to over come this limitation. On the other hand, I believe that it should be possible to build ITK with shared libraries and SimpelITK with share libraries to over come this limit  as well. However, afterward you'll have to manage of ITK shared libraries along with the SimpleITK libraries and the C Sharp managed library. I have not verified this shared library approach, but will do so on Monday. However, I don't really recommend any of these approach to those who are not extremely motivated.

So the recommendations I have are:

1) Switch so VS10, The freely available express edition should be compatible with precompiled C#. This should be the easiest.
2) Wait a couple weeks to see if the libraries can be refactored, to over come the limitations of this compiler.
3) Figure out how to use VS10 to compile SimpleITK c# for .Net 2.0
4) Delve into getting it to work on VS9 wither with magic flags, the experimental branch, or with build ITK and SimpleITK with shared libraries.

[1] https://itk.icts.uiowa.edu/jira/browse/SIMPLEITK-216


Please let up know if you have further problems or success, and good luck,
Bradley Lowekamp

========================================================
Bradley Lowekamp
Medical Science and Computing for
Office of High Performance Computing and Communications
National Library of Medicine
blowekamp at mail.nih.gov<mailto:blowekamp at mail.nih.gov>

On Mar 31, 2012, at 11:05 AM, Scott Johnson wrote:



Thanks Dan.

Where is cmake looking to find stdint.h?

                        -- Scott

-----Original Message-----
From: Dan Mueller [mailto:dan.muel at gmail.com]
Sent: Friday, March 30, 2012 6:43 PM
To: Scott Johnson
Cc: itk (Insight-users at itk.org<mailto:Insight-users at itk.org>)
Subject: Re: [Insight-users] SimpleITK Build Issues VS 2008 (x64)

Hi Scott,

Yes, I also had discovered this. Sorry for not making this clear in my email.

Just to be clear, the options are:
1. Change SimpleITK so that VS10 builds do no use .NET 4.0 (meaning pre-built SimpleITKCSharpManaged.dll will be usable with VS9). I'm not going to be able to address this any time soon.
2. Get your VS9 environment to support TR1/C99, then build SimpleITK yourself.
(3. Switch to VS10.)



If I can past the CMake issues I'll feel more confident that I can get it to build.
BTW: The issue you report is not an issue with the CMake build per se, but an issue with your compiler -- the CMake build is simply doing some checks and has determined that your build environment does not meet the requirements for SimpleITK.

Good luck.

Cheers, Dan

On 31 March 2012 09:40, Scott Johnson <Scott.Johnson at neuwave.com<mailto:Scott.Johnson at neuwave.com>> wrote:


Hi Again,

With a little research I have found that Visual Studio 2008 is not compatible with .Net Framework 4.0.  Therefore the pre-built dlls cannot be used under VS 2008.

Back to trying to build it.

Thanks

               -- Scott

-----Original Message-----
From: insight-users-bounces at itk.org<mailto:insight-users-bounces at itk.org>
[mailto:insight-users-bounces at itk.org] On Behalf Of Scott Johnson
Sent: Friday, March 30, 2012 6:00 PM
To: Dan Mueller
Cc: itk (Insight-users at itk.org<mailto:Insight-users at itk.org>)
Subject: Re: [Insight-users] SimpleITK Build Issues VS 2008 (x64)

Thanks for the response Dan.

I'll try to target .NET 4.0 to see if I can use the prebuilt dlls.

If I can past the CMake issues I'll feel more confident that I can get it to build.

               -- Scott

-----Original Message-----
From: Dan Mueller [mailto:dan.muel at gmail.com]
Sent: Friday, March 30, 2012 4:44 PM
To: Scott Johnson
Cc: itk (Insight-users at itk.org<mailto:Insight-users at itk.org>); Bradley Lowekamp
Subject: Re: [Insight-users] SimpleITK Build Issues VS 2008 (x64)

Hi Scott,

Sorry to hear you are experiencing issues with building the SimpleITK C# wrappers.

I tried to use SimpleITKCSharpManaged.dll from SimpleITK-0.4.0-CSharp-Win64-anycpu.zip in a Visual Studio 2008 project and experienced the same issue you described:
Could not load file or assembly 'SimpleITKCSharpManaged.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.

The issue is not that the assembly was built by Visual Study 2010 (which it was) but rather it was built to target the .NET 4.0 runtime.
AFAIK it should be possible to build with Visual Studio 2010 but to target the .NET 2.0 runtime for example. That said, I am totally flat out at the moment and don't know when I will get a chance to do this... So you will probably get faster results if you build yourself.

The SimpleITK FAQ does say that Visual Studio 9 is currently
problematic

http://www.itk.org/Wiki/ITK_Release_4/SimpleITK/FAQ#Currently_Problema
tic but looking at the SimpleITK dashboard
   http://open.cdash.org/index.php?project=simpleITK
I notice there is one Visual Studio 2008 (aka Visual Studio 9) build (an x86 build), so it does seem possible to build SimpleITK with VS9.

Brad owns this build machine, so I've cc'd him. Hopefully he can provide some advice on how to setup VS9 to support TR1/C99.

Cheers, Dan

On 31 March 2012 05:34, Scott Johnson <Scott.Johnson at neuwave.com<mailto:Scott.Johnson at neuwave.com>> wrote:
Hello,



I've been attempting to use SimpleITK under Windows 7 (x64) and
Visual Studio 2008 and CMake 2.8.5.  The goal is to use the C# wrappers.



First, I downloaded SimpleITK-0.4.0-CSharp-Win64-anycpu.zip and
attempted to add a reference to SimpleITKCSharpManaged.dll to my
solution.  VS didn't recognize the dll as being valid.  (Now I'm
assuming that the dll was built against VS 2010 and isn't backward
compatible.)



I then downloaded the source tree with the intent to build it myself.
(I've tried with both the source package from sourceforge and
checking out the most recent code from GIT.)  I have been attempting
to follow the directions at http://www.itk.org/Wiki/ITK_Release_4/SimpleITK/FAQ.



When I first ran CMake I was given an error reading:



CMake Error at CMakeLists.txt:117 (message):

SimpleITK requires usage of C99 stdint.

It may be available as an optional download for your compiler.

Please see the FAQ for details and to see if your compiler is supported.

http://www.itk.org/Wiki/ITK_Release_4/SimpleITK/FAQ#Do_I_need_to_down
l
oad_an_optional_package_for_C99.3F



I downloaded the Visual C++ 2008 Feature Pack Release via the link on
the web site and attempted to install it.  It failed because the
installer said that I didn't have the proper features installed for
the update.  I also grabbed the stdint.h file and copied it to the
location called out in the directions.  I've searched for a 64 bit
version of this feature pack with no luck.  I did find Microsoft
Visual C++ 2008 Feature Pack Redistributable Package (x64) but that didn't help.



CMake continues to give me errors and I've tracked the initial error
to a line in the CMakeLists.txt file which reads:

check_include_file_cxx( stdint.h SITK_HAS_STDINT_H )

I've been looking around to find out what paths are searched by
check_include_file_cxx to no avail.  But evidently C:\Program
Files\Microsoft Visual Studio 9/0\VC\include isn't one of them.



If possible I'd like to get this to work under VS 2008 and I'd
appreciate any help I can get.  Right now I'm out of ideas as to what is going wrong.



Thanks



                                -- Scott



========================================================
Bradley Lowekamp
Medical Science and Computing for
Office of High Performance Computing and Communications
National Library of Medicine
blowekamp at mail.nih.gov<mailto:blowekamp at mail.nih.gov>





========================================================

Bradley Lowekamp

Medical Science and Computing for

Office of High Performance Computing and Communications

National Library of Medicine

blowekamp at mail.nih.gov<mailto:blowekamp at mail.nih.gov>




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20120403/bcc7af4d/attachment-0001.htm>


More information about the Insight-users mailing list