Dear all,
I'm quite new in CMAKE. The compilation of our sources (EUROPLEXUS) under
Windows is running very well but under Linux I get an error while cmake is
copying the module files. For one particular file, cmake uses a wrong filename.
See the two bold lines below.
Any idea?
Many thanks
Martin
[ 17%] Building Fortran object source/CMakeFiles/epx.dir/m_failed_ghost_elem.f.o
cd /home/larchma/cmake/_built/source &&
/opt/intel/composer_xe_2013_sp1.5.212/bin/intel64/ifort -O0 -traceback -fpp
-LIBS:static -c -debug full -debug-parameters all -I/home/larchma/cmake/include
-c /home/larchma/cmake/source/m_failed_ghost_elem.f -o
CMakeFiles/epx.dir/m_failed_ghost_elem.f.o
/usr/bin/cmake -E cmake_copy_f90_mod source/m_failed_ghost_elem
source/CMakeFiles/epx.dir/m_failed_ghost_elem.mod.stamp Intel Fortran Compiler
/usr/bin/cmake -E touch
source/CMakeFiles/epx.dir/m_failed_ghost_elem.f.o.provides.build
make[3]: Leaving directory '/home/larchma/cmake/_built'
/usr/bin/make -f source/CMakeFiles/epx.dir/build.make
source/CMakeFiles/epx.dir/m_material_mco_chg.f.o.provides.build
make[3]: Entering directory '/home/larchma/cmake/_built'
/usr/bin/cmake -E cmake_progress_report /home/larchma/cmake/_built/CMakeFiles
[ 17%] Building Fortran object source/CMakeFiles/epx.dir/m_material_mco_chg.f.o
cd /home/larchma/cmake/_built/source &&
/opt/intel/composer_xe_2013_sp1.5.212/bin/intel64/ifort -O0 -traceback -fpp
-LIBS:static -c -debug full -debug-parameters all -I/home/larchma/cmake/include
-c /home/larchma/cmake/source/m_material_mco_chg.f -o
CMakeFiles/epx.dir/m_material_mco_chg.f.o
/usr/bin/cmake -E cmake_copy_f90_mod source/d
source/CMakeFiles/epx.dir/d.mod.stamp Intel Fortran Compiler
Error copying Fortran module "source/d". Tried "source/D.mod" and
"source/d.mod".
source/CMakeFiles/epx.dir/depend.make:19476: recipe for target
'source/CMakeFiles/epx.dir/m_material_mco_chg.f.o.provides.build' failed
make[3]: *** [source/CMakeFiles/epx.dir/m_material_mco_chg.f.o.provides.build]
Error 1
make[3]: Leaving directory '/home/larchma/cmake/_built'
source/CMakeFiles/epx.dir/build.make:7670: recipe for target
'source/CMakeFiles/epx.dir/m_material_mco_chg.f.o.provides' failed
make[2]: *** [source/CMakeFiles/epx.dir/m_material_mco_chg.f.o.provides] Error 2
make[2]: Leaving directory '/home/larchma/cmake/_built'
CMakeFiles/Makefile2:78: recipe for target 'source/CMakeFiles/epx.dir/all'
failed
make[1]: *** [source/CMakeFiles/epx.dir/all] Error 2
make[1]: Leaving directory '/home/larchma/cmake/_built'
Makefile:120: recipe for target 'all' failed
--
Dr.-Ing. Martin Larcher
European Commission
Joint Research Centre, T.P. 480
Directorate for Space, Security and Migration
Safety and Security of Buildings
I-21027 Ispra (VA) Italy
Phone: +39-0332-789563
cmake_minimum_required (VERSION 2.6)
# set (CMAKE_VERBOSE_MAKEFILE ON)
# include(CMakeForceCompiler)
#
CMAKE_FORCE_Fortran_COMPILER(/opt/intel/composer_xe_2013_sp1.5.212/bin/intel64/ifort
"Intel Fortran Compiler")
# set(FC /opt/intel/composer_xe_2013_sp1.5.212/bin/intel64/ifort)
# set(CMAKE_FORTRAN_LINK_EXECUTABLE
/opt/intel/composer_xe_2013_sp1.5.212/bin/intel64/ifort)
enable_language (CXX Fortran)
project (epx)
# Turn on the ability to create folders to organize projects (.vcproj)
# It creates "CMakePredefinedTargets" folder by default and adds CMake
# defined projects like INSTALL.vcproj and ZERO_CHECK.vcproj
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Set compiler flags and options.
# Here it is setting the Visual Studio warning level to 4
# set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
# Command to output information to the console
# Useful for displaying errors, warnings, and debugging
# message ("cxx Flags: " ${CMAKE_CXX_FLAGS})
# FFLAGS depend on the compiler
get_filename_component (Fortran_COMPILER_NAME ${CMAKE_Fortran_COMPILER} NAME)
message ("Fortran Compiler: " ${Fortran_COMPILER_NAME})
if (Fortran_COMPILER_NAME MATCHES "gfortran.*")
# gfortran
set (CMAKE_Fortran_FLAGS_RELEASE "-funroll-all-loops -fno-f2c -O3")
set (CMAKE_Fortran_FLAGS_DEBUG "-fno-f2c -O0 -g")
elseif (Fortran_COMPILER_NAME MATCHES "ifort.*")
# ifort
set (CMAKE_Fortran_FLAGS_RELEASE "-O3 -traceback -fpp -LIBS:static -nodebug
-stand:f90")
set (CMAKE_Fortran_FLAGS_DEBUG "-Od -traceback -fpp -LIBS:static -c
-debug:full -debug-parameters:all")
elseif (Fortran_COMPILER_NAME MATCHES "g77")
# g77
set (CMAKE_Fortran_FLAGS_RELEASE "-funroll-all-loops -fno-f2c -O3 -m32")
set (CMAKE_Fortran_FLAGS_DEBUG "-fno-f2c -O0 -g -m32")
else (Fortran_COMPILER_NAME MATCHES "gfortran.*")
message ("Fortran compiler: " ${Fortran_COMPILER_NAME})
message ("No optimized Fortran compiler flags are known, we just try -O2...")
set (CMAKE_Fortran_FLAGS_RELEASE "-O2")
set (CMAKE_Fortran_FLAGS_DEBUG "-O0 -g")
endif (Fortran_COMPILER_NAME MATCHES "gfortran.*")
if(MSVC)
set (CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE}
-Qmkl:sequential")
set (CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG}
-Qmkl:sequential")
ENDIF()
message ("CMAKE_Fortran_COMPILER full path: " ${CMAKE_Fortran_COMPILER})
message ("CMAKE_Fortran_FLAGS_RELEASE: " ${CMAKE_Fortran_FLAGS_RELEASE})
message ("CMAKE_Fortran_FLAGS_DEBUG: " ${CMAKE_Fortran_FLAGS_DEBUG})
# Sub-directories where more CMakeLists.txt exist
add_subdirectory (source)
add_subdirectory (cpp)
add_dependencies(epx epx_cxx)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT
epx)
# SET_TARGET_PROPERTIES(epx PROPERTIES LINKER_LANGUAGE FORTRAN)
# SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
# Adds logic to INSTALL.vcproj to copy epx.exe to destination directory
# install (TARGETS epx RUNTIME DESTINATION ${PROJECT_SOURCE_DIR}/_install)
enable_language (Fortran)
# /incremental:no is under windows set until now for both versions but by
default for debugging it is set to /incremental
if(MSVC)
set(CMAKE_EXE_LINKER_FLAGS
"${CMAKE_EXE_LINKER_FLAGS} /STACK:0x64000000 /NODEFAULTLIB:libc.lib
/NODEFAULTLIB:libifcoremd.lib /NODEFAULTLIB:MSVCRT.lib
/NODEFAULTLIB:msvcprt.lib /INCREMENTAL:NO")
endif()
set (CMAKE_BUILD_TYPE DEBUG CACHE STRING "Choose the type of build, options
are: None Debug Release." FORCE)
if (NOT CMAKE_BUILD_TYPE)
set (CMAKE_BUILD_TYPE DEBUG CACHE STRING
"Choose the type of build, options are: None Debug Release."
FORCE)
endif (NOT CMAKE_BUILD_TYPE)
message ("CMAKE_EXE_LINKER_FLAGS: " ${CMAKE_EXE_LINKER_FLAGS})
message ("CMAKE_EXE_LINKER_FLAGS_DEBUG: " ${CMAKE_EXE_LINKER_FLAGS_DEBUG})
message ("CMAKE_EXE_LINKER_FLAGS_RELEASE: " ${CMAKE_EXE_LINKER_FLAGS_RELEASE})
message ("CMAKE_Fortran_FLAGS_RELEASE: " ${CMAKE_Fortran_FLAGS_RELEASE})
message ("CMAKE_Fortran_FLAGS_DEBUG: " ${CMAKE_Fortran_FLAGS_DEBUG})
message ("CMAKE_BUILD_TYPE: " ${CMAKE_BUILD_TYPE})
# Properties->C/C++->General->Additional Include Directories
include_directories (${CMAKE_SOURCE_DIR}/include)
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
link_directories(${CMAKE_SOURCE_DIR}/library)
link_directories(${LIBRARY_OUTPUT_PATH})
file(GLOB epx_sources
"*.f"
)
add_executable(epx ${epx_sources})
target_link_libraries (epx epx_cxx Libsp f90GL f90GLU f90GLUT glut64 bmplib
libncoco libqhull mtl3d user32.lib gdi32.lib vfw32.lib)
# Creates a folder "executables" and adds target
# project (app.vcproj) under it
# set_property(TARGET epx PROPERTY FOLDER "executables")
SET_TARGET_PROPERTIES(epx PROPERTIES LINKER_LANGUAGE FORTRAN)
# Properties->General->Output Directory
set_target_properties(epx PROPERTIES RUNTIME_OUTPUT_DIRECTORY
${PROJECT_BINARY_DIR}/bin)
# Adds logic to INSTALL.vcproj to copy app.exe to destination directory
install (TARGETS epx RUNTIME DESTINATION ${PROJECT_SOURCE_DIR}/_install)
--
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