DICOM @ OFFIS

Discussion Forum for OFFIS DICOM Tools - For registration, send email with desired user name to the OFFIS DICOM team
It is currently Thu, 2017-08-17, 16:35

All times are UTC + 1 hour




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Thu, 2017-05-18, 22:24 
Offline

Joined: Tue, 2013-09-17, 10:24
Posts: 5
Location: Stanford, CA
I'm trying to compile and run DCMTK in a minimal Alpine Linux Docker container, which uses musl libc instead of glibc.

The unmodified source of dcmtk-3.6.1_20170228.tar.gz fails to build with the following error.

Code:
/tmp/dcmtk-3.6.1_20170228 # make config-all
(cd config && make ARCH="" DESTDIR="" all)
make[1]: Entering directory '/tmp/dcmtk-3.6.1_20170228/config'
c++ -O  -D_REENTRANT -D_XOPEN_SOURCE_EXTENDED -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_POSIX_C_SOURCE=199506L -Wall  -Iinclude -I../ofstd/include -I../ofstd/libsrc -oarith arith.cc
arith.cc: In function 'void provoke_snan()':
arith.cc:323:32: error: there are no arguments to 'feenableexcept' that depend on a template parameter, so a declaration of 'feenableexcept' must be available [-fpermissive]
     feenableexcept( FE_INVALID );
                                ^
arith.cc:323:32: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
arith.cc: In function 'int test_snan(std::ostream&, const char*)':
arith.cc:350:33: error: there are no arguments to 'fedisableexcept' that depend on a template parameter, so a declaration of 'fedisableexcept' must be available [-fpermissive]
     fedisableexcept( FE_INVALID );
                                 ^
arith.cc: In instantiation of 'int test_snan(std::ostream&, const char*) [with T = float; std::ostream = std::basic_ostream<char>]':
arith.cc:572:54:   required from here
arith.cc:350:20: error: 'fedisableexcept' was not declared in this scope
     fedisableexcept( FE_INVALID );
                    ^
arith.cc: In instantiation of 'int test_snan(std::ostream&, const char*) [with T = double; std::ostream = std::basic_ostream<char>]':
arith.cc:573:56:   required from here
arith.cc:350:20: error: 'fedisableexcept' was not declared in this scope
arith.cc: In instantiation of 'void provoke_snan() [with T = float]':
arith.cc:339:58:   required from 'int test_snan(std::ostream&, const char*) [with T = float; std::ostream = std::basic_ostream<char>]'
arith.cc:572:54:   required from here
arith.cc:323:19: error: 'feenableexcept' was not declared in this scope
     feenableexcept( FE_INVALID );
                   ^
arith.cc: In instantiation of 'void provoke_snan() [with T = double]':
arith.cc:339:58:   required from 'int test_snan(std::ostream&, const char*) [with T = double; std::ostream = std::basic_ostream<char>]'
arith.cc:573:56:   required from here
arith.cc:323:19: error: 'feenableexcept' was not declared in this scope
Makefile:67: recipe for target 'arith' failed
make[1]: *** [arith] Error 1
make[1]: Leaving directory '/tmp/dcmtk-3.6.1_20170228/config'
Makefile:97: recipe for target 'config-all' failed
make: *** [config-all] Error 2


This failure can easily be reproduced with the following command:
Code:
docker run -it --rm alpine sh -c "
apk add --no-cache build-base curl
cd /tmp
curl http://support.dcmtk.org/redmine/attachments/download/104/dcmtk-3.6.1_20170228.tar.gz | tar xz
cd dcmtk-*
./configure
make
"


According to the C++ reference, feenableexcept() is not part of the standard for fenv.h. It is rather an extension added by glibc for trapping floating-point exceptions.

By simply dropping the line defining HAVE_FENV_H from config/configure, I can get the code to compile and run. Obviously, this is not the proper way to do it, but it was the quickest.

Questions:
    Is there a better way to do this?
    Is feenableexcept() actually needed or could it be removed?
    Could the check for fenv.h be expanded to include a check for feenableexcept()?

Thanks,
Gunnar


Top
 Profile  
 
PostPosted: Fri, 2017-05-19, 10:16 
Offline
OFFIS DICOM Team
OFFIS DICOM Team

Joined: Mon, 2014-03-03, 09:51
Posts: 193
Location: Oldenburg, Germany
We've also noticed problems regarding feenableexcept recently on OpenIndiana and are already working on a fix that detects feenableexcept with a separate configuration test and sets the respective CPU flags "by hand" instead if feenableexcept is not available. Stay tuned, I expect it to be commited during the next few days.


Top
 Profile  
 
PostPosted: Fri, 2017-05-19, 17:37 
Offline

Joined: Tue, 2013-09-17, 10:24
Posts: 5
Location: Stanford, CA
Thanks for your response, Jan. Looking forward to trying it out soon.


Top
 Profile  
 
PostPosted: Fri, 2017-05-26, 16:16 
Offline
OFFIS DICOM Team
OFFIS DICOM Team

Joined: Mon, 2014-03-03, 09:51
Posts: 193
Location: Oldenburg, Germany
It's here: http://git.dcmtk.org/?p=dcmtk.git;a=com ... 92a2418d87


Top
 Profile  
 
PostPosted: Wed, 2017-05-31, 00:59 
Offline

Joined: Tue, 2013-09-17, 10:24
Posts: 5
Location: Stanford, CA
Thanks again. Now it compiles and runs successfully on Alpine.


Top
 Profile  
 
PostPosted: Wed, 2017-05-31, 13:10 
Offline
OFFIS DICOM Team
OFFIS DICOM Team

Joined: Mon, 2014-03-03, 09:51
Posts: 193
Location: Oldenburg, Germany
Great!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group