[CMake] Cpack generated RPM and changed binary file size in 2.8.10

2013-04-17 Thread jupiter
Hi,

I have a wired situation, I have a binary file (ELF 64-bit LSB
executable, x86-64, version 1 (SYSV), dynamically linked (uses shared
libs), for GNU/Linux 2.6.18, stripped) in bin directory, I then I run
cpack -G RPM to generate an RPM package. After install the RPM
package in another machine, the size of the binary file (82576 KB) is
different from original binary file (106228 KB). Some functions in
that packaged binary file did not run correctly. Could anyone help to
explain me why the size of binary file changes? And how to fix it?

Thank you.

Kind regards.

j
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Cpack generated RPM and changed binary file size in 2.8.10

2013-04-17 Thread Eric Noulard
2013/4/17 jupiter jupiter@gmail.com:
 Hi,

 I have a wired situation, I have a binary file (ELF 64-bit LSB
 executable, x86-64, version 1 (SYSV), dynamically linked (uses shared
 libs), for GNU/Linux 2.6.18, stripped) in bin directory, I then I run
 cpack -G RPM to generate an RPM package. After install the RPM
 package in another machine, the size of the binary file (82576 KB) is
 different from original binary file (106228 KB).

Could you check the size of the executable which gets into the RPM
it should be located in:

builddir/_CPack_Packages/packageName/RPM/packageFileName/

When CPackRPM runs you get a message like:

CPackRPM: Will use GENERATED spec file:
/blah/blah/.../RPM/SPECS/yourpackage.spec


then the directory to look into should be:
/blah/blah/.../RPM/packageFileName/

You can also extract the content of the generated RPM using rpm2cpio (or alien)

rpm2cpio yourpackage.rpm | cpio -idmv

alien -t yourpackage.rpm
tar zxvf yourpackage.tgz

then verify the size  of the concerned file.

 Some functions in
 that packaged binary file did not run correctly. Could anyone help to
 explain me why the size of binary file changes?

I bet you compare with a file produced by make install/strip?

a) The executable your are looking at may not be the same as the one
put into the RPM.

b) rpmbuild (which get called by CPackRPM) can post-process the
library/executable
  depending on the distribution you are running on.

So first do the comparison with the package executable.
Then more questions:

1) On which kind of hosts do you create the RPM?
(Fedora Y,  OpenSuSE W, Debian Z, etc...)
What is the version of RPM on this one:
   rpm --version

2) On which king of target do you intsall it?
What is the version of RPM on the target:
rpm --version

In each case could check the dependency found in the RPM:
rpm -qp --requires yourPackage.rpm


 And how to fix it?

Depending on the discrepancy between the host and the target this may
not be fixable.

 Thank you.

 Kind regards.

 j
 --

 Powered by www.kitware.com

 Visit other Kitware open-source projects at 
 http://www.kitware.com/opensource/opensource.html

 Please keep messages on-topic and check the CMake FAQ at: 
 http://www.cmake.org/Wiki/CMake_FAQ

 Follow this link to subscribe/unsubscribe:
 http://www.cmake.org/mailman/listinfo/cmake



--
Erk
Le gouvernement représentatif n'est pas la démocratie --
http://www.le-message.org
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Cpack generated RPM and changed binary file size in 2.8.10

2013-04-17 Thread hce
Eric Noulard wrote
 2013/4/17 jupiter lt;

 jupiter.hce@

 gt;:
 
 Could you check the size of the executable which gets into the RPM
 it should be located in:
 builddir
 /_CPack_Packages/
 packageName
 /RPM/
 packageFileName
 /
 
 When CPackRPM runs you get a message like:
 
 CPackRPM: Will use GENERATED spec file:
 /blah/blah/.../RPM/SPECS/yourpackage.spec

I've just updated my description, the size of the binary package in
builddir/_CPack_Packages/packageName/RPM/packageFileName was already
changed to 82576 KB.


Eric Noulard wrote
 then the directory to look into should be:
 /blah/blah/.../RPM/
 packageFileName
 /
 
 You can also extract the content of the generated RPM using rpm2cpio (or
 alien)
 
 rpm2cpio 
 yourpackage
 .rpm | cpio -idmv
 
 alien -t 
 yourpackage
 .rpm
 tar zxvf 
 yourpackage
 .tgz
 
 then verify the size  of the concerned file.
 
 Some functions in
 that packaged binary file did not run correctly. Could anyone help to
 explain me why the size of binary file changes?
 
 I bet you compare with a file produced by make install/strip?
 
 a) The executable your are looking at may not be the same as the one
 put into the RPM.
 
 b) rpmbuild (which get called by CPackRPM) can post-process the
 library/executable
   depending on the distribution you are running on.

No, I did not run make install/trip. I used CMake ExternalProject to copy
the whole bin directory in configure command, and run echo in make and
make install command.


Eric Noulard wrote
 So first do the comparison with the package executable.
 Then more questions:
 
 1) On which kind of hosts do you create the RPM?
 (Fedora Y,  OpenSuSE W, Debian Z, etc...)
 What is the version of RPM on this one:
rpm --version

CentOS 6.2, RPM version 4.8.0.


Eric Noulard wrote
 2) On which king of target do you intsall it?
 What is the version of RPM on the target:
 rpm --version
 
 In each case could check the dependency found in the RPM:
 rpm -qp --requires yourPackage.rpm

CentOS 6.2, RPM version 4.8.0. 



Eric Noulard wrote
 And how to fix it?
 
 Depending on the discrepancy between the host and the target this may
 not be fixable.

The binary file size had already changed in build _CPack_Packages directory.

Thanks Eric.

j



--
View this message in context: 
http://cmake.3232098.n2.nabble.com/Cpack-generated-RPM-and-changed-binary-file-size-in-2-8-10-tp7584084p7584086.html
Sent from the CMake mailing list archive at Nabble.com.
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake