The unmodified source of dcmtk-3.6.1_20170228.tar.gz fails to build with the following error.
Code: Select all
/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
Code: Select all
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
"
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()?
Gunnar