Operating System - HP-UX
1748279 Members
4194 Online
108761 Solutions
New Discussion юеВ

Re: Make command help. Exe are not created in right size

 
SOLVED
Go to solution
vaish
Frequent Advisor

Make command help. Exe are not created in right size

Hi,
I am new to makefile and make commands. I need to support an project. But When I execute make command , it is not creating the executables in right size.

It have created message_generator executable with size 19898480 bytes. But when I run the make command it is giving me only 2732176 bytes message_generator exe.

What are the things that I need to check or configure to run this make command correctly ?
Thanks In Advance
Vaish
17 REPLIES 17
Dennis Handly
Acclaimed Contributor

Re: Make command help. Exe are not created in right size

Why are you looking at the size? Instead try to run the executable and see if it works.

One reason for a size bloat would be debug info, -g.
vaish
Frequent Advisor

Re: Make command help. Exe are not created in right size

The executable is not working as expected.

I doubt whether it links with the necessary library files. How to check them ?

Thanks
Dennis Handly
Acclaimed Contributor

Re: Make command help. Exe are not created in right size

>The executable is not working as expected.

And executable that is 1/8 the size probably wouldn't even work at all.

>I doubt whether it links with the necessary library files. How to check them?

You can list shlibs with ldd(1):
ldd message_generator
vaish
Frequent Advisor

Re: Make command help. Exe are not created in right size

Thanks Dennis Handly for telling me ldd command.

I really see the difference between old exe saved on precaution and the new exe created now

When I do ldd with old exe, it shows
/usr/lib/libc.2 => /usr/lib/libc.2
/usr/lib/libdld.2 => /usr/lib/libdld.2
/usr/lib/libc.2 => /usr/lib/libc.2
/usr/local/appl/gcc-3.4.2/lib/libgcc_s.sl => /usr/local/appl/gcc-3.4.2/lib/libgcc_s.sl
/usr/lib/libc.2 => /usr/lib/libc.2
/usr/lib/libm.2 => /usr/lib/libm.2
/usr/local/appl/gcc-3.4.2/lib/libstdc++.sl.6 => /usr/local/appl/gcc-3.4.2/lib/libstdc++.sl.6
/usr/lib/libc.2 => /usr/lib/libc.2
/usr/log/ccase/gcc-3.4.2-objdir/gcc/libgcc_s.sl => /usr/local/appl/gcc/lib/libgcc_s.sl
/usr/lib/libm.2 => /usr/lib/libm.2

But when I do the same with new exe , it shows
/usr/lib/libdld.2 => /usr/lib/libdld.2
/usr/lib/libc.2 => /usr/lib/libc.2
/usr/lib/libdld.2 => /usr/lib/libdld.2
/usr/lib/libc.2 => /usr/lib/libc.2
/usr/lib/libcl.2 => /usr/lib/libcl.2
/usr/lib/libisamstub.1 => /usr/lib/libisamstub.1
/usr/lib/libdld.2 => /usr/lib/libdld.2
/usr/lib/libm.2 => /usr/lib/libm.2
/usr/lib/libCsup_v2.2 => /usr/lib/libCsup_v2.2
/usr/lib/libstd_v2.2 => /usr/lib/libstd_v2.2

Is it possible for you to explain me what it is all about ?


Dennis Handly
Acclaimed Contributor
Solution

Re: Make command help. Exe are not created in right size

>When I do ldd with old exe, it shows:
/usr/local/appl/gcc-3.4.2/lib/libstdc++.sl.6

This is using foreign devil g++.

>But when I do the same with new exe, it shows
/usr/lib/libCsup_v2.2
>Is it possible for you to explain me what it is all about?

This is using aC++ -AA.
It's unfortunate the latter isn't the one that works. :-(
vaish
Frequent Advisor

Re: Make command help. Exe are not created in right size

Dennis,
I use CXX=/opt/aCC/bin/aCC and I compile in my Makefile. Do I need to make it to gCC compiler and compile them.

Thanks
Vaish
vaish
Frequent Advisor

Re: Make command help. Exe are not created in right size

Is it possible for you to explain me "CXX=/opt/aCC/bin/aCC and CXXFLAGS=-AA -mt -c -g0 +objdebug -z -I$(BOOSTINCL) +W823 $(MK_CXXOPTS)" How should I modify them to point to gCC compiler ?
Dennis Handly
Acclaimed Contributor

Re: Make command help. Exe are not created in right size

>I use CXX=/opt/aCC/bin/aCC and I compile in my Makefile. Do I need to make it to gCC compiler and compile them?

Well, my ulterior motive is to have you use aC++. :-)
But you could try setting CXX=g++.

>Is it possible for you to explain me "CXX=/opt/aCC/bin/aCC and CXXFLAGS=-AA -mt -c -g0 +objdebug -z -I$(BOOSTINCL) +W823 $(MK_CXXOPTS)"

This says use aCC to compile. And pass the -AA & -mt & -g0 & +objdebug +W823 ... options to it.

>How should I modify them to point to g++ compiler?

You need to point CXX to the absolute path of g++.
For CXXFLAGS, remove -AA -mt -g0 +objdebug +W823 and replace by -g -threads
vaish
Frequent Advisor

Re: Make command help. Exe are not created in right size

Okay I modified as the following
CXX=gcc
CXXFLAGS=-g -I$(BOOSTINCL)

But I get errors like
/usr/ccs/bin/ld: Unsatisfied symbols:
std::basic_ostream >& std::operator<< , std::allocator >(std::basic_ostream >&, std::basic_string, std::allocator > const&)(first referenced in /var/tmp//cck6qFKn.o) (code)
std::basic_stringstream, std::allocator >::~basic_stringstream()(first referenced in /var/tmp//cck6qFKn.o) (code)
std::basic_istream >& std::ws >(std::basic_istream >&)(first referenced in /var/tmp//cck6qFKn.o) (code)

I hope I miss something else in CXXFlag to compile with gcc compiler