Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Don't build smpi in a separate library anymore.
[simgrid.git] / buildtools / Cmake / Distrib.cmake
index 70faceb..b84a0f0 100644 (file)
@@ -3,31 +3,17 @@
 #########################################
 
 # doc
-file(MAKE_DIRECTORY ${CMAKE_HOME_DIRECTORY}/doc/shared/doxygen/)
-file(MAKE_DIRECTORY ${CMAKE_HOME_DIRECTORY}/doc/ref_guide/html/)
-file(MAKE_DIRECTORY ${CMAKE_HOME_DIRECTORY}/doc/user_guide/html/)
-
-install(DIRECTORY "${CMAKE_HOME_DIRECTORY}/doc/ref_guide/html/"
-  DESTINATION "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/doc/simgrid/ref_guide/html/"
-  PATTERN ".svn" EXCLUDE
-  PATTERN ".git" EXCLUDE
-  PATTERN "*.o" EXCLUDE
-  PATTERN "*~" EXCLUDE
-  )
-
-install(DIRECTORY "${CMAKE_HOME_DIRECTORY}/doc/user_guide/html/"
-  DESTINATION "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/doc/simgrid/user_guide/html/"
-  PATTERN ".svn" EXCLUDE
-  PATTERN ".git" EXCLUDE
-  PATTERN "*.o" EXCLUDE
-  PATTERN "*~" EXCLUDE
-  )
+file(MAKE_DIRECTORY ${CMAKE_HOME_DIRECTORY}/doc/html/)
+install(DIRECTORY "${CMAKE_HOME_DIRECTORY}/doc/html/"
+  DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/doc/simgrid/html/)
+install(DIRECTORY "${CMAKE_HOME_DIRECTORY}/doc/HelloWorld/"
+  DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/doc/simgrid/HelloWorld/)
 
 #### Generate the manpages
 if(NOT WIN32)
   if( NOT MANPAGE_DIR)
     set( MANPAGE_DIR ${CMAKE_BINARY_DIR}/manpages )
-  endif( NOT MANPAGE_DIR)
+  endif()
 
   add_custom_target(manpages ALL
     COMMAND ${CMAKE_COMMAND} -E make_directory ${MANPAGE_DIR}
@@ -37,12 +23,13 @@ if(NOT WIN32)
   install(FILES ${MANPAGE_DIR}/simgrid_update_xml.1 ${CMAKE_HOME_DIRECTORY}/tools/tesh/tesh.1
     DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/share/man/man1)
 
-endif(NOT WIN32)
+endif()
 
 # binaries
 install(PROGRAMS ${CMAKE_BINARY_DIR}/bin/smpicc
   ${CMAKE_BINARY_DIR}/bin/smpif2c
   ${CMAKE_BINARY_DIR}/bin/smpiff
+  ${CMAKE_BINARY_DIR}/bin/smpif90
   ${CMAKE_BINARY_DIR}/bin/smpirun
   DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/)
 
@@ -70,26 +57,21 @@ add_custom_target(simgrid_update_xml ALL
   COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_HOME_DIRECTORY}/tools/simgrid_update_xml.pl ${CMAKE_BINARY_DIR}/bin/simgrid_update_xml
   )
 
-install(PROGRAMS ${CMAKE_BINARY_DIR}/bin/gras_stub_generator
-  DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/)
-
 # libraries
-install(TARGETS simgrid gras
+install(TARGETS simgrid 
   DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/)
 
-if(enable_smpi)
-  install(TARGETS smpi
-    DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/)
-endif(enable_smpi)
-
 if(enable_lib_static AND NOT WIN32)
   install(TARGETS simgrid_static
     DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/)
-  if(enable_smpi)
-    install(TARGETS smpi_static
+endif()
+
+if(enable_java)
+  install(TARGETS SG_java
       DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/)
-  endif(enable_smpi)
-endif(enable_lib_static AND NOT WIN32)
+  install(FILES ${SIMGRID_JAR}
+      DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/java/)
+endif()
 
 # include files
 set(HEADERS
@@ -126,7 +108,7 @@ if(HAVE_LUA)
   install(FILES ${CMAKE_BINARY_DIR}/lib/lua/5.1/simgrid.${LIB_EXE}
     DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/lua/5.1
     )
-endif(HAVE_LUA)
+endif()
 
 ###########################################
 ### Fill in the "make uninstall" target ###
@@ -135,22 +117,19 @@ endif(HAVE_LUA)
 add_custom_target(uninstall
   COMMAND ${CMAKE_COMMAND} -E  remove_directory ${CMAKE_INSTALL_PREFIX}/doc/simgrid
   COMMAND ${CMAKE_COMMAND} -E  echo "uninstall doc ok"
-  COMMAND ${CMAKE_COMMAND} -E  remove -f ${CMAKE_INSTALL_PREFIX}/lib/libgras*
   COMMAND ${CMAKE_COMMAND} -E  remove -f ${CMAKE_INSTALL_PREFIX}/lib/libsimgrid*
-  COMMAND ${CMAKE_COMMAND} -E  remove -f ${CMAKE_INSTALL_PREFIX}/lib/libsmpi*
+  COMMAND ${CMAKE_COMMAND} -E   remove -f ${CMAKE_INSTALL_PREFIX}/lib/lua/5.1/simgrid*
   COMMAND ${CMAKE_COMMAND} -E  echo "uninstall lib ok"
   COMMAND ${CMAKE_COMMAND} -E  remove -f ${CMAKE_INSTALL_PREFIX}/bin/smpicc
   COMMAND ${CMAKE_COMMAND} -E  remove -f ${CMAKE_INSTALL_PREFIX}/bin/smpif2c
   COMMAND ${CMAKE_COMMAND} -E  remove -f ${CMAKE_INSTALL_PREFIX}/bin/smpiff
+  COMMAND ${CMAKE_COMMAND} -E  remove -f ${CMAKE_INSTALL_PREFIX}/bin/smpif90
   COMMAND ${CMAKE_COMMAND} -E  remove -f ${CMAKE_INSTALL_PREFIX}/bin/smpirun
   COMMAND ${CMAKE_COMMAND} -E  remove -f ${CMAKE_INSTALL_PREFIX}/bin/tesh
   COMMAND ${CMAKE_COMMAND} -E  remove -f ${CMAKE_INSTALL_PREFIX}/bin/simgrid-colorizer
   COMMAND ${CMAKE_COMMAND} -E  remove -f ${CMAKE_INSTALL_PREFIX}/bin/simgrid_update_xml
-  COMMAND ${CMAKE_COMMAND} -E  remove -f ${CMAKE_INSTALL_PREFIX}/bin/gras_stub_generator
   COMMAND ${CMAKE_COMMAND} -E  remove -f ${CMAKE_INSTALL_PREFIX}/bin/graphicator
   COMMAND ${CMAKE_COMMAND} -E  echo "uninstall bin ok"
-  COMMAND ${CMAKE_COMMAND} -E  remove_directory ${CMAKE_INSTALL_PREFIX}/include/amok
-  COMMAND ${CMAKE_COMMAND} -E  remove_directory ${CMAKE_INSTALL_PREFIX}/include/gras
   COMMAND ${CMAKE_COMMAND} -E  remove_directory ${CMAKE_INSTALL_PREFIX}/include/instr
   COMMAND ${CMAKE_COMMAND} -E  remove_directory ${CMAKE_INSTALL_PREFIX}/include/msg
   COMMAND ${CMAKE_COMMAND} -E  remove_directory ${CMAKE_INSTALL_PREFIX}/include/simdag
@@ -161,10 +140,10 @@ add_custom_target(uninstall
   COMMAND ${CMAKE_COMMAND} -E  remove_directory ${CMAKE_INSTALL_PREFIX}/include/mc
   COMMAND ${CMAKE_COMMAND} -E  remove_directory ${CMAKE_INSTALL_PREFIX}/include/simgrid
   COMMAND ${CMAKE_COMMAND} -E  remove -f ${CMAKE_INSTALL_PREFIX}/include/simgrid_config.h
-  COMMAND ${CMAKE_COMMAND} -E  remove -f ${CMAKE_INSTALL_PREFIX}/include/gras.h
   COMMAND ${CMAKE_COMMAND} -E  remove -f ${CMAKE_INSTALL_PREFIX}/include/xbt.h
   COMMAND ${CMAKE_COMMAND} -E  echo "uninstall include ok"
   COMMAND ${CMAKE_COMMAND} -E  remove -f ${CMAKE_INSTALL_PREFIX}/share/man/man1/simgrid_update_xml.1
+    COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_INSTALL_PREFIX}/share/man/man1/tesh.1
   COMMAND ${CMAKE_COMMAND} -E  echo "uninstall man ok"
   WORKING_DIRECTORY "${CMAKE_INSTALL_PREFIX}"
   )
@@ -175,7 +154,7 @@ if(HAVE_LUA)
     COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_INSTALL_PREFIX}/lib/lua/5.1/simgrid.${LIB_EXE}
     WORKING_DIRECTORY "${CMAKE_HOME_DIRECTORY}/"
     )
-endif(HAVE_LUA)
+endif()
 
 ################################################################
 ## Build a sain "make dist" target to build a source package ###
@@ -187,21 +166,19 @@ endif(HAVE_LUA)
 set(source_to_pack
   ${headers_to_install}
   ${source_of_generated_headers}
-  ${AMOK_SRC}
   ${BINDINGS_SRC}
-  ${GRAS_COMMON_SRC}
-  ${GRAS_RL_SRC}
-  ${GRAS_SG_SRC}
   ${GTNETS_SRC}
   ${JEDULE_SRC}
+  ${JMSG_C_SRC}
+  ${JMSG_JAVA_SRC}
   ${LUA_SRC}
   ${MC_SRC}
   ${MSG_SRC}
   ${NS3_SRC}
   ${RNGSTREAM_SRC}
   ${SIMDAG_SRC}
+  ${SIMGRID_SRC}
   ${SIMIX_SRC}
-  ${SMPI_SRC}
   ${SURF_SRC}
   ${TRACING_SRC}
   ${XBT_RL_SRC}
@@ -215,14 +192,7 @@ set(source_to_pack
   ${DOC_FIGS}
   ${DOC_IMG}
   ${DOC_SOURCES}
-  ${DOC_GTUT_SRC}
-  ${LISTE_GTUT}
-  ${EXTRA_LISTE_GTUT}
   ${DOC_TOOLS}
-  ${DOC_SHARED_TAG}
-  ${REF_GUIDE_SOURCES}
-  ${USER_GUIDE_SOURCES}
-  ${DEV_GUIDE_SOURCES}
   ${PLATFORMS_EXAMPLES}
   ${README_files}
   ${bin_files}
@@ -244,10 +214,8 @@ add_custom_target(dist-dir
   COMMAND ${CMAKE_COMMAND} -E remove_directory ${PROJECT_NAME}-${release_version}/
   COMMAND ${CMAKE_COMMAND} -E remove ${PROJECT_NAME}-${release_version}.tar.gz
   COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_NAME}-${release_version}
-  COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_NAME}-${release_version}/doc/user_guide/html/
-  COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_NAME}-${release_version}/doc/ref_guide/html/
-  COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_HOME_DIRECTORY}/doc/user_guide/html/ ${PROJECT_NAME}-${release_version}/doc/user_guide/html/
-  COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_HOME_DIRECTORY}/doc/ref_guide/html/ ${PROJECT_NAME}-${release_version}/doc/ref_guide/html/
+  COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_NAME}-${release_version}/doc/html/
+  COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_HOME_DIRECTORY}/doc/html/ ${PROJECT_NAME}-${release_version}/doc/html/
   )
 add_dependencies(dist-dir simgrid_documentation)
 add_dependencies(dist-dir maintainer_files)
@@ -267,7 +235,7 @@ foreach(file ${source_to_pack})
       TARGET dist-dir
       COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_NAME}-${release_version}/${file_location}/
       )
-  endif(NOT OPERATION)
+  endif()
 
   # Actually copy the file
   add_custom_command(
@@ -288,6 +256,7 @@ add_custom_command(
 add_custom_target(dist
   COMMENT "Removing the distribution directory"
   DEPENDS ${CMAKE_BINARY_DIR}/${PROJECT_NAME}-${release_version}.tar.gz
+  COMMAND ${CMAKE_COMMAND} -E echo ${PROJECT_NAME}-${release_version} > ${CMAKE_BINARY_DIR}/VERSION
   COMMAND ${CMAKE_COMMAND} -E remove_directory ${PROJECT_NAME}-${release_version}/
   )
 
@@ -307,7 +276,7 @@ if(NOT enable_maintainer_mode)
     COMMAND ${CMAKE_COMMAND} -E echo "WARNING: ----------------------------------------------------"
     )
   add_dependencies(dist echo-dist)
-endif(NOT enable_maintainer_mode)
+endif()
 
 ###########################################
 ### Fill in the "make distcheck" target ###
@@ -317,11 +286,14 @@ set(CMAKE_BINARY_TEST_DIR ${CMAKE_BINARY_DIR})
 
 # Allow to test the "make dist"
 add_custom_target(distcheck
+  COMMAND ${CMAKE_COMMAND} -E echo "XXX compare archive with git repository"
+  COMMAND ${CMAKE_HOME_DIRECTORY}/tools/check_dist_archive -batch ${CMAKE_BINARY_TEST_DIR}/${PROJECT_NAME}-${release_version}.tar.gz
+
   COMMAND ${CMAKE_COMMAND} -E echo "XXX remove old copy"
   COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_TEST_DIR}/${PROJECT_NAME}-${release_version}
 
   COMMAND ${CMAKE_COMMAND} -E echo "XXX Untar distrib"
-  COMMAND ${CMAKE_COMMAND} -E tar  xf ${CMAKE_BINARY_TEST_DIR}/${PROJECT_NAME}-${release_version}.tar.gz ${CMAKE_BINARY_TEST_DIR}/${PROJECT_NAME}-${release_version}
+  COMMAND ${CMAKE_COMMAND} -E tar xf ${CMAKE_BINARY_TEST_DIR}/${PROJECT_NAME}-${release_version}.tar.gz ${CMAKE_BINARY_TEST_DIR}/${PROJECT_NAME}-${release_version}
 
   COMMAND ${CMAKE_COMMAND} -E echo "XXX create build and install subtrees"
   COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_TEST_DIR}/${PROJECT_NAME}-${release_version}/_build
@@ -331,14 +303,12 @@ add_custom_target(distcheck
   COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_TEST_DIR}/${PROJECT_NAME}-${release_version}/_build
   ${CMAKE_COMMAND}
   -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_TEST_DIR}/${PROJECT_NAME}-${release_version}/_inst
-  -Denable_lua=ON
-  -Denable_model-checking=ON
   ..
   COMMAND ${CMAKE_COMMAND} -E echo "XXX Build"
   COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_TEST_DIR}/${PROJECT_NAME}-${release_version}/_build ${CMAKE_MAKE_PROGRAM}
 
   COMMAND ${CMAKE_COMMAND} -E echo "XXX Test"
-  COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_TEST_DIR}/${PROJECT_NAME}-${release_version}/_build ctest || true
+  COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_TEST_DIR}/${PROJECT_NAME}-${release_version}/_build ctest
 
   COMMAND ${CMAKE_COMMAND} -E echo "XXX Install"
   COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_TEST_DIR}/${PROJECT_NAME}-${release_version}/_build ${CMAKE_MAKE_PROGRAM} install
@@ -346,10 +316,16 @@ add_custom_target(distcheck
   ${CMAKE_BINARY_TEST_DIR}/${PROJECT_NAME}-${release_version}/_inst/lib/libsimgrid.so
   ${CMAKE_BINARY_TEST_DIR}/${PROJECT_NAME}-${release_version}/_inst/lib/libsimgridtest.so
 
+  COMMAND ${CMAKE_COMMAND} -E echo "XXX Build documentation"
+  COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_TEST_DIR}/${PROJECT_NAME}-${release_version}/_build ${CMAKE_MAKE_PROGRAM} simgrid_documentation
+
+  COMMAND ${CMAKE_COMMAND} -E echo "XXX Install with documentation"
+  COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_TEST_DIR}/${PROJECT_NAME}-${release_version}/_build ${CMAKE_MAKE_PROGRAM} install
+
   COMMAND ${CMAKE_COMMAND} -E echo "XXX Remove temp directories"
   COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_TEST_DIR}/${PROJECT_NAME}-${release_version}
   )
-#add_dependencies(distcheck dist)
+add_dependencies(distcheck dist)
 
 #######################################
 ### Fill in the "make check" target ###
@@ -359,11 +335,11 @@ if(enable_memcheck)
   add_custom_target(check
     COMMAND ctest -D ExperimentalMemCheck
     )
-else(enable_memcheck)
+else()
   add_custom_target(check
     COMMAND make test
     )
-endif(enable_memcheck)
+endif()
 
 #######################################
 ### Fill in the "make xxx-clean" target ###
@@ -386,23 +362,10 @@ add_custom_target(maintainer-clean
   )
 
 add_custom_target(supernovae-clean
-  COMMAND ${CMAKE_COMMAND} -E remove -f src/supernovae_gras.c
   COMMAND ${CMAKE_COMMAND} -E remove -f src/supernovae_sg.c
   COMMAND ${CMAKE_COMMAND} -E remove -f src/supernovae_smpi.c
   WORKING_DIRECTORY "${CMAKE_HOME_DIRECTORY}"
   )
 
-#############################################
-### Fill in the "make sync-gforge" target ###
-#############################################
-
-#PIPOL
-add_custom_target(sync-pipol
-  COMMAND scp -r Experimental_bindings.sh Experimental.sh  MemCheck.sh pre-simgrid.sh navarro@pipol.inria.fr:~/
-  COMMAND scp -r rc.* navarro@pipol.inria.fr:~/.pipol/
-  COMMAND scp -r Nightly* navarro@pipol.inria.fr:~/.pipol/nightly
-  COMMAND ssh navarro@pipol.inria.fr "chmod a=rwx ~/* ~/.pipol/rc.* ~/.pipol/nightly/*"
-  WORKING_DIRECTORY "${CMAKE_HOME_DIRECTORY}/buildtools/pipol/"
-  )
 
 include(CPack)