ftnlf

Check-in [df8b8eb14a]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Build FX.Core module under different names to use in FX tree.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:df8b8eb14a71aadc1fb594f3d4ec49b789e3cdf5
User & Date: vadim 2018-10-17 07:18:57
Context
2018-10-23
15:14
Unpack-to-table function and option to link static or shared runtime. check-in: 4b3f3fed00 user: vadim tags: trunk
2018-10-17
07:18
Build FX.Core module under different names to use in FX tree. check-in: df8b8eb14a user: vadim tags: trunk
2018-05-22
08:54
Cleanup. check-in: ddd58d65b7 user: vadim tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to CMakeLists.txt.

24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
..
63
64
65
66
67
68
69


70
71
72
73
74
75
76
77
78
79
80
81

82
83
84
85
86
87
88
89




90
91
92
93
94
95
96
	else()
		set (FCFLAGS "-fp-model precise -g -O0 -C -traceback")
	endif()
	set (FCFLAGS90 "-warn")
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
	if(MINGW)
		#	set (LFLAGS "-static-libgcc -static-libgfortran -Wl,-s")
		# set (LFLAGS "-static-libgcc -static-libgfortran")
		set (LFLAGS "")
		set (LFLAGS_FX ${LFLAGS})
	else()		
		set (LFLAGS "")
		set (LFLAGS_FX "")
	endif()
	if(CMAKE_BUILD_TYPE STREQUAL "Release")
		set (FCFLAGS "-O2 -march=native -mfpmath=sse")
................................................................................
	)

set (src_shlib
	ftnlf_fxcore.f90
	luaf/luaf.f90
	luaf/luafe.f90
	${CMAKE_CURRENT_BINARY_DIR}/luaf_conf.fi


	)

set (src_test
	test.f90
	)

add_library(ftnlf STATIC ${src_lib})
set_target_properties(ftnlf PROPERTIES COMPILE_FLAGS "${FCFLAGS} ${FCFLAGS90}")
if(CMAKE_BUILD_TYPE STREQUAL "Release")
	set_target_properties(ftnlf PROPERTIES INTERPROCEDURAL_OPTIMIZATION 1)
endif()


add_library(FX SHARED ${src_shlib})
target_link_libraries(FX ${LUA_LIBRARIES})
set_target_properties(FX PROPERTIES COMPILE_FLAGS "${FCFLAGS} ${FCFLAGS90}")
set_target_properties(FX PROPERTIES LINK_FLAGS "${LFLAGS_FX}")
set_target_properties(FX PROPERTIES PREFIX "")
if(CMAKE_BUILD_TYPE STREQUAL "Release")
	set_target_properties(FX PROPERTIES INTERPROCEDURAL_OPTIMIZATION 1)
endif()





add_executable(ftnlf_test ${src_test})
# Link static
target_link_libraries(ftnlf_test ftnlf ${LUA_STATIC_LIB} ${CMAKE_DL_LIBS})
# Link dynamic
# target_link_libraries(ftnlf ${LUA_LIBRARIES})
set_target_properties(ftnlf_test PROPERTIES COMPILE_FLAGS "${FCFLAGS} ${FCFLAGS90}")







|
|







 







>
>












>
|
|
|
|
|

|

>
>
>
>







24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
..
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
	else()
		set (FCFLAGS "-fp-model precise -g -O0 -C -traceback")
	endif()
	set (FCFLAGS90 "-warn")
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
	if(MINGW)
		#	set (LFLAGS "-static-libgcc -static-libgfortran -Wl,-s")
		set (LFLAGS "-static -Wl,-s")
		# set (LFLAGS "")
		set (LFLAGS_FX ${LFLAGS})
	else()		
		set (LFLAGS "")
		set (LFLAGS_FX "")
	endif()
	if(CMAKE_BUILD_TYPE STREQUAL "Release")
		set (FCFLAGS "-O2 -march=native -mfpmath=sse")
................................................................................
	)

set (src_shlib
	ftnlf_fxcore.f90
	luaf/luaf.f90
	luaf/luafe.f90
	${CMAKE_CURRENT_BINARY_DIR}/luaf_conf.fi
# export everything
#	ftnlf_fxcore.def
	)

set (src_test
	test.f90
	)

add_library(ftnlf STATIC ${src_lib})
set_target_properties(ftnlf PROPERTIES COMPILE_FLAGS "${FCFLAGS} ${FCFLAGS90}")
if(CMAKE_BUILD_TYPE STREQUAL "Release")
	set_target_properties(ftnlf PROPERTIES INTERPROCEDURAL_OPTIMIZATION 1)
endif()

function(add_fxlib FX)
add_library(${FX} SHARED ${src_shlib})
target_link_libraries(${FX} ${LUA_LIBRARIES})
set_target_properties(${FX} PROPERTIES COMPILE_FLAGS "${FCFLAGS} ${FCFLAGS90}")
set_target_properties(${FX} PROPERTIES LINK_FLAGS "${LFLAGS_FX}")
set_target_properties(${FX} PROPERTIES PREFIX "")
if(CMAKE_BUILD_TYPE STREQUAL "Release")
	set_target_properties({FX} PROPERTIES INTERPROCEDURAL_OPTIMIZATION 1)
endif()
endfunction()

add_fxlib(Core)
add_fxlib(FX)

add_executable(ftnlf_test ${src_test})
# Link static
target_link_libraries(ftnlf_test ftnlf ${LUA_STATIC_LIB} ${CMAKE_DL_LIBS})
# Link dynamic
# target_link_libraries(ftnlf ${LUA_LIBRARIES})
set_target_properties(ftnlf_test PROPERTIES COMPILE_FLAGS "${FCFLAGS} ${FCFLAGS90}")

Added ftnlf_fxcore.def.









>
>
>
>
1
2
3
4
LIBRARY FX

EXPORTS
    luaopen_FX_Core