- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear all,
I am trying to write CMakeLists.txt to let CMake to generate C++ and Fortran projects. Because I need to build both static and dynamic libraries, I need to build objects at first, and then link them to static and dynamic libraries. The CMake code to generate projects is as follows:
Code to generate static library by 'OBJECT' keyword of CMake:
ADD_LIBRARY(MUMPS_d_FORTRAN OBJECT "${MUMPS_COMMON_OTHER_HEAD}" "${dMUMPS_SRC}" "${dMUMPS_OTHER_SRC}") SET_TARGET_PROPERTIES(MUMPS_d_FORTRAN PROPERTIES COMPILE_FLAGS "${GENERIC_COMPILER_FLAGS_FORTRAN} ${ORDERINGS_COMPILER_FLAGS_FORTRAN} -c" LINKER_LANGUAGE FORTRAN) TARGET_INCLUDE_DIRECTORIES(MUMPS_d_FORTRAN PUBLIC "${MUMPS_INCLUDE_DIRS}" "${LIBSEQ_INCLUDE_DIRS}")
code to generate static library by objects:
ADD_LIBRARY(dmumps STATIC $<TARGET_OBJECTS:MUMPS_d_FORTRAN>) SET_TARGET_PROPERTIES(dmumps PROPERTIES COMPILE_FLAGS "${GENERIC_COMPILER_FLAGS_FORTRAN} ${ORDERINGS_COMPILER_FLAGS_FORTRAN} -c" LINKER_LANGUAGE C) TARGET_INCLUDE_DIRECTORIES("dmumps" PUBLIC "${MUMPS_INCLUDE_DIRS}" "${LIBSEQ_INCLUDE_DIRS}")
Now the problem is that when I build the whole solution, the project 'MUMPS_d_FORTRAN' can successfully generate MUMPS_d_FORTRAN.lib but the project 'dmumps' generated nothing. What could lead to this problem.
I tested both VS2013 + Intel Parallel Studio 2016 update 2 and VS2015 + Intel Parallel Studio 2017 update 4 and the results are the same.
PS: I have similar operation for C++ project, but both projects can successfully generate static libraries.
Thanks,
Tang Laoya
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Another problem: I am trying to let CMake set the Runtime library (Project->Properties->Configuration Properties->Fortran->Libraries) to Multithreaded (change from default value Multithreaded DLL) by the following command:
set(CMAKE_FORTRAN_FLAGS_DEBUG "/MTd ${CMAKE_FORTRAN_FLAGS_DEBUG}") set(CMAKE_FORTRAN_FLAGS_RELEASE "/MT ${CMAKE_FORTRAN_FLAGS_RELEASE}")
or the following command:
set (DBUILD_WITH_STATIC_CRT "OFF")
But they all don't work. Could anyone tell me how to write code to do these settings?
Thanks,
Tang Laoya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your questions have more to do with Cmake than the Intel Fortran compiler, and you would probably receive help on your question if you ask in a Cmake forum or ask the authors of the Cmakefile.txt that you are using.
If you have got as far as getting Cmake to produce a makefile, and you ran into problems using that makefile, you can report here the problems that you ran into with the makefile.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page