From 67a0a4de0e7d0b76e4bd6e1727da7802bb77fcf7 Mon Sep 17 00:00:00 2001 From: Diego Caceres Date: Mon, 2 Jul 2012 14:02:36 +0000 Subject: [PATCH] DFCH: Update for x84 and x64 bit compilation --- .../install_generate_thirdparty.bat_TEMPLATE | 9 +- .../scripts/download_ThirdPartySW.bat | 31 +++-- .../scripts/install_thirdparty.bat | 4 +- .../scripts/install_thirdparty_all.bat | 128 +++++++++++++----- .../scripts/install_thirdparty_dlls_cmake.bat | 13 +- .../install_thirdparty_libraries_cmake.bat | 13 +- 6 files changed, 145 insertions(+), 53 deletions(-) diff --git a/Install_ThirdParty/install_generate_thirdparty.bat_TEMPLATE b/Install_ThirdParty/install_generate_thirdparty.bat_TEMPLATE index a2306a9..6ef05be 100644 --- a/Install_ThirdParty/install_generate_thirdparty.bat_TEMPLATE +++ b/Install_ThirdParty/install_generate_thirdparty.bat_TEMPLATE @@ -6,9 +6,16 @@ echo ----------------------------------- set thirdpartyGeneration= set buildType= +::The following line sets wxWidgets version. Set it ON if you want to compile wxWidgets 2.8.12 +::The following line set swxWidgets version. Set it OFF if you want to compile wxWidgets 2.9.3 +set wxStable= +::Set the following line ON if you want to force x86 compilation +set forcex86=OFF + echo thirdpartyGeneration=%thirdpartyGeneration% echo buildType=%buildType% +echo wxStable=%wxStable% echo ----------------------------------- echo ---End Setting Global Variables---- @@ -28,7 +35,7 @@ cd %scripts% echo Calling download_ThirdPartySW.bat -call download_ThirdPartySW.bat %thirdpartyGeneration% %buildType% >> downloadThirdParty.log 2>&1 +call download_ThirdPartySW.bat %thirdpartyGeneration% %buildType% %wxStable% >> downloadThirdParty.log 2>&1 cd %scripts% diff --git a/Install_ThirdParty/scripts/download_ThirdPartySW.bat b/Install_ThirdParty/scripts/download_ThirdPartySW.bat index 7c96b27..7130046 100644 --- a/Install_ThirdParty/scripts/download_ThirdPartySW.bat +++ b/Install_ThirdParty/scripts/download_ThirdPartySW.bat @@ -9,9 +9,9 @@ echo ----------------------------------- set thirdpartyGeneration=%1 set buildType=%2 +set wxStable=%3 set urlCreatisSource=http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source -set urlCreatisSource=http://www.creatis.insa-lyon.fr/~caceres/software if %PROCESSOR_ARCHITECTURE%==x86 ( set ProgramFilesPath_x86=%ProgramFiles% @@ -56,12 +56,21 @@ set binpath=%thirdpartyGeneration%\thirdparty_bin\%buildType% set sourcepath=%thirdpartyGeneration%\thirdparty_source\%buildType% set QTFNAME=qt-everywhere-opensource-src-4.8.2.zip -set WXFNAME=wxWidgets-2.9.3.7z + +if %wxStable%==ON ( + set WXFNAME=wxWidgets-2.8.12.zip + set WXVERSION=2.8.12 +) else ( + set WXFNAME=wxWidgets-2.9.3.zip + set WXVERSION=2.9.2 +) +else set BOOSTFNAME=boost_1_49_0.7z set XERCESFNAME=xerces-c-3.1.1.zip set ITKFNAME=InsightToolkit-3.20.1.zip set VTKFNAME=vtk-5.10.0.zip -set GDCMFNAME=gdcm_11_Oct_2011.tar.gz +::set GDCMFNAME=gdcm_11_Oct_2011.tar.gz +set GDCMFNAME=gdcm_05_Mai_2011.tar set TTHFNAME=tth_exe.zip set JOMFNAME=jom.zip @@ -102,12 +111,12 @@ echo ----------------------------------- cd %sourcepath%\ %wgetPath% "http://releases.qt-project.org/qt4/source/%QTFNAME%" -%wgetPath% "http://sourceforge.net/projects/wxwindows/files/2.9.3/%WXFNAME%/download" +%wgetPath% "http://sourceforge.net/projects/wxwindows/files/%WXVERSION%/%WXFNAME%/download" %wgetPath% "http://sourceforge.net/projects/boost/files/boost/1.49.0/%BOOSTFNAME%/download" %wgetPath% "http://mirror.ibcp.fr/pub/apache//xerces/c/3/sources/%XERCESFNAME%" %wgetPath% "http://sourceforge.net/projects/itk/files/itk/3.20/%ITKFNAME%/download" %wgetPath% "http://www.vtk.org/files/release/5.10/%VTKFNAME%" -%wgetPath% "%urlCreatisSource%/%GDCMFNAME%" +%wgetPath% "%urlCreatisSource%/%GDCMFNAME%.gz" %wgetPath% "http://hutchinson.belmont.ma.us/tth/tth-noncom/%TTHFNAME%" %wgetPath% "ftp://ftp.qt.nokia.com/jom/%JOMFNAME%" @@ -134,7 +143,7 @@ echo ----------------------------------- echo ----------Extracting--------------- cd %sourcepath% -%zipPath% x %sourcepath%\%WXFNAME% -o* +%zipPath% x %sourcepath%\%WXFNAME% del %sourcepath%\%WXFNAME% echo ----------------------------------- @@ -174,10 +183,10 @@ echo ------------GDCM ------------------ echo ----------------------------------- cd %sourcepath% -%zipPath% x gdcm_11_Oct_2011.tar.gz -%zipPath% x gdcm_11_Oct_2011.tar -del gdcm_11_Oct_2011.tar.gz -del gdcm_11_Oct_2011.tar +%zipPath% x %GDCMFNAME%.gz +%zipPath% x %GDCMFNAME% +del %GDCMFNAME%.gz +del %GDCMFNAME% echo ----------------------------------- echo --------------TTH------------------ @@ -196,7 +205,7 @@ echo --------Renaming Folders----------- echo ----------------------------------- cd %sourcepath% rename qt-everywhere-opensource-src-4.8.2 qt -rename wxWidgets-2.9.3 wxWidgets +rename wxWidgets-%WXVERSION% wxWidgets rename boost_1_49_0 boost rename InsightToolkit-3.20.1 itk rename VTK vtk diff --git a/Install_ThirdParty/scripts/install_thirdparty.bat b/Install_ThirdParty/scripts/install_thirdparty.bat index 2799438..bcd0f3d 100644 --- a/Install_ThirdParty/scripts/install_thirdparty.bat +++ b/Install_ThirdParty/scripts/install_thirdparty.bat @@ -2,10 +2,10 @@ set thirdpartyGeneration=%1 set buildType=%2 - +set x86Comp=%3 echo Calling install_thirdparty_all.bat -call install_thirdparty_all.bat %thirdpartyGeneration% %buildType% >> installThirdParty.log 2>&1 +call install_thirdparty_all.bat %thirdpartyGeneration% %buildType% %x86Comp% >> installThirdParty.log 2>&1 exit diff --git a/Install_ThirdParty/scripts/install_thirdparty_all.bat b/Install_ThirdParty/scripts/install_thirdparty_all.bat index 86e9058..eb77577 100644 --- a/Install_ThirdParty/scripts/install_thirdparty_all.bat +++ b/Install_ThirdParty/scripts/install_thirdparty_all.bat @@ -9,12 +9,14 @@ echo ----------------------------------- set thirdpartyGeneration=%1 set buildType=%2 +::The following line is to force x86 or x64 compilation +set x86Comp=%3 set installpath=%thirdpartyGeneration%\thirdparty_install\%buildType% set binpath=%thirdpartyGeneration%\thirdparty_bin\%buildType% set sourcepath=%thirdpartyGeneration%\thirdparty_source\%buildType% -if %PROCESSOR_ARCHITECTURE%==x86 ( +if %PROCESSOR_ARCHITECTURE%==x86 ( set ProgramFilesPath_x86=%ProgramFiles% echo "Architecture found = x86" ) else ( @@ -53,10 +55,6 @@ echo Environment variables Configuration echo ----------------------------------- echo ThirdpartyGeneration=%thirdpartyGeneration% echo BuildType=%buildType% -echo wget=%wgetPath% -echo MikTex=%miktex% -echo urlCreatis=%urlCreatisSource% -echo 7zip=%zipPath% echo Visual Studio=%vcvarsall% echo InstallPath=%installpath% echo BinPath=%binpath% @@ -82,7 +80,18 @@ echo ---End Setting Global Variables---- echo ----------------------------------- -call %vcvarsall% +if %x86Comp%==ON ( + call %vcvarsall% + echo "Compilation forced x86" +) else ( + if %PROCESSOR_ARCHITECTURE%==x86 ( + call %vcvarsall% + ) else ( + call %vcvarsall% amd64 + ) +) + +goto next echo ----------------------------------- echo --------Qt Installation------------ @@ -93,6 +102,7 @@ set QMAKESPEC=win32-msvc2010 echo y | configure -%buildType% -opensource -shared -qt-sql-sqlite -phonon -phonon-backend -platform win32-msvc2010 -mp %JOMDIR%\jom.exe -j %NUMBER_OF_PROCESSORS% +%JOMDIR%\jom.exe clean cd C:\ @@ -100,7 +110,15 @@ echo ----------------------------------- echo -----wxWidgets Installation-------- echo ----------------------------------- cd %WXDIR%\build\msw -nmake -f makefile.vc BUILD=%buildType% UNICODE=0 SHARED=1 +if %x86Comp%==ON ( + nmake -f makefile.vc BUILD=%buildType% UNICODE=0 SHARED=1 +) else ( + if %PROCESSOR_ARCHITECTURE%==x86 ( + nmake -f makefile.vc BUILD=%buildType% UNICODE=0 SHARED=1 + ) else ( + nmake -f makefile.vc TARGET_CPU=AMD64 BUILD=release UNICODE=0 SHARED=1 + ) +) cd C:\ echo ----------------------------------- @@ -113,10 +131,19 @@ mkdir %installpath%\%boost% cd %sourcepath%\%boost% call bootstrap.bat -bjam.exe -j %NUMBER_OF_PROCESSORS% --toolset=msvc-10.0 --build-type=complete --build-dir=%binpath%\%boost%Bin --link=shared --runtime-link=shared --prefix=%installpath%\%boost% install -cd C:\ +if %x86Comp%==ON ( + bjam.exe -j %NUMBER_OF_PROCESSORS% --toolset=msvc-10.0 --build-type=complete --build-dir=%binpath%\%boost%Bin --link=shared --runtime-link=shared --prefix=%installpath%\%boost% install +) else ( + if %PROCESSOR_ARCHITECTURE%==x86 ( + bjam.exe -j %NUMBER_OF_PROCESSORS% --toolset=msvc-10.0 --build-type=complete --build-dir=%binpath%\%boost%Bin --link=shared --runtime-link=shared --prefix=%installpath%\%boost% install + ) else ( + bjam.exe -j %NUMBER_OF_PROCESSORS% --toolset=msvc-10.0 address-model=64 --build-type=complete --build-dir=%binpath%\%boost%Bin --link=shared --runtime-link= shared --prefix=%installpath%\%boost% install + ) +) +cd C:\ +:next echo ----------------------------------- echo -------VTK Installation------------ echo ----------------------------------- @@ -124,53 +151,84 @@ echo ----------------------------------- cd %binpath% mkdir %vtk%Bin cd %vtk%Bin -cmake -G"Visual Studio 10" -H%sourcepath%\%vtk% -B%binpath%\%vtk%Bin + +if %x86Comp%==ON ( + cmake -G"Visual Studio 10" -H%sourcepath%\%vtk% -B%binpath%\%vtk%Bin +) else ( + if %PROCESSOR_ARCHITECTURE%==x86 ( + cmake -G"Visual Studio 10" -H%sourcepath%\%vtk% -B%binpath%\%vtk%Bin + ) else ( + cmake -G"Visual Studio 10 Win64" -H%sourcepath%\%vtk% -B%binpath%\%vtk%Bin + ) +) + cmake -D USE_DEBUG_LIB:BOOL=%buildType% -D CMAKE_INSTALL_PREFIX:PATH=%installpath%\%vtk%\ CMakeCache.txt cmake -D BUILD_EXAMPLES:BOOL=OFF -D BUILD_TESTING:BOOL=OFF -D BUILD_SHARED_LIBS:BOOL=ON -D VTK_USE_QT:BOOL=ON CMakeCache.txt cmake CMakeCache.txt -FOR /R %%a IN (*.sln) DO msbuild %%a /m:%NUMBER_OF_PROCESSORS% /p:UseEnv=true;BuildInParallel=true;Configuration=%buildType% -msbuild /m:%NUMBER_OF_PROCESSORS% /p:UseEnv=true;BuildInParallel=true;Configuration=%buildType% INSTALL.vcxproj +FOR /R %%a IN (*.sln) DO msbuild %%a /m:%NUMBER_OF_PROCESSORS% /target:ALL_BUILD /p:Platform=AnyCPU ;UseEnv=true;BuildInParallel=true;Configuration=%buildType% +msbuild /m:%NUMBER_OF_PROCESSORS% /p:Platform=AnyCPU ;UseEnv=true;BuildInParallel=true;Configuration=%buildType% INSTALL.vcxproj + +cd c:\ + +echo ----------------------------------- +echo -------GDCM Installation----------- +echo ----------------------------------- + +cd %binpath% +mkdir %gdcm%Bin + +cd %gdcm%Bin + +if %x86Comp%==ON ( + cmake -G"Visual Studio 10" -H%sourcepath%\%gdcm% -B%binpath%\%gdcm%Bin +) else ( + if %PROCESSOR_ARCHITECTURE%==x86 ( + cmake -G"Visual Studio 10" -H%sourcepath%\%gdcm% -B%binpath%\%gdcm%Bin + ) else ( + cmake -G"Visual Studio 10 Win64" -H%sourcepath%\%gdcm% -B%binpath%\%gdcm%Bin + ) +) + +cmake -D USE_DEBUG_LIB:BOOL=%buildType% -D CMAKE_INSTALL_PREFIX:PATH=%installpath%\%gdcm%\ CMakeCache.txt +cmake -D VTK_DIR:PATH=%installpath%\%vtk%\ -D GDCM_VTK:BOOL=ON -D BUILD_TESTING:BOOL=OFF -D GDCM_NAME_SPACE:STRING=gdcm13 CMakeCache.txt +cmake CMakeCache.txt +FOR /R %%a IN (*.sln) DO msbuild %%a /m:%NUMBER_OF_PROCESSORS% /p:UseEnv=true;BuildInParallel=true;Platform=AnyCPU;Configuration=%buildType% +msbuild INSTALL.vcxproj /m:%NUMBER_OF_PROCESSORS% /p:UseEnv=true;BuildInParallel=true;Platform=AnyCPU;Configuration=%buildType% + cd c:\ echo ----------------------------------- echo -------ITK Installation------------ echo ----------------------------------- -echo ----------Extracting--------------- cd %binpath% mkdir %itk%Bin cd %itk%Bin -cmake -G"Visual Studio 10" -H%sourcepath%\%itk% -B%binpath%\%itk%Bin + +if %x86Comp%==ON ( + cmake -G"Visual Studio 10" -H%sourcepath%\%itk% -B%binpath%\%itk%Bin +) else ( + if %PROCESSOR_ARCHITECTURE%==x86 ( + cmake -G"Visual Studio 10" -H%sourcepath%\%itk% -B%binpath%\%itk%Bin + ) else ( + cmake -G"Visual Studio 10 Win64" -H%sourcepath%\%itk% -B%binpath%\%itk%Bin + ) +) cmake -D USE_DEBUG_LIB:BOOL=%buildType% -D CMAKE_INSTALL_PREFIX:PATH=%installpath%\%itk%\ CMakeCache.txt cmake -D BUILD_EXAMPLES:BOOL=OFF -D BUILD_TESTING:BOOL=OFF -D BUILD_SHARED_LIBS:BOOL=ON -D ITK_USE_REVIEW:BOOL=ON CMakeCache.txt cmake CMakeCache.txt -FOR /R %%a IN (*.sln) DO msbuild %%a /m:%NUMBER_OF_PROCESSORS% /p:UseEnv=true;BuildInParallel=true;Configuration=%buildType% -msbuild /m:%NUMBER_OF_PROCESSORS% /p:UseEnv=true;BuildInParallel=true;Configuration=%buildType% INSTALL.vcxproj +FOR /R %%a IN (*.sln) DO msbuild %%a /m:%NUMBER_OF_PROCESSORS% /p:UseEnv=true;BuildInParallel=true;Platform=AnyCPU;Configuration=%buildType% +msbuild INSTALL.vcxproj /m:%NUMBER_OF_PROCESSORS% /p:UseEnv=true;BuildInParallel=true;Platform=AnyCPU;Configuration=%buildType% + cd c:\ echo ----------------------------------- echo ------XERCES Installation---------- echo ----------------------------------- cd %sourcepath%\%xercesc%\projects\Win32\VC10\xerces-all -FOR /R %%a IN (*.sln) DO msbuild %%a /m:%NUMBER_OF_PROCESSORS% /p:UseEnv=true;BuildInParallel=true;Configuration=%buildType% -FOR /R %%a IN (*.sln) DO msbuild %%a /m:%NUMBER_OF_PROCESSORS% /p:UseEnv=true;BuildInParallel=true;Configuration=%buildType% -msbuild /m:%NUMBER_OF_PROCESSORS% /p:UseEnv=true;BuildInParallel=true;Configuration=%buildType% INSTALL.vcxproj - -echo ----------------------------------- -echo -------GDCM Installation----------- -echo ----------------------------------- - -cd %binpath% -mkdir %gdcm%Bin - -cd %gdcm%Bin -cmake -G"Visual Studio 10" -H%sourcepath%\%gdcm% -B%binpath%\%gdcm%Bin -cmake -D USE_DEBUG_LIB:BOOL=%buildType% -D CMAKE_INSTALL_PREFIX:PATH=%installpath%\%gdcm%\ CMakeCache.txt -cmake -D VTK_DIR:PATH=%installpath%\%vtk%\ -D GDCM_VTK:BOOL=ON -D BUILD_TESTING:BOOL=OFF -D GDCM_NAME_SPACE:STRING=gdcm13 CMakeCache.txt -cmake CMakeCache.txt -FOR /R %%a IN (*.sln) DO msbuild %%a /m:%NUMBER_OF_PROCESSORS% /p:UseEnv=true;BuildInParallel=true;Configuration=%buildType% -msbuild /m:%NUMBER_OF_PROCESSORS% /p:UseEnv=true;BuildInParallel=true;Configuration=%buildType% INSTALL.vcxproj -cd c:\ +FOR /R %%a IN (*.sln) DO msbuild %%a /m:%NUMBER_OF_PROCESSORS% /p:UseEnv=true;BuildInParallel=true;Platform=AnyCPU;Configuration=%buildType% +FOR /R %%a IN (*.sln) DO msbuild %%a /m:%NUMBER_OF_PROCESSORS% /p:UseEnv=true;BuildInParallel=true;Platform=AnyCPU;Configuration=%buildType% +msbuild INSTALL.vcxproj /m:%NUMBER_OF_PROCESSORS% /p:UseEnv=true;BuildInParallel=true;Platform=AnyCPU;Configuration=%buildType% echo ----------------------------------- echo ---End of Installing Libraries----- diff --git a/Install_ThirdParty/scripts/install_thirdparty_dlls_cmake.bat b/Install_ThirdParty/scripts/install_thirdparty_dlls_cmake.bat index abb2613..2e791bf 100644 --- a/Install_ThirdParty/scripts/install_thirdparty_dlls_cmake.bat +++ b/Install_ThirdParty/scripts/install_thirdparty_dlls_cmake.bat @@ -37,12 +37,21 @@ if not exist %vcvarsall% ( exit ) -call %vcvarsall% +if %PROCESSOR_ARCHITECTURE%==x86 ( + call %vcvarsall% +) else ( + call %vcvarsall% amd64 +) mkdir %binpath% cd %binpath% -cmake -G"Visual Studio 10" -H%sourcepath% -B%binpath% +if %PROCESSOR_ARCHITECTURE%==x86 ( + cmake -G"Visual Studio 10" -H%sourcepath% -B%binpath% +) else ( + cmake -G"Visual Studio 10 Win64" -H%sourcepath% -B%binpath% +) + cmake -D CMAKE_INSTALL_PREFIX:PATH=%installpath% CMakeCache.txt cmake -D CREA_LIBRARY_DLL_PATH:PATH=%thirdpartydllspath% CMakeCache.txt cmake CMakeCache.txt diff --git a/Install_ThirdParty/scripts/install_thirdparty_libraries_cmake.bat b/Install_ThirdParty/scripts/install_thirdparty_libraries_cmake.bat index e54703f..cd24ef5 100644 --- a/Install_ThirdParty/scripts/install_thirdparty_libraries_cmake.bat +++ b/Install_ThirdParty/scripts/install_thirdparty_libraries_cmake.bat @@ -36,12 +36,21 @@ if not exist %vcvarsall% ( exit ) -call %vcvarsall% +if %PROCESSOR_ARCHITECTURE%==x86 ( + call %vcvarsall% +) else ( + call %vcvarsall% amd64 +) mkdir %binpath% cd %binpath% -cmake -G"Visual Studio 10" -H%sourcepath% -B%binpath% +if %PROCESSOR_ARCHITECTURE%==x86 ( + cmake -G"Visual Studio 10" -H%sourcepath% -B%binpath% +) else ( + cmake -G"Visual Studio 10 Win64" -H%sourcepath% -B%binpath% +) + cmake -D CMAKE_INSTALL_PREFIX:PATH=%installpath% CMakeCache.txt cmake -D CREA_LIBRARY_SOURCE_PATH:PATH=%thirdpartylibpath% CMakeCache.txt cmake CMakeCache.txt -- 2.47.1