Skip to content

Commit

Permalink
EH: CS-290: add a build step that allows to generate CULL header from…
Browse files Browse the repository at this point in the history
… JSON files
  • Loading branch information
ernst-bablick committed Dec 22, 2024
1 parent 70d52fc commit e5867be
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 12 deletions.
5 changes: 4 additions & 1 deletion source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@
#___INFO__MARK_END_NEW__

# source

# sgeobj library needs to be first, as it contains the generation of CULL header files required by others
add_subdirectory(libs)

add_subdirectory(3rdparty)
add_subdirectory(clients)
add_subdirectory(common)
add_subdirectory(daemons)
add_subdirectory(dist)
add_subdirectory(libs)
add_subdirectory(security)
add_subdirectory(utilbin)

Expand Down
8 changes: 7 additions & 1 deletion source/clients/common/ocs_client_job.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
#include "uti/sge_rmon_macros.h"
#include "uti/sge_time.h"

#include "sgeobj/cull/sge_all_listsL.h"
#include "sgeobj/cull_parse_util.h"
#include "sgeobj/ocs_binding_io.h"
#include "sgeobj/sge_centry.h"
Expand All @@ -54,6 +53,13 @@
#include "sgeobj/sge_ulong.h"
#include "sgeobj/sge_usage.h"
#include "sgeobj/sge_var.h"
#include "sgeobj/sge_str.h"
#include "sgeobj/sge_path_alias.h"
#include "sgeobj/sge_qref.h"
#include "sgeobj/sge_ja_task.h"
#include "sgeobj/sge_pe_task.h"
#include "sgeobj/sge_mesobj.h"
#include "sgeobj/sge_grantedres.h"

#include "get_path.h"
#include "ocs_client_job.h"
Expand Down
1 change: 0 additions & 1 deletion source/clients/common/ocs_client_print.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
#include "uti/sge_time.h"
#include "uti/sge_unistd.h"

#include "sgeobj/cull/sge_all_listsL.h"
#include "sgeobj/parse.h"
#include "sgeobj/sge_host.h"
#include "sgeobj/sge_job.h"
Expand Down
2 changes: 1 addition & 1 deletion source/common/parse_qsub.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
#include "uti/sge_string.h"
#include "uti/sge_time.h"

#include "sgeobj/cull/sge_all_listsL.h"
#include "sgeobj/cull_parse_util.h"
#include "sgeobj/sge_mailrec.h"
#include "sgeobj/parse.h"
Expand All @@ -60,6 +59,7 @@
#include "sgeobj/sge_answer.h"
#include "sgeobj/sge_jsv.h"
#include "sgeobj/sge_qref.h"
#include "sgeobj/sge_binding.h"

#include "parse_job_cull.h"
#include "parse_qsub.h"
Expand Down
6 changes: 5 additions & 1 deletion source/libs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
#___INFO__MARK_END_NEW__

# source/clients

# sgeobj library needs to be first, as it contains the generation of CULL header files required by others
add_subdirectory(sgeobj)


add_subdirectory(comm)
add_subdirectory(cull)
add_subdirectory(evc)
Expand All @@ -30,7 +35,6 @@ add_subdirectory(japi)
add_subdirectory(lck)
add_subdirectory(mir)
add_subdirectory(sched)
add_subdirectory(sgeobj)
add_subdirectory(spool)
add_subdirectory(uti)
# add_subdirectory(wingrid)
1 change: 0 additions & 1 deletion source/libs/evm/sge_event_master.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
#include "sgeobj/sge_feature.h"
#include "sgeobj/sge_host.h"
#include "sgeobj/sge_event.h"
#include "sgeobj/cull/sge_all_listsL.h"
#include "sgeobj/sge_conf.h"
#include "sgeobj/sge_answer.h"
#include "sgeobj/sge_qinstance.h"
Expand Down
1 change: 0 additions & 1 deletion source/libs/gdi/ocs_gdi_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
#include "gdi/sge_gdi_data.h"
#include "gdi/msg_gdilib.h"

#include "sgeobj/cull/sge_all_listsL.h"
#include "sgeobj/sge_feature.h"
#include "sgeobj/sge_object.h"
#include "sgeobj/sge_answer.h"
Expand Down
4 changes: 3 additions & 1 deletion source/libs/sched/sge_orders.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@
#include "sgeobj/sge_answer.h"
#include "sgeobj/sge_order.h"
#include "sgeobj/sge_feature.h"
#include "sgeobj/sge_mesobj.h"
#include "sgeobj/sge_job.h"
#include "sgeobj/sge_ja_task.h"

#include "evc/sge_event_client.h"

#include "gdi/sge_gdi.h"

#include "sge_orders.h"
#include "sgeobj/cull/sge_all_listsL.h"
#include "schedd_message.h"

#include "msg_schedd.h"
Expand Down
22 changes: 18 additions & 4 deletions source/libs/sgeobj/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,23 @@
#___INFO__MARK_END_NEW__

# source/libs/sgeobj
file(GLOB INPUT_FILES ${CMAKE_CURRENT_SOURCE_DIR}/json/*.json)
file(GLOB OUTPUT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/cull)
set(OUTPUT_FILES
${OUTPUT_DIR}/sge_sub_object.cc
${OUTPUT_DIR}/sge_all_listsL.h
${OUTPUT_DIR}/sge_boundaries.h
# no need to list other files here, they are included in the above files
)
add_custom_command(
OUTPUT ${OUTPUT_FILES}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND gen_types json CULL cull
DEPENDS ${INPUT_FILES} gen_types
COMMENT "Generating CULL header files"
)
add_custom_target(cull_header DEPENDS ${OUTPUT_FILES})

set(LIBRARY_NAME sgeobj)
set(LIBRARY_SOURCES
config.cc
Expand Down Expand Up @@ -90,10 +107,7 @@ set(LIBRARY_SOURCES
set(LIBRARY_INCLUDES ${SGE_INCLUDES} "./")

add_library(${LIBRARY_NAME} STATIC ${LIBRARY_SOURCES})
add_dependencies(${LIBRARY_NAME} cull_header)
target_include_directories(${LIBRARY_NAME} PUBLIC ${LIBRARY_INCLUDES})





#add_subdirectory(cpp)
1 change: 1 addition & 0 deletions source/libs/sgeobj/sge_mesobj.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include "cull/cull.h"

#include "sgeobj/cull/sge_mesobj_QIM_L.h"
#include "sgeobj/cull/sge_message_SME_L.h"

bool
object_message_add(lListElem *this_elem, int name,
Expand Down
2 changes: 2 additions & 0 deletions source/libs/sgeobj/sge_object.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
#include "cull/cull.h"
#include "cull/cull_list.h"

#include "sgeobj/cull/sge_all_listsL.h"

/****** sgeobj/object/--Object-Handling ***************************************
*
* NAME
Expand Down

0 comments on commit e5867be

Please sign in to comment.