Failed test with snapshot from 20131114

Compilation and installation of DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
ghleclerc
Posts: 9
Joined: Thu, 2013-11-07, 06:18
Location: Canada

Failed test with snapshot from 20131114

#1 Post by ghleclerc »

Hello,

I am not sure if this is the right place to ask this question. Hoping it is. Sorry if it's not. Just let me know where to do it.

I am building DCMTK on Windows.

I don't have a choice of my operating system version here at the hospital, so the machine is Windows XP, Service Pack 3. I have Visual Studio Express 2010, Service Pack 1 (SP1Rel) installed. I am using CMake version 2.8.12.1 downloaded form the official site.

I have compiled the latest DCMTK snapshot (3.6.1) found here:
http://dicom.offis.de/download/dcmtk/snapshot/

As the title of the post implies, I have downloaded the 2013-11-14 snapshot that is available. I have used cmake to create a 2010 visual studio solution and selected ALL_BUILD. Then, I have selected the RUN_TESTS target and ran all tests.

I get a failure on the test 41 - ofstd_markup_6. I was wondering if this is normal or not; if this is a known issue?

I should say that I have also compiled the library using two compiler flags:
1) -DDCMTK_LOG4CPLUS_DISABLE_ERROR to minimize the output to the command line on some of my applications
2) /MD changed for /MT and /MDd changed for /MTd to get completely static library

When I add these two flags, then I get two tests failing: 41 - ofstd_markup_6 and 31 - ofstd_atof. Again, not sure if this is normal or not. I have tried Googling these errors and I have searched the forum for info on these, but I have not found information on it. If memory serves (and I will probably test this later today), I did not have any error when running the tests after compiling the previous snapshot (2012-11-02).

Thanks



Edit : 2013-11-26 at 10:26 (EST)
I forgot to say that I set the CMAKE_BUILD_TYPE to Release when not compiling with Visual Studio (I have tried compiling with nmake as well, another fact I forgot to mention :oops:). Don't know if it makes much of a difference. I will try in Debug and Release modes. I am still investigating this to try and get no error. Might not work and go back to previous snapshot. I am not sure the errors are significant, but not knowing, I am not sure I want to take a chance.

Also, as I said I would try, I just re-compiled the previous snapshot (3.6.1, 2012-11-02) and ran the tests. The test ofstd_markup_6 did not exist, so it could not have failed. :oops: As is the case for the latest snapshot, the ofstd_atof did not fail when compiling without the supplementary compiler flags that I define, but fails when I add them. Are they the problem ? Is it normal ?



Edit : 2013-11-26 at 10:51 (EST)
I just built the previous snapshot (3.6.1, 2012-11-02) using Visual Studio, not defining my extra compiler flags and selecting release mode. When running the tests, the ofstd_atof one fails. Might it be that this test always fails in release mode?

J. Riesmeier
DCMTK Developer
Posts: 2506
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: Failed test with snapshot from 20131114

#2 Post by J. Riesmeier »

Thank you for your detailed report. The issue with "ofstd_markup_6" has just been fixed with the following commit: http://git.dcmtk.org/web?p=dcmtk.git;a= ... 8ddd75418f

I can confirm the issue with "ofstd_atof", but I thought it had been fixed already since it was marked as "closed" in our issue tracker (just opened it again).

Regarding your first change (use -DDCMTK_LOG4CPLUS_DISABLE_ERROR), I don't think that this is really a good idea. Why don't you just disable certain log level at run-time?
Regarding your second change (code generation options), I don't think that they are necessary when using the DCMTK-specific defaults. At least not when using "Visual Studio"
(see CMakeLists.txt files that are shipped with the source code package of the DCMTK).

Code: Select all

IF(DCMTK_OVERWRITE_WIN32_COMPILER_FLAGS AND NOT BUILD_SHARED_LIBS)

  # settings for Microsoft Visual Studio
  IF(CMAKE_GENERATOR MATCHES "Visual Studio .*")
    # get Visual Studio Version
    STRING(REGEX REPLACE "Visual Studio ([0-9]+).*" "\\1" VS_VERSION "${CMAKE_GENERATOR}")
    # these settings never change even for C or C++
    SET(CMAKE_C_FLAGS_DEBUG "/MTd /Z7 /Od")
    SET(CMAKE_C_FLAGS_RELEASE "/DNDEBUG /MT /O2")
    SET(CMAKE_C_FLAGS_MINSIZEREL "/DNDEBUG /MT /O2")
    SET(CMAKE_C_FLAGS_RELWITHDEBINFO "/DNDEBUG /MTd /Z7 /Od")
    SET(CMAKE_CXX_FLAGS_DEBUG "/MTd /Z7 /Od")
    SET(CMAKE_CXX_FLAGS_RELEASE "/DNDEBUG /MT /O2")
    SET(CMAKE_CXX_FLAGS_MINSIZEREL "/DNDEBUG /MT /O2")
    SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/DNDEBUG /MTd /Z7 /Od")
    # specific settings for the various Visual Studio versions
    IF(VS_VERSION EQUAL 6)
      SET(CMAKE_C_FLAGS "/nologo /W3 /GX /Gy /YX")
      SET(CMAKE_CXX_FLAGS "/nologo /W3 /GX /Gy /YX /Zm500") # /Zm500 increments heap size which is needed on some system to compile templates in dcmimgle
    ENDIF(VS_VERSION EQUAL 6)
    IF(VS_VERSION EQUAL 7)
      SET(CMAKE_C_FLAGS "/nologo /W3 /Gy")
      SET(CMAKE_CXX_FLAGS "/nologo /W3 /Gy")
    ENDIF(VS_VERSION EQUAL 7)
    IF(VS_VERSION GREATER 7)
      SET(CMAKE_C_FLAGS "/nologo /W3 /Gy /EHsc")
      SET(CMAKE_CXX_FLAGS "/nologo /W3 /Gy /EHsc")
    ENDIF(VS_VERSION GREATER 7)
  ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio .*")

ghleclerc
Posts: 9
Joined: Thu, 2013-11-07, 06:18
Location: Canada

Re: Failed test with snapshot from 20131114

#3 Post by ghleclerc »

Thank you for such a rapid response. Much appreciated.
J. Riesmeier wrote:Thank you for your detailed report. The issue with "ofstd_markup_6" has just been fixed with the following commit
If I want that fix, I just use git to pull the latest working copy ? I am sorry if this is a newbie question, but I have not used DCMTK in any other way then the snapshot or official release.

J. Riesmeier wrote:Regarding your first change (use -DDCMTK_LOG4CPLUS_DISABLE_ERROR), I don't think that this is really a good idea. Why don't you just disable certain log level at run-time?
As always when we talk, because I did not know any better. :( In the application I am working on, I am trying to load all files in a folder as a DICOM and check for the return code. If it failed, then I act as though the file is not DICOM or is corrupted and simply ignore it. To test my code, I took a DICOM file and corrupted it myself, left it in my folder and ran my application. What happens is that the function loadFile() still outputs errors when it tries to open the corrupted file and what I would like is for it to be silent. I was looking for a way to stop the messages and the only one I could find was the compilation flag. I will look into the runtime option again, but if you could point me in the right direction, it would be greatly appreciated. :)

J. Riesmeier wrote:Regarding your second change (code generation options), I don't think that they are necessary when using the DCMTK-specific defaults.
I usually don't use Visual Studio and use jom (you might already know about it, but for completion sake : http://qt-project.org/wiki/jom) to compile. And I changed them because when I hit configure in cmake-gui, the flags appear to be MD and MDd. I will stop changing them if it is not useful. Thanks for the information.

ghleclerc
Posts: 9
Joined: Thu, 2013-11-07, 06:18
Location: Canada

Re: Failed test with snapshot from 20131114

#4 Post by ghleclerc »

Just because if someone searches for log levels, they might find this post, I did find a way to set the log level at runtime. Here is what I came up with. Hope its a better approach then the compilation flag.

Code: Select all

#include <dcmtk/oflog/oflog.h>

using dcmtk::log4cplus::Logger;

Logger mainLog = Logger::getRoot();
mainLog.setLogLevel( dcmtk::log4cplus::FATAL_LOG_LEVEL );

J. Riesmeier
DCMTK Developer
Posts: 2506
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: Failed test with snapshot from 20131114

#5 Post by J. Riesmeier »

Here's also more background information on the logging issue: http://support.dcmtk.org/wiki/dcmtk/howto/logprogram

And, regarding the code generation flags: make sure that the CMake option DCMTK_OVERWRITE_WIN32_COMPILER_FLAGS is enabled and BUILD_SHARED_LIBS is disabled. Both should be the default values.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest