Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#22840 closed defect (fixed)

dcmtk: Need to add compiler flag to make this port work with Snow Leopard

Reported by: wojtek@… Owned by: guidolorenz@…
Priority: Normal Milestone:
Component: ports Version: 1.8.1
Keywords: Cc: ryandesign (Ryan Carsten Schmidt), dershow
Port: dcmtk

Description

This port does not presently install due to compiler errors. Need to add the following flag to CFLAGS and CXXFLAGS in Makefile.def:

-D_DARWIN_C_SOURCE

After that all is ok. Full error prior to modification appears below:

Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_dcmtk/work/dcmtk-3.5.4" && /usr/bin/make all " returned error 2
Command output: (cd config && /usr/bin/make ARCH="" DESTDIR="" all)
make[1]: Nothing to be done for `all'.
(cd ofstd && /usr/bin/make ARCH="" DESTDIR="" all)
(cd include; /usr/bin/make ARCH="" all)
make[2]: Nothing to be done for `all'.
(cd libsrc; /usr/bin/make ARCH="" all)
/usr/bin/g++-4.2	-DHAVE_CONFIG_H  -DNDEBUG  -c -I. -I. -I../include -I../../config/include   \
		-I/opt/local/include -O -I/opt/local/include/libxml2 -D_REENTRANT -D_XOPEN_SOURCE_EXTENDED -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_POSIX_C_SOURCE=199506L -O2 -arch x86_64 oflist.cc
/usr/bin/g++-4.2	-DHAVE_CONFIG_H  -DNDEBUG  -c -I. -I. -I../include -I../../config/include   \
		-I/opt/local/include -O -I/opt/local/include/libxml2 -D_REENTRANT -D_XOPEN_SOURCE_EXTENDED -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_POSIX_C_SOURCE=199506L -O2 -arch x86_64 ofstring.cc
In file included from /usr/include/sys/attr.h:42,
                 from /usr/include/sys/mount.h:76,
                 from /usr/include/libc.h:45,
                 from ../include/dcmtk/ofstd/ofstdinc.h:320,
                 from ../include/dcmtk/ofstd/ofstring.h:61,
                 from ofstring.cc:47:
/usr/include/sys/ucred.h:91: error: 'u_long' does not name a type
/usr/include/sys/ucred.h:137: error: 'u_int' does not name a type
In file included from /usr/include/sys/mount.h:76,
                 from /usr/include/libc.h:45,
                 from ../include/dcmtk/ofstd/ofstdinc.h:320,
                 from ../include/dcmtk/ofstd/ofstring.h:61,
                 from ofstring.cc:47:
/usr/include/sys/attr.h:77: error: 'u_short' does not name a type
/usr/include/sys/attr.h:430: error: 'u_long' does not name a type
/usr/include/sys/attr.h:442: error: 'u_char' does not name a type
make[2]: *** [ofstring.o] Error 1
make[1]: *** [libsrc-all] Error 2
make: *** [ofstd-all] Error 2

Attachments (3)

patch-config-configure.in.diff (1.5 KB) - added by guidolorenz@… 14 years ago.
Portfile.diff (4.4 KB) - added by guidolorenz@… 14 years ago.
dcmtk.diff (1.6 KB) - added by ryandesign (Ryan Carsten Schmidt) 14 years ago.
fix the fix

Download all attachments as: .zip

Change History (20)

comment:1 Changed 14 years ago by mf2k (Frank Schima)

Owner: changed from macports-tickets@… to guidolorenz@…

comment:2 Changed 14 years ago by mf2k (Frank Schima)

Priority: HighNormal

Changed 14 years ago by guidolorenz@…

comment:3 Changed 14 years ago by guidolorenz@…

The attached patch file incorporates the -D_DARWIN_C_SOURCE flag and also fixes the port on Snow Leopard. It is meant as a replacement for the existing configure.in patch. The other two patches aren't needed anymore, due to Portfile changes.

Let me know if this does not solve your problem. Otherwise, can someone please commit the files?

comment:4 Changed 14 years ago by raimue (Rainer Müller)

I recommend not to hardcode version numbers in a Portfile as that makes updates more complicated later. port lint also emits a warning for this.

comment:5 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Has duplicate #23982.

Changed 14 years ago by guidolorenz@…

Attachment: Portfile.diff added

comment:6 Changed 14 years ago by guidolorenz@…

The reason for dcmtk-3.5.4_p2.tar.gz being hardcoded is that it's a patch file -- when updating, it needs to be removed from the Portfile anyway. Using ${name}-${version}${extract.suffix} instead did not make much sense to me, as it would have disguised that fact.

However, I hereby retire as a maintainer anyway, since I do not have any kind of commitment to this port anymore. Feel free to alter the Portfile as you like.

Cheers,
Guido

comment:7 Changed 14 years ago by michionken@…

Thanks for the suggested patch Guido, I will apply it to DCMTK source code repository so it will be part of the next snapshot.

Michael Onken (OFFIS DICOM Team)

comment:8 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… added
Resolution: fixed
Status: newclosed
Summary: Need to add compiler flag to make this port work with Leoparddcmtk: Need to add compiler flag to make this port work with Snow Leopard

Thanks, committed in r67316 along with adding a dependency on openssl since it does link with openssl's libraries.

comment:9 Changed 14 years ago by dershow

Resolution: fixed
Status: closedreopened

I had this port working fine, using the above mentioned fix, and then the update from 3.5.4_p2_0 to 3.5.4_p2_1 has again broken it on 10.5 with similar errors to those above.

comment:10 Changed 14 years ago by dershow

Cc: dersh@… added

Cc Me!

comment:11 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

In r67316 I applied the patches that are provided above. If those are the patches you used before, and they worked for you before, I don't understand why 3.5.4_p2_1 isn't working for you now, since that should be exactly the same thing. Then again, the patches above were to fix Snow Leopard, and you're now writing with problems on Leopard. Please provide a complete debug log so we can see what's going on.

comment:12 Changed 14 years ago by dershow

I actually had built it on two different machines, one is 10.5 (G5) and one is 10.6 (Intel). I don't recall which one had the problem a while ago. But, this new upgrade worked for 10.6, but not for 10.5. Here is my log:

sudo port clean --all dcmtk
--->  Cleaning dcmtk
murrays-desktop:~ dersh$ sudo port upgrade dcmtk -d
--->  Computing dependencies for dcmtk
--->  Fetching dcmtk
--->  Attempting to fetch dcmtk-3.5.4.tar.gz from http://distfiles.macports.org/dcmtk
--->  Attempting to fetch dcmtk-3.5.4_p2.tar.gz from http://distfiles.macports.org/dcmtk
--->  Verifying checksum(s) for dcmtk
--->  Extracting dcmtk
--->  Applying patches to dcmtk
--->  Configuring dcmtk
--->  Building dcmtk
Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_dcmtk/work/dcmtk-3.5.4" && /usr/bin/make all " returned error 2
Command output: (cd config && /usr/bin/make ARCH="" DESTDIR="" all)
make[1]: Nothing to be done for `all'.
(cd ofstd && /usr/bin/make ARCH="" DESTDIR="" all)
(cd include; /usr/bin/make ARCH="" all)
make[2]: Nothing to be done for `all'.
(cd libsrc; /usr/bin/make ARCH="" all)
/usr/bin/g++-4.0	-DHAVE_CONFIG_H  -DNDEBUG  -c -I. -I. -I../include -I../../config/include   \
		-I/opt/local/include -O -I/opt/local/include/libxml2 -D_REENTRANT -D_XOPEN_SOURCE_EXTENDED -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_POSIX_C_SOURCE=199506L -O2 -arch ppc oflist.cc
/usr/bin/g++-4.0	-DHAVE_CONFIG_H  -DNDEBUG  -c -I. -I. -I../include -I../../config/include   \
		-I/opt/local/include -O -I/opt/local/include/libxml2 -D_REENTRANT -D_XOPEN_SOURCE_EXTENDED -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_POSIX_C_SOURCE=199506L -O2 -arch ppc ofstring.cc
/usr/include/bsm/audit.h:224: error: expected ';' before '*' token
/usr/include/bsm/audit.h:234: error: expected ';' before '*' token
/usr/include/sys/ucred.h:90: error: 'u_long' does not name a type
/usr/include/sys/ucred.h:130: error: 'u_int' does not name a type
/usr/include/sys/attr.h:75: error: 'u_short' does not name a type
/usr/include/sys/attr.h:411: error: 'u_long' does not name a type
/usr/include/sys/attr.h:423: error: 'u_char' does not name a type
make[2]: *** [ofstring.o] Error 1
make[1]: *** [libsrc-all] Error 2
make: *** [ofstd-all] Error 2

Error: Unable to upgrade port: 1
Before reporting a bug, first run the command again with the -d flag to get complete output.

Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Attachment: dcmtk.diff added

fix the fix

comment:13 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

I think the fix may be simple. (The syntax used for the Tiger / Leopard part in the patch was wrong.) I attached a patch that might fix it; I'm currently testing.

comment:14 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: reopenedclosed

Yes, that was it. Committed in r69433 and verified it builds on Tiger i386, Leopard ppc and Snow Leopard x86_64.

comment:15 Changed 14 years ago by dershow

Resolution: fixed
Status: closedreopened

I just tried to upgrade to 3.5.4_p2_2 on two different machines. The G5 is running Leopard, so I am still on 3.5.4_p2_0, since I was never able to get that upgrade to work to p2_1. While on a MacBook Pro, running 10.6.4 I have 3.5.4_p2_1.

Both upgrades to p2_2 gave the same error:

--->  Building dcmtk
Error: Target org.macports.build returned: shell command failed
Log for dcmtk is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_dcmtk/main.log
Error: Unable to upgrade port: 1
To report a bug, see <http://guide.macports.org/#project.tickets>

comment:16 in reply to:  15 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: reopenedclosed

Replying to dersh@…:

I just tried to upgrade to 3.5.4_p2_2 on two different machines. The G5 is running Leopard, so I am still on 3.5.4_p2_0, since I was never able to get that upgrade to work to p2_1. While on a MacBook Pro, running 10.6.4 I have 3.5.4_p2_1.

This ticket was fixed by r69433. You should have been able to install 3.5.4_p2_1 after that revision was committed.

Both upgrades to p2_2 gave the same error:

---> Building dcmtk
Error: Target org.macports.build returned: shell command failed
Log for dcmtk is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_dcmtk/main.log

Since you did not supply the logfile I can only guess, but I assume this is a totally new and unrelated error which I have filed as #25608.

comment:17 Changed 14 years ago by dershow

Ooops. Yes, you are correct, this is the same the new ticket you listed above. Sorry I missed it. I never got P2_1 to install on Leopard, but it is possible that I never tried since the upgrade to _2 happened soon after.

Note: See TracTickets for help on using tickets.