* cmake and fortran
@ 2010-07-09 16:52 Marco Atzeri
2010-07-09 21:30 ` Yaakov (Cygwin/X)
0 siblings, 1 reply; 3+ messages in thread
From: Marco Atzeri @ 2010-07-09 16:52 UTC (permalink / raw)
To: cygwin
[-- Attachment #1: Type: text/plain, Size: 524 bytes --]
Hi,
as lapack is moving to cmake as build system,
I started to playing with cmake and I suspect no one
tried before cmake and fortran together on cygwin.
The definition file
/usr/share/cmake-2.6.4/Modules/Platform/CYGWIN-g77.cmake
is clearly wrong. It tries to build libxxx.dll and so on.
Attached the one that I am currently using, copied and modified
from CYGWIN-g77.cmake that seems right.
Could the cmake maintainer give a check and eventually
report the issue upstream ?
Regards
Marco
[-- Attachment #2: cmake_patch --]
[-- Type: application/octet-stream, Size: 3248 bytes --]
--- CYGWIN-g77.cmake_bk 2010-07-06 21:06:21.031250000 +0200
+++ CYGWIN-g77.cmake 2010-07-06 22:09:28.843750000 +0200
@@ -1,6 +1,55 @@
-SET(CMAKE_SHARED_LIBRARY_PREFIX "lib")
+SET(WIN32 1)
+SET(CYGWIN 1)
+SET(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS "-shared -Wl,--export-all-symbols -Wl,--enable-auto-import")
+SET(CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS})
+
+SET(CMAKE_SHARED_LIBRARY_PREFIX "cyg")
SET(CMAKE_SHARED_LIBRARY_SUFFIX ".dll")
+SET(CMAKE_SHARED_MODULE_PREFIX "lib")
+SET(CMAKE_SHARED_MODULE_SUFFIX ".dll")
+SET(CMAKE_IMPORT_LIBRARY_PREFIX "lib")
+SET(CMAKE_IMPORT_LIBRARY_SUFFIX ".dll.a")
SET(CMAKE_SHARED_LIBRARY_Fortran_FLAGS "")
SET(CMAKE_SHARED_LIBRARY_Fortran_FLAGS "")
SET(CMAKE_EXECUTABLE_SUFFIX ".exe") # .exe
+
+# Modules have a different default prefix that shared libs.
+SET(CMAKE_MODULE_EXISTS 1)
+
+SET(CMAKE_FIND_LIBRARY_PREFIXES "cyg" "lib")
+SET(CMAKE_FIND_LIBRARY_SUFFIXES ".dll" ".dll.a" ".a")
+
+SET(CMAKE_GNULD_IMAGE_VERSION
+ "-Wl,--major-image-version,<TARGET_VERSION_MAJOR>,--minor-image-version,<TARGET_VERSION_MINOR>")
+
+SET(CMAKE_Fortran_CREATE_SHARED_MODULE
+ "<CMAKE_Fortran_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_MODULE_Fortran_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS> -o <TARGET> ${CMAKE_GNULD_IMAGE_VERSION} <OBJECTS> <LINK_LIBRARIES>")
+SET(CMAKE_CXX_CREATE_SHARED_MODULE
+ "<CMAKE_CXX_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_MODULE_CXX_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS> -o <TARGET> ${CMAKE_GNULD_IMAGE_VERSION} <OBJECTS> <LINK_LIBRARIES>")
+
+SET(CMAKE_Fortran_CREATE_SHARED_LIBRARY
+ "<CMAKE_Fortran_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_Fortran_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS> -o <TARGET> -Wl,--out-implib,<TARGET_IMPLIB> ${CMAKE_GNULD_IMAGE_VERSION} <OBJECTS> <LINK_LIBRARIES>")
+SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
+ "<CMAKE_CXX_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> -o <TARGET> -Wl,--out-implib,<TARGET_IMPLIB> ${CMAKE_GNULD_IMAGE_VERSION} <OBJECTS> <LINK_LIBRARIES>")
+
+SET(CMAKE_Fortran_LINK_EXECUTABLE
+ "<CMAKE_Fortran_COMPILER> <FLAGS> <CMAKE_Fortran_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> -Wl,--out-implib,<TARGET_IMPLIB> ${CMAKE_GNULD_IMAGE_VERSION} <LINK_LIBRARIES>")
+SET(CMAKE_CXX_LINK_EXECUTABLE
+ "<CMAKE_CXX_COMPILER> <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> -Wl,--out-implib,<TARGET_IMPLIB> ${CMAKE_GNULD_IMAGE_VERSION} <LINK_LIBRARIES>")
+
+# Shared libraries on cygwin can be named with their version number.
+SET(CMAKE_SHARED_LIBRARY_NAME_WITH_VERSION 1)
+
+# Initialize C link type selection flags. These flags are used when
+# building a shared library, shared module, or executable that links
+# to other libraries to select whether to use the static or shared
+# versions of the libraries.
+FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
+ SET(CMAKE_${type}_LINK_STATIC_Fortran_FLAGS "-Wl,-Bstatic")
+ SET(CMAKE_${type}_LINK_DYNAMIC_Fortran_FLAGS "-Wl,-Bdynamic")
+ENDFOREACH(type)
+
+
+
+
INCLUDE(Platform/g77)
[-- Attachment #3: Type: text/plain, Size: 218 bytes --]
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: cmake and fortran
2010-07-09 16:52 cmake and fortran Marco Atzeri
@ 2010-07-09 21:30 ` Yaakov (Cygwin/X)
2010-07-12 1:00 ` Marco Atzeri
0 siblings, 1 reply; 3+ messages in thread
From: Yaakov (Cygwin/X) @ 2010-07-09 21:30 UTC (permalink / raw)
To: cygwin
On Fri, 2010-07-09 at 16:50 +0000, Marco Atzeri wrote:
> as lapack is moving to cmake as build system,
> I started to playing with cmake and I suspect no one
> tried before cmake and fortran together on cygwin.
>
> The definition file
> /usr/share/cmake-2.6.4/Modules/Platform/CYGWIN-g77.cmake
> is clearly wrong. It tries to build libxxx.dll and so on.
>
> Attached the one that I am currently using, copied and modified
> from CYGWIN-g77.cmake that seems right.
>
> Could the cmake maintainer give a check and eventually
> report the issue upstream ?
I'm not the cmake maintainer, but could you try Ports' cmake-2.8.1-11
and see if that's any better?
Yaakov
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: cmake and fortran
2010-07-09 21:30 ` Yaakov (Cygwin/X)
@ 2010-07-12 1:00 ` Marco Atzeri
0 siblings, 0 replies; 3+ messages in thread
From: Marco Atzeri @ 2010-07-12 1:00 UTC (permalink / raw)
To: cygwin
--- Ven 9/7/10, Yaakov ha scritto:
> Marco Atzeri wrote:
> > as lapack is moving to cmake as build system,
> > I started to playing with cmake and I suspect no one
> > tried before cmake and fortran together on cygwin.
> >
> > The definition file
> >
> /usr/share/cmake-2.6.4/Modules/Platform/CYGWIN-g77.cmake
> > is clearly wrong. It tries to build libxxx.dll and so
> on.
> >
> > Attached the one that I am currently using, copied and
> modified
> > from CYGWIN-g77.cmake that seems right.
> >
> > Could the cmake maintainer give a check and eventually
>
> > report the issue upstream ?
>
> I'm not the cmake maintainer, but could you try Ports'
> cmake-2.8.1-11
> and see if that's any better?
>
>
> Yaakov
2.8.1-11 looks much better.
I see that the same structure is used for all GNU compiler
on
/usr/share/cmake-2.8.1/Modules/Platform
CYGWIN-GNU-C.cmake
CYGWIN-GNU-Fortran.cmake
CYGWIN-GNU-CXX.cmake
all refer to common structure in
CYGWIN-GNU.cmake
Marco
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-07-11 19:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-09 16:52 cmake and fortran Marco Atzeri
2010-07-09 21:30 ` Yaakov (Cygwin/X)
2010-07-12 1:00 ` Marco Atzeri
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).