users > Compile issue
Showing 1-6 of 6 posts
Display:
Results per page:
Jan 10, 2023  07:01 PM | Antonio Ulloa
Compile issue
Hello, while compiling 3.3.2 from source we get the error below and we were hoping to get some guidance as to how to fix it. Thanks!

--------------------------------
In file included from cmtk/core/Utilities/numdiff-5.2.1/analyze.c:52:0:
cmtk/core/Utilities/numdiff-5.2.1/numdiff.h:117:28: error: 'FIELDMASK_SIZE' undeclared here (not in a function); did you mean 'FD_SETSIZE'?
unsigned char ghostmask1[FIELDMASK_SIZE];
^~~~~~~~~~~~~~
FD_SETSIZE
In file included from cmtk/core/Utilities/numdiff-5.2.1/numdiff.h:23:0,
from cmtk/core/Utilities/numdiff-5.2.1/analyze.c:52:
cmtk/core/Utilities/numdiff-5.2.1/system.h:354:15: error: unknown type name 'uintmax_t'
# define word uintmax_t
^
cmtk/core/Utilities/numdiff-5.2.1/numdiff.h:494:5: note: in expansion of macro 'word'
word *buffer;
^~~~
make[2]: *** [Utilities/numdiff-5.2.1/CMakeFiles/numdiff.dir/analyze.o] Error 1
make[1]: *** [Utilities/numdiff-5.2.1/CMakeFiles/numdiff.dir/all] Error 2
make: *** [all] Error 2
------------------------------------
Jan 10, 2023  08:01 PM | Greg Jefferis
RE: Compile issue
Might need some more details of what you have done, but have you successfully run cmake before starting the build?

See e.g. this thread for the steps required to build:

https://www.nitrc.org/forum/forum.php?th...

Best,

Greg.

Originally posted by Antonio Ulloa:
Hello, while compiling 3.3.2 from source we get the error below and we were hoping to get some guidance as to how to fix it. Thanks!

--------------------------------
In file included from cmtk/core/Utilities/numdiff-5.2.1/analyze.c:52:0:
cmtk/core/Utilities/numdiff-5.2.1/numdiff.h:117:28: error: 'FIELDMASK_SIZE' undeclared here (not in a function); did you mean 'FD_SETSIZE'?
unsigned char ghostmask1[FIELDMASK_SIZE];
^~~~~~~~~~~~~~
FD_SETSIZE
In file included from cmtk/core/Utilities/numdiff-5.2.1/numdiff.h:23:0,
from cmtk/core/Utilities/numdiff-5.2.1/analyze.c:52:
cmtk/core/Utilities/numdiff-5.2.1/system.h:354:15: error: unknown type name 'uintmax_t'
# define word uintmax_t
^
cmtk/core/Utilities/numdiff-5.2.1/numdiff.h:494:5: note: in expansion of macro 'word'
word *buffer;
^~~~
make[2]: *** [Utilities/numdiff-5.2.1/CMakeFiles/numdiff.dir/analyze.o] Error 1
make[1]: *** [Utilities/numdiff-5.2.1/CMakeFiles/numdiff.dir/all] Error 2
make: *** [all] Error 2
------------------------------------
Jan 12, 2023  03:01 PM | Antonio Ulloa
RE: Compile issue
Thanks for your response. I had followed the steps that you provided in the link and so I was puzzled by that error, which seems to come from numdiff. And so I looked back at the "cmake -C..." step and I see several warning regarding *.h include files not found. Do you by any chance have a list of all dependencies I need to have on my end to be able to compile? I am trying to install on centos7 using cmake 3.16.4 and gcc 7.4.0. Back in 2018 I compiled cmtk 3.3.1 with no problems at all. By the way, is there a container version for cmtk? Thanks again!
Jan 12, 2023  03:01 PM | Antonio Ulloa
RE: Compile issue
Actually, I wanted to clarify that this is (partial output) what I get at the "cmake..." step:

-------------------------------
[...]
-- Using system zlib
-- Could NOT find MXML (missing: MXML_LIBRARIES MXML_INCLUDE_DIRS)
-- Building bundled mxml due to missing system mxml
-- Found system libbz2
-- Could NOT find LZMA (missing: LZMA_LIBRARIES LZMA_INCLUDE_DIRS)
-- Could NOT find DCMTK (missing: DCMTK_config_INCLUDE_DIR DCMTK_ofstd_INCLUDE_DIR DCMTK_ofstd_LIBRARY DCMTK_dcmdata_INCLUDE_DIR DCMTK_dcmdata_LIBRARY DCMTK_dcmimgle_INCLUDE_DIR DCMTK_dcmimgle_LIBRARY)
-- DCMTK library not found - defaulting to bundled version.
-- Building bundled DCMTK library for DICOM support.
-- BUILD_TESTING is active - building numdiff for tolerant numerical comparisons
[...]
-- Configuring done
-- Generating done
-- Build files have been written to: cmtk/3.3.2
-----------------------------

and then at the "make..." step I get warnings regarding several include *.h files are not found and this at the end:

-----------------------------
--------------------------------
In file included from cmtk/core/Utilities/numdiff-5.2.1/analyze.c:52:0:
cmtk/core/Utilities/numdiff-5.2.1/numdiff.h:117:28: error: 'FIELDMASK_SIZE' undeclared here (not in a function); did you mean 'FD_SETSIZE'?
unsigned char ghostmask1[FIELDMASK_SIZE];
^~~~~~~~~~~~~~
FD_SETSIZE
In file included from cmtk/core/Utilities/numdiff-5.2.1/numdiff.h:23:0,
from cmtk/core/Utilities/numdiff-5.2.1/analyze.c:52:
cmtk/core/Utilities/numdiff-5.2.1/system.h:354:15: error: unknown type name 'uintmax_t'
# define word uintmax_t
^
cmtk/core/Utilities/numdiff-5.2.1/numdiff.h:494:5: note: in expansion of macro 'word'
word *buffer;
^~~~
make[2]: *** [Utilities/numdiff-5.2.1/CMakeFiles/numdiff.dir/analyze.o] Error 1
make[1]: *** [Utilities/numdiff-5.2.1/CMakeFiles/numdiff.dir/all] Error 2
make: *** [all] Error 2
------------------------------------
-----------------------------
Jan 12, 2023  06:01 PM | Greg Jefferis
Compile issue

>
Thanks, Antonio. Those missing headers sound like part of the problem. cmake should check for existence of many. Are there no other issues with cmake?

If not, then it feels like there is something odd about the setup for your include files / compiler. For example are all the includes definitely associated with the same compiler installation ie gcc 7.4? If you have a mix of includes installed by different toolchains, I imagine that could cause some problems.

In general I find that compiling CMTK on new installations is pretty reliable so I am a bit suspicious that there is something strange about yours setup.

I would recommend to include the full cmake and make output so we can sniff for clues about the problem.
Jan 17, 2023  04:01 PM | Antonio Ulloa
RE: Compile issue
Thanks for the advice!

I decided to go back to the original instructions and start from a clean directory. This time I followed very very closely the steps provided, down to the creation of a directory named "core" and the creation of a "build" directory (not located within the "core" directory tree) and this time both cmake and make ran successfully. I tested dcm2image on a bunch of DICOM files and the test completed suceesfully.

Thanks very much for the feedback and for actively developing cmtk toolkit!

Best,