[MINC-users] redefinitions in volume_io/basic.h, multidim.h causing compilation errors on Windows

Rupert Brooks rupe.brooks at gmail.com
Tue Sep 23 09:12:37 EDT 2008


Ok -

So heres my adventurous tale of building MINC tools natively on
Windows XP with Visual Studio 2005 express.  My reason for doing this
was that I wanted to be able to read MINC files using the itkMINC2IO.
Not surprisingly that requires linking against the minc2 library.

For just general use of the minc tools under windows, a cygwin build
is probably my recommendation for people.

I've put the full set of binaries that I've created on my website for
download if people need them.  I will make some effort to keep these
up to date. http://www.rupertbrooks.ca/code.html  I'll try to help out
anyone who wants to push this project forward, but i can't spend too
much time on it.  Day job and all ya know.

1. MINC is dependent on HDF, SZ, Z, and NETCDF.
            - I got HDF5, SZ and ZLIB from the hdf 5 site.
            - The NETCDF from unidata did not come with netcdf.h,
oddly enough.   I used the binary and .h from the 2005 installer
package that Leila Baghdadi made.

2. I configured a Visual Studio solution using CMAKE.  The CMakeLists
file in the minc distribution was modified as described below.   The
CMAKE settings are:
USE_PARSERS=OFF
HDF5_LIBRARY=hdf5dll.lib
NETCDF_LIBRARY=netcdf.lib
SZ_LIBRARY=szlibdll.lib
Z_LIBRARY=zlib1.dll

I found it was absolutely necessary to build against the DLL versions
of things.  I would have preferred to build static - my application
would have been fat, but i could have passed the binaries around much
more easily.  Anyway, i never managed to get static linking to these
required libraries to work.

Turning the parsers off was also necessary.   I tried fairly hard to
find a flex for windows native builds.  The thing is - besides the
parser, you need to link against the flex library.  This seems to be
pretty much ignored by purveyors of native flex tools.  Theres a few
out there that i tried, and they gave me completely different results
for simple programs vs flex on unix, so i abandoned the search.

3. It is necessary to change the hdf_convenience.c to be ANSI
compliant.  See changes below.  This should not interfere with
building on any other system.

4. I removed the dll_export stuff in the minc api.  I wanted a static
build, and i had trouble with the DLL build anyway.

5.  I fired up visual studio and build the solution, in both release
and debug modes.  Due to the use of Debug postfix in the CMake, i end
up with minc.lib and mincd.lib for optimized and debug respectively.
There are 3 projects that dont build (xfminvert, dcm2mnc, acr_nema).
After some investigation, i saw that they made heavy use of POSIX
specific calls from unistd.h, etc, and I figured the porting effort
was too hard for me.  Particularly because i didnt really need these
tools.


TODO:
Theres lots of things that could improve this.  Config.h is partly
build through CMake tests, mainly due to Andrew, and partly through
direct hacks (due to me).  Proper testing would be the way to go.

Under Unix theres a fair number of compiler warnings.  Under Win32,
the compiler is freaking out.  There are hundreds of warnings.  I
think that most of these are spurious.   Nevertheless i dont like
spurious warnings, if for no other reason than they hide the real
problems.   I also suspect there are some real issues lurking in among
the spurious ones.

There are no code tests in WIN32.  I really think that some serious
test scripts and data should be added

Rupert

CODE CHANGES
(apologies for the length of this)

diff -d -r minc-2.0.15 cleanunpack/minc-2.0.15

diff -d -r minc-2.0.15/CMakeLists.txt cleanunpack/minc-2.0.15/CMakeLists.txt
1,32c1,31
< # CMakeFiles.txt for the MINC2 library
< #
< # Andrew Janke - a.janke at gmail.com
< CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
< PROJECT(libminc2)
<
< SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake-modules")
<
<
< #ADD_SUBDIRECTORY( testdir )
< #ADD_SUBDIRECTORY( doc )
<
<
< # Packaging defines
< SET(CPACK_GENERATOR TGZ)
< SET(CPACK_PACKAGE_VERSION_MAJOR 2)
< SET(CPACK_PACKAGE_VERSION_MINOR 0)
< SET(CPACK_PACKAGE_VERSION_PATCH 15)
< INCLUDE(CPack)
<
<
< SET(PACKAGE "minc")
< SET(PACKAGE_BUGREPORT "a.janke at gmail.com")
<
< SET(PACKAGE_NAME "minc")
< SET(PACKAGE_VERSION
"${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
< SET(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
<
< SET(CMAKE_DEBUG_POSTFIX "d")
<
< # yes, build as minc2
< SET(MINC2 "1")
---
> # CMakeFiles.txt for the MINC2 library
> #
> # Andrew Janke - a.janke at gmail.com
>
> PROJECT(libminc2)
>
> SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake-modules")
>
>
> #ADD_SUBDIRECTORY( testdir )
> #ADD_SUBDIRECTORY( doc )
>
>
> # Packaging defines
> SET(CPACK_GENERATOR TGZ)
> SET(CPACK_PACKAGE_VERSION_MAJOR 2)
> SET(CPACK_PACKAGE_VERSION_MINOR 0)
> SET(CPACK_PACKAGE_VERSION_PATCH 14)
> INCLUDE(CPack)
>
>
> SET(PACKAGE "minc")
> SET(PACKAGE_BUGREPORT "a.janke at gmail.com")
>
> SET(PACKAGE_NAME "minc")
> SET(PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
> SET(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
>
>
> # yes, build as minc2
> SET(MINC2 "1")
58,66c57
< INCLUDE_DIRECTORIES( ${NETCDF_INCLUDE_DIR} ${HDF5_INCLUDE_DIR}
${CMAKE_BINARY_DIR})
< FIND_LIBRARY(SZ_LIBRARY NAMES sz libszdll
<   PATHS /usr/lib DOC "path to the sz library")
< FIND_LIBRARY(Z_LIBRARY NAMES z libz
<   PATHS /usr/lib DOC "path to the z library")
< IF(NOT UNIX)
< ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -DDLL_NETCDF -D_POSIX_
-D_HDF5USEDLL_ -D_USE_MATH_DEFINES)
< #ADD_DEFINITIONS( -D_POSIX_  -D_USE_MATH_DEFINES)
< ENDIF(NOT UNIX)
---
> INCLUDE_DIRECTORIES( ${NETCDF_INCLUDE_DIR} ${HDF5_INCLUDE_DIR} )
69c60
< CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/config.h.cmake
${CMAKE_BINARY_DIR}/config.h)
---
> CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/config.h.cmake ${CMAKE_SOURCE_DIR}/config.h)
72c63
< CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/epm-header.in
${CMAKE_BINARY_DIR}/epm-header)
---
> CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/epm-header.in ${CMAKE_SOURCE_DIR}/epm-header)
118c109
< ADD_LIBRARY(minc2 ${minc1_LIB_SRCS} ${minc2_LIB_SRCS})
---
> ADD_LIBRARY(minc2 STATIC ${minc1_LIB_SRCS} ${minc2_LIB_SRCS})
173c164
< ADD_LIBRARY(volume_io2 ${volume_io2_LIB_SRCS})
---
> ADD_LIBRARY(volume_io2 STATIC ${volume_io2_LIB_SRCS})
diff -d -r minc-2.0.15/config.h.cmake cleanunpack/minc-2.0.15/config.h.cmake
2,3d1
< #ifndef CONFIG_H_INCG
< #define CONFIG_H_INCG
17,49d14
<
< #ifdef WIN32
< #undef HAVE_MKSTEMP
< #define HAVE_FCNTL_H 1
< #define HAVE_FLOAT_H 1
< #define HAVE_MEMORY_H 1
< #define HAVE_STDINT_H 1
< #define HAVE_STDLIB_H 1
< #define HAVE_STRING_H 1
< #define HAVE_SYS_STAT_H 1
< #define HAVE_SYS_TYPES_H 1
< #define HAVE_TEMPNAM 1
< #define HAVE_TMPNAM 1
< #define STDC_HEADERS 1
< #define sleep(x) _sleep(x)
< #define snprintf _snprintf
< #define strncasecmp(x,y,z) strnicmp(x,y,z)
< #define tempnam(x,y) _tempnam(x,y)
<
< int __stdcall gethostname(char *name, int namelen);
<
< /* Quick implmentation of rint() for Intel, since thoughtless Microsoft
<  * programmers failed to provide us with one...
<  */
< __inline double rint(double dblvar)
< {
<   __asm fld dblvar
<   __asm frndint
<   __asm fst dblvar
<   return dblvar;
< }
< #endif
< #endif
\ No newline at end of file
diff -d -r minc-2.0.15/conversion/CMakeLists.txt
cleanunpack/minc-2.0.15/conversion/CMakeLists.txt
1,82c1,77
< # CMakeFiles.txt for the MINC2 conversion progs
< #
< # Andrew Janke - a.janke at gmail.com
<
< LINK_DIRECTORIES(../)
< LINK_LIBRARIES( optimized minc2 debug minc2d  ${NETCDF_LIBRARY}
${HDF5_LIBRARY} ${SZ_LIBRARY} ${Z_LIBRARY})
< IF(NOT UNIX)
< LINK_LIBRARIES(ws2_32)
< ADD_DEFINITIONS(-DDLL_NETCDF -D_POSIX_ -D_HDF5USEDLL_ -D_USE_MATH_DEFINES)
< ENDIF(NOT UNIX)
<
< ADD_DEFINITIONS(-DHAVE_CONFIG_H)
<
<
< # conversion progs (and libraries)
< INCLUDE_DIRECTORIES(Acr_nema)
< ADD_LIBRARY(acr_nema STATIC
<    Acr_nema/acr_io.c
<    Acr_nema/dicom_client_routines.c
<    Acr_nema/dicom_network.c
<    Acr_nema/element.c
<    Acr_nema/file_io.c
<    Acr_nema/globals.c
<    Acr_nema/group.c
<    Acr_nema/message.c
<    Acr_nema/value_repr.c)
< #INSTALL(TARGETS acr_nema DESTINATION lib)
<
< ADD_EXECUTABLE(dcm2mnc
<    dcm2mnc/dcm2mnc.c
<    dcm2mnc/dicom_to_minc.c
<    dcm2mnc/siemens_to_dicom.c
<    dcm2mnc/dicom_read.c
<    dcm2mnc/minc_file.c
<    dcm2mnc/progress.c
<    dcm2mnc/string_to_filename.c)
< TARGET_LINK_LIBRARIES(dcm2mnc acr_nema )
<
< ADD_EXECUTABLE(ecattominc
<    ecattominc/ecattominc.c
<    ecattominc/insertblood.c
<    ecattominc/ecat_file.c
<    ecattominc/machine_indep.c
<    )
< ADD_EXECUTABLE(minctoecat
<    minctoecat/minctoecat.c
<    minctoecat/ecat_write.c
<    minctoecat/machine_indep.c
<    )
< TARGET_LINK_LIBRARIES(minctoecat volume_io2 minc2)
<
< ADD_EXECUTABLE(mnc2nii
<    nifti1/mnc2nii.c
<    nifti1/nifti1_io.c
<    nifti1/znzlib.c
<    )
< ADD_EXECUTABLE(nii2mnc
<    nifti1/nii2mnc.c
<    nifti1/nifti1_io.c
<    nifti1/znzlib.c
<    )
< TARGET_LINK_LIBRARIES(nii2mnc volume_io2 minc2)
<
< ADD_EXECUTABLE(upet2mnc
<    micropet/upet2mnc.c
<    )
<
< ADD_EXECUTABLE(vff2mnc
<    vff2mnc/vff2mnc.c
<    )
<
<
< # install progs
< INSTALL(TARGETS
<    dcm2mnc
<    ecattominc
<    minctoecat
<    mnc2nii
<    nii2mnc
<    upet2mnc
<    vff2mnc
<    DESTINATION bin)
---
> # CMakeFiles.txt for the MINC2 conversion progs
> #
> # Andrew Janke - a.janke at gmail.com
>
> LINK_DIRECTORIES(../)
> LINK_LIBRARIES( minc2 ${NETCDF_LIBRARY} ${HDF5_LIBRARY} )
> ADD_DEFINITIONS(-DHAVE_CONFIG_H)
>
>
> # conversion progs (and libraries)
> INCLUDE_DIRECTORIES(Acr_nema)
> ADD_LIBRARY(acr_nema STATIC
>    Acr_nema/acr_io.c
>    Acr_nema/dicom_client_routines.c
>    Acr_nema/dicom_network.c
>    Acr_nema/element.c
>    Acr_nema/file_io.c
>    Acr_nema/globals.c
>    Acr_nema/group.c
>    Acr_nema/message.c
>    Acr_nema/value_repr.c)
> #INSTALL(TARGETS acr_nema DESTINATION lib)
>
> ADD_EXECUTABLE(../dcm2mnc
>    dcm2mnc/dcm2mnc.c
>    dcm2mnc/dicom_to_minc.c
>    dcm2mnc/siemens_to_dicom.c
>    dcm2mnc/dicom_read.c
>    dcm2mnc/minc_file.c
>    dcm2mnc/progress.c
>    dcm2mnc/string_to_filename.c)
> TARGET_LINK_LIBRARIES(../dcm2mnc acr_nema )
>
> ADD_EXECUTABLE(../ecattominc
>    ecattominc/ecattominc.c
>    ecattominc/insertblood.c
>    ecattominc/ecat_file.c
>    ecattominc/machine_indep.c
>    )
> ADD_EXECUTABLE(../minctoecat
>    minctoecat/minctoecat.c
>    minctoecat/ecat_write.c
>    minctoecat/machine_indep.c
>    )
> TARGET_LINK_LIBRARIES(../minctoecat volume_io2 minc2)
>
> ADD_EXECUTABLE(../mnc2nii
>    nifti1/mnc2nii.c
>    nifti1/nifti1_io.c
>    nifti1/znzlib.c
>    )
> ADD_EXECUTABLE(../nii2mnc
>    nifti1/nii2mnc.c
>    nifti1/nifti1_io.c
>    nifti1/znzlib.c
>    )
> TARGET_LINK_LIBRARIES(../nii2mnc volume_io2 minc2)
>
> ADD_EXECUTABLE(../upet2mnc
>    micropet/upet2mnc.c
>    )
>
> ADD_EXECUTABLE(../vff2mnc
>    vff2mnc/vff2mnc.c
>    )
>
>
> # install progs
> INSTALL(TARGETS
>    ../dcm2mnc
>    ../ecattominc
>    ../minctoecat
>    ../mnc2nii
>    ../nii2mnc
>    ../upet2mnc
>    ../vff2mnc
>    DESTINATION bin)
Only in minc-2.0.15: epm-header
diff -d -r minc-2.0.15/libsrc/hdf_convenience.c
cleanunpack/minc-2.0.15/libsrc/hdf_convenience.c
1266,1267d1265
< 	hsize_t val;
< 	int unit_size;
1344,1347c1342,1344
< 			
< 			//hsize_t val;
< 			val = 1;
<             unit_size = nctypelen( vartype );
---
>
>             hsize_t val = 1;
>             int unit_size = nctypelen( vartype );
diff -d -r minc-2.0.15/libsrc/image_conversion.c
cleanunpack/minc-2.0.15/libsrc/image_conversion.c
317d316
< 	int new_icv;
341c340
<    //int new_icv;
---
>    int new_icv;
diff -d -r minc-2.0.15/libsrc/minc.h cleanunpack/minc-2.0.15/libsrc/minc.h
465c465
< //#if defined(_MSC_VER)
---
> #if defined(_MSC_VER)
469,470c469,470
< //#define MNCAPI __declspec(dllimport)
< //#else
---
> #define MNCAPI __declspec(dllimport)
> #else
472c472
< //#endif /* _MSC_VER not defined */
---
> #endif /* _MSC_VER not defined */
diff -d -r minc-2.0.15/progs/CMakeLists.txt
cleanunpack/minc-2.0.15/progs/CMakeLists.txt
9,18c9
< #IF(UNIX)
< LINK_LIBRARIES( optimized minc2 debug minc2d ${NETCDF_LIBRARY}
${HDF5_LIBRARY} ${SZ_LIBRARY} ${Z_LIBRARY})
< #ELSE(UNIX)
< #LINK_LIBRARIES( minc2 ${NETCDF_LIBRARY} ${HDF5_LIBRARY} szlibdll zlib)
< IF(NOT UNIX)
< LINK_LIBRARIES(ws2_32)
< # winsoc needed for gethostname
< ADD_DEFINITIONS(-DDLL_NETCDF -D_POSIX_ -D_HDF5USEDLL_ -D_USE_MATH_DEFINES)
< #ADD_DEFINITIONS(-D_POSIX_  -D_USE_MATH_DEFINES)
< ENDIF(NOT UNIX)
---
> LINK_LIBRARIES( minc2 ${NETCDF_LIBRARY} ${HDF5_LIBRARY} )
21,22c12,13
< #SET(BISON_FIND_REQUIRED)
< #SET(FLEX_FIND_REQUIRED)
---
> SET(BISON_FIND_REQUIRED)
> SET(FLEX_FIND_REQUIRED)
26,31d16
< IF(BISON_FOUND AND FLEX_FOUND)
<     SET(USE_PARSERS TRUE CACHE BOOL "Build targets needing flex and
bison (minccalc,mincgen)")
< ELSE(BISON_FOUND AND FLEX_FOUND)
<     SET(USE_PARSERS FALSE CACHE BOOL "Build targets needing flex and
bison (minccalc,mincgen)")
< ENDIF(BISON_FOUND AND FLEX_FOUND)
<
33,34c18,19
< ADD_EXECUTABLE(invert_raw_image mincview/invert_raw_image.c)
< ADD_EXECUTABLE(mincaverage mincaverage/mincaverage.c)
---
> ADD_EXECUTABLE(../invert_raw_image mincview/invert_raw_image.c)
> ADD_EXECUTABLE(../mincaverage mincaverage/mincaverage.c)
36,45c21,24
< # these targets require bison and flex to build
< IF(USE_PARSERS)
< BISON_TARGET(minccalc minccalc/gram.y
${CMAKE_CURRENT_BINARY_DIR}/gram.c COMPILE_FLAGS "--debug")
< FLEX_TARGET(minccalc minccalc/lex.l ${CMAKE_CURRENT_BINARY_DIR}/lex.c)
< SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/gram.c
<     PROPERTIES COMPILE_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR}/minccalc")
< SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/lex.c
<     PROPERTIES COMPILE_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR}/minccalc")
< ADD_EXECUTABLE(minccalc minccalc/minccalc.c
<                            ${CMAKE_CURRENT_BINARY_DIR}/gram.c
---
> BISON_TARGET(../minccalc minccalc/gram.y minccalc/gram.c COMPILE_FLAGS "--debug")
> FLEX_TARGET(../minccalc minccalc/lex.l minccalc/lex.c)
> ADD_EXECUTABLE(../minccalc minccalc/minccalc.c
>                            minccalc/gram.c
48c27
<                            ${CMAKE_CURRENT_BINARY_DIR}/lex.c
---
>                            minccalc/lex.c
55,77c34,36
< BISON_TARGET(mincgen mincgen/ncgentab.y
${CMAKE_CURRENT_BINARY_DIR}/ncgentab.c)
< FLEX_TARGET(mincgen mincgen/ncgenyy.l ${CMAKE_CURRENT_BINARY_DIR}/ncgenyy.c)
< SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/ncgentab.c
<     PROPERTIES COMPILE_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR}/mincgen")
< SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/ncgenyy.c
<     PROPERTIES COMPILE_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR}/mincgen")
< ADD_EXECUTABLE(mincgen mincgen/main.c
<                           mincgen/escapes.c
<                           mincgen/genlib.c
<                           mincgen/getfill.c
<                           mincgen/init.c
<                           mincgen/load.c
<                           ${CMAKE_CURRENT_BINARY_DIR}/ncgentab.c
<                           ${CMAKE_CURRENT_BINARY_DIR}/ncgenyy.c)
< INSTALL(TARGETS
<    minccalc
<    mincgen
<    DESTINATION bin)
< ENDIF(USE_PARSERS)
<
< ADD_EXECUTABLE(mincconcat mincconcat/mincconcat.c)
< ADD_EXECUTABLE(mincconvert mincconvert/mincconvert.c)
< ADD_EXECUTABLE(minccopy minccopy/minccopy.c)
---
> ADD_EXECUTABLE(../mincconcat mincconcat/mincconcat.c)
> ADD_EXECUTABLE(../mincconvert mincconvert/mincconvert.c)
> ADD_EXECUTABLE(../minccopy minccopy/minccopy.c)
79c38
< ADD_EXECUTABLE(mincdump mincdump/mincdump.c
---
> ADD_EXECUTABLE(../mincdump mincdump/mincdump.c
83,86c42,45
< ADD_EXECUTABLE(mincexample1 mincexample/mincexample1.c)
< ADD_EXECUTABLE(mincexample2 mincexample/mincexample2.c)
< ADD_EXECUTABLE(mincexpand mincexpand/mincexpand.c)
< ADD_EXECUTABLE(mincextract mincextract/mincextract.c)
---
> ADD_EXECUTABLE(../mincexample1 mincexample/mincexample1.c)
> ADD_EXECUTABLE(../mincexample2 mincexample/mincexample2.c)
> ADD_EXECUTABLE(../mincexpand mincexpand/mincexpand.c)
> ADD_EXECUTABLE(../mincextract mincextract/mincextract.c)
87a47,56
> BISON_TARGET(../mincgen mincgen/ncgentab.y mincgen/nccentab.c)
> FLEX_TARGET(../mincgen mincgen/ncgenyy.l mincgen/ncgenyy.c)
> ADD_EXECUTABLE(../mincgen mincgen/main.c
>                           mincgen/escapes.c
>                           mincgen/genlib.c
>                           mincgen/getfill.c
>                           mincgen/init.c
>                           mincgen/load.c
>                           mincgen/ncgentab.c
>                           mincgen/ncgenyy.c)
89,94c58,63
< ADD_EXECUTABLE(mincinfo mincinfo/mincinfo.c)
< ADD_EXECUTABLE(minclookup minclookup/minclookup.c)
< ADD_EXECUTABLE(mincmakescalar mincmakescalar/mincmakescalar.c)
< ADD_EXECUTABLE(mincmakevector mincmakevector/mincmakevector.c)
< ADD_EXECUTABLE(mincmath mincmath/mincmath.c)
< ADD_EXECUTABLE(minc_modify_header minc_modify_header/minc_modify_header.c)
---
> ADD_EXECUTABLE(../mincinfo mincinfo/mincinfo.c)
> ADD_EXECUTABLE(../minclookup minclookup/minclookup.c)
> ADD_EXECUTABLE(../mincmakescalar mincmakescalar/mincmakescalar.c)
> ADD_EXECUTABLE(../mincmakevector mincmakevector/mincmakevector.c)
> ADD_EXECUTABLE(../mincmath mincmath/mincmath.c)
> ADD_EXECUTABLE(../minc_modify_header minc_modify_header/minc_modify_header.c)
96c65
< ADD_EXECUTABLE(mincresample mincresample/mincresample.c
---
> ADD_EXECUTABLE(../mincresample mincresample/mincresample.c
99c68
< TARGET_LINK_LIBRARIES(mincresample volume_io2)
---
> TARGET_LINK_LIBRARIES(../mincresample volume_io2)
101c70
< ADD_EXECUTABLE(mincreshape mincreshape/mincreshape.c
---
> ADD_EXECUTABLE(../mincreshape mincreshape/mincreshape.c
104,106c73,75
< ADD_EXECUTABLE(mincstats mincstats/mincstats.c)
< ADD_EXECUTABLE(minctoraw minctoraw/minctoraw.c)
< ADD_EXECUTABLE(mincwindow mincwindow/mincwindow.c)
---
> ADD_EXECUTABLE(../mincstats mincstats/mincstats.c)
> ADD_EXECUTABLE(../minctoraw minctoraw/minctoraw.c)
> ADD_EXECUTABLE(../mincwindow mincwindow/mincwindow.c)
108c77
< ADD_EXECUTABLE(rawtominc rawtominc/rawtominc.c
---
> ADD_EXECUTABLE(../rawtominc rawtominc/rawtominc.c
111,112c80,81
< ADD_EXECUTABLE(voxeltoworld coordinates/voxeltoworld.c)
< TARGET_LINK_LIBRARIES(voxeltoworld volume_io2 minc2)
---
> ADD_EXECUTABLE(../voxeltoworld coordinates/voxeltoworld.c)
> TARGET_LINK_LIBRARIES(../voxeltoworld volume_io2 minc2)
114,115c83,84
< ADD_EXECUTABLE(worldtovoxel coordinates/worldtovoxel.c)
< TARGET_LINK_LIBRARIES(worldtovoxel volume_io2 minc2)
---
> ADD_EXECUTABLE(../worldtovoxel coordinates/worldtovoxel.c)
> TARGET_LINK_LIBRARIES(../worldtovoxel volume_io2 minc2)
118,119c87,88
< ADD_EXECUTABLE(transformtags xfm/transformtags.c)
< TARGET_LINK_LIBRARIES(transformtags volume_io2 minc2)
---
> ADD_EXECUTABLE(../transformtags xfm/transformtags.c)
> TARGET_LINK_LIBRARIES(../transformtags volume_io2 minc2)
121,122c90,91
< ADD_EXECUTABLE(xfmconcat xfm/xfmconcat.c)
< TARGET_LINK_LIBRARIES(xfmconcat volume_io2 minc2)
---
> ADD_EXECUTABLE(../xfmconcat xfm/xfmconcat.c)
> TARGET_LINK_LIBRARIES(../xfmconcat volume_io2 minc2)
124,125c93,94
< ADD_EXECUTABLE(xfminvert xfm/xfminvert.c)
< TARGET_LINK_LIBRARIES(xfminvert volume_io2 minc2)
---
> ADD_EXECUTABLE(../xfminvert xfm/xfminvert.c)
> TARGET_LINK_LIBRARIES(../xfminvert volume_io2 minc2)
129,157c98,126
<    invert_raw_image
<    mincaverage
< #   minccalc
<    mincconcat
<    mincconvert
<    minccopy
<    mincdump
< #   mincexample1
< #   mincexample2
<    mincexpand
<    mincextract
< #   mincgen
<    mincinfo
<    minclookup
<    mincmakescalar
<    mincmakevector
<    mincmath
<    minc_modify_header
<    mincresample
<    mincreshape
<    mincstats
<    minctoraw
<    mincwindow
<    rawtominc
<    voxeltoworld
<    worldtovoxel
<    transformtags
<    xfmconcat
<    xfminvert
---
>    ../invert_raw_image
>    ../mincaverage
>    ../minccalc
>    ../mincconcat
>    ../mincconvert
>    ../minccopy
>    ../mincdump
> #   ../mincexample1
> #   ../mincexample2
>    ../mincexpand
>    ../mincextract
>    ../mincgen
>    ../mincinfo
>    ../minclookup
>    ../mincmakescalar
>    ../mincmakevector
>    ../mincmath
>    ../minc_modify_header
>    ../mincresample
>    ../mincreshape
>    ../mincstats
>    ../minctoraw
>    ../mincwindow
>    ../rawtominc
>    ../voxeltoworld
>    ../worldtovoxel
>    ../transformtags
>    ../xfmconcat
>    ../xfminvert
diff -d -r minc-2.0.15/volume_io/Include/volume_io.h
cleanunpack/minc-2.0.15/volume_io/Include/volume_io.h
52,54c52,54
< //#if defined(_MSC_VER)
< //#define       VIOAPI   __declspec(dllimport)
< //#else
---
> #if defined(_MSC_VER)
> #define       VIOAPI   __declspec(dllimport)
> #else
56c56
< //#endif /* _MSC_VER not defined */
---
> #endif /* _MSC_VER not defined */


On Mon, Sep 22, 2008 at 5:30 PM, Andrew Janke <a.janke at gmail.com> wrote:
> Hi Rupert,
>
>> So far, my experience was that to build it natively, i had to make
>> minor mods to hdf_convenience.c to adhere to ANSI c, standards
>> (variable declarations), and i forcibly removed the dll_exports and
>> built it statically.  I got minc2 and volume_io to build, and more
>> than half of the minc tools.  However, those that require flex/bison,
>> and the conversion build tree I was never successful with.
>
> By all means send the diffs and I will integrate them into CVS where
> possible. There have already been a number of Win32 specific changes
> made from previous work of Leila Baghdadi and Bert Vincent. At one
> state there even was a stand alone .exe MINC installer (perish the
> thought! :)
>
>
>
> --
> Andrew Janke - andrew.janke at anu.edu.au
> Department of Geriatric Medicine, ANU
> (a.janke at gmail.com || http://a.janke.googlepages.com/)
> Canberra->Australia +61 (402) 700 883
> _______________________________________________
> MINC-users at bic.mni.mcgill.ca
> http://www2.bic.mni.mcgill.ca/mailman/listinfo/minc-users
>



-- 
--------------------------------------------------------------
Rupert Brooks


More information about the MINC-users mailing list