Skip to content

Commit

Permalink
Merge pull request #154 from gdevenyi/2204_fixbuild
Browse files Browse the repository at this point in the history
Fixes for 22.04 build
  • Loading branch information
vfonov authored May 20, 2022
2 parents 4a15cc2 + 7adcb8e commit 96a7ae7
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 15 deletions.
20 changes: 10 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ OPTION(MT_BUILD_VISUAL_TOOLS "Build visual tools (Display, Register, postf, ray_
OPTION(USE_SYSTEM_ITK "Use System ITK" OFF)
OPTION(MT_USE_OPENMP "Use OpenMP multi-threading" OFF)
OPTION(MT_BUILD_IM "Build ImageMagick and dependent libraries" OFF)
OPTION(MT_BUILD_OPENBLAS "Build OpenBLAS: will require fortran" OFF)
OPTION(MT_BUILD_OPENBLAS "Build OpenBLAS: will require fortran" ON)
#OPTION(MT_USE_OPENMP_BLAS "Use Build OpenBLAS with OpenMP support" OFF) # TODO: finish this to compile on some platforms

SET(MT_PACKAGES_PATH "${CMAKE_BINARY_DIR}/cache" CACHE PATH "Directory containing 3rd party packages")
Expand Down Expand Up @@ -156,7 +156,7 @@ SET(SUPERBUILD_STAGING_PREFIX ${CMAKE_BINARY_DIR}/external)
file(MAKE_DIRECTORY ${SUPERBUILD_STAGING_PREFIX}/${CMAKE_INSTALL_PREFIX}/share)

SET(MINC_TEST_ENVIRONMENT
"PATH=${CMAKE_CURRENT_BINARY_DIR}:${CMAKE_CURRENT_BINARY_DIR}/N3:${CMAKE_CURRENT_BINARY_DIR}/classify:${CMAKE_CURRENT_BINARY_DIR}/minctools/progs:${CMAKE_CURRENT_BINARY_DIR}/mni_autoreg/mincblur:${CMAKE_CURRENT_BINARY_DIR}/mni_autoreg/make_phantom:${CMAKE_CURRENT_BINARY_DIR}/mni_autoreg/minctracc:${SUPERBUILD_STAGING_PREFIX}/${CMAKE_INSTALL_PREFIX}/bin:$ENV{PATH}"
"PATH=${CMAKE_CURRENT_BINARY_DIR}:${CMAKE_CURRENT_BINARY_DIR}/N3:${CMAKE_CURRENT_BINARY_DIR}/classify:${CMAKE_CURRENT_BINARY_DIR}/minctools/progs:${CMAKE_CURRENT_BINARY_DIR}/mni_autoreg/mincblur:${CMAKE_CURRENT_BINARY_DIR}/mni_autoreg/make_phantom:${CMAKE_CURRENT_BINARY_DIR}/mni_autoreg/minctracc:${SUPERBUILD_STAGING_PREFIX}/${CMAKE_INSTALL_PREFIX}/bin:$ENV{PATH}"
)

LIST(APPEND MINC_TEST_ENVIRONMENT "PERL5LIB=${CMAKE_SOURCE_DIR}/mni-perllib:${CMAKE_CURRENT_BINARY_DIR}/mni-perllib/perl:${CMAKE_CURRENT_BINARY_DIR}/perl-modules:$ENV{PERL5LIB}")
Expand Down Expand Up @@ -501,7 +501,7 @@ IF(MT_BUILD_ITK_TOOLS)
build_C3D(${CMAKE_INSTALL_PREFIX} ${SUPERBUILD_STAGING_PREFIX} ${ITK_DIR})
ADD_DEPENDENCIES(C3D ITKv4 minc2)
ENDIF(MT_BUILD_C3D)

IF(MT_BUILD_ELASTIX)
INCLUDE(BuildElastix)
build_Elastix(${CMAKE_INSTALL_PREFIX} ${SUPERBUILD_STAGING_PREFIX} ${ITK_DIR})
Expand All @@ -511,21 +511,21 @@ IF(MT_BUILD_ITK_TOOLS)
INCLUDE(BuildEZMINC)
build_EZMINC(${CMAKE_INSTALL_PREFIX} ${SUPERBUILD_STAGING_PREFIX} ${CMAKE_BINARY_DIR}/libminc ${CMAKE_BINARY_DIR}/bicpl ${ITK_DIR})
ADD_DEPENDENCIES(EZMINC ITKv4 GSL minc2 minc_io bicpl)

INCLUDE(BuildPatchMorphology)
build_PatchMorphology(${CMAKE_INSTALL_PREFIX} ${SUPERBUILD_STAGING_PREFIX} ${ITK_DIR})
ADD_DEPENDENCIES(patch_morphology ITKv4 minc_io)

IF(MT_BUILD_OPENBLAS)
ADD_DEPENDENCIES(patch_morphology OpenBLAS)
ENDIF(MT_BUILD_OPENBLAS)

IF(MT_BUILD_ABC)
INCLUDE(BuildABC)
build_ABC(${CMAKE_INSTALL_PREFIX} ${SUPERBUILD_STAGING_PREFIX} ${ITK_DIR})
ADD_DEPENDENCIES(ABC ITKv4 minc2)
ENDIF(MT_BUILD_ABC)

ENDIF(MT_BUILD_ITK_TOOLS)

# tools requiring OpenBLAS
Expand All @@ -544,9 +544,9 @@ ENDIF()
IF(MT_BUILD_VISUAL_TOOLS)
FIND_PACKAGE( OpenGL REQUIRED )
FIND_PACKAGE( X11 QUIET )

IF(USE_SYSTEM_GLUT)
FIND_PACKAGE( GLUT REQUIRED )
FIND_PACKAGE( GLUT REQUIRED )
ELSE(USE_SYSTEM_GLUT)
INCLUDE(BuildFREEGLUT) # newer version of build_freeglut seem to be causing problems
build_freeglut( ${CMAKE_INSTALL_PREFIX} ${SUPERBUILD_STAGING_PREFIX})
Expand Down Expand Up @@ -590,7 +590,7 @@ IF(MT_BUILD_IM)
INCLUDE(BuildPNG)
INCLUDE(BuildFREETYPE)
INCLUDE(BuildIM)

build_jpeg(${CMAKE_INSTALL_PREFIX} ${SUPERBUILD_STAGING_PREFIX})
build_png(${CMAKE_INSTALL_PREFIX} ${SUPERBUILD_STAGING_PREFIX} ${ZLIB_INCLUDE_DIR} ${ZLIB_LIBRARY} ${ZLIB_DIR} )
build_freetype(${CMAKE_INSTALL_PREFIX} ${SUPERBUILD_STAGING_PREFIX} ${ZLIB_INCLUDE_DIR} ${ZLIB_LIBRARY} ${ZLIB_DIR})
Expand Down
4 changes: 2 additions & 2 deletions cmake-modules/BuildFREEGLUT.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ macro(build_freeglut install_prefix staging_prefix)
)
endif()

GET_PACKAGE("http://downloads.sourceforge.net/project/freeglut/freeglut/3.2.1/freeglut-3.2.1.tar.gz" "cd5c670c1086358598a6d4a9d166949d" "freeglut-3.2.1.tar.gz" FREEGLUT_PATH )
GET_PACKAGE("https://github.com/FreeGLUTProject/freeglut/releases/download/v3.2.2/freeglut-3.2.2.tar.gz" "485c1976165315fc42c0b0a1802816d9" "freeglut-3.2.2.tar.gz" FREEGLUT_PATH )

# have to find GL X11 Xrandr Xi
FIND_PACKAGE(OpenGL REQUIRED)
FIND_PACKAGE(X11 REQUIRED)

ExternalProject_Add(FREEGLUT
URL "${FREEGLUT_PATH}"
URL_MD5 "cd5c670c1086358598a6d4a9d166949d"
URL_MD5 "485c1976165315fc42c0b0a1802816d9"
SOURCE_DIR FREEGLUT
BINARY_DIR FREEGLUT-build
LIST_SEPARATOR :::
Expand Down
2 changes: 1 addition & 1 deletion cmake-modules/BuildOpenBLAS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ macro(build_open_blas install_prefix staging_prefix build_parallel)
INSTALL_DIR ${staging_prefix}/${install_prefix}
)

SET(OpenBLAS_INCLUDE_DIRS ${staging_prefix}/${install_prefix}/include )
SET(OpenBLAS_INCLUDE_DIRS ${staging_prefix}/${install_prefix}/include/openblas )
SET(OpenBLAS_LIBRARIES ${staging_prefix}/${install_prefix}/lib${LIB_SUFFIX}/libopenblas.so )
SET(OpenBLAS_LIBRARY ${OpenBLAS_LIBRARIES})
SET(OpenBLAS_DIR ${staging_prefix}/${install_prefix}/share/cmake/OpenBLAS )
Expand Down
3 changes: 2 additions & 1 deletion cmake-modules/BuildPatchMorphology.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ macro(build_PatchMorphology install_prefix staging_prefix itk_dir)
-DCMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING=${CMAKE_STATIC_LINKER_FLAGS_RELEASE}
-DCMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING=${CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO}
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-DOpenBLAS_INCLUDE_DIR:PATH=${OpenBLAS_INCLUDE_DIRS}
-DOpenBLAS_INCLUDE_DIRS:PATH=${OpenBLAS_INCLUDE_DIRS}
-DOpenBLAS_LIBRARIES:PATH=${OpenBLAS_LIBRARIES}
-DOpenBLAS_LIBRARY:PATH=${OpenBLAS_LIBRARY}
-DCMAKE_DISABLE_FIND_PACKAGE_OpenBLAS:BOOL=ON
-DOpenBLAS_DIR:PATH=${OpenBLAS_DIR}
Expand Down
2 changes: 1 addition & 1 deletion mni_autoreg

0 comments on commit 96a7ae7

Please sign in to comment.