Where do I get iostream for g++ in fedora 19 - io

I'm trying to compile xmacro which I downloaded from http://xmacro.sourceforge.net/.
I'm running Fedora 19 LXDE.
question: Where do I get iostream.h? It's missing. I see some packages the include iostream.h. The package version number compat-gcc-34-c++.i686 doesn't match g++ (GCC) 4.8.1 20130603. Should it?
I'd think iostream.h would be included when I downloaded the compiler.
I have installed gcc-c++ , libx11-devel, & libxtxt.
question: did I get the right version of c++? What is Compatibility GNU Compiler Collection?
$ yum search "compat-gcc"
Loaded plugins: langpacks, refresh-packagekit
=========================================== N/S matched: compat-gcc ============================================
compat-gcc-34.i686 : Compatibility GNU Compiler Collection
compat-gcc-34-c++.i686 : C++ support for compatibility compiler
compat-gcc-34-g77.i686 : Fortran 77 support for compatibility compiler
Name and summary matches only, use "search all" for everything.
I get:
$ make
g++ -O2 -I/usr/X11R6/include -Wall -pedantic -DVERSION=0.3 xmacroplay.cpp -o xmacroplay -L/usr/X11R6/lib -lXtst -lX11
xmacroplay.cpp:57:22: fatal error: iostream.h: No such file or directory
#include <iostream.h>
^
compilation terminated.
make: *** [xmacroplay] Error 1
$ yum whatprovides '*/iostream.h'
Loaded plugins: langpacks, refresh-packagekit
compat-gcc-34-c++-3.4.6-29.fc19.i686 : C++ support for compatibility compiler
Repo : fedora
Matched from:
Filename : /usr/include/c++/3.4.6/backward/iostream.h
cxxtools-devel-2.2-1.fc19.i686 : Development files for cxxtools
Repo : fedora
Matched from:
Filename : /usr/include/cxxtools/iostream.h
gap-devel-4.6.4-2.fc19.i686 : GAP compiler and development files
Repo : fedora
Matched from:
Filename : /usr/lib/gap/src/iostream.h
gap-devel-4.6.5-1.fc19.i686 : GAP compiler and development files
Repo : updates
Matched from:
Filename : /usr/lib/gap/src/iostream.h
glibmm24-devel-2.36.2-2.fc19.i686 : Headers for developing programs that will use glibmm24
Repo : fedora
Matched from:
Filename : /usr/include/giomm-2.4/giomm/iostream.h
marisa-devel-0.2.2-2.fc19.i686 : Development files for marisa
Repo : fedora
Matched from:
Filename : /usr/include/marisa/iostream.h
mingw32-glibmm24-2.36.2-2.fc19.noarch : MinGW Windows C++ interface for GTK2 (a GUI library for X)
Repo : fedora
Matched from:
Filename : /usr/i686-w64-mingw32/sys-root/mingw/include/giomm-2.4/giomm/iostream.h
mingw64-glibmm24-2.36.2-2.fc19.noarch : MinGW Windows C++ interface for GTK2 (a GUI library for X)
Repo : fedora
Matched from:
Filename : /usr/x86_64-w64-mingw32/sys-root/mingw/include/giomm-2.4/giomm/iostream.h
root-cint-5.34.07-1.fc19.i686 : CINT C++ interpreter
Repo : fedora
Matched from:
Filename : /usr/lib/root/cint/cint/include/iostream.h
root-cint-5.34.10-1.fc19.i686 : CINT C++ interpreter
Repo : updates
Matched from:
Filename : /usr/lib/root/cint/cint/include/iostream.h
me ~ $ g++ --version
g++ (GCC) 4.8.1 20130603 (Red Hat 4.8.1-1)
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
me ~ $

iostream.h is the old, pre-standard name for a header in what would later become the C++ standard library. The modern, standardised name is just iostream, without the .h.
The best solution would be to go through the source and change iostream.h to iostream everywhere. You might encounter other problems though, if the C++ code you're trying to compile is truly ancient. On the other hand it might work fine, with a few warnings. Give it a try and see what happens.
If it doesn't work, you might find that the "compat-g++" package (which has the very old 3.4 version of g++) handles this old code better than 4.8 does.

Related

Downgrading MSYS2 to a specific Mingw / gcc version

I have MSYS2 64 bit installed in my system.
When I try to check the gcc version, I am getting the following output.
$ gcc --version
gcc.exe (Rev9, Built by MSYS2 project) 10.2.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
But I want to use a specific mingw version for my project which uses qt library.
When I check my build log and installation folder of my qt project I found this.
|Project name: DataManager
|Project version: undefined
|C++ compiler for the host machine: ccache c++ (gcc 4.9.2 "c++ (i686-posix-dwarf-rev1, Built by MinGW-W64 project) 4.9.2")
|C++ linker for the host machine: c++ ld.bfd 2.24
|Program python3 found: YES
|Found qmake: C:\Qt\5.6.3\mingw49_32\bin\qmake.EXE (5.6.3)
I am assuming that it uses mingw49_32 version and gcc version 4.9.2.
I would like to use the same gcc version (4.9.2) in MSYS2.
How can I achieve it ?
You can't do that with MSYS2. Old packages are eventually removed from MSYS2 repos, so even if it had GCC 4.9 at some point in the past, it no longer does. The earliest available version is GCC 9.3.
Even if it was in the repo, you'd have to manually download and install it and all its dependencies, since there's no way to download outdated packages directly from pacman.
But, I suspect that:
You already have GCC 4.9 installed in C:\Qt\5.6.3\mingw49_32\bin.
Even if you don't, you might be able to get away with using an up-to-date GCC.

cuda, gcc incompatible, downgrade [duplicate]

I am new to Cuda, and I am trying to compile this simple test_1.cu file:
#include <stdio.h>
__global__ void kernel(void)
{
}
int main (void)
{
kernel<<<1,1>>>();
printf( "Hello, World!\n");
return 0;
}
using this: nvcc test_1.cu
The output I get is:
In file included from /usr/local/cuda/bin/../include/cuda_runtime.h:59:0,
from <command-line>:0:
/usr/local/cuda/bin/../include/host_config.h:82:2: error: #error -- unsupported GNU version! gcc 4.5 and up are not supported!
my gcc --version:
gcc (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
How can I install a second version of gcc (4.4 -) along with 4.6 without messing everything up?
I found this old topic:
CUDA incompatible with my gcc version
the answer was:
gcc 4.5 and 4.6 are not supported with CUDA - code won't compile and
the rest of the toolchain, including cuda-gdb, won't work properly.
You cannot use them, and the restriction is non-negotiable.
Your only solution is to install a gcc 4.4 version as a second
compiler (most distributions will allow that). There is an option to
nvcc --compiler-bindir which can be used to point to an alternative
compiler. Create a local directory and the make symbolic links to the
supported gcc version executables. Pass that local directory to nvcc
via the --compiler-bindir option, and you should be able to compile
CUDA code without effecting the rest of your system.
But I have no idea how to do it
In my case I didn't have root rights, so I couldn't fully replace the current gcc (4.7) with the older version 4.4 (which I think would be a bad alternative). Although I did have rights where CUDA was installed. My solution was to create an extra folder (e.g. /somepath/gccfornvcc/), wherever I had rights, then to create a link to an nvcc accepted compiler. I already had gcc 4.4 available (but you can install it, without removing your current version).
ln -s [path to gcc 4.4]/gcc-4.4 /somepath/gccfornvcc/gcc
Then, in the same folder where the nvcc binary lives, you should find a file called nvcc.profile . There you just need to add the following line:
compiler-bindir = /somepath/gccfornvcc
And that will make nvcc use the proper compiler. This helps keeping the system in a proper state, keeping the newest compiler, but nvcc (only nvcc) will use the old compiler version.
Doing some research online shows several methods for accomplishing this task. I just tested the method found here: http://www.vectorfabrics.com/blog/item/cuda_4.0_on_ubuntu_11.04 and it worked like a charm for me. It steps you through installing gcc 4.4 and creating scripts to run that version with nvcc. If you prefer trying the method mentioned in your post I'd recommend following that first link to install gcc4.4 and then create symbolic links as mentioned in your post. Creating symbolic links in Linux is accomplished by using the 'ln' command.
For example:
ln -s [source file/folder path] [linkpath]
This link gives a few examples of creating symbolic links on both Ubuntu and Windows: http://www.howtogeek.com/howto/16226/complete-guide-to-symbolic-links-symlinks-on-windows-or-linux/. Hopefully that points you in the right direction.
I guess you may try the new, beta, version, that based on LLVM.
Another way to make nvcc work with non-default compiler (unlike #Sluml's answer, it allows more flexibility):
At first, just like #Slump proposed, you need to create directory ~/local/gcc-4.4/, and then create there symlinks for right versions of gcc: for i in gcc gxx; do ln -s /usr/bin/${i}-4.4 ~/local/cudagcc/${i}; done. Now when you run nvcc -ccbin ~/local/gcc-4.4/ ... nvcc will use correct versions of gcc.
Here is small CMake snippet of forcing nvcc use specific host compiler.
option (CUDA_ENFORCE_HOST_COMPILER "Force nvcc to use the same compiler used to compile .c(pp) files insted of gcc/g++" OFF)
if (${CUDA_ENFORCE_HOST_COMPILER})
set (CMAKE_GCC_TEMP_DIR "CMakeGCC")
file(MAKE_DIRECTORY ${CMAKE_GCC_TEMP_DIR})
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_C_COMPILER} ${CMAKE_GCC_TEMP_DIR}/gcc)
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_CXX_COMPILER} ${CMAKE_GCC_TEMP_DIR}/g++)
set(CUDA_NVCC_FLAGS -ccbin ${CMAKE_GCC_TEMP_DIR} ${CUDA_NVCC_FLAGS})
endif()
Referenceļ¼š
I update my gcc from 4.4 to 4.6. Then I could not use nvcc to compile my code. Luckily, by using the method provided by the following link. I set my default gcc compiler back to gcc 4.4. Now, I could compile file using either gcc4.4 or gcc4.6. quit cool
http://ubuntuguide.net/how-to-install-and-setup-gcc-4-1g4-1-in-ubuntu-10-0410-10

GDB is not showing line number information although debuginfo is installed

I am trying to debug gcov code. I wrote a simple C program which calls __gcov_flush() method which is part of gcc/gcov.
After confirming that libgcov.a library has not been built with debug symbols, I have installed debuginfo packages for gcc on my machine (SLES 10).
# gcc -v
Using built-in specs.
Target: x86_64-suse-linux
Configured with: ../configure --enable-threads=posix --prefix=/usr --with-local-prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64 --enable-languages=c,c++,objc,fortran,obj-c++,java,ada --enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.1.2 --enable-ssp --disable-libssp --disable-libgcj --with-slibdir=/lib64 --with-system-zlib --enable-shared --enable-__cxa_atexit --enable-libstdcxx-allocator=new --program-suffix= --enable-version-specific-runtime-libs --without-system-libunwind --with-cpu=generic --host=x86_64-suse-linux
Thread model: posix
gcc version 4.1.2 20070115 (SUSE Linux)
# rpm -qi gcc-debuginfo-4.1.2_20070115-0.29.6.x86_64
Name : gcc-debuginfo Relocations: (not relocatable)
Version : 4.1.2_20070115 Vendor: SUSE LINUX Products GmbH, Nuernberg, Germany
Release : 0.29.6 Build Date: Sat Sep 5 03:04:50 2009
Install Date: Thu Apr 24 05:25:32 2014 Build Host: bingen
Group : Development/Debug Source RPM: gcc-4.1.2_20070115-0.29.6.src.rpm
Size : 251823743 License: GPL v2 or later
Signature : DSA/SHA1, Sat Sep 5 03:06:59 2009, Key ID a84edae89c800aca
Packager : http://bugs.opensuse.org
URL : http://gcc.gnu.org/
Summary : Debug information for package gcc
Description :
This package provides debug information for package gcc.
Debug information is useful when developing applications that use this
package or when debugging this package.
Distribution: SUSE Linux Enterprise 10
/usr/lib/debug/usr/bin # ls -lrt gcov.debug
-rw-r--r-- 1 root root 94216 Sep 5 2009 gcov.debug
However, even after installing the proper version of debuginfo (gcov.debug) packages, GDB still cannot recognize the line number information, it just passes the control to next line without reporting line number (or stepping into the function).
(gdb)s
26 i++;
(gdb)s
27 __gcov_flush();
(gdb)s
28 printf("%d",i);
(gdb)
(gdb) show debug-file-directory
The directory where separate debug symbols are searched for is "/usr/lib/debug".
Why GDB cannot identify line number information for gcov? If I have not installed the proper version of debuginfo packages for gcc/gcov, How to confirm it?
After confirming that libgcov.a library has not been built with debug symbols, I have installed debuginfo packages
You don't appear to understand how debuginfo packages work. They can't magically add debuginfo to an archive library that was built without debug symbols (or one that was stripped).
The usual build flow is:
build everything with -g
prepare separate debuginfo packages for all fully-linked binaries (executables and shared libraries)
strip fully-linked binaries (but not archive libraries)
This allows binaries and shared libraries to be small, but still debuggable after installing the debuginfo package.
Apparently, on SLES10 the "but not archive libraries" was not honored, and libgcov.a got stripped as well. Since separate debuginfo packages do not work for archive libraries, you can't get that info back. Your only option is to rebuild GCC from sources.
P.S. Why would they strip libgcov.a?
It's a trade-off: binaries that end-users link will be smaller, but code in libgcov.a will not be debuggable.
Since most end-users never debug libgcov.a, I'd say it was not an unreasonable trade-off.

Cuda compiler not working with GCC 4.5 +

I am new to Cuda, and I am trying to compile this simple test_1.cu file:
#include <stdio.h>
__global__ void kernel(void)
{
}
int main (void)
{
kernel<<<1,1>>>();
printf( "Hello, World!\n");
return 0;
}
using this: nvcc test_1.cu
The output I get is:
In file included from /usr/local/cuda/bin/../include/cuda_runtime.h:59:0,
from <command-line>:0:
/usr/local/cuda/bin/../include/host_config.h:82:2: error: #error -- unsupported GNU version! gcc 4.5 and up are not supported!
my gcc --version:
gcc (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
How can I install a second version of gcc (4.4 -) along with 4.6 without messing everything up?
I found this old topic:
CUDA incompatible with my gcc version
the answer was:
gcc 4.5 and 4.6 are not supported with CUDA - code won't compile and
the rest of the toolchain, including cuda-gdb, won't work properly.
You cannot use them, and the restriction is non-negotiable.
Your only solution is to install a gcc 4.4 version as a second
compiler (most distributions will allow that). There is an option to
nvcc --compiler-bindir which can be used to point to an alternative
compiler. Create a local directory and the make symbolic links to the
supported gcc version executables. Pass that local directory to nvcc
via the --compiler-bindir option, and you should be able to compile
CUDA code without effecting the rest of your system.
But I have no idea how to do it
In my case I didn't have root rights, so I couldn't fully replace the current gcc (4.7) with the older version 4.4 (which I think would be a bad alternative). Although I did have rights where CUDA was installed. My solution was to create an extra folder (e.g. /somepath/gccfornvcc/), wherever I had rights, then to create a link to an nvcc accepted compiler. I already had gcc 4.4 available (but you can install it, without removing your current version).
ln -s [path to gcc 4.4]/gcc-4.4 /somepath/gccfornvcc/gcc
Then, in the same folder where the nvcc binary lives, you should find a file called nvcc.profile . There you just need to add the following line:
compiler-bindir = /somepath/gccfornvcc
And that will make nvcc use the proper compiler. This helps keeping the system in a proper state, keeping the newest compiler, but nvcc (only nvcc) will use the old compiler version.
Doing some research online shows several methods for accomplishing this task. I just tested the method found here: http://www.vectorfabrics.com/blog/item/cuda_4.0_on_ubuntu_11.04 and it worked like a charm for me. It steps you through installing gcc 4.4 and creating scripts to run that version with nvcc. If you prefer trying the method mentioned in your post I'd recommend following that first link to install gcc4.4 and then create symbolic links as mentioned in your post. Creating symbolic links in Linux is accomplished by using the 'ln' command.
For example:
ln -s [source file/folder path] [linkpath]
This link gives a few examples of creating symbolic links on both Ubuntu and Windows: http://www.howtogeek.com/howto/16226/complete-guide-to-symbolic-links-symlinks-on-windows-or-linux/. Hopefully that points you in the right direction.
I guess you may try the new, beta, version, that based on LLVM.
Another way to make nvcc work with non-default compiler (unlike #Sluml's answer, it allows more flexibility):
At first, just like #Slump proposed, you need to create directory ~/local/gcc-4.4/, and then create there symlinks for right versions of gcc: for i in gcc gxx; do ln -s /usr/bin/${i}-4.4 ~/local/cudagcc/${i}; done. Now when you run nvcc -ccbin ~/local/gcc-4.4/ ... nvcc will use correct versions of gcc.
Here is small CMake snippet of forcing nvcc use specific host compiler.
option (CUDA_ENFORCE_HOST_COMPILER "Force nvcc to use the same compiler used to compile .c(pp) files insted of gcc/g++" OFF)
if (${CUDA_ENFORCE_HOST_COMPILER})
set (CMAKE_GCC_TEMP_DIR "CMakeGCC")
file(MAKE_DIRECTORY ${CMAKE_GCC_TEMP_DIR})
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_C_COMPILER} ${CMAKE_GCC_TEMP_DIR}/gcc)
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_CXX_COMPILER} ${CMAKE_GCC_TEMP_DIR}/g++)
set(CUDA_NVCC_FLAGS -ccbin ${CMAKE_GCC_TEMP_DIR} ${CUDA_NVCC_FLAGS})
endif()
Referenceļ¼š
I update my gcc from 4.4 to 4.6. Then I could not use nvcc to compile my code. Luckily, by using the method provided by the following link. I set my default gcc compiler back to gcc 4.4. Now, I could compile file using either gcc4.4 or gcc4.6. quit cool
http://ubuntuguide.net/how-to-install-and-setup-gcc-4-1g4-1-in-ubuntu-10-0410-10

Haskell GHC 7.2.2 Configure Does Not Find HsColour

Mac OSX 10.7.2, XCode 4.1, GHC 7.0.3
I am trying to build GHC 7.2.2 from source. Here is the result of ./configure:
----------------------------------------------------------------------
Configure completed successfully.
Building GHC version : 7.2.2
Build platform : x86_64-apple-darwin
Host platform : x86_64-apple-darwin
Target platform : x86_64-apple-darwin
Bootstrapping using : /usr/bin/ghc
which is version : 7.0.3
Using GCC : /usr/bin/gcc-4.2
which is version : 4.2.1
ld : /usr/bin/ld
Happy : /usr/bin/happy (1.18.6)
Alex : /usr/bin/alex (2.3.5)
Python : /opt/local/bin/python
Perl : /opt/local/bin/perl
dblatex :
xsltproc : /usr/bin/xsltproc
HsColour was not found; documentation will not contain source links
Building DocBook HTML documentation : NO
Building DocBook PS documentation : NO
Building DocBook PDF documentation : NO
----------------------------------------------------------------------
HsColour was not found. If I run ghc-pkg on my GHC 7.0.3 installation, it shows "hscolour-1.19" installed in the global GHC directory. I would like source links in the documentation, so why is it not seeing hscolour?
HsColour is a library and executable. It probably looked for the executable while you are talking about the library. Be sure to install the HsColour executable somewhere in the current PATH.

Resources