Building Blitz++ issue

Hi!

I’m trying to build Blitz++ on my openSuse11 machine and it just doesn’t build the library for it. I think this might be due to a compiler misconfiguration, but I’m still new to compiling on linux so I need any help on this. When I make the lib I get the following output:

make[1]: Entering directory /home/stafford/Documents/HOT_src_1.0rc6/src/3rdparty/src/blitz-0.9/lib' if /bin/sh ../libtool --mode=compile --tag=CXX c++ -DHAVE_CONFIG_H -I.. -I.. -MT globals.lo -MD -MP -MF ".deps/globals.Tpo" -c -o globals.lo test -f ‘…/src/globals.cpp’ || echo ‘./’../src/globals.cpp; \ then mv -f ".deps/globals.Tpo" ".deps/globals.Plo"; else rm -f ".deps/globals.Tpo"; exit 1; fi c++ -DHAVE_CONFIG_H -I.. -I.. -MT globals.lo -MD -MP -MF .deps/globals.Tpo -c ../src/globals.cpp -o globals.o In file included from ../blitz/applics.h:400, from ../blitz/vecexpr.h:32, from ../blitz/vecpick.cc:16, from ../blitz/vecpick.h:293, from ../blitz/vector.h:449, from ../blitz/tinyvec.h:430, from ../blitz/indexexpr.h:30, from ../src/globals.cpp:11: ../blitz/mathfunc.h: In static member function 'static long int blitz::_bz_abs<long int>::apply(long int)': ../blitz/mathfunc.h:45: error: 'labs' is not a member of 'std' In file included from ../blitz/array/funcs.h:29, from ../blitz/array/newet.h:29, from ../blitz/array/et.h:27, from ../blitz/array-impl.h:2515, from ../blitz/array.h:32, from ../src/globals.cpp:13: ../blitz/funcs.h: In static member function 'static int blitz::Fn_abs<int>::apply(int)': ../blitz/funcs.h:509: error: call of overloaded 'abs(int&)' is ambiguous /usr/include/c++/4.3/cmath:99: note: candidates are: double std::abs(double) /usr/include/c++/4.3/cmath:103: note: float std::abs(float) /usr/include/c++/4.3/cmath:107: note: long double std::abs(long double) ../blitz/funcs.h: In static member function 'static long int blitz::Fn_abs<long int>::apply(long int)': ../blitz/funcs.h:530: error: 'labs' is not a member of 'std' make[1]: *** [globals.lo] Error 1 make[1]: Leaving directory /home/stafford/Documents/HOT_src_1.0rc6/src/3rdparty/src/blitz-0.9/lib’
make: *** [blitz-library] Error 1
stafford@linux-er3h:~/Documents/HOT_src_1.0rc6/src/3rdparty/src/blitz-0.9> make check-testsuite
make[1]: Entering directory /home/stafford/Documents/HOT_src_1.0rc6/src/3rdparty/src/blitz-0.9/lib' if /bin/sh ../libtool --mode=compile --tag=CXX c++ -DHAVE_CONFIG_H -I.. -I.. -MT globals.lo -MD -MP -MF ".deps/globals.Tpo" -c -o globals.lo test -f ‘…/src/globals.cpp’ || echo ‘./’../src/globals.cpp; \ then mv -f ".deps/globals.Tpo" ".deps/globals.Plo"; else rm -f ".deps/globals.Tpo"; exit 1; fi c++ -DHAVE_CONFIG_H -I.. -I.. -MT globals.lo -MD -MP -MF .deps/globals.Tpo -c../src/globals.cpp -o globals.o In file included from ../blitz/applics.h:400, from ../blitz/vecexpr.h:32, from ../blitz/vecpick.cc:16, from ../blitz/vecpick.h:293, from ../blitz/vector.h:449, from ../blitz/tinyvec.h:430, from ../blitz/indexexpr.h:30, from ../src/globals.cpp:11: ../blitz/mathfunc.h: In static member function 'static long int blitz::_bz_abs<long int>::apply(long int)': ../blitz/mathfunc.h:45: error: 'labs' is not a member of 'std' In file included from ../blitz/array/funcs.h:29, from ../blitz/array/newet.h:29, from ../blitz/array/et.h:27, from ../blitz/array-impl.h:2515, from ../blitz/array.h:32, from ../src/globals.cpp:13: ../blitz/funcs.h: In static member function 'static int blitz::Fn_abs<int>::apply(int)': ../blitz/funcs.h:509: error: call of overloaded 'abs(int&)' is ambiguous /usr/include/c++/4.3/cmath:99: note: candidates are: double std::abs(double) /usr/include/c++/4.3/cmath:103: note: float std::abs(float) /usr/include/c++/4.3/cmath:107: note: long double std::abs(long double) ../blitz/funcs.h: In static member function 'static long int blitz::Fn_abs<long int>::apply(long int)': ../blitz/funcs.h:530: error: 'labs' is not a member of 'std' make[1]: *** [globals.lo] Error 1 make[1]: Leaving directory /home/stafford/Documents/HOT_src_1.0rc6/src/3rdparty/src/blitz-0.9/lib’
make: *** [blitz-library] Error 1

What could I have done wrong? I just followed the steps of the install note and my openSuse is not strongly modified. I’d appreciate any help,

Phong

Hi
More than likely it needs patching to use gcc 4.3


Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.25-0.1-default
up 1 day 4:22, 2 users, load average: 0.05, 0.10, 0.14
GPU GeForce 8600 GTS Silent - Driver Version: 185.18.14

Do you think then I might able to compile it with gcc4.2? If yes, how am I supposed to downgrade to 4.2?

Hi
No, it’s better to patch, if you would like I can build an rpm for you
based on the fc9 version?


Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.25-0.1-default
up 1 day 6:38, 2 users, load average: 0.22, 0.28, 0.39
GPU GeForce 8600 GTS Silent - Driver Version: 185.18.14

Well the thing is that I need Blitz as a 3rd party library for something else I want to compile (Houdini Ocean Toolkit. The Houdini Ocean Toolkit — Houdini Ocean Toolkit v1.0rc6 documentation). And probably that also needs gcc4.2 to compile correctly. So I think it would be better to downgrade to gcc4.2 then right?

Hi
If you search here Get
It
for blitz there should be builds for 11 and 11.1 if you grab a
src rpm and extract it you can see the patch details.


Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.25-0.1-default
up 2 days 0:18, 3 users, load average: 0.28, 0.14, 0.10
GPU GeForce 8600 GTS Silent - Driver Version: 185.18.14

Hi
It may not make a difference, you have 4.3, 4.1 and 3.3 to choose from.
The patch should be good for 4.1 as well, just need export the gcc and
g++ so it uses them.

I can rebuild the rpm against that if you want?


Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.25-0.1-default
up 2 days 1:39, 2 users, load average: 0.11, 0.06, 0.01
GPU GeForce 8600 GTS Silent - Driver Version: 185.18.14

Hi
Had a look at the HOT src, in my 11.1 setup if you install gcc-4.1 and
g+±4.1 and then export it all compiles without errors including
blitz0.9;


export CC=/usr/bin/gcc-4.1
export CXX=/usr/bin/g++-4.1
../build_linux.sh


Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.25-0.1-default
up 2 days 2:11, 2 users, load average: 0.45, 0.93, 0.71
GPU GeForce 8600 GTS Silent - Driver Version: 185.18.14

Malcolm you are just great!!
I’ll try installing gcc and g++ then. But installing g++ seems to be a quite hard task, I just had a look on the installation notes and there were so many things to consider! Isn’t there anything like an installer for it without needing to configure things first?

Hi
You should be able to just use zypper to install them?


sudo zypper in gcc41 gcc41-c++


Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.25-0.1-default
up 2 days 23:29, 3 users, load average: 1.65, 1.75, 1.54
GPU GeForce 8600 GTS Silent - Driver Version: 185.18.14

Malcolm you are amazing! Everything works fine now! Whenever you come to Berlin, let me know, I really owe you one!

Phong