trac tickets and alternative build system

Adam Goode agoode at andrew.cmu.edu
Mon Apr 26 16:02:22 EDT 2010


On 04/26/2010 11:50 AM, Hauke Heibel wrote:
> Hi,
> 
> I tried to submit a track ticket today though it seems to have failed.
> But I can anyways be a little bit more verbose over here.
> 

Hmm, this should work. I just tested it. Did you solve the captcha?

> I am trying to compile OpenSlide with Visual Studio 2010. For that
> matter, I forked the git repository and started to create a CMake
> configuration. I am not yet quite done but I am sure that it will work
> even though I cannot yet compile with the most recent dependencies.
> 

Very cool. We have never tried to compile with VS, but it would be good
to try. I can tell you that we use some C99 features that VS do not
support. You have encountered some of these below, I see.

> The first question is whether you are even interested in a CMake build
> system? I think it makes a lot of sense since only then you will be
> able to easily support build targets as e.g. Visual Studio without a
> lot of manual modifications CMake is open source and allows you to aim
> at a wide range of build targets.
> 

I have used CMake before, I am not against using CMake for OpenSlide,
but I would prefer to see how well it works for you first. I would even
be open to including your CMake support in the repository, but secondary
to the existing configure stuff, so that people could try it out.

> Talking about my recent experiences, I compiled (and downloaded)
> 
> jpeg lib (version 7.0 according to jpeglig.h)
> tiff lib (versions 42 and 43 for bigtiff according to the tiff.h)
> zlib (version 1.2.3 according to zlib.h)
> openjpeg (version 1.3.0 according to openjpeg.h)
> gtk+ (just downloaded 32bit and 64bit pre-built binaries, version 2.0)
> 
> all in 64 bit since I am particularly interested in 64 bit builds.
> 
> I've seen on the web that you have a 32bit binary built for Windows
> but as I said, I am more interested in a 64bit version.
> 

I would definitely like to see 64-bit support on Windows someday.

> As mentioned before, I have quite a few issues when trying to build
> the library and I am going to name a few of them. Since Windows
> binaries are on your road map I hope you are interested in solutions
> as much as I am.
> 
> 1) the git repository is missing config.h.in (though it is present in
> the tarball)
> 

Yes, that is a generated file and is not checked in. (Use autoreconf -i
to generate it.)

> 2) stdbool.h and inttypes.h are not available under MSVC
> 

Yes, these are C99 files.

> I can create the config.h with CMake such that this is reflected
> though the defines from config.h are not used in the code. Even when
> they are reflected, MSVC is not really C99 compliant when code is
> compiled as C code thus I am wondering whether it were possible to
> compile the code as C++ code. In that case, those headers just need to
> be disabled for MSVC builds.
> 
> 3) MSVC does make problems with implicit casting.
> 
> This can easily be fixed by adding explicit C-style casts like e.g.
> (struct my_src_mgr *) and I already did that in my fork at many
> places.
> 

This is not a bad idea, C++ is more strict here. It would be ok to fix this.

> 4) PRId64 is not defined and I have no idea how to fix it.
> 

This is a C99 way to get the printf format string for a 64-bit signed
number.

> 5) void __attribute ((constructor)) _openslide_init(void);
> 
> The constructor attribute is not supported under MSCV. I temporarily
> hacked around it by declaring the function as void
> _openslide_init(void);
> 

Yeah, for VS, there must be some way to annotate functions to be run as
DLL constructors. This can be abstracted in openslide-features.h like
OPENSLIDE_PUBLIC is.

> 6) struct _openslide_cache_key key = { .x = x, .y = y, .layer = layer };
> 
> is not supported. As a workaround I created the temporary and set the
> three values manually. ;)
> 

Yup, another C99 thing.

> Ok, I think that's that for a start. I am still wondering how you
> compiled your 32 bit binaries under Windows. Did you do it with
> Cygwin?
> 

I used MinGW. This is greatly preferred over Cygwin as it generates
native Windows applications without the Cygwin layer. I used the mingw32
support in Fedora to cross compile.

> Well, and even though it is not yet running over here thank you for
> the great work!
> 

Great to hear!


Hopefully moving forward, the CoApp project from Microsoft
http://coapp.org/ should help OpenSlide and other programs to work
better on Windows. I look forward to making CoApp packages someday.



Adam

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
Url : http://lists.andrew.cmu.edu/pipermail/openslide-users/attachments/20100426/0eb741e3/attachment.bin 


More information about the openslide-users mailing list