Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not compiles with gcc-4.7.0 #51

Closed
GoogleCodeExporter opened this issue Mar 31, 2015 · 16 comments
Closed

Not compiles with gcc-4.7.0 #51

GoogleCodeExporter opened this issue Mar 31, 2015 · 16 comments
Labels
Milestone

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1.Use gentoo sci-astronomy/casacore-1.4.0 ebuild and gcc-4.7.0
2.
3.

What is the expected output? What do you see instead?
Compiles and run fine.

Please provide any additional information below.

cd /var/tmp/portage/sci-astronomy/casacore-1.4.0/work/casacore-1.4.0_build/casa 
&& /usr/bin/x86_64-pc-linux-gnu-g++  -Dcasa_casa_EXPORTS -DHAVE_HDF5 
-DHAVE_FFTW3 -DHAVE_FFTW3_THREADS -DHAVE_READLINE -DUSE_THREADS 
-DUSE_MULTI_THREADING  -DNDEBUG -O2 -pipe -ggdb -march=native  -pthread 
-fopenmp -fPIC 
-I/var/tmp/portage/sci-astronomy/casacore-1.4.0/work/casacore-1.4.0 
-I/var/tmp/portage/sci-astronomy/casacore-1.4.0/work/casacore-1.4.0_build    -o 
CMakeFiles/casa_casa.dir/Arrays/ArrayError.cc.o -c 
/var/tmp/portage/sci-astronomy/casacore-1.4.0/work/casacore-1.4.0/casa/Arrays/Ar
rayError.cc
In file included from 
/var/tmp/portage/sci-astronomy/casacore-1.4.0/work/casacore-1.4.0/casa/Arrays/Ar
rayBase.h:34:0,
                 from /var/tmp/portage/sci-astronomy/casacore-1.4.0/work/casacore-1.4.0/casa/Arrays/Array.h:32,
                 from /var/tmp/portage/sci-astronomy/casacore-1.4.0/work/casacore-1.4.0/casa/Arrays/ArrayUtil2.cc:33:
/var/tmp/portage/sci-astronomy/casacore-1.4.0/work/casacore-1.4.0/casa/Arrays/IP
osition.h:130:28: error: ‘ssize_t’ has not been declared
/var/tmp/portage/sci-astronomy/casacore-1.4.0/work/casacore-1.4.0/casa/Arrays/IP
osition.h:135:29: error: ‘ssize_t’ has not been declared
/var/tmp/portage/sci-astronomy/casacore-1.4.0/work/casacore-1.4.0/casa/Arrays/IP
osition.h:135:43: error: ‘ssize_t’ has not been declared
/var/tmp/portage/sci-astronomy/casacore-1.4.0/work/casacore-1.4.0/casa/Arrays/IP
osition.h:135:57: error: ‘ssize_t’ has not been declared
/var/tmp/portage/sci-astronomy/casacore-1.4.0/work/casacore-1.4.0/casa/Arrays/IP
osition.h:136:9: error: ‘ssize_t’ has not been declared
/var/tmp/portage/sci-astronomy/casacore-1.4.0/work/casacore-1.4.0/casa/Arrays/IP
osition.h:136:31: error: ‘ssize_t’ has not been declared
/var/tmp/portage/sci-astronomy/casacore-1.4.0/work/casacore-1.4.0/casa/Arrays/IP
osition.h:136:53: error: ‘ssize_t’ has not been declared
/var/tmp/portage/sci-astronomy/casacore-1.4.0/work/casacore-1.4.0/casa/Arrays/IP
osition.h:137:9: error: ‘ssize_t’ has not been declared
/var/tmp/portage/sci-astronomy/casacore-1.4.0/work/casacore-1.4.0/casa/Arrays/IP
osition.h:137:31: error: ‘ssize_t’ has not been declared
/var/tmp/portage/sci-astronomy/casacore-1.4.0/work/casacore-1.4.0/casa/Arrays/IP
osition.h:137:53: error: ‘ssize_t’ has not been declared
/var/tmp/portage/sci-astronomy/casacore-1.4.0/work/casacore-1.4.0/casa/Arrays/IP
osition.h:138:9: error: ‘ssize_t’ has not been declared
/var/tmp/portage/sci-astronomy/casacore-1.4.0/work/casacore-1.4.0/casa/Arrays/IP
osition.h:151:26: error: declaration of ‘operator=’ as non-function
/var/tmp/portage/sci-astronomy/casacore-1.4.0/work/casacore-1.4.0/casa/Arrays/IP
osition.h:151:24: error: expected ‘;’ at end of member declaration
/var/tmp/portage/sci-astronomy/casacore-1.4.0/work/casacore-1.4.0/casa/Arrays/IP
osition.h:151:34: error: expected ‘)’ before ‘value’
/var/tmp/portage/sci-astronomy/casacore-1.4.0/work/casacore-1.4.0/casa/Arrays/IP
osition.h:224:5: error: ‘ssize_t’ does not name a type
/var/tmp/portage/sci-astronomy/casacore-1.4.0/work/casacore-1.4.0/casa/Arrays/IP
osition.h:225:5: error: ‘ssize_t’ does not name a type
/var/tmp/portage/sci-astronomy/casacore-1.4.0/work/casacore-1.4.0/casa/Arrays/IP
osition.h:226:5: error: ‘ssize_t’ does not name a type
/var/tmp/portage/sci-astronomy/casacore-1.4.0/work/casacore-1.4.0/casa/Arrays/IP
osition.h:227:5: error: ‘ssize_t’ does not name a type
/var/tmp/portage/sci-astronomy/casacore-1.4.0/work/casacore-1.4.0/casa/Arrays/IP
osition.h:235:5: error: ‘ssize_t’ does not name a type
/var/tmp/portage/sci-astronomy/casacore-1.4.0/work/casacore-1.4.0/casa/Arrays/IP
osition.h:236:5: error: ‘ssize_t’ does not name a type
/var/tmp/portage/sci-astronomy/casacore-1.4.0/work/casacore-1.4.0/casa/Arrays/IP
osition.h:240:11: error: ‘ssize_t’ does not name a type
/var/tmp/portage/sci-astronomy/casacore-1.4.0/work/casacore-1.4.0/casa/Arrays/IP
osition.h:295:23: error: ‘ssize_t’ has not been declared
/var/tmp/portage/sci-astronomy/casacore-1.4.0/work/casacore-1.4.0/casa/Arrays/IP
osition.h:296:23: error: ‘ssize_t’ has not been declared
/var/tmp/portage/sci-astronomy/casacore-1.4.0/work/casacore-1.4.0/casa/Arrays/IP
osition.h:297:23: error: ‘ssize_t’ has not been declared
/var/tmp/portage/sci-astronomy/casacore-1.4.0/work/casacore-1.4.0/casa/Arrays/IP
osition.h:298:23: error: ‘ssize_t’ has not been declared
/var/tmp/portage/sci-astronomy/casacore-1.4.0/work/casacore-1.4.0/casa/Arrays/IP
osition.h:365:13: error: ‘ssize_t’ does not name a type
/var/tmp/portage/sci-astronomy/casacore-1.4.0/work/casacore-1.4.0/casa/Arrays/IP
osition.h:366:13: error: ‘ssize_t’ does not name a type
/var/tmp/portage/sci-astronomy/casacore-1.4.0/work/casacore-1.4.0/casa/Arrays/IP
osition.h:367:19: error: ‘ssize_t’ does not name a type
/var/tmp/portage/sci-astronomy/casacore-1.4.0/work/casacore-1.4.0/casa/Arrays/IP
osition.h:368:13: error: ‘value_type’ does not name a type
/var/tmp/portage/sci-astronomy/casacore-1.4.0/work/casacore-1.4.0/casa/Arrays/IP
osition.h:369:19: error: ‘value_type’ does not name a type
/var/tmp/portage/sci-astronomy/casacore-1.4.0/work/casacore-1.4.0/casa/Arrays/IP
osition.h:370:13: error: ‘value_type’ does not name a type
/var/tmp/portage/sci-astronomy/casacore-1.4.0/work/casacore-1.4.0/casa/Arrays/IP
osition.h:371:19: error: ‘value_type’ does not name a type
/var/tmp/portage/sci-astronomy/casacore-1.4.0/work/casacore-1.4.0/casa/Arrays/IP
osition.h:377:5: error: ‘iterator’ does not name a type
/var/tmp/portage/sci-astronomy/casacore-1.4.0/work/casacore-1.4.0/casa/Arrays/IP
osition.h:379:5: error: ‘const_iterator’ does not name a type
/var/tmp/portage/sci-astronomy/casacore-1.4.0/work/casacore-1.4.0/casa/Arrays/IP
osition.h:381:5: error: ‘iterator’ does not name a type
/var/tmp/portage/sci-astronomy/casacore-1.4.0/work/casacore-1.4.0/casa/Arrays/IP
osition.h:383:5: error: ‘const_iterator’ does not name a type
/var/tmp/portage/sci-astronomy/casacore-1.4.0/work/casacore-1.4.0/casa/Arrays/IP
osition.h:398:5: error: ‘ssize_t’ does not name a type
/var/tmp/portage/sci-astronomy/casacore-1.4.0/work/casacore-1.4.0/casa/Arrays/IP
osition.h:401:5: error: ‘ssize_t’ does not name a type
/var/tmp/portage/sci-astronomy/casacore-1.4.0/work/casacore-1.4.0/casa/Arrays/IP
osition.h: In member function ‘void casa::IPosition::fill(casa::uInt, 
InputIterator)’:

Full build log attached.

Thank you in advance.

Original issue reported on code.google.com by nheghath...@gmail.com on 12 May 2012 at 9:36

@GoogleCodeExporter
Copy link
Author

Build.log file.

Original comment by nheghath...@gmail.com on 12 May 2012 at 9:37

  • Added labels: ****
  • Removed labels: ****

Attachments:

@GoogleCodeExporter
Copy link
Author

Will use prtdiff_t instead of ssize_t (typedef-ed as axSize_t).
Hope to commit it soon.

Original comment by gervandi...@gmail.com on 15 May 2012 at 6:20

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

The attached patch (against today's trunk, not v1.4.0, although it probably 
applies to that too) should address the issue with gcc-4.7. Obviously, this is 
a temporary hack until Ger's promised changes come through.

Original comment by jdswinb...@gmail.com on 27 Jun 2012 at 12:10

  • Added labels: ****
  • Removed labels: ****

Attachments:

@GoogleCodeExporter
Copy link
Author

Actually, the attached is probably better.

Original comment by jdswinb...@gmail.com on 27 Jun 2012 at 1:45

  • Added labels: ****
  • Removed labels: ****

Attachments:

@GoogleCodeExporter
Copy link
Author

The same patch is required to compile for the upcoming Debian Wheezy and Ubuntu 
Quantal releases. I can confirm that it applies fine (with a few lines offset) 
on v1.5.0.

Original comment by ole.stre...@gmail.com on 14 Sep 2012 at 3:22

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

This should have been applied to trunk already. You need trunk for these 
systems at the moment.

Original comment by Malte.Marquarding on 19 Sep 2012 at 12:20

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

The required changes on the trunk still aren't complete. Both r21266 and r21268 
(which is required on more than just OSX) help, but the attached change to 
IPosition.h is still needed.

Original comment by jdswinb...@gmail.com on 2 Oct 2012 at 8:05

  • Added labels: ****
  • Removed labels: ****

Attachments:

@GoogleCodeExporter
Copy link
Author

Sorry, that last comment was possibly misleading. By including unistd.h in 
IPosition.h the build can proceed using ssize_t rather than ptrdiff_t, but I 
understand that that isn't the intention. Unfortunately, the source has many 
references to ssize_t within it, even after Ger's changes.

I attach a new patch which switches everything to use ptrdiff_t instead, which 
compiles with GCC 4.7 and passes most tests (5 failures out of 480; I see 6 
failures on my older system).

Note that as well as using ptrdiff_t, there are also some changes required in 
scimath/Mathematics/ConvolveGridder.tcc. These are also included in my patch.

Original comment by jdswinb...@gmail.com on 2 Oct 2012 at 9:28

  • Added labels: ****
  • Removed labels: ****

Attachments:

@GoogleCodeExporter
Copy link
Author

Don't know what the current status is of this issue. However, I was able to 
compile release 1.5.0 with GCC 4.7.1 on a Linux openSUSE 12.2 system with only 
two minor tweaks:

marcel@aragorn:~/distrib> diff -ru casacore-1.5.0-org casacore-1.5.0
diff -ru casacore-1.5.0-org/casa/Arrays/IPosition.h 
casacore-1.5.0/casa/Arrays/IPosition.h
--- casacore-1.5.0-org/casa/Arrays/IPosition.h  2012-03-14 15:30:48.000000000 
+0100
+++ casacore-1.5.0/casa/Arrays/IPosition.h      2012-10-22 23:29:24.646173200 
+0200
@@ -34,6 +34,7 @@
 #include <casa/BasicSL/String.h>
 #include <vector>
 #include <cstddef>                  // for ptrdiff_t
+#include <sys/types.h>

 namespace casa { //# NAMESPACE CASA - BEGIN

diff -ru casacore-1.5.0-org/casa/System/Casarc.cc 
casacore-1.5.0/casa/System/Casarc.cc
--- casacore-1.5.0-org/casa/System/Casarc.cc    2011-10-18 09:39:05.000000000 
+0200
+++ casacore-1.5.0/casa/System/Casarc.cc        2012-10-22 23:36:33.997450564 
+0200
@@ -34,6 +34,7 @@
 #include <fcntl.h>
 #include <sys/mman.h>
 #include <cstdio>
+#include <unistd.h>

 #define USE_FLOCK 0
 #define CASARC_DEBUG 0

Original comment by marcel.l...@gmail.com on 22 Oct 2012 at 10:51

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Original comment by Malte.Marquarding on 23 Oct 2012 at 4:03

  • Changed state: Fixed
  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Thanks Marcel, I have applied this to trunk.

Original comment by Malte.Marquarding on 23 Oct 2012 at 4:05

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Hi,

i've wandered for hours trying to compile this code on OpenSuSE 12.2 without 
results.

The patch mentioned above is not applied to the trunk release available via svn 
on googlecode.

After making the modifications mentioned above by hand (didn't trust an old 
diff) everything runs ok.

Using OpenSuSE 12.2 _64, gcc 4.7 

Regards,
Victor M. 


Original comment by victormo...@gmail.com on 18 Jun 2013 at 12:52

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

hi, friends, how to use the patch file, could anyone teach me?

Thanks very much

Original comment by hlfw...@gmail.com on 4 Nov 2013 at 9:18

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

A patch (made with diff) is applied using the "patch" command. Look for the 
manpage.

In my case, the modification posted by Marcel worked great and you can do it by 
hand (without the diff command) :

- in file "/casa/Arrays/IPosition.h"  add  "#include <sys/types.h>"
- in file "/casa/System/Casarc.cc " add  "#include <unistd.h>"

FYI : In the diff included above, the lines prepended by "+" are to be added.

Post your results !

Regards,
Victor M.

Original comment by victormo...@gmail.com on 11 Nov 2013 at 6:16

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Victor,

This issue has been fixed more than a year ago on the trunk, so I don't 
understand why you still have to change it in your workspace. Didn't you do an 
'svn up'?

Cheers,
Ger

Original comment by gervandi...@gmail.com on 12 Nov 2013 at 7:00

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Sorry for the mess...

The problem only arises with the stable version 1.5.0 available in the Donload 
section. 
I was always talking about that one...

The SVN version includes the patch for gcc47.

Regards,
vm


Original comment by victormo...@gmail.com on 16 Dec 2013 at 4:00

  • Added labels: ****
  • Removed labels: ****

@gijzelaerr gijzelaerr added bug and removed bug labels Apr 2, 2015
@gijzelaerr gijzelaerr modified the milestone: v1.4 Apr 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants