[CMake] cpack 32bit rpm on a 64bit system

Yngve Inntjore Levinsen yngve.levinsen at gmail.com
Thu Feb 17 05:35:40 EST 2011


Dear Eric,

I have tried again a few times without success, and tried with the version 2.8.4 that you provided.

Since this didn't succeed I figured I should test with a helloworld binary and see how that goes. Of course it works just fine, even with the 2.6 series installed on the server. The CMakeLists.txt is below for those interested.

I will send a new e-mail if I figure out that there is some issues with the packaging, but for now we close the case. I'd say it is about 99% sure I am doing something wrong ;)

By the way, in this script I did not specify i686 or x86_64, will it then default to the latter or does it check the binary format to some extent?

Thanks for your efforts!

Cheers,
Yngve


cmake_minimum_required (VERSION 2.6) 
project (hello Fortran) 

set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -m32")
set (CMAKE_Fortran_LINK_FLAGS   "${CMAKE_Fortran_LINK_FLAGS} -static ")

add_executable(hello hello.F90)

INSTALL(TARGETS hello
  BUNDLE DESTINATION .
  RUNTIME DESTINATION bin
  LIBRARY DESTINATION lib
  ARCHIVE DESTINATION lib
)

set (CPACK_RPM_PACKAGE_RELEASE 1)
set (CPACK_RPM_PACKAGE_LICENSE "custom")
set (CPACK_RPM_PACKAGE_GROUP "Development/Tools")
include (CPack)


On Wednesday 16 February 2011 02:01:28 PM Eric Noulard wrote:
> 2011/2/16 Yngve Inntjore Levinsen <yngve.levinsen at gmail.com>:
> >
> > The server OS is quite conservative when it comes to new packages, so I already had to go into a fight to get 2.6 series installed. I do not think that is possible system-wide but I am of course able to compile cmake myself and put it on my own share.
> 
> I understand.
> You may try 2.8.3 (or even todays 2.8.4) without compiling it by
> taking precompiled one:
> http://www.cmake.org/files/v2.8/cmake-2.8.3-Linux-i386.tar.gz
> or
> http://www.cmake.org/files/v2.8/cmake-2.8.4-Linux-i386.tar.gz
> 
> Untar them somewhere in your directory.
> Then invoke the installed CMake.
> 
> > I propose you let me know how to do it with 2.8.3 and I do that workaround.
> 
> I'm not sure it will work with CMake 2.8.3 but it would easier
> for me to fix it in the maintained 2.8.x branch than trying to fix
> the unmaintained 2.6.4.
> 
> 
> Normally
> set(CPACK_RPM_PACKAGE_ARCHITECTURE "i686")
> should be enough.
> 
> If it is not try:
> 
> $ setarch i686
> $ cpack -G RPM
> 
> this last method may work with CMake 2.6.4 too.
> 
> > I can put a feature request to upgrade cmake.
> >
> > I forgot to answer one of your questions, I build 32bit with the -m32 flag, that is correct.
> 
> 
> 


More information about the CMake mailing list