HP-UX installation problem

Compilation and installation of DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
pbnoel
Posts: 15
Joined: Fri, 2009-08-14, 12:05

HP-UX installation problem

#1 Post by pbnoel »

Hello,

right now I'm trying to install dcmtk on a HP-UX maschine. The ./configure runs without any problem. However, when starting ./make I get the following error message:

ofstd.cc: In function 'int my_isinf(double)':
ofstd.cc:216: error: 'finite' was not declared in this scope

I looked around the forum, but was not able to find any answer... Any Idea what I need to do?

Thanks, Peter

Michael Onken
DCMTK Developer
Posts: 2072
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

#2 Post by Michael Onken »

Hi Peter,

ah, good to know there are some HP-UX users... Actually we do only test on HP-UX for releases (last release being some time ago). Are you using a current snapshot of DCMTK? If not, please try (see http://dicom.offis.de/download/dcmtk/snapshot/) because there is lots of new code in there; maybe HP-UX compilations errors have also been fixed "accidentally" :wink:

Regards,
Michael

pbnoel
Posts: 15
Joined: Fri, 2009-08-14, 12:05

#3 Post by pbnoel »

Hi Michael,

thank you for your answer. Actually I use already the 3.5.4 version... However, I changed the following in ofstd.cc:

I commented out cmath and added #include <math.h> and in line 216 I changed finite to isfinite... After doing the changes I did not get this error anymore, but now I'm getting the following:

...
/usr/ccs/bin/ld: Unsatisfied symbols:
sem_post (first referenced in ../libsrc/libofstd.a (ofthread.o)) (code)
...
...

I'm new to this lib, so it may that I'm doing something stupid wrong. Any idea what I need to do to fix my problem?

Thank You, Peter
Michael Onken wrote:Hi Peter,

ah, good to know there are some HP-UX users... Actually we do only test on HP-UX for releases (last release being some time ago). Are you using a current snapshot of DCMTK? If not, please try (see http://dicom.offis.de/download/dcmtk/snapshot/) because there is lots of new code in there; maybe HP-UX compilations errors have also been fixed "accidentally" :wink:

Regards,
Michael

Michael Onken
DCMTK Developer
Posts: 2072
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

#4 Post by Michael Onken »

Hi Peter,

I don't think you are doing anything generally wrong but we do not regularly test on HP-UX and for the release (as the INSTALL file also explains) we only tested the following using the following combination:

HP-UX 10.20 / HP PA-RISC / GNU gcc 2.95.3

So there may be some extra work for other / newer combinations. Maybe we have the chance to get this running together and to incorporate the changes into DCMTK.
...
/usr/ccs/bin/ld: Unsatisfied symbols:
sem_post (first referenced in ../libsrc/libofstd.a (ofthread.o)) (code)
Seems that there is a library that needs to be linked additionally. Since I'm not familar with HP-UX, I don't know which... maybe disabling threads may help? (./configure --disable-threads)?

Regards,
Michael

pbnoel
Posts: 15
Joined: Fri, 2009-08-14, 12:05

#5 Post by pbnoel »

Michael,

I'm using a HP-UX U9000/800 B.11.23 with gcc 4.1.1...

After doing the following changes I got ``make all'' running with out problems. I performed the following steps, however, I think some of them are not a 100% proper.

1) ./configure --disable-threads

2) the cmath / finite changes as discribed before

3) In ofdate.cc commented out line 220

4) In oftime.cc commented out line 312

5) In wlfsim.cc commented out line 574

Please let me know if I did any critical changes. Now for testing dcmtk, what is the best way? Do you have a test .cc with makefile?

Thank You, Peter

Michael Onken wrote:Hi Peter,

I don't think you are doing anything generally wrong but we do not regularly test on HP-UX and for the release (as the INSTALL file also explains) we only tested the following using the following combination:

HP-UX 10.20 / HP PA-RISC / GNU gcc 2.95.3

So there may be some extra work for other / newer combinations. Maybe we have the chance to get this running together and to incorporate the changes into DCMTK.
...
/usr/ccs/bin/ld: Unsatisfied symbols:
sem_post (first referenced in ../libsrc/libofstd.a (ofthread.o)) (code)
Seems that there is a library that needs to be linked additionally. Since I'm not familar with HP-UX, I don't know which... maybe disabling threads may help? (./configure --disable-threads)?

Regards,
Michael

Michael Onken
DCMTK Developer
Posts: 2072
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

#6 Post by Michael Onken »

Hi Peter,

great, thanks for your feedback about how to get things running with a current HP-UX compiler combination. The problem you detected is just because many std c libraries differ in their exact API a littlebit. Thats why there are some #ifdef commands in the code that check during compilation, which system the code is compiled on and selects the right lib c function API call for that system.

Your changes to OFDate and OFTime are critical, because they are used to determine the current time and that can happen in many places of the toolkit. I have no developer documentation for HP-UX (nor can I find the appropriate library API information in HPs online documentation, but I guess you have it on your system.

Actually you must find out how the call to localtime_r(...) works on your machine. Maybe you or somebody from your team has the ability to check that? At least OFDate and OFTime should be fixed. The call is inside an #ifdef. Maybe you can just try using the other variant of the call currently in the #else tree: struct tm *lt = localtime(&tt); For testing, try removing line 217-220 and just insert that line above, so that #ifdef and #else tree are looking the same.

The worklist thing (wlfsim.cc) is also critical if you want to use the worklist server. It seems the readdir() call has another API than expected by DCMTK. So, also something to check like for OFDate/OFTime. You can also try to insert the readdir_r(...) call from line 569 instead, maybe this is the right one.

Unfortunately, there is no test system in DCMTK. For some routines we started coding tests but this is currently on a promille level ;) Of course we have something like that on our TODO list for years but at the moment there is no time for this. Some modules (e. g. dcmdata) do contain a tests directory, where you can go in and call the programs there. They will produce error messages if something is wrong. Howver, those tests are definetly not sufficient in any regard to test your DCMTK build.

Regards,
Michael

pbnoel
Posts: 15
Joined: Fri, 2009-08-14, 12:05

#7 Post by pbnoel »

Hi Michael,

Small update; For oftime and otdate I used localtime(&tt), that works without any problems. For the wlfsim.cc I could not find a solution. I'm planning to not use any server functions, therefore without that line 574 I could be fine?

Peter
Michael Onken wrote:Hi Peter,

great, thanks for your feedback about how to get things running with a current HP-UX compiler combination. The problem you detected is just because many std c libraries differ in their exact API a littlebit. Thats why there are some #ifdef commands in the code that check during compilation, which system the code is compiled on and selects the right lib c function API call for that system.

Your changes to OFDate and OFTime are critical, because they are used to determine the current time and that can happen in many places of the toolkit. I have no developer documentation for HP-UX (nor can I find the appropriate library API information in HPs online documentation, but I guess you have it on your system.

Actually you must find out how the call to localtime_r(...) works on your machine. Maybe you or somebody from your team has the ability to check that? At least OFDate and OFTime should be fixed. The call is inside an #ifdef. Maybe you can just try using the other variant of the call currently in the #else tree: struct tm *lt = localtime(&tt); For testing, try removing line 217-220 and just insert that line above, so that #ifdef and #else tree are looking the same.

The worklist thing (wlfsim.cc) is also critical if you want to use the worklist server. It seems the readdir() call has another API than expected by DCMTK. So, also something to check like for OFDate/OFTime. You can also try to insert the readdir_r(...) call from line 569 instead, maybe this is the right one.

Unfortunately, there is no test system in DCMTK. For some routines we started coding tests but this is currently on a promille level ;) Of course we have something like that on our TODO list for years but at the moment there is no time for this. Some modules (e. g. dcmdata) do contain a tests directory, where you can go in and call the programs there. They will produce error messages if something is wrong. Howver, those tests are definetly not sufficient in any regard to test your DCMTK build.

Regards,
Michael

Michael Onken
DCMTK Developer
Posts: 2072
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

#8 Post by Michael Onken »

Hi Peter,

Small update; For oftime and otdate I used localtime(&tt), that works without any problems. For the wlfsim.cc I could not find a solution. I'm planning to not use any server functions, therefore without that line 574 I could be fine?
a) thanks for the update, we will try to build a #ifdef workaround for HP-UX correspondingly.
b) yes, the wlfsim.cc is only needed for worklist server code; anything else will just work fine without that line.

Regards and have fun with DCMTK,
Michael

Michael Onken
DCMTK Developer
Posts: 2072
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

#9 Post by Michael Onken »

P.S:
3) In ofdate.cc commented out line 220
4) In oftime.cc commented out line 312
5) In wlfsim.cc commented out line 574
If you have the time, could you post the errors thrown by the compiler?

Thanks and regards,
Michael

pbnoel
Posts: 15
Joined: Fri, 2009-08-14, 12:05

#10 Post by pbnoel »

Michael Onken wrote:P.S:
3) In ofdate.cc commented out line 220
4) In oftime.cc commented out line 312
5) In wlfsim.cc commented out line 574
If you have the time, could you post the errors thrown by the compiler?

Thanks and regards,
Michael
Hi Michael,

sorry for the delay, I was out of Town...

Here the errors:

ofdate.cc: In member function 'bool OFDate::setCurrentDate(const time_t&)':
ofdate.cc:221:error: 'localtime_r' was not declared in this scope

oftime.cc: In member function 'bool OFTime::setCurrentTime(const time_t&)':
oftime.cc:313: error: 'localtime_r' was not declared in this scope

wlfsim.cc: In member function 'void WlmFileSystemInteractionManager::DetermineWorklistFiles(OfOrderedSet<OFString>&)':
wlfsim.cc:574: error: 'readdir_r' was not declared in this scope

I have one question or I have to ask you for a favor. I have the follwoing makefile and somehow I have a problem. Could you only quick look over the file and tell me what you think. Sorry I'm sure I'm a freshman in things like that...

CC=g++

CFLAGS=-c -ggdb3 -O3 -Wall -Wno-deprecated -I/opt/dcmtk-3.5.4/config/include -I/opt/dcmtk-3.5.4/dcmdata/include -I/opt/dcmtk-3.5.4/ofstd/include



LIBS=-rm

LIBSDCMTK=-L/opt/dcmtk-3.5.4/dcmimgle/libsrc -dcmimgle -L/opt/dcmtk-3.5.4/dcmdata/libsrc -dcmdata -L/opt/dcmtk-3.5.4/ofstd/libsrc -ofstd



FLAGS=-ggdb3

DIR=../

EXE=test_dcmtk



TEST_DCMTK_OBJ=\

main.o



.SUFFIXES: .cpp

.cpp.o:

$(CC) $(CFLAGS) $<



test_dcmtk: $(TEST_DCMTK_OBJ)

$(CC) $(FLAGS) -o $(DIR)$(EXE) $(TEST_DCMTK_OBJ) $(LIBSDCMTK) $(LIBS)



clean:

rm *.o *~

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest