Warning, /eic-opticks/sysrap/CMakeLists.txt is written in an unsupported language. File is not indexed.
0001 set(name SysRap)
0002 set(desc "System Level Utilities depending")
0003
0004 find_package(nlohmann_json REQUIRED)
0005 find_package(plog REQUIRED)
0006 find_package(GLEW REQUIRED)
0007 find_package(glfw3 REQUIRED)
0008 find_package(glm REQUIRED)
0009 find_package(CUDAToolkit REQUIRED)
0010 find_package(OpenSSL REQUIRED)
0011
0012 set(Custom4_VERBOSE ON)
0013 find_package(Custom4 CONFIG)
0014
0015 message(STATUS "${name} Custom4_FOUND:${Custom4_FOUND} " )
0016
0017 set(WITH_SLOG YES)
0018
0019 set(SYSRAP_OPTICKS_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
0020 configure_file(sconfig.h.in inc/sconfig.h)
0021 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/inc/sconfig.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME})
0022
0023 set(SOURCES
0024 SYSRAP_LOG.cc
0025 SLOG.cc
0026
0027 SCurandStateMonolithic.cc
0028 SSys.cc
0029 SProf.cc
0030 SMeta.cc
0031
0032
0033 SStr.cc
0034 SPath.cc
0035 SSeq.cc
0036 STranche.cc
0037 SAr.cc
0038 SArr.cc
0039 SArgs.cc
0040 SPPM.cc
0041 SVec.cc
0042 SNameVec.cc
0043 SMap.cc
0044 SCount.cc
0045 SDigest.cc
0046 SDigestNP.cc
0047 SDirect.cc
0048 SArrayDigest.cc
0049
0050 SLauncher.cc
0051 SRenderer.cc
0052 SCtrl.cc
0053 SGeo.cc
0054 SConstant.cc
0055
0056 STimes.cc
0057 SLogger.cc
0058 SBase36.cc
0059 SSortKV.cc
0060 SPairVec.cc
0061 md5.cc
0062 SPPM.cc
0063 SColor.cc
0064 SId.cc
0065 SGDML.cc
0066 S_get_option.cc
0067 STime.cc
0068 SASCII.cc
0069 SAbbrev.cc
0070 SPack.cc
0071 SBit.cc
0072 SEnabled.cc
0073 SRand.cc
0074
0075 SMockViz.cc
0076 SRngSpec.cc
0077
0078 CheckGeo.cc
0079
0080 SLabelCache.cc
0081
0082 SMath.cc
0083
0084 snd.cc
0085 scsg.cc
0086
0087 s_csg.cc
0088 sn.cc
0089 s_pa.cc
0090 s_bb.cc
0091 s_tv.cc
0092
0093
0094 SEvent.cc
0095 SFrameGenstep.cc
0096
0097 SOpticks.cc
0098 SOpticksResource.cc
0099 SOpticksKey.cc
0100 SThetaCut.cc
0101 SPhiCut.cc
0102
0103 SCenterExtentGenstep.cc
0104
0105 OpticksPhoton.cc
0106
0107 SU.cu
0108 SPM.cu
0109
0110 SEventConfig.cc
0111 SFrameConfig.cc
0112 SGeoConfig.cc
0113
0114 SEvt.cc
0115 SSim.cc
0116
0117 SFastSim_Debug.cc
0118 SFastSimOpticalModel.cc
0119
0120 SOpBoundaryProcess.cc
0121 )
0122
0123
0124 set(CURANDLITE_HEADERS
0125 curandlite/curandStatePhilox4_32_10_OpticksLite.h
0126 )
0127
0128
0129 set(HEADERS
0130 OPTICKS_LOG.hh
0131
0132 SYSRAP_LOG.hh
0133 SYSRAP_API_EXPORT.hh
0134 SYSRAP_HEAD.hh
0135 SYSRAP_TAIL.hh
0136 SLOG.hh
0137 slog.h
0138
0139 PLOG.hh
0140 SLOG_INIT.hh
0141
0142 SLaunchSequence.h
0143
0144
0145 SCurandSpec.h
0146 SCurandChunk.h
0147 scurandref.h
0148 SCurandState.h
0149
0150
0151 SCurandStateMonolithic.hh
0152 sproc.h
0153 sprof.h
0154 SProf.hh
0155 SMeta.hh
0156 smeta.h
0157
0158 SBacktrace.h
0159 SStackFrame.h
0160 SProfile.h
0161
0162 ssys.h
0163 SSys.hh
0164
0165 sstr.h
0166 SStr.hh
0167
0168 schrono.h
0169 stimer.h
0170 sstamp.h
0171 ssystime.h
0172
0173 SBnd.h
0174 SPrd.h
0175
0176 SPath.hh
0177 spath.h
0178 sdirectory.h
0179
0180 sdevice.h
0181 scontext.h
0182
0183 SSeq.hh
0184 STranche.hh
0185
0186 SVec.hh
0187 svec.h
0188
0189 SNameVec.hh
0190 SMap.hh
0191 SCount.hh
0192
0193 slist.h
0194 sfreq.h
0195 snode.h
0196 stree.h
0197 s_unique.h
0198 suniquename.h
0199
0200 sstandard.h
0201 sprop.h
0202 sproplist.h
0203 sidxname.h
0204
0205 snam.h
0206 smatsur.h
0207
0208
0209 strid.h
0210 sfactor.h
0211
0212 snd.hh
0213 scsg.hh
0214
0215 sndtree.h
0216
0217 s_pool.h
0218 s_csg.h
0219 sn.h
0220 s_pa.h
0221 s_bb.h
0222 s_tv.h
0223
0224 st.h
0225 stra.h
0226 sgeomtools.h
0227
0228 spa.h
0229 sxf.h
0230 sbb.h
0231
0232 sdigest.h
0233 SDigest.hh
0234
0235
0236
0237 SDigestNP.hh
0238 SDirect.hh
0239 sdirect.h
0240 SArrayDigest.hh
0241
0242 SLauncher.hh
0243 SRenderer.hh
0244 SRandom.h
0245 s_seq.h
0246 S4Random.h
0247
0248 SCF.h
0249
0250 SCtrl.hh
0251 SGeo.hh
0252 SConstant.hh
0253 SEvt.hh
0254
0255 STimes.hh
0256 SLogger.hh
0257 SBase36.hh
0258 SSortKV.hh
0259 SPairVec.hh
0260 OpticksCSG.h
0261 PlainFormatter.hh
0262 SAr.hh
0263 SArr.hh
0264 SArgs.hh
0265 S_freopen_redirect.hh
0266 S_get_option.hh
0267
0268 STime.hh
0269 s_time.h
0270
0271 SPPM.hh
0272 sppm.h
0273
0274 SColor.hh
0275 SId.hh
0276 SGDML.hh
0277 SASCII.hh
0278 SAbbrev.hh
0279 SPack.hh
0280 SBit.hh
0281 SBitSet.h
0282 SEnabled.hh
0283 SRand.hh
0284
0285 SMockViz.hh
0286 SRngSpec.hh
0287
0288 CheckGeo.hh
0289 SLabelCache.hh
0290
0291 SRng.hh
0292 SBuf.hh
0293
0294 SName.h
0295 SLabel.h
0296
0297 smath.h
0298 sblackbody.h
0299 tcomplex.h
0300
0301 srng.h
0302 sbuild.h
0303 srngcpu.h
0304 scurand.h
0305
0306 s_mock_texture.h
0307 stexture.h
0308
0309 njuffa_erfcinvf.h
0310 s_mock_erfcinvf.h
0311
0312
0313 squad.h
0314 squadx.h
0315
0316 sphoton.h
0317 sphit.h
0318 spho.h
0319 sgs.h
0320 srec.h
0321 srec.h
0322 sseq.h
0323 sseq_index.h
0324
0325 sframe.h
0326 sfr.h
0327 SCE.h
0328 SCSGOptiX.h
0329
0330 SPMT.h
0331 SPMTAccessor.h
0332
0333 storchtype.h
0334
0335 storch.h
0336 scarrier.h
0337 scerenkov.h
0338 sscint.h
0339 sevent.h
0340 sstate.h
0341 sctx.h
0342 salloc.h
0343
0344 SGenerate.h
0345
0346 sflow.h
0347 sqat4.h
0348 saabb.h
0349 stran.h
0350 stmm.h
0351
0352 SPlace.h
0353 SPlaceSphere.h
0354 SPlaceRing.h
0355 SPlaceCylinder.h
0356 SPlaceCircle.h
0357
0358 ssincos.h
0359 sxyz.h
0360 sc4u.h
0361 stag.h
0362
0363 sbit_.h
0364 sbibit.h
0365
0366 sview.h
0367 strided_range.h
0368 iexpand.h
0369
0370
0371 SOpticks.hh
0372 sdomain.h
0373
0374 SDBG.h
0375
0376 SOpticksResource.hh
0377
0378 SCMD.h
0379
0380 SRecord.h
0381 SGen.h
0382
0383 SGLM.h
0384 SGLM_Parse.h
0385 SGLM_Modifiers.h
0386 SGLM_Arcball.h
0387
0388 GL_CHECK.h
0389
0390 SScene.h
0391 SMesh.h
0392 SMeshGroup.h
0393
0394 SGLFW.h
0395 SGLFW_Keys.h
0396 SGLFW_check.h
0397 SGLFW_Buffer.h
0398 SGLFW_VAO.h
0399 SGLFW_Attrib.h
0400 SGLFW_Program.h
0401 SGLFW_Mesh.h
0402 SGLFW_Scene.h
0403 SGLFW_Record.h
0404 SGLFW_Gen.h
0405 SGLFW_Evt.h
0406 SGLFW_GLEQ.h
0407
0408 SGLDisplay.h
0409 SCUDA_OutputBuffer.h
0410 SGLFW_CUDA.h
0411
0412 SCUDA_Mesh.h
0413 SCU_BufferView.h
0414 SCUDA_MeshGroup.h
0415 SCSGPrimSpec.h
0416
0417 scuda.h
0418 scuda_pointer.h
0419
0420 SOPTIX.h
0421 SOPTIX_Context.h
0422 SOPTIX_Properties.h
0423 SOPTIX_Options.h
0424 SOPTIX_getPRD.h
0425 SOPTIX_Desc.h
0426 SOPTIX_Accel.h
0427 SOPTIX_Binding.h
0428 SOPTIX_MeshGroup.h
0429 SOPTIX_Module.h
0430 SOPTIX_OPT.h
0431 SOPTIX_Pipeline.h
0432 SOPTIX_SBT.h
0433 SOPTIX_Scene.h
0434
0435 SOPTIX_BuildInput.h
0436 SOPTIX_BuildInput_Mesh.h
0437 SOPTIX_BuildInput_CPA.h
0438 SOPTIX_BuildInput_IA.h
0439
0440 gleq.h
0441
0442 SDir.h
0443 SRG.h
0444 SCAM.h
0445 SBAS.h
0446
0447 SEvt.hh
0448
0449 SOpticksKey.hh
0450 SMath.hh
0451
0452 SEvent.hh
0453 SGenstep.h
0454 sslice.h
0455
0456 SFrameGenstep.hh
0457
0458 SThetaCut.hh
0459 SPhiCut.hh
0460
0461
0462 SCenterExtentFrame.h
0463 SPresent.h
0464
0465 SCenterExtentGenstep.hh
0466 scanvas.h
0467
0468 OpticksGenstep.h
0469 OpticksPhoton.h
0470 OpticksPhoton.hh
0471
0472 CUDA_CHECK.h
0473 SCU.h
0474 SCU_.h
0475 OPTIX_CHECK.h
0476
0477
0478 SU.hh
0479 SComponent_OLD.hh
0480 SComp.h
0481
0482 SEventConfig.hh
0483 SRM.h
0484 SFrameConfig.hh
0485 SGeoConfig.hh
0486
0487 np.h
0488 NP.hh
0489 NP_nanobind.h
0490
0491 NPU.hh
0492 NPX.h
0493 NPFold.h
0494 SSim.hh
0495 SPropMockup.h
0496
0497 S4Material.h
0498 S4MaterialPropertyVector.h
0499
0500 SNameOrder.h
0501 S4.h
0502 S4Surface.h
0503 S4TreeBorder.h
0504
0505 S4RandomMonitor.h
0506 S4RandomArray.h
0507
0508
0509 SFastSim_Debug.hh
0510 SFastSimOpticalModel.hh
0511 STrackInfo.h
0512 SVolume.h
0513 SPhoton_Debug.h
0514 SUniformRand.h
0515
0516 sgeomdefs.h
0517 sfmt.h
0518 ssolid.h
0519 SIntersect.h
0520 SSimtrace.h
0521
0522 SOpBoundaryProcess.hh
0523 )
0524
0525 # using absolute ANADIR avoids build environment requiring it in PATH
0526 get_filename_component(ANADIR ../ana ABSOLUTE)
0527 get_filename_component(BINDIR ../bin ABSOLUTE)
0528
0529 message(STATUS "CMAKE_CURRENT_SOURCE_DIR : ${CMAKE_CURRENT_SOURCE_DIR}")
0530 message(STATUS "ANADIR : ${ANADIR}")
0531
0532
0533
0534 set(HGS ${CMAKE_CURRENT_SOURCE_DIR}/OpticksGenstep.h)
0535 set(IGS ${CMAKE_CURRENT_BINARY_DIR}/OpticksGenstep_Enum.ini)
0536 add_custom_command(
0537 OUTPUT
0538 ${IGS}
0539 COMMAND
0540 ${ANADIR}/enum_.py ${HGS} --quiet --simple --inipath ${IGS}
0541 DEPENDS
0542 ${HGS}
0543 )
0544 add_custom_target(PythonGS ALL DEPENDS ${IGS} )
0545
0546 #[=[
0547
0548 cd ~/opticks/sysrap ; ../ana/enum_.py OpticksGenstep.h --quiet --simple --inipath /tmp/OpticksGenstep_Enum.ini && cat /tmp/OpticksGenstep_Enum.ini
0549 #]=]
0550
0551
0552 ## HMM:the flags change very infrequently : easier to code generate into source directories for discoverability
0553 set(HPH ${CMAKE_CURRENT_SOURCE_DIR}/OpticksPhoton.h)
0554 set(IPH ${CMAKE_CURRENT_BINARY_DIR}/OpticksPhoton_Enum.ini)
0555 add_custom_command(
0556 OUTPUT
0557 ${IPH}
0558 COMMAND
0559 ${ANADIR}/enum_.py ${HPH} --quiet --inipath ${IPH}
0560 DEPENDS
0561 ${HPH}
0562 )
0563 add_custom_target(PythonPH ALL DEPENDS ${IPH} )
0564 # ALL : Indicates that this custom target should be added to the
0565 # default build target so that it will be run every time.
0566
0567
0568
0569 set(CCFL ${CMAKE_CURRENT_SOURCE_DIR}/OpticksPhoton.hh)
0570 set(PYJS ${CMAKE_CURRENT_BINARY_DIR}/OpticksPhoton_Abbrev.json)
0571
0572 add_custom_command(
0573 OUTPUT
0574 ${PYJS}
0575 COMMAND
0576 ${ANADIR}/OpticksPhoton.py ${CCFL} --quiet --jsonpath ${PYJS}
0577 DEPENDS
0578 ${CCFL}
0579 )
0580 add_custom_target(PythonJSON ALL DEPENDS ${PYJS} )
0581
0582
0583 list(APPEND HEADERS
0584 ${IGS}
0585 ${IPH}
0586 ${PYJS}
0587 )
0588
0589
0590 set(WITH_SIMG YES)
0591 if(WITH_SIMG)
0592 list(APPEND HEADERS stb_image.h stb_image_write.h)
0593 list(APPEND HEADERS SIMG.h )
0594 list(APPEND HEADERS SIMG_Frame.h )
0595 endif()
0596
0597
0598 set(WITH_STTF YES)
0599 if(WITH_STTF)
0600 list(APPEND HEADERS stb_truetype.h)
0601 list(APPEND HEADERS STTF.h)
0602 endif()
0603
0604
0605 set(WITH_NP YES)
0606
0607
0608 add_library( ${name} ${SOURCES} )
0609
0610 set_property( TARGET ${name} PROPERTY INTERFACE_DESCRIPTION ${desc} )
0611
0612 target_link_libraries(${name}
0613 plog::plog
0614 nlohmann_json::nlohmann_json
0615 CUDA::cudart
0616 GLEW::GLEW
0617 glfw
0618 glm::glm
0619 OpenSSL::SSL
0620 OpenSSL::Crypto
0621 )
0622
0623 target_include_directories( ${name} PUBLIC
0624 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
0625 $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/sysrap/inc>
0626 $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
0627 $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}>
0628 $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/sysrap>
0629 )
0630
0631
0632 #[=[
0633 SysRap Compile Definitions
0634 ----------------------------
0635
0636 former WITH..SND
0637 switched the below to use the old inflexible snd.hh CSG node impl,
0638 instead of the default more flexible sn.h impl:
0639
0640 sysrap/stree.h
0641 WITH..SND saves CSG nodes in CSGFoundry/SSim/stree/csg
0642 NOT:WITH..SND saves CSG nodes in CSGFoundry/SSim/stree/_csg
0643
0644 u4/U4Tree.h u4/U4Solid.h u4/U4Polycone.h
0645 WITH..SND uses snd.hh idx int as CSG root
0646 NOT:WITH..SND uses sn.h sn* pointer as CSG root
0647
0648 WITH_CHILD
0649 sysrap/sn.h uses child vector of sn pointers supporting n-ary trees
0650
0651 NOT:WITH_CHILD
0652 sysrap/sn.h uses left, right sn pointers supporting only binary trees
0653
0654 DEBUG_TAG
0655 needed for random aligned running in multiple pkgs: sysrap, qudarap, u4
0656 however making this PUBLIC makes rebuilding real heavy
0657 so must rely on making coordinated switches when doing random aligned running
0658
0659 PLOG_LOCAL
0660 changes visibility of plog external symbols, allowing better
0661 integration with packages (like junosw) that do not hide
0662 symbols by default
0663
0664 RNG_XORWOW/RNG_PHILOX/RNG_PHILITEOX
0665 Use one of these to pick the curandState implementation, in srng.h
0666 picking RNG_XORWOW requires curandState files which slows
0667 down initialization greatly when simulating many millions
0668 of photons
0669
0670 #]=]
0671
0672
0673 if(Custom4_FOUND)
0674 target_compile_definitions( ${name} PUBLIC WITH_CUSTOM4 )
0675 target_include_directories( ${name} PUBLIC ${Custom4_INCLUDE_DIR})
0676 endif()
0677
0678 target_compile_definitions( ${name}
0679 PUBLIC
0680 $<$<CONFIG:Debug>:CONFIG_Debug>
0681 $<$<CONFIG:RelWithDebInfo>:CONFIG_RelWithDebInfo>
0682 $<$<CONFIG:Release>:CONFIG_Release>
0683 $<$<CONFIG:MinSizeRel>:CONFIG_MinSizeRel>
0684
0685 OPTICKS_SYSRAP
0686 GLM_ENABLE_EXPERIMENTAL
0687 WITH_CHILD
0688 PLOG_LOCAL
0689 RNG_PHILOX
0690
0691 $<$<CONFIG:Debug>:DEBUG_TAG>
0692 $<$<CONFIG:Debug>:DEBUG_PIDX>
0693 $<$<CONFIG:Debug>:DEBUG_PIDXYZ>
0694 $<$<CONFIG:Release>:PRODUCTION>
0695 )
0696
0697
0698
0699
0700 if(WITH_STTF)
0701 target_compile_definitions( ${name} PUBLIC WITH_STTF)
0702 endif()
0703 if(WITH_SLOG)
0704 target_compile_definitions( ${name} PUBLIC WITH_SLOG)
0705 endif()
0706
0707 install(FILES ${HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/sysrap/)
0708 install(FILES ${CURANDLITE_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/curandlite)
0709
0710 install(TARGETS ${name}
0711 EXPORT ${PROJECT_NAME}Targets
0712 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
0713 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
0714 )