C++11: Compile and Execute: cross-platform compilation - c++

I have a short C++ code that I have successfully compiled on a remote server A. I wish to run the executable on another target remote server T.
The code main.cpp contains the following snippet (requires C++11 support):
#include <random>
default_random_engine GENERATOR;
void get_random_indices(set<int> &output, int max_ind) {
uniform_int_distribution<int> dist(0, max_ind);
while (output.size() < SAMPLE_SIZE) {
output.insert(dist(GENERATOR));
}
}
I compiled the code using the following line:
g++ -o exec_foo -std=c++11 main.cpp
The spec of server A is
[me#A ~]$ uname -a
Linux some-ip:D 2.6.32-573.1.1.el6.x86_64 #1 SMP Tue Jul 14 02:46:51 EDT 2015 x86_64 x86_64 x86_64 GNU/Linux
[me#A ~]$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/nfs/nfs5-insecure/home/insecure-ro/software/rhel6_x86_64/gcc-5.1.0/bin/../libexec/gcc/x86_64-unknown-linux-gnu/5.1.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ./configure --prefix=/l/gcc-5.1.0
Thread model: posix
gcc version 5.1.0 (GCC)
When I run the exec_foo in server A, it works fine. Now running the same executable on the target server T results in the following error:
./exec_foo: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.18' not found (required by ./exec_foo)
./exec_foo: /usr/lib64/libstdc++.so.6: version `CXXABI_1.3.5' not found (required by ./exec_foo)
./exec_foo: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by ./exec_foo)
Checking the spec on target server T, I see the following:
-bash-4.1$ uname -a
Linux marry-christmas 2.6.32-358.6.2.el6.marry-christmas.20130516.x86_64 #1 SMP Fri May 17 04:49:39 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
-bash-4.1$ g++ -v
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC)
OK, I get it. Server T can't find some links of library. But I can't compile the code natively on T:
-bash-4.1$ g++ -o exec_foo --std=c++11 main.cpp
cc1plus: error: unrecognized command line option "-std=c++11"
No c++11. Let's try c++0x.
-bash-4.1$ g++ -o exec_foo --std=c++0x main.cpp
main.cpp:64: error: ‘default_random_engine’ does not name a type
main.cpp: In function ‘void get_random_indices(std::set<int, std::less<int>, std::allocator<int> >&, int)’:
main.cpp:66: error: ‘uniform_int_distribution’ was not declared in this scope
main.cpp:66: error: expected primary-expression before ‘int’
main.cpp:66: error: expected ‘;’ before ‘int’
main.cpp:69: error: ‘GENERATOR’ was not declared in this scope
main.cpp:69: error: ‘dist’ was not declared in this scope
Besides updating the bloody g++ + gcc on server T, which I don't have rights to do, is there a way out?

Related

ICPC: "identifier "_Node_allocator" is undefined" when compiling C++ file using std::map with icpc

I am trying to compile the following code:
#include <map>
int main() {
std::map<double, double> test;
return 0;
}
using the following command:
icpc -I /usr/include/x86_64-linux-gnu/c++/8 main.cpp -o test
I get the following error:
/usr/include/c++/8/bits/stl_tree.h(700): error: identifier
"_Node_allocator" is undefined
_GLIBCXX_NOEXCEPT_IF(
^
detected during instantiation of "std::_Rb_tree<_Key, _Val,
_KeyOfValue, _Compare, _Alloc>::_Rb_tree_impl<_Key_compare,
<unnamed>>::_Rb_tree_impl() [with _Key=double, _Val=std::pair<const
double, double>, _KeyOfValue=std::_Select1st<std::pair<const double,double>>, _Compare=std::less<double>, Alloc=std::allocator<std::pair<const double, double>>,_Key_compare=std::less<double>, <unnamed>=true]"
at line 6 of "main.cpp"
together with a handful of type traits errors like the following:
/usr/include/c++/8/type_traits(921): error: not a class or struct name
: public __is_default_constructible_atom<_Tp>::type
^
detected during:
instantiation of class
"std::__is_default_constructible_safe<_Tp, false> [with _Tp=<error-
type>]" at line 927
instantiation of class "std::is_default_constructible<_Tp>
[with _Tp=<error-type>]" at line 144
instantiation of class "std::__and_<_B1, _B2> [with
_B1=std::is_default_constructible<<error-type>>,
_B2=std::__is_nt_default_constructible_impl<<error-type>, false>]" at
line 995
instantiation of class
"std::is_nothrow_default_constructible<_Tp> [with _Tp=<error-type>]"
at line 700 of "/usr/include/c++/8/bits/stl_tree.h"
instantiation of "std::_Rb_tree<_Key, _Val, _KeyOfValue,
_Compare, _Alloc>::_Rb_tree_impl<_Key_compare,
<unnamed>>::_Rb_tree_impl() [with _Key=double, _Val=std::pair<const
double, double>, _Key
OfValue=std::_Select1st<std::pair<const double, double>>,
_Compare=std::less<double>, _Alloc=std::allocator<std::pair<const
double, double>>, _Key_compare=std::less<double>, <unnamed>=true]" at
line 6 of "
main.cpp"
This code compiles without a problem using g++.
The result of icpc and g++ version commands give the following:
> icpc -v
icpc version 18.0.3 (gcc version 8.1.0 compatibility)
> g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/8/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu
8.1.0-5ubuntu1~16.04' --with-bugurl=file:///usr/share/doc/gcc-
8/README.Bugs --enable-
languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --
with-gcc-major-version-only --program-suffix=-8 --program-
prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --
libexecdir=/usr/lib --without-included-gettext --enable-
threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --
enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-
time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object
--disable-vtable-verify --enable-libmpx --enable-plugin --with-
system-zlib --with-target-system-zlib --enable-objc-gc=auto --
enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64
--with-multilib-list=m32,m64,mx32 --enable-multilib --with-
tune=generic --enable-offload-targets=nvptx-none --without-cuda-
driver --enable-checking=release --build=x86_64-linux-gnu --
host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 8.1.0 (Ubuntu 8.1.0-5ubuntu1~16.04)
So my icpc and g++ version are compatible. I also didn't forget to source the compilervars.sh file of icpc.
I can't find any post with this error, also not on the Intel site. Is there a specific library needed to add to icpc that is not added automatically to be able to use std::map?
I've tried adding -lstdc++ myself in the compilation command but this didn't work.
The problem was answered by someone on the intel forums:
icc 18.0.3 does not support gcc-8 even though using the following bash command:
> icpc -v
icpc version 18.0.3 (gcc version 8.1.0 compatibility)
makes it seem that it does.
icc 18 support gcc 4.3 to 6.3.
To solve this without changing my default gcc version I did the following:
First I installed gcc 6 on my Ubuntu 16.04 machine:
sudo apt-get install gcc-6 g++-6
Then I added the following flag to my compiler flags:
-gxx-name=/usr/bin/g++-6
And changed the version of the include directory to 6 instead of 8:
-I /usr/include/x86_64-linux-gnu/c++/6

caffe installation: gcc error namespace "std" has no member "isnan"

I'm trying to install (py)caffe on ubuntu 17.10
However when I do make all I get the following error:
./include/caffe/common.hpp(84): error: namespace "std" has no member "isnan"
./include/caffe/common.hpp(85): error: namespace "std" has no member "isinf"
2 errors detected in the compilation of "/tmp/tmpxft_00004921_00000000-19_nesterov_solver.compute_61.cpp1.ii".
Makefile:594: recipe for target '.build_release/cuda/src/caffe/solvers/nesterov_solver.o' failed
or when I use cmake instead
/home/thijser/caffe/include/caffe/common.hpp(84): error: namespace "std" has no member "isnan"
/home/thijser/caffe/include/caffe/common.hpp(85): error: namespace "std" has no member "isinf"
2 errors detected in the compilation of "/tmp/tmpxft_00004e32_00000000-7_math_functions.cpp1.ii".
CMake Error at cuda_compile_1_generated_math_functions.cu.o.Release.cmake:282 (message):
Error generating file
/home/thijser/caffe/build/src/caffe/CMakeFiles/cuda_compile_1.dir/util/./cuda_compile_1_generated_math_functions.cu.o
Note that I'm not just going for sudo apt-get install caffe as doing so does not also install pycaffe, any solution that also installs pycaffe is also valid. I understand that isnan in std likely comes via boost or that this somehow involves a discrepancy between c++ versions? I'm not much of a c++ expert so I'm not sure how that works, I use gcc4.9 for this as nvcc doesn't like later versions of gcc. I know that caffe works on other people's machines and on a older version of ubuntu I had installed so that suggests it's all a configuration issue.
Anybody know how to fix this?
edit using verbose mode on cmake I was able to find out that it doing the following as it happened
/usr/bin/cmake -E remove /home/thijser/caffe/build/src/caffe/CMakeFiles/cuda_compile_1.dir/util/cuda_compile_1_generated_math_functions.cu.o.depend.tmp /home/thijser/caffe/build/src/caffe/CMakeFiles/cuda_compile_1.dir/util/cuda_compile_1_generated_math_functions.cu.o.NVCC-depend
-- Generating /home/thijser/caffe/build/src/caffe/CMakeFiles/cuda_compile_1.dir/util/./cuda_compile_1_generated_math_functions.cu.o
/usr/bin/nvcc /home/thijser/caffe/src/caffe/util/math_functions.cu -c -o /home/thijser/caffe/build/src/caffe/CMakeFiles/cuda_compile_1.dir/util/./cuda_compile_1_generated_math_functions.cu.o -ccbin /usr/bin/cc -m64 -DCAFFE_VERSION=1.0.0 -Xcompiler ,\"-fPIC\",\"-Wall\",\"-Wno-sign-compare\",\"-Wno-uninitialized\",\"-O3\",\"-DNDEBUG\" -gencode arch=compute_61,code=sm_61 -Xcudafe --diag_suppress=cc_clobber_ignored -Xcudafe --diag_suppress=integer_sign_change -Xcudafe --diag_suppress=useless_using_declaration -Xcudafe --diag_suppress=set_but_not_used -DUSE_LMDB -DUSE_LEVELDB -DUSE_OPENCV -DWITH_PYTHON_LAYER -Xcompiler -fPIC -DNVCC -I/home/thijser/caffe/include -I/home/thijser/caffe/src -I/usr/include -I/usr/include/hdf5/serial -I/usr/include/opencv -I/usr/include/x86_64-linux-gnu -I/usr/include/python2.7 -I/usr/local/lib/python2.7/dist-packages/numpy/core/include -I/home/thijser/caffe/build/include -I/home/thijser/caffe/build
/home/thijser/caffe/include/caffe/common.hpp(84): error: namespace "std" has no member "isnan"
/home/thijser/caffe/include/caffe/common.hpp(85): error: namespace "std" has no member "isinf"
testing against the following code:
https://ideone.com/Yxvt5m
$ gcc -std=c++11 test.cpp which is the same as g++ test.cpp
gave me
test.cpp: In function ‘int main()’:
test.cpp:7:15: error: ‘__builtin_isnan’ is not a member of ‘std’
cout << std::isnan(42.0) << std::isinf(42.0);
^
test.cpp:7:15: note: suggested alternative:
<built-in>: note: ‘__builtin_isnan’
test.cpp:7:35: error: ‘__builtin_isinf_sign’ is not a member of ‘std’
cout << std::isnan(42.0) << std::isinf(42.0);
^
test.cpp:7:35: note: suggested alternative:
<built-in>: note: ‘__builtin_isinf_sign’
suggesting an configuration issue on my machine, however clang++ test.cpp did not give any error suggesting that maybe we could use that to install caffe?
$ gcc --version
gcc (Ubuntu 4.8.5-4ubuntu6) 4.8.5
Copyright (C) 2015 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.
$gcc -xc++ -E -v -
Using built-in specs.
COLLECT_GCC=gcc
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.5-4ubuntu6' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.8.5 (Ubuntu 4.8.5-4ubuntu6)
COLLECT_GCC_OPTIONS='-E' '-v' '-mtune=generic' '-march=x86-64'
/usr/lib/gcc/x86_64-linux-gnu/4.8/cc1plus -E -quiet -v -imultiarch x86_64-linux-gnu -D_GNU_SOURCE - -mtune=generic -march=x86-64 -fstack-protector -Wformat -Wformat-security
ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/4.8"
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../x86_64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/include/c++/4.8
/usr/include/x86_64-linux-gnu/c++/4.8
/usr/include/c++/4.8/backward
/usr/lib/gcc/x86_64-linux-gnu/4.8/include
/usr/local/include
/usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed
/usr/include/x86_64-linux-gnu
/usr/include
End of search list.
Edit: thanks to #EliahKagan 's suggestions in the askubuntu chat I found that adding in the line CXXFLAGS += g++ -D_GLIBCXX_USE_C99_MATH -std=c++11 to the makefile solves this issue, however it inimitably throws the next error of
thijser#AI-core-Regain:~/caffe/build$ make all
[ 0%] Building CXX object src/caffe/CMakeFiles/caffeproto.dir/__/__/include/caffe/proto/caffe.pb.cc.o
In file included from /home/thijser/caffe/build/include/caffe/proto/caffe.pb.cc:5:
/home/thijser/caffe/build/include/caffe/proto/caffe.pb.h:7:10: fatal error:
'string' file not found
#include <string>
^~~~~~~~
1 error generated.
In my case, I also met this error when I built caffe on ubuntu 17.10, but I finally found solution:
Let add the following to:
/usr/include/x86_64-linux-gnu/c++/5/bits/c++config.h
/* #undef _GLIBCXX_USE_C99_MATH */
#define _GLIBCXX_USE_C99_MATH 1
After a long and detailed discussion with several of the people on the chat.askubuntu.com room #EliahKagan found out that there is a python3-caffe-cuda package which allows on to import caffe in python3. Note that this won't solve this issue for anyone in the future who has python2 but for me it works. In other words sudo apt-get install caffe and then using python3 rather then python2.7 worked for me.
Also note that we found that the underlying issue appears to be that gcc/g++ isn't finding the standard libraries (std) however it seems that clang and later version of gcc (gcc7)can find these libraries however these do not work with the current version of nvcc.
I am pretty sure you should set the right C++ standard. std::isnan is part of C++11 and newer GCCs use this version by default. Older ones still default to C++98.

Homebrew gcc can't find omp.h on OS X

I've spent hours trying different solutions but nothing has worked so far.
I've installed gcc via Homebrew, and linked gcc to the Homebrew gcc. gcc -v returns this:
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc/5.3.0/libexec/gcc/x86_64-apple-darwin14.5.0/5.3.0/lto-wrapper
Target: x86_64-apple-darwin14.5.0
Configured with: ../configure --build=x86_64-apple-darwin14.5.0 --prefix=/usr/local/Cellar/gcc/5.3.0 --libdir=/usr/local/Cellar/gcc/5.3.0/lib/gcc/5 --enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-5 --with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr --with-mpc=/usr/local/opt/libmpc --with-isl=/usr/local/opt/isl --with-system-zlib --enable-libstdcxx-time=yes --enable-stage1-checking --enable-checking=release --enable-lto --with-build-config=bootstrap-debug --disable-werror --with-pkgversion='Homebrew gcc 5.3.0 --without-multilib' --with-bugurl=https://github.com/Homebrew/homebrew/issues --enable-plugin --disable-nls --disable-multilib
Thread model: posix
gcc version 5.3.0 (Homebrew gcc 5.3.0 --without-multilib)
However, when I try to compile I get
This is make_MWA_Tools.sh
using $CFITSIO =
building LFILE & read_mwac utilities
cc -g -O -Wall -D_FILE_OFFSET_BITS=64 -fopenmp -c mwac_utils.c
mwac_utils.c:3:10: fatal error: 'omp.h' file not found
#include <omp.h>
^
1 error generated.
make: *** [mwac_utils.o] Error 1
!!!!!!!!!!!!!!!!!!!!!!
build_lfiles/read_mwac make failed !
I've looked in gcc located under Cellar and found mop.h, but for some reason its not being included. Any help would be greatly appreciated.
Edit: I don't believe this is a duplicate question because I could not find another question that Installed gcc from Homebrew, linked 'gcc' to the homebrew gcc installation, and still couldn't find omp.h

GCC 4.9.2 cross-compiler build for ARM

I am trying to build a cross-compiler for ARM. When I add c++ to my "enable-languages" list in the configure (see) below, the gmake errors out with:
checking for exception model to use...
configure: error: unable to detect exception model
gmake[1]: *** [configure-target-libstdc++-v3]
but when I take c++ out of the "enable-languages", as in my configure script below, the GCC cross-compiler builds just fine.
../gcc-4.9.2/configure --prefix=/home/me/ANDROID21 --target=arm-linux-androideabi
--with-gmp=/home/me/ANDROID21 --with-mpfr=/home/me/ANDROID21
--with-mpc=/home/me/ANDROID21
--with-gnu-as--with-gnu-ld --enable-languages=c,fortran --disable-nls
--disable-tls
--disable-bootstrap --disable-libgomp --disable-shared --disable-libssp
-disable-libquadmath --enable-threads --enable-target-optspace --disable-libatomic
--with-sysroot=/home/me/android-ndk-r10c/platforms/android-21/arch-arm
For reference, here is my machine info:
$ uname -a
Linux (system name) 2.6.32-504.el6.x86_64 #1 SMP Tue Sep 16 01:56:35 EDT 2014 x86_64 x86_64 x86_64 GNU/Linux
And the GCC I'm building off of:
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/home/me/GCC4.9.2/libexec/gcc/x86_64-unknown-linux-gnu/4.9.2/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /home/me/gcc-4.9.2/configure --prefix=/home/me/GCC4.9.2 --disable-multilib
--enable-libgomp --enable-languages=c,c++,objc,obj-c++,java,fortran
Thread model: posix
gcc version 4.9.2 (GCC)
Any ideas on possible causes?
Haven't found anything definitive in the archives yet. Would really like to get the c++ portion to cross-compile too.
TIA,
Steve

Linking libstdc++ issue on RHEL 5.7

I would like to create a statically linked binary with the following command:
g++ -o bin/target_binary objs/obj1.o objs/obj2.o objs/obj3.o -I/usr/include/c++/4.1.1/ -O3 -Wall -static -static-libstdc++ -static-libgcc -L /usr/lib/gcc/x86_64-redhat-linux/4.1.1/32 -Wl,-verbose
The relevant part of the output:
attempt to open /usr/lib/gcc/x86_64-redhat-linux/4.1.1/32/libstdc++.a succeeded
attempt to open /usr/lib/gcc/x86_64-redhat-linux/4.1.2/libstdc++.a failed
attempt to open /usr/lib/gcc/x86_64-redhat-linux/4.1.2/libstdc++.a failed
attempt to open /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libstdc++.a failed
attempt to open /lib/../lib64/libstdc++.a failed
attempt to open /usr/lib/../lib64/libstdc++.a failed
attempt to open /usr/x86_64-redhat-linux/lib64/libstdc++.a failed
attempt to open /usr/local/lib64/libstdc++.a failed
attempt to open /lib64/libstdc++.a failed
attempt to open /usr/lib64/libstdc++.a failed
attempt to open /usr/x86_64-redhat-linux/lib/libstdc++.a failed
attempt to open /usr/lib64/libstdc++.a failed
attempt to open /usr/local/lib/libstdc++.a failed
attempt to open /lib/libstdc++.a failed
attempt to open /usr/lib/libstdc++.a failed
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.1.1/32/libstdc++.a when searching for -lstdc++
/usr/bin/ld: cannot find -lstdc++
collect2: ld returned 1 exit status
g++ -v
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --disable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=x86_64-redhat-linux
Thread model: posix
gcc version 4.1.2 20080704 (Red Hat 4.1.2-51)
uname -a
Linux vmh-caipi-reporting.lsy.fra.dlh.de 2.6.18-274.18.1.el5 #1 SMP Fri Jan 20 15:11:18 EST 2012 x86_64 x86_64 x86_64 GNU/Linux
lsb_release -a
LSB Version: :core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:printing-4.0-noarch
Distributor ID: RedHatEnterpriseServer
Description: Red Hat Enterprise Linux Server release 5.7 (Tikanga)
Release: 5.7
Codename: Tikanga
What is wrong?
Thanks in advance!
/usr/bin/ld: cannot find -lstdc++
The problem seems to be that you have 32-bit libstdc++.a, but not a 64-bit one.
Find out where the 32-bit version came from: rpm -qf /usr/lib/gcc/x86_64-redhat-linux/4.1.1/32/libstdc++.a, and try to install equivalent 64-bit package.
If there is no existing package that provides 64-bit libstdc++.a (that's very unlikely), you can grab the source RPM for your gcc, and rebuild it. That should give you a usable 64-bit version of libstdc++.a.