[CMake] ExternalProject_Add fails with gcc-4.9.3

2017-07-29 Thread T.Sariyski
cmake version 3.4.3

Hi,

I have ExternalProject_Add (attached), which works with gcc-4.4.7, but fails
with gcc-4.9.3:

...
...
[100%] Performing build step for 'ep_netcdf'
CMake Error at
/scratch/tesari/build/cee/gnu.dbg/netcdf/src/ep_netcdf-stamp/ep_netcdf-build
-DEBUG.cmake:16 (message):
Command failed: 2
 'make'
 See also
 
/scratch/tesari/build/cee/gnu.dbg/netcdf/src/ep_netcdf-stamp/ep_netcdf-build
-*.log (attached).

If I execute configure and make, as defined in  ${CONFIGURE_COMMAND}, it
works.

What is the meaning of  "Command failed: 2 'make'" error message, and how
should I track it down? Any help is highly appreciated.

Thanks in advance,
Ted 


ExternalProject_Add( ep_netcdf
  URL ${CMAKE_SOURCE_DIR}/src/netcdf/netcdf_distro.tar
  PREFIX ${CMAKE_CURRENT_BINARY_DIR}/netcdf
  LOG_CONFIGURE 1  
  LOG_BUILD 1
  LOG_INSTALL 1   
  LOG_DOWNLOAD 0
  LOG_UPDATE 0
  BUILD_IN_SOURCE 1
  CONFIGURE_COMMAND
${CMAKE_CURRENT_BINARY_DIR}/netcdf/src/ep_netcdf/configure  
   --enable-64bit FC=" " F90=${CMAKE_Fortran_COMPILER}
CXX=${CMAKE_CXX_COMPILER}  CC=${CMAKE_C_COMPILER} 
  BUILD_COMMAND ${MAKE}
)


ep_netcdf-build-DEBUG.cmake

set(command "${make}")
execute_process(
  COMMAND ${command}
  RESULT_VARIABLE result
  OUTPUT_FILE
"/scratch/tesari/build/cee/gnu.dbg/netcdf/src/ep_netcdf-stamp/ep_netcdf-buil
d-out.log"
  ERROR_FILE
"/scratch/tesari/build/cee/gnu.dbg/netcdf/src/ep_netcdf-stamp/ep_netcdf-buil
d-err.log"
  )
if(result)
  set(msg "Command failed: ${result}\n")
  foreach(arg IN LISTS command)
set(msg "${msg} '${arg}'")
  endforeach()
  set(msg "${msg}\nSee also\n
/scratch/tesari/build/cee/gnu.dbg/netcdf/src/ep_netcdf-stamp/ep_netcdf-build
-*.log")
  message(FATAL_ERROR "${msg}")
else()
  set(msg "ep_netcdf build command succeeded.  See also
/scratch/tesari/build/cee/gnu.dbg/netcdf/src/ep_netcdf-stamp/ep_netcdf-build
-*.log")
  message(STATUS "${msg}")
endif()


-- 

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


[CMake] How to make a Fortran file dependent on #inclde files

2017-07-18 Thread T.Sariyski
Hi,

 

I have a Fortran project with numerous #include files. When a #include file is 
changed, CMake does not detect the change, and does not rebuild the objects 
using this include file. In order to reflect the change, currently I  ‘make 
clean; make’, which rebuilds the entire project.  Is there a way to tell CMake 
that a Fortran file depends from its #include files?

 

Thanks in advance,

Ted

 

P.S. I use cmake-3.4.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

[CMake] FW: CTest question

2017-05-18 Thread T.Sariyski
', '0']

113: /Users/tesari/kodiak/trunk/benchmark/Scripts/assert_case.py called with  3 
 arguments:

113: 1 /Users/tesari/build/gnu.dbg/CTEST/zamod/hskdk

113: 2 /Users/tesari/kodiak/trunk/CTEST/zamod/../GOLD/zamod/hskdk

113: 3 0

113: /Users/tesari/build/gnu.dbg/CTEST/zamod/hskdk  does not exist!

 

 

 

From: Eric Noulard [mailto:eric.noul...@gmail.com] 
Sent: Wednesday, May 17, 2017 10:54 PM
To: T.Sariyski <tzsari...@gmail.com <mailto:tzsari...@gmail.com> >
Cc: CMake ML <cmake@cmake.org <mailto:cmake@cmake.org> >
Subject: Re: [CMake] CTest question

 

We lack information on how your test are failing. If they all timeout then may 
be you should setup a proper timeout for the test. The actual execution speed 
of a test may depend on the load of your machine or the network (depending on 
what the test are actually doing).

This may be even more sensible if your test are run in parallel. Do you run 
ctest with --parallel option? 

 

Do your tests depends on each other? If so did you setup test dependencies?

 

Le 17 mai 2017 10:59 PM, "T.Sariyski" < <mailto:tzsari...@gmail.com> 
tzsari...@gmail.com> a écrit :

Hi,

 

I wonder what is the reason that sometimes ctest ends with numerous ‘Failed’ 
and ‘Timeout’, which ‘ctest –rerun-failed’ reports ‘Passed’. At times the 
number of these false failures is about one third. I guess that the problem is 
in the way I set my tests, but I have no clue where to look, or how to ‘debug’ 
the ctest run.

Any advice is highly appreciated.

 

Thanks,

Ted


--

Powered by www.kitware.com <http://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

-- 

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

Re: [CMake] CTest question

2017-05-18 Thread T.Sariyski
Hi Eric,

 

I am sorry I did not state the question clear enough. Let me first say that 
tests does not depend on each other, and  running with or without –parallel 
does not make much of difference.

 

Here is how I set the tests . This is a Fortran code, it does not return. 
ADD_TEST command is a call to CMAKE, which (i) executes the Fortran code, and 
(ii) executes a python script, a metrics of how close the solution is to the 
reference data. I have a PASS_REGULAR_EXPRESSION property,  passRegex, 
associated with the test. When a test fails, the output is that the required 
regular expression ${passRegex} is not found. A test and the python script are 
attached. Please let me know if more information is needed. 

 

Thanks in advance,

Ted

 

 

CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

project(project_name Fortran ) 

enable_testing()

 

set (SRUN_COMMAND /bin/sh -c "cd ${ CMAKE_CURRENT_BINARY_DIR } &&  
$ ${PROJECT_NAME}")

add_custom_target(${PROJECT_NAME}_srun COMMAND ${SRUN_COMMAND})

set(TARGET_NAME ${PROJECT_NAME}_serial)

add_test(NAME ${TARGET_NAME}

   WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}

   COMMAND ${CMAKE_COMMAND} 

 -D "PRE_DELETE_OUTPUT_FILES:BOOL=true" 

 -D "OUTPUT_FILES:STRING=${files_to_delete}" 

 -D "PROGRAM1:STRING=${SRUN_COMMAND}" 

 -D 
"PROGRAM2:STRING=python;${assert_case};${hs_work_file};${hs_gold_file};0"   
  

 -P "run_and_assert.cmake")

 

set(passRegex "CALCULATION TERMINATED BECAUSE STOP TIME ACHIEVED" "ctest: 
SUCCESS")

set_property(TEST ${TARGET_NAME}

 PROPERTY PASS_REGULAR_EXPRESSION "${passRegex}")



 

/> cat run_and_assert.cmake

…

EXECUTE_PROCESS(COMMAND ${PROGRAM1}

RESULT_VARIABLE error

ERROR_FILE err.log

OUTPUT_FILE out.log

)

IF(error)

MESSAGE(FATAL_ERROR "Executing \"${PROGRAM1}\" FAIED! error=${error}")

ENDIF()

 

EXECUTE_PROCESS(COMMAND ${PROGRAM2}

RESULT_VARIABLE status)

IF(status)

MESSAGE(SEND_ERROR "Executing \"${PROGRAM2}\" FAILED! status=${status}")

ENDIF()

 

 

 

From: Eric Noulard [mailto:eric.noul...@gmail.com] 
Sent: Wednesday, May 17, 2017 10:54 PM
To: T.Sariyski <tzsari...@gmail.com>
Cc: CMake ML <cmake@cmake.org>
Subject: Re: [CMake] CTest question

 

We lack information on how your test are failing. If they all timeout then may 
be you should setup a proper timeout for the test. The actual execution speed 
of a test may depend on the load of your machine or the network (depending on 
what the test are actually doing).

This may be even more sensible if your test are run in parallel. Do you run 
ctest with --parallel option? 

 

Do your tests depends on each other? If so did you setup test dependencies?

 

Le 17 mai 2017 10:59 PM, "T.Sariyski" <tzsari...@gmail.com 
<mailto:tzsari...@gmail.com> > a écrit :

Hi,

 

I wonder what is the reason that sometimes ctest ends with numerous ‘Failed’ 
and ‘Timeout’, which ‘ctest –rerun-failed’ reports ‘Passed’. At times the 
number of these false failures is about one third. I guess that the problem is 
in the way I set my tests, but I have no clue where to look, or how to ‘debug’ 
the ctest run.

Any advice is highly appreciated.

 

Thanks,

Ted


--

Powered by www.kitware.com <http://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

-- 

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

[CMake] CTest question

2017-05-17 Thread T.Sariyski
Hi,

 

I wonder what is the reason that sometimes ctest ends with numerous ‘Failed’ 
and ‘Timeout’, which ‘ctest –rerun-failed’ reports ‘Passed’. At times the 
number of these false failures is about one third. I guess that the problem is 
in the way I set my tests, but I have no clue where to look, or how to ‘debug’ 
the ctest run.

Any advice is highly appreciated.

 

Thanks,

Ted

-- 

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

[CMake] compiler flags passed to cmake appear doubled at build time

2017-02-24 Thread T.Sariyski
Hi,

 

For some reason, compiler flags passed to cmake, appear twice at build time.
I have a message line at the bottom of the cmakelist file, and it reports
the compilers flag as expected. 

 

cmake \

-G "Eclipse CDT4 - Unix Makefiles" \

-D MPI=ON \

-D CMAKE_Fortran_FLAGS="-132 -cpp -g -O0 -DIFORT" \

..

 

-- CMAKE_Fortran_FLAGS=  -DMPI -132 -cpp -g -O0 -DIFORT

 

At build time, these flags are doubled:

 

make

[  0%] Building Fortran object
src/modules/CMakeFiles/modules.dir/constants.F90.o

cd /users/tesari/my/build.intel/src/modules &&
/opt/mpi/RH6/intel_PS_XE_2013/openmpi-1.6/bin/mpif90   -DMPI -132 -cpp -g
-O0 -DIFORT -132 -cpp -g -O0 -DIFORT .

 

This is not a critical error, I am just curious what I am doing wrong.

 

Thanks in advance,

Ted

 

-- 

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