## -*-text-*- ## ## HowTo install the OFFIS DICOM toolkit dcmtk350 in our IRIX environment ## # $Id: HowTo-Install-dcmtk350.txt,v 1.2 2001/06/14 10:02:39 meyer Exp $ # $Source: /people/staff2/meyer/.cvsroot/public_html/dcmtk/HowTo-Install-dcmtk350.txt,v $ This text describes how I compiled dcmtk-350rc1 on a SGI Onyx2 running IRIX 6.5.6m using gcc/g++ 2.95.2. The crucial step is to remove -lsocket and -lnsl from the list of linked libraries, and to remove /usr/lib from the linkpath. These are known flaws of autoconf/configure, as stated in http://toolbox.sgi.com/TasteOfDT/public/freeware/shared/howto.html Compiling in OpenSSL support rises another problem, that can be solved by careful selection of compiler options, as stated below. * Configure: - By default, configure grabs gcc, c++ and libtool as compiler and archiver. This can be overridden by setting CC, CXX and AR: 15:23 meyer@forte:~mtdyna/related_software/dcmtk350_rc1> ./configure --prefix=/usr/local/dcmtk350 --with-openssl --with-opensslinc=/usr/local/ssl Running configure for module config. creating cache ./config.cache checking whether make sets ${MAKE}... yes [...] updating cache ./config.cache creating ./config.status creating ./apps/Makefile creating ./docs/Makefile creating ./Makefile creating ./include/Makefile creating ./tests/Makefile creating ./wwwapps/Makefile creating ./libsrc/Makefile * Two problems occur, both well known flaws of autoconf: - configure wants to link with -lsocket, -lnsl. They are not needed under IRIX 6.x. - configure adds "-L /usr/lib" to the linker flags, which is wrong if /usr/lib32 is present. (One should leave this to the linker himself )-: To fix this: - cd conf - edit config.status - remove -lsocket - remove -lnsl - remove -L /usr/lib - rerun config.status (./config.status) - cd .. - for reference, here is a diff: 15:32 meyer@onyx2:~mtdyna/related_software/dcmtk342-rc1/config> diff config.status* 45c45 < s%@LIBS@%-lrt -lpthread %g --- > s%@LIBS@%-lrt -lpthread -lsocket -lnsl %g 77c77 < s%@X_LIBS@%%g --- > s%@X_LIBS@% -L/usr/lib%g See http://toolbox.sgi.com/TasteOfDT/public/freeware/shared/howto.html for mor info. * Another problem occurs when compiling in OpenSSL support, only. This needs tweeking with compilerflags. Defining so many macros confuses IRIX, so I tried a minimalistic approach and succeeded with only 4 macros. You have to modify CXXFLAGS in config/config.status like that: # s%@CXXFLAGS@%-O -I/usr/local/ssl/include -D_REENTRANT -D_XOPEN_SOURCE_EXTENDED -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_POSIX_C_SOURCE=199506L -Wall %g s%@CXXFLAGS@%-O -I/usr/local/ssl/include -D_REENTRANT -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE -D_BSD_COMPAT -Wall %g Then rerun config.status (cd config; ./config.status; cd ..) and remake. * Make: - pmake, smake and make fail (with different problems, Makefiles not thread-safe) -> use GNUmake * Don't forget: Kaum macht man's richtig, schon gehts. # APPENDIX: Compile error with OpenSSL and default CXXFLAGS: Failure compiling dulfsm.cc [....] c++ -DHAVE_CONFIG_H -DNDEBUG -c -I. -I. -I../include -I../../config/include -I../../ofstd/include -I../../dcmdata/include -I/usr/local/dcmtk350/include/ofstd -I/usr/local/dcmtk350/include/dcmdata \ -O -I/usr/local/ssl/include -D_REENTRANT -D_XOPEN_SOURCE_EXTENDED -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_POSIX_C_SOURCE=199506L -Wall dulfsm.cc In file included from dulfsm.cc:92: /usr/include/netinet/tcp.h:52: declaration of `u_char tcphdr::th_off' /usr/include/netinet/tcp.h:49: conflicts with previous declaration `u_char tcphdr::th_off' /usr/include/netinet/tcp.h:53: declaration of `u_char tcphdr::th_x2' /usr/include/netinet/tcp.h:48: conflicts with previous declaration `u_char tcphdr::th_x2' /usr/include/netinet/tcp.h:53: duplicate member `tcphdr::th_x2' /usr/include/netinet/tcp.h:52: duplicate member `tcphdr::th_off' gmake[2]: *** [dulfsm.o] Error 1 gmake[2]: Leaving directory `/projects/mtdyna/related_software/dcmtk350_rc1/dcmnet/libsrc' gmake[1]: *** [libsrc-all] Error 2 gmake[1]: Leaving directory `/projects/mtdyna/related_software/dcmtk350_rc1/dcmnet' gmake: *** [dcmnet-all] Error 2