64 bit Message Why this message for 64 bits

When I compile a program I get the following message.

./compile5.sh
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.3.3/libstdc++.so when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.3.3/libstdc++.a when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.3.3/libstdc++.so when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.3.3/libstdc++.a when searching for -lstdc++

Now I am compiling for a 32 bit system. So why I am getting a message about skipping some directories for 64 bit Linux when all I really want is the 32 bit compilation anyway?

I am showing my file that I use when compiling

#!/bin/sh

nvcc -G -m32 -lm -lrt -g -pg -O0 -o grab32 WEGtest.c InitializeScenarioData.c WAFmutex.c P_tra_ray2.c thread.c P_prc_typ2.c set_nod2.c env_nodb.c vlm_atnb.c tra_ray2.c zro_rng2.c lin_lin.c test_vlm_atn3.c prc_typ2.c ray_sgm2.c vlm_atn3.c ray_typ2.c test_ndx_tbl.c str_eig.c zsbl94.c snd_slw2.c ndx_tbl.c btm_dptb.c lwr_vtx2.c rfl_srf2.c rfl_btm2.c zbtms94.c zbtmrf9.c vrt_typ2.c dcm_sgm2.c vrt_tim2.c prc_ray2m.c vrt_srf2.c srf_int2.c vrt_btm2.c btm_int2.c test4.c gnr_seq.c chn_rfl2.c unfold2.c int_bnd2.c nrm_bnd2.c zblos94.c zbtmr04.c zsigmpr.c zsigmpv.c trn_mtx2.c adv_mtx2.c zelblos.c zbrlael.c WAFmathComplex.c fmod.c zgsiz2des.c zgam.c zbeta.c WEG.c src_ang2.c prc_brn2.c merge.c IntSrcRays.c

The use of -m32 should make it clear that I am seeking a 32 bit executable. So why the 64 bit message?

Newport_j

Yes, but the linker is relying on system global shared library path and dependency settings, which will search the paths in order - 64 bit first, 32 bit second (if they are installed at all).

Having answered your question, I have one for you: Why on earth are you using shell scripts for compilation? Feldman create make in 1977 for precisely this purpose (the ACM even gave him a medal for it, they thought it was such an important and useful contribution to computer science). Why not use it?

I have never seen that message before. Yes, I do have 64 bit capability installed. I use it sometimes. I am unimpressed by the speed increase or lack therof. One does get to access more memory by using 64 bit, but that is about your only advantage.

I am curious as to why that message (the one about bypasng 64 bit libraries) popped up now. It never has before.

As to why I do not use make files, that is a good question. I have never found anyone who can explain them to me. I have never found a tutorial that can explain them to me. Seasoned c programmers are often rendered mute when a rookie like me asks them to explain make files.

The shell script is used because it looks and operates so much like a traditional bat file in Windows/DOS.

If you know of a good reference or tutorial on makefiles, please tell me.

Newport_j

Be aware that you won’t be able to run CUDA applications built for 32 bit hosts on 64 bit hosts.

Probably because this is the first time you have compiled this code using nvcc, which is really using the C++ compiler to compile your code, not the C compiler.

Norman Matloff from UC Davis maintains a reasonable set of undergrad tutorials on Unix and C programming, including a first course on make. You can find them here.