Hi,

I ran into a problem with SunPro Fortran compiler not being able to
create a shared library since the -KPIC flag was missing. The patch
that is attached fixes this. I didn't add a -KPIE as that doesn't
exist for SunPro.

Looking at other compiler configurations, it seems it might be better
to have a SunPro.cmake module that combines flags that are independent
of the language?

greetings,
Steven

-- 
Steven Vancoillie
Theoretical Chemistry
Lund University
P.O.B 124
S-221 00 Lund
Sweden
>From f4efea633c55e384454e2f879144fa621510d6bb Mon Sep 17 00:00:00 2001
From: Steven Vancoillie <[email protected]>
Date: Fri, 20 Mar 2015 09:13:00 +0100
Subject: [PATCH] Add position independent code flag for SunPro Fortran
 compiler.

---
 Modules/Compiler/SunPro-Fortran.cmake | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Modules/Compiler/SunPro-Fortran.cmake b/Modules/Compiler/SunPro-Fortran.cmake
index e4db1e8..196aae4 100644
--- a/Modules/Compiler/SunPro-Fortran.cmake
+++ b/Modules/Compiler/SunPro-Fortran.cmake
@@ -2,6 +2,7 @@ set(CMAKE_Fortran_VERBOSE_FLAG "-v")
 set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-fixed")
 set(CMAKE_Fortran_FORMAT_FREE_FLAG "-free")
 
+set(CMAKE_Fortran_COMPILE_OPTIONS_PIC "-KPIC")
 set(CMAKE_SHARED_LIBRARY_Fortran_FLAGS "-KPIC")
 set(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS "-G")
 set(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG "-R")
-- 
2.3.3

-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to