Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions easybuild/easyconfigs/a/ASAP/ASAP-2.1-cmath.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Author: Robert Jan Schlimbach (SURF)
# ASAP/2.1 forgets a few headers, in this case cmath
# Possibly fixed if https://github.com/computationalpathologygroup/ASAP/pull/241 gets merged

diff --git a/annotation/ImageScopeRepository.cpp b/annotation/ImageScopeRepository.cpp
Comment thread
robogast marked this conversation as resolved.
index 6916a58..c135cb3 100644
--- a/annotation/ImageScopeRepository.cpp
+++ b/annotation/ImageScopeRepository.cpp
@@ -9,6 +9,7 @@
#include <stdio.h>
#include "pugixml.hpp"
#include <algorithm>
+#include <cmath>

ImageScopeRepository::ImageScopeRepository(const std::shared_ptr<AnnotationList>& list) :
Repository(list),
72 changes: 72 additions & 0 deletions easybuild/easyconfigs/a/ASAP/ASAP-2.1-foss-2022a.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
easyblock = 'CMakeMake'

name = 'ASAP'
version = '2.1'

homepage = 'https://computationalpathologygroup.github.io/ASAP/'
description = """ASAP focuses on fast and fluid image viewing with an easy-to-use interface
for making annotations. It consists of two main components: an IO library for reading and writing
multi-resolution images and a viewer component for visualizing such images."""

toolchain = {'name': 'foss', 'version': '2022a'}

source_urls = ['https://github.com/computationalpathologygroup/%(name)s/archive']
sources = [SOURCE_TAR_GZ]
patches = [
'ASAP-2.1-libjpeg.patch',
'ASAP-2.1-pugixml.patch',
'ASAP-2.1-cmath.patch',
]
checksums = [
'7ba9f39d09bada808f760c5dc9ac0cda0d221fd1393a0a3f9decfd6b5e913b3c', # ASAP-2.1.tar.gz
'78337d0250c567335f1a356f8761587000170b71a87b3e546b6b9330d3236b0f', # ASAP-2.1-libjpeg.patch
'ab6104fb19515d0b042944bbe95fa67f55f47ef3bf18a91d337e0ca476c7385d', # ASAP-2.1-pugixml.patch
'15cf6bf2ab65ce37338ea571d80ced59b4e35cf82e434b2ccec7b534778f4a33', # ASAP-2.1-cmath.patch
]

builddependencies = [
('binutils', '2.38'),
('CMake', '3.23.1'),
]
dependencies = [
('Boost', '1.79.0'),
('Python', '3.10.4'),
('OpenCV', '4.6.0', '-contrib'),
('Qt5', '5.15.5'),
('LibTIFF', '4.3.0'),
('libjpeg-turbo', '2.1.3'),
('JasPer', '2.0.33'),
('DCMTK', '3.6.7'),
('SWIG', '4.0.2'),
('OpenSlide', '3.4.1', '-largefiles'),
('pugixml', '1.12.1'),
('zlib', '1.2.12'),
]

configopts = " ".join([
"-DOPENSLIDE_INCLUDE_DIR=$EBROOTOPENSLIDE/include/openslide",
"-DPugiXML_INCLUDE_DIR=$EBROOTPUGIXML/include",
"-DDCMTKJPEG_INCLUDE_DIR=$EBROOTDCMTK/include",
"-DWRAP_MULTIRESOLUTIONIMAGEINTERFACE_PYTHON=TRUE",
"-DBUILD_ASAP=TRUE",
"-DBUILD_EXECUTABLES=TRUE",
"-DBUILD_IMAGEPROCESSING=TRUE",
"-DBUILD_MULTIRESOLUTIONIMAGEINTERFACE_VSI_SUPPORT=TRUE",
"-DSWIG_EXECUTABLE=$EBROOTSWIG/bin/swig"
])


sanity_check_paths = {
'files': [
'bin/%(name)s',
'bin/multiresolutionimageinterface.py',
'lib/libmultiresolutionimageinterface.%s' % SHLIB_EXT],
'dirs': ['bin'],
}

sanity_check_commands = ['python -c "import multiresolutionimageinterface"']

# ASAP installs its python interface in bin. Ugly, but we'll need to add it to PYTHONPATH
modextrapaths = {'PYTHONPATH': ['bin']}

moduleclass = 'vis'
41 changes: 41 additions & 0 deletions easybuild/easyconfigs/a/ASAP/ASAP-2.1-libjpeg.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Author: Robert Jan Schlimbach (SURF)
# ASAP/2.1 uses DCMKT jpeg sources directly by manually setting a PATH
# see https://github.com/computationalpathologygroup/ASAP/issues/32
# we simply replace DCMTK jpeg with the default jpeglib header.
# Need to rename jpeg_mem_src to avoid a resulting name conflic.

diff --git a/multiresolutionimageinterface/VSIImage.cpp b/multiresolutionimageinterface/VSIImage.cpp
Comment thread
robogast marked this conversation as resolved.
index 509bb18..1763201 100644
--- a/multiresolutionimageinterface/VSIImage.cpp
+++ b/multiresolutionimageinterface/VSIImage.cpp
@@ -11,7 +11,7 @@
// Include DCMTK LIBJPEG for lossy and lossless JPEG compression
extern "C" {
#define boolean ijg_boolean
-#include "dcmtk/dcmjpeg/libijg8/jpeglib8.h"
+#include "jpeglib.h"
#include "jpeg_mem_src.h"
#undef boolean
#undef const
@@ -234,7 +234,7 @@ char* VSIImage::decodeTile(int no, int row, int col) const {
jpeg_source_mgr src_mem;
jpeg_create_decompress(&cinfo);
cinfo.err = jpeg_std_error(&jerr);
- jpeg_mem_src(&cinfo, &src_mem, (void*)buf, size);
+ jpeg_mem_src_asap(&cinfo, &src_mem, (void*)buf, size);
jpeg_read_header(&cinfo, true);
if (_compressionType == 2) {
cinfo.jpeg_color_space = JCS_YCbCr;
diff --git a/multiresolutionimageinterface/jpeg_mem_src.h b/multiresolutionimageinterface/jpeg_mem_src.h
index b9b91e9..13b9040 100644
--- a/multiresolutionimageinterface/jpeg_mem_src.h
+++ b/multiresolutionimageinterface/jpeg_mem_src.h
@@ -47,7 +47,7 @@ static void mem_skip_input_data( j_decompress_ptr cinfo, long num_bytes )
}
}

-static void jpeg_mem_src( j_decompress_ptr cinfo, jpeg_source_mgr * const src, void const * const buffer, long nbytes )
+static void jpeg_mem_src_asap( j_decompress_ptr cinfo, jpeg_source_mgr * const src, void const * const buffer, long nbytes )
{
src->init_source = mem_init_source;
src->fill_input_buffer = mem_fill_input_buffer;
55 changes: 55 additions & 0 deletions easybuild/easyconfigs/a/ASAP/ASAP-2.1-pugixml.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Author: Robert Jan Schlimbach (SURF)
# Patch to make ASAP/2.1 accept pugixml as non-header-only shared lib

diff --git a/annotation/CMakeLists.txt b/annotation/CMakeLists.txt
Comment thread
robogast marked this conversation as resolved.
index 114babe..2156cd3 100644
--- a/annotation/CMakeLists.txt
+++ b/annotation/CMakeLists.txt
@@ -25,10 +25,9 @@ set(ANNOTATION_SOURCE
)

add_library(annotation SHARED ${ANNOTATION_SOURCE} ${ANNOTATION_HEADERS})
-target_compile_definitions(annotation PRIVATE "PUGIXML_HEADER_ONLY")
generate_export_header(annotation)
target_include_directories(annotation PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}> $<INSTALL_INTERFACE:include/annotation> PRIVATE ${DIAGPathology_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${Boost_INCLUDE_DIRS} ${PugiXML_INCLUDE_DIR})
-target_link_libraries(annotation PUBLIC core PRIVATE multiresolutionimageinterface)
+target_link_libraries(annotation PUBLIC core PRIVATE multiresolutionimageinterface ${PUGIXML_LIBRARY})
set_target_properties(annotation PROPERTIES DEBUG_POSTFIX _d)

IF(APPLE)
diff --git a/cmakemodules/FindPugiXML.cmake b/cmakemodules/FindPugiXML.cmake
index ccffcc4..9afcfb4 100644
--- a/cmakemodules/FindPugiXML.cmake
+++ b/cmakemodules/FindPugiXML.cmake
@@ -5,11 +5,12 @@
# PugiXML_FOUND, If false, do not try to use PugiXML.

find_path(PugiXML_INCLUDE_DIR pugixml.hpp)
+find_library(PUGIXML_LIBRARY NAMES pugixml)

# handle the QUIETLY and REQUIRED arguments and set PugiXML_FOUND to TRUE if
# all listed variables are TRUE
include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PugiXML
- REQUIRED_VARS PugiXML_INCLUDE_DIR)
+ REQUIRED_VARS PUGIXML_LIBRARY PugiXML_INCLUDE_DIR)

-mark_as_advanced(PugiXML_INCLUDE_DIR)
+mark_as_advanced(PugiXML_INCLUDE_DIR PUGIXML_LIBRARY)
diff --git a/multiresolutionimageinterface/CMakeLists.txt b/multiresolutionimageinterface/CMakeLists.txt
index 132e6ef..8d24176 100644
--- a/multiresolutionimageinterface/CMakeLists.txt
+++ b/multiresolutionimageinterface/CMakeLists.txt
@@ -87,11 +87,10 @@ endif(BUILD_MULTIRESOLUTIONIMAGEINTERFACE_VSI_SUPPORT)

add_library(multiresolutionimageinterface SHARED ${MULTIRESOLUTIONIMAGEINTERFACE_SRCS} ${MULTIRESOLUTIONIMAGEINTERFACE_HS} ${VSI_SOURCE_HS} ${VSI_SOURCE_SRCS})
target_include_directories(multiresolutionimageinterface PUBLIC $<BUILD_INTERFACE:${DIAGPathology_SOURCE_DIR}> $<INSTALL_INTERFACE:include> $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}> $<INSTALL_INTERFACE:include/multiresolutionimageinterface> PRIVATE ${PugiXML_INCLUDE_DIR} ${TIFF_INCLUDE_DIR})
-target_link_libraries(multiresolutionimageinterface PUBLIC core PRIVATE jpeg2kcodec libtiff)
+target_link_libraries(multiresolutionimageinterface PUBLIC core PRIVATE jpeg2kcodec libtiff ${PUGIXML_LIBRARY})
IF(NOT WIN32)
target_link_libraries(multiresolutionimageinterface PRIVATE dl)
ENDIF(NOT WIN32)
-target_compile_definitions(multiresolutionimageinterface PRIVATE PUGIXML_HEADER_ONLY)
generate_export_header(multiresolutionimageinterface)
set_target_properties(multiresolutionimageinterface PROPERTIES DEBUG_POSTFIX _d)

49 changes: 49 additions & 0 deletions easybuild/easyconfigs/d/DCMTK/DCMTK-3.6.7-GCCcore-11.3.0.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
easyblock = 'CMakeMake'

name = 'DCMTK'
version = '3.6.7'

homepage = 'https://dicom.offis.de/dcmtk'
description = """DCMTK is a collection of libraries and applications implementing large parts the DICOM standard.
It includes software for examining, constructing and converting DICOM image files, handling offline media, sending
and receiving images over a network connection, as well as demonstrative image storage and worklist servers."""

toolchain = {'name': 'GCCcore', 'version': '11.3.0'}
toolchainopts = {'pic': True}

local_stripped_version = version.replace('.', '')

source_urls = ['https://dicom.offis.de/download/%(namelower)s/dcmtk{}/'.format(local_stripped_version)]
sources = [SOURCELOWER_TAR_GZ]
checksums = ['7c58298e3e8d60232ee6fc8408cfadd14463cc11a3c4ca4c59af5988c7e9710a']

builddependencies = [
('binutils', '2.38'),
('CMake', '3.23.1'),
]
dependencies = [
('zlib', '1.2.12'),
('libjpeg-turbo', '2.1.3'),
('LibTIFF', '4.3.0'),
('libpng', '1.6.37'),
('libxml2', '2.9.13'),
('libiconv', '1.17'),
]

configopts = [
'-DBUILD_SHARED_LIBS=OFF',
'-DBUILD_SHARED_LIBS=ON'
]


sanity_check_paths = {
'files': ['bin/dcmdump', 'bin/dcmj2pnm'],
'dirs': ['lib'],
}

local_test_modules = ['dcmdata', 'dcmect', 'dcmfg', 'dcmiod', 'dcmnet', 'dcmrt', 'dcmseg', 'dcmsr', 'dcmtls', 'ofstd']
sanity_check_commands = [
'%s_tests | grep " 0 failed"' % s for s in local_test_modules
]

moduleclass = 'data'
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
easyblock = 'ConfigureMake'

name = 'OpenSlide'
version = '3.4.1'
versionsuffix = '-largefiles'

homepage = 'https://openslide.org/'
description = """OpenSlide is a C library that provides a simple interface to
read whole-slide images (also known as virtual slides)."""

toolchain = {'name': 'GCCcore', 'version': '11.3.0'}

source_urls = [GITHUB_SOURCE]
sources = ['v%(version)s.tar.gz']
patches = ['%(name)s-%(version)s_large_file_support.patch']
checksums = [
# v3.4.1.tar.gz
'a5d869916e370125421535dcce778b2ba625dc50d920aa4ca93bbaaa6a7b470c',
# %(name)s-%(version_major_minor)s.1_large_file_support.patch
'cb618053f4ae6c3ce37d1b8b0e4ef7c55fd17378776d13be4aa4efab91706b8c',
]

builddependencies = [
('Autotools', '20220317'),
('M4', '1.4.19'),
('pkg-config', '0.29.2'),
('binutils', '2.38'),
]

dependencies = [
('zlib', '1.2.12'),
('libpng', '1.6.37'),
('libjpeg-turbo', '2.1.3'),
('LibTIFF', '4.3.0'),
('OpenJPEG', '2.5.0'),
('libxml2', '2.9.13'),
('SQLite', '3.38.3'),
('cairo', '1.17.4'),
('Gdk-Pixbuf', '2.42.8'),
]

preconfigopts = "autoreconf -f -i && "

sanity_check_paths = {
'files': [
'bin/openslide-quickhash1sum',
'bin/openslide-show-properties',
'bin/openslide-write-png',
'lib/libopenslide.la',
'lib/libopenslide.%s' % SHLIB_EXT
],
'dirs': ['include/openslide']
}


moduleclass = 'vis'
37 changes: 37 additions & 0 deletions easybuild/easyconfigs/p/pugixml/pugixml-1.12.1-GCCcore-11.3.0.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
easyblock = 'CMakeMake'

name = 'pugixml'
version = '1.12.1'

homepage = 'https://pugixml.org/'
description = "pugixml is a light-weight C++ XML processing library"

toolchain = {'name': 'GCCcore', 'version': '11.3.0'}
toolchainopts = {'pic': True}

source_urls = ['https://github.com/zeux/pugixml/archive/']
sources = ['v%(version)s.tar.gz']
checksums = ['1e28ab24b6e04e013d96f45d25e9f2d04c921dc68c613fd010ecaaad3892c14d']

builddependencies = [
('binutils', '2.38'),
('CMake', '3.23.1'),
]

configopts = " ".join([
"-DBUILD_SHARED_LIBS=ON",
"-DPUGIXML_BUILD_SHARED_AND_STATIC_LIBS=ON",
])

sanity_check_paths = {
'files': [
'include/pugiconfig.hpp',
'include/pugixml.hpp',
'lib/libpugixml.a',
'lib/libpugixml.%s' % SHLIB_EXT,
'lib/pkgconfig/pugixml.pc'
],
'dirs': ['lib/cmake/pugixml'],
}

moduleclass = 'data'