omniscidb OmniSciDB (formerly MapD Core)开源项目

我要开发同款
匿名用户2021年11月09日
60阅读
所属分类C/C++、开发工具、编译器
授权协议Apache-2.0 License

作品详情

OmniSciDB(formerlyMapDCore)

OmniSciDBisanopensourceSQL-based,relational,columnardatabaseenginethatleveragesthefullperformanceandparallelismofmodernhardware(bothCPUsandGPUs)toenablequeryingofmulti-billionrowdatasetsinmilliseconds,withouttheneedforindexing,pre-aggregation,ordownsampling.OmniSciDBcanberunonhybridCPU/GPUsystems(NvidiaGPUsarecurrentlysupported),aswellasonCPU-onlysystemsfeaturingX86,Power,andARM(experimentalsupport)architectures.Toachievemaximumperformance,OmniSciDBfeaturesmulti-tieredcachingofdatabetweenstorage,CPUmemory,andGPUmemory,andaninnovativeJust-In-Time(JIT)querycompilationframework.

Forusageinfo,seetheproductdocumentation,andformoredetailsaboutthesystem'sinternalarchitecture,checkoutthedeveloperdocumentation.FurthertechnicaldiscussioncanbefoundontheOmniSciCommunityForum.

Therepositoryincludesanumberofthirdpartypackagesprovidedunderseparatelicenses.DetailsaboutthesepackagesandtheirrespectivelicensesisatThirdParty/licenses/index.md.

DownloadsandInstallationInstructions

OmniSciprovidespre-builtbinariesforLinuxforstablereleasesoftheproject:

DistroPackagetypeCPU/GPURepositoryDocsCentOSRPMCPUhttps://releases.omnisci.com/os/yum/stable/cpuhttps://docs.omnisci.com/latest/4_centos7-yum-cpu-os-recipe.htmlCentOSRPMGPUhttps://releases.omnisci.com/os/yum/stable/cudahttps://docs.omnisci.com/latest/4_centos7-yum-gpu-os-recipe.htmlUbuntuDEBCPUdebhttps://releases.omnisci.com/os/apt/stablecpuhttps://docs.omnisci.com/latest/4_ubuntu-apt-cpu-os-recipe.htmlUbuntuDEBGPUdebhttps://releases.omnisci.com/os/apt/stablecudahttps://docs.omnisci.com/latest/4_ubuntu-apt-gpu-os-recipe.html*tarballCPUhttps://releases.omnisci.com/os/tar/omnisci-os-latest-Linux-x86_64-cpu.tar.gz*tarballGPUhttps://releases.omnisci.com/os/tar/omnisci-os-latest-Linux-x86_64-cuda.tar.gzDevelopingOmniSciDB:TableofContentsLinksLicenseContributingBuildingTestingUsingCodeStyleDependenciesRoadmapLinksDeveloperDocumentationDoxygen-generatedDocumentationProductDocumentationReleaseNotesCommunityForumOmniSciHomepageOmniSciBlogOmniSciDownloadsLicense

ThisprojectislicensedundertheApacheLicense,Version2.0.

Therepositoryincludesanumberofthirdpartypackagesprovidedunderseparatelicenses.DetailsaboutthesepackagesandtheirrespectivelicensesisatThirdParty/licenses/index.md.

Contributing

InordertoclarifytheintellectualpropertylicensegrantedwithContributionsfromanypersonorentity,OmniScimusthaveaContributorLicenseAgreement("CLA")onfilethathasbeensignedbyeachContributor,indicatingagreementtotheContributorLicenseAgreement.Aftermakingapullrequest,abotwillnotifyyouifasignedCLAisrequiredandprovideinstructionsforhowtosignit.Pleasereadtheagreementcarefullybeforesigningandkeepacopyforyourrecords.

Building

IfthisisyourfirsttimebuildingOmniSciDB,installthedependenciesmentionedintheDependenciessectionbelow.

OmniSciDBusesCMakeforitsbuildsystem.

mkdirbuildcdbuildcmake-DCMAKE_BUILD_TYPE=debug..make-j4

Thefollowingcmake/ccmakeoptionscanenable/disabledifferentfeatures:

-DCMAKE_BUILD_TYPE=release-Buildtypeandcompileroptionstouse.OptionsareDebug,Release,RelWithDebInfo,MinSizeRel,andunset.-DENABLE_ASAN=off-Enableaddresssanitizer.Defaultisoff.-DENABLE_AWS_S3=on-EnableAWSS3support,ifavailable.Defaultison.-DENABLE_CUDA=off-DisableCUDA.Defaultison.-DENABLE_CUDA_KERNEL_DEBUG=off-EnabledebuggingsymbolsforCUDAkernels.Willdramaticallyreducekernelperformance.Defaultisoff.-DENABLE_DECODERS_BOUNDS_CHECKING=off-Enableboundscheckingforcolumndecoding.Defaultisoff.-DENABLE_FOLLY=on-UseFolly.Defaultison.-DENABLE_IWYU=off-Enableinclude-what-you-use.Defaultisoff.-DENABLE_JIT_DEBUG=off-EnabledebuggingsymbolsfortheJIT.Defaultisoff.-DENABLE_PROFILER=off-Enablegoogleperftools.Defaultisoff.-DENABLE_STANDALONE_CALCITE=off-RequirestandaloneCalciteserver.Defaultisoff.-DENABLE_TESTS=on-Buildunittests.Defaultison.-DENABLE_TSAN=off-Enablethreadsanitizer.Defaultisoff.-DENABLE_CODE_COVERAGE=off-Enablecodecoveragesymbols(clangonly).Defaultisoff.-DMAPD_DOCS_DOWNLOAD=on-Downloadthelatestmasterbuildofthedocumentation/docs.mapd.com.Defaultisoff.Note:thisisa>50MBdownload.-DPREFER_STATIC_LIBS=off-Staticlinkdependencies,ifavailable.Defaultisoff.Testing

OmniSciDBusesGoogleTestasitsmaintestingframework.TestsresideundertheTestsdirectory.

Thesanity_teststargetrunsthemostcommontests.IfusingMakefilestobuild,thetestsmayberunusing:

makesanity_testsAddressSanitizer

AddressSanitizercanbeactivatedbysettingtheENABLE_ASANCMakeflaginafreshbuilddirectory.AtthistimeCUDAmustalsobedisabled.InanemptybuilddirectoryrunCMakeandcompile:

mkdirbuild&&cdbuildcmake-DENABLE_ASAN=on-DENABLE_CUDA=off..make-j4

Finallyrunthetests:

exportASAN_OPTIONS=alloc_dealloc_mismatch=0:handle_segv=0makesanity_testsThreadSanitizer

ThreadSanitizercanbeactivatedbysettingtheENABLE_TSANCMakeflaginafreshbuilddirectory.AtthistimeCUDAmustalsobedisabled.InanemptybuilddirectoryrunCMakeandcompile:

mkdirbuild&&cdbuildcmake-DENABLE_TSAN=on-DENABLE_CUDA=off..make-j4

WeuseaTSANsuppressionsfiletoignorewarningsinthirdpartylibraries.SourcethesuppressionsfilebyaddingittoyourTSAN_OPTIONSenv:

exportTSAN_OPTIONS="suppressions=/path/to/mapd/config/tsan.suppressions"

Finallyrunthetests:

makesanity_testsGeneratingPackages

OmniSciDBusesCPacktogeneratepackagesfordistribution.PackagesgeneratedonCentOSwithstaticlinkingenabledcanbeusedonmostotherrecentLinuxdistributions.

TogeneratepackagesonCentOS(assumingstartingfromtopleveloftheomniscidbrepository):

mkdirbuild-package&&cdbuild-packagecmake-DPREFER_STATIC_LIBS=on-DCMAKE_BUILD_TYPE=release..make-j4cpack-GTGZ

Thefirstcommandcreatesafreshbuilddirectory,toensurethereisnothingleftoverfromapreviousbuild.

Thesecondcommandconfiguresthebuildtopreferlinkingtothedependencies'staticlibrariesinsteadofthe(default)sharedlibraries,andtobuildusingCMake'sreleaseconfiguration(enablescompileroptimizations).Linkingtothestaticversionsofthelibrarieslibrariesreducesthenumberofdependenciesthatmustbeinstalledontargetsystems.

Thelastcommandgeneratesa.tar.gzpackage.TheTGZcanbereplacedwith,forexample,RPMorDEBtogeneratea.rpmor.deb,respectively.

Using

ThestartomnisciwrapperscriptmaybeusedtostartOmniSciDBinatestingenvironment.Thisscriptperformsthefollowingtasks:

initializesthedatastoragedirectoryviainitdb,ifrequiredstartsthemainOmniSciDBserver,omnisci_serverofferstodownloadandimportasampledataset,usingtheinsert_sample_datascript

Assumingyouareinthebuilddirectory,anditisasubdirectoryoftheomniscidbrepository,startomniscimayberunby:

../startomnisciStartingManually

Itisassumedthatthefollowingcommandsarerunfrominsidethebuilddirectory.

Initializethedatastoragedirectory.Thiscommandonlyneedstoberunonce.

mkdirdata&&./bin/initdbdata

StarttheOmniSciDBserver:

./bin/omnisci_server

Ifdesired,insertasampledatasetbyrunningtheinsert_sample_datascriptinanewterminal:

../insert_sample_data

Youcannowstartusingthedatabase.Theomnisqlutilitymaybeusedtointeractwiththedatabasefromthecommandline:

./bin/omnisql-pHyperInteractive

whereHyperInteractiveisthedefaultpassword.Thedefaultuseradminisassumedifnotprovided.

CodeStyle

ContributedcodeshouldcompilewithoutgeneratingwarningsbyrecentcompilersonmostLinuxdistributions.ChangestothecodeshouldfollowtheC++CoreGuidelines.

clang-format

A.clang-formatstyleconfiguration,basedontheChromiumstyleguide,isprovidedatthetopleveloftherepository.Pleaseformatyourcodeusingarecentversion(8.0+preferred)ofClangFormatbeforesubmitting.

Touse:

clang-format-iFile.cppclang-tidy

A.clang-tidyconfigurationisprovidedatthetopleveloftherepository.Pleaselintyourcodeusingarecentversion(6.0+preferred)ofclang-tidybeforesubmitting.

clang-tidyrequiresallgeneratedfilestoexistbeforerunning.Theeasiestwaytoaccomplishthisistosimplyrunafullbuildbeforerunningclang-tidy.Abuildtargetwhichrunsclang-tidyisprovided.Touse:

makerun-clang-tidy

Note:clang-tidymaymakeinvalidoroverlyverbosechangestothesourcecode.Itisrecommendedtofirstcommityourchanges,thenrunclang-tidyandreviewitsrecommendedchangesbeforeamendingthemtoyourcommit.

Note:theclang-tidytargetusestherun-clang-tidy.pyscriptprovidedwithLLVM,whichmaydependonPyYAML.Thetargetalsodependsonjq,whichisusedtofilterportionsofthecompile_commands.jsonfile.

Dependencies

OmniSciDBhasthefollowingdependencies:

PackageMinVersionRequiredCMake3.16yesLLVM9.0yesGCC8.4.0no,ifbuildingwithclangGo1.12yesBoost1.72.0yesOpenJDK1.7yesCUDA11.0yes,ifcompilingwithGPUsupportgperftoolsyesgdal2.4.2yesArrow3.0.0yesCentOS7

OmniSciDBrequiresanumberofdependencieswhicharenotprovidedinthecommonCentOS/RHELpackagerepositories.AprebuiltpackagecontainingallthesedependenciesisprovidedforCentOS7(x86_64).

Usethescripts/mapd-deps-prebuilt.shbuildscripttoinstallprebuiltdependencies.

Thesedependencieswillbeinstalledtoadirectoryunder/usr/local/mapd-deps.Themapd-deps-prebuilt.shscriptalsoinstallsEnvironmentModulesinordertosimplifymanagingtherequiredenvironmentvariables.Logoutandlogbackinafterrunningthemapd-deps-prebuilt.shscriptinordertoactiveEnvironmentModulescommand,module.

Themapd-depsenvironmentmoduleisdisabledbydefault.Toactivateforyourcurrentsession,run:

moduleloadmapd-deps

Todisablethemapd-depsmodule:

moduleunloadmapd-deps

WARNING:Themapd-depspackagecontainsnewerversionsofpackagessuchasGCCandncurseswhichmightnotbecompatiblewiththerestofyourenvironment.Makesuretodisablethemapd-depsmodulebeforecompilingotherpackages.

InstructionsforinstallingCUDAarebelow.

CUDA

Itispreferred,butnotnecessary,toinstallCUDAandtheNVIDIAdriversusingthe.rpmusingtheinstructionsprovidedbyNVIDIA.Therpm(network)method(preferred)willensureyoualwayshavethelateststabledrivers,whiletherpm(local)methodallowsyoutoinstalldoesnotrequireInternetaccess.

The.rpmmethodrequiresDKMStobeinstalled,whichisavailablefromtheExtraPackagesforEnterpriseLinuxrepository:

sudoyuminstallepel-release

BesuretorebootafterinstallinginordertoactivatetheNVIDIAdrivers.

EnvironmentVariables

Themapd-deps-prebuilt.shscriptincludestwofileswiththeappropriateenvironmentvariables:mapd-deps-<date>.sh(forsourcingfromyourshellconfig)andmapd-deps-<date>.modulefile(forusewithEnvironmentModules,yumpackageenvironment-modules).Thesefilesareplacedinmapd-depsinstalldirectory,usually/usr/local/mapd-deps/<date>.Eitherofthesemaybeusedtoconfigureyourenvironment:the.shmaybesourcedinyourshellconfig;the.modulefileneedstobemovedtothemodulespath.

BuildingDependencies

Thescripts/mapd-deps-centos.shscriptisusedtobuildthedependencies.ModifythisscriptandrunifyouwouldliketochangedependencyversionsortobuildonalternativeCPUarchitectures.

cdscriptsmoduleunloadmapd-deps./mapd-deps-centos.sh--compressmacOS

scripts/mapd-deps-osx.shisprovidedthatwillautomaticallyinstalland/orupdateHomebrewandusethattoinstallalldependencies.PleasemakesuremacOSiscompletelyuptodateandXcodeisinstalledbeforerunning.XcodecanbeinstalledfromtheAppStore.

CUDA

mapd-deps-osx.shwillautomaticallyinstallCUDAviaHomebrewandaddthecorrectenvironmentvariablesto~/.bash_profile.

Java

mapd-deps-osx.shwillautomaticallyinstallJavaandMavenviaHomebrewandaddthecorrectenvironmentvariablesto~/.bash_profile.

Ubuntu

MostbuilddependenciesrequiredbyOmniSciDBareavailableviaAPT.CertaindependenciessuchasThrift,Blosc,andFollymustbebuiltastheyeitherdonotexistinthedefaultrepositoriesorhaveoutdatedversions.AprebuiltpackagecontainingallthesedependenciesisprovidedforUbuntu18.04(x86_64).Thedependencieswillbeinstalledto/usr/local/mapd-deps/bydefault;seetheEnvironmentVariablessectionbelowforhowtoaddthesedependenciestoyourenvironment.

Ubuntu16.04

OmniSciDBrequiresanewerversionofBoostthantheversionwhichisprovidedbyUbuntu16.04.Thescripts/mapd-deps-ubuntu1604.shbuildscriptwillcompileandinstallanewerversionofBoostintothe/usr/local/mapd-deps/directory.

Ubuntu18.04

Usethescripts/mapd-deps-prebuilt.shbuildscripttoinstallprebuiltdependencies.

Thesedependencieswillbeinstalledtoadirectoryunder/usr/local/mapd-deps.Themapd-deps-prebuilt.shscriptabovewillgenerateascriptnamedmapd-deps.shcontainingtheenvironmentvariableswhichneedtobeset.Simplysourcethisfileinyourcurrentsession(orsymlinkitto/etc/profile.d/mapd-deps.sh)inordertoactivateit:

source/usr/local/mapd-deps/mapd-deps.shEnvironmentVariables

TheCUDAandmapd-depslibdirectoriesneedtobeaddedtoLD_LIBRARY_PATH;theCUDAandmapd-depsbindirectoriesneedtobeaddedtoPATH.Themapd-deps-ubuntu.shandmapd-deps-prebuilt.shscriptswillgenerateascriptnamedmapd-deps.shcontainingtheenvironmentvariableswhichneedtobeset.Simplysourcethisfileinyourcurrentsession(orsymlinkitto/etc/profile.d/mapd-deps.sh)inordertoactivateit:

source/usr/local/mapd-deps/mapd-deps.shCUDA

RecentversionsofUbuntuprovidetheNVIDIACUDAToolkitanddriversinthestandardrepositories.Toinstall:

sudoaptinstall-y\nvidia-cuda-toolkit

BesuretorebootafterinstallinginordertoactivatetheNVIDIAdrivers.

BuildingDependencies

Thescripts/mapd-deps-ubuntu.shandscripts/mapd-deps-ubuntu1604.shscriptsareusedtobuildthedependenciesforUbuntu18.04and16.04,respectively.Thescriptswillinstallallrequireddependencies(exceptCUDA)andbuildthedependencieswhichrequireit.ModifythisscriptandrunifyouwouldliketochangedependencyversionsortobuildonalternativeCPUarchitectures.

cdscripts./mapd-deps-ubuntu.sh--compressArch

scripts/mapd-deps-arch.shisprovidedthatwilluseyaytoinstallpackagesfromtheArchUserRepositoryandacustomPKGBUILDscriptforApacheArrow.Ifyoudon'thaveyayyet,installitfirst:https://github.com/Jguer/yay#installation

Note:ApacheArrow,whileavailableintheAUR,requiresafewcustombuildflagsinordertobeusedwithCore.AcustomPKGBUILDforitisincluded.

CUDA

CUDAandtheNVIDIAdriversmaybeinstalledusingthefollowing.

yay-S\linux-headers\cuda\nvidia

BesuretorebootafterinstallinginordertoactivatetheNVIDIAdrivers.

EnvironmentVariables

ThecudapackageshouldsetuptheenvironmentvariablesrequiredtouseCUDA.Ifyoureceiveerrorssayingnvccisnotfound,thenCUDAbindirectoriesneedtobeaddedtoPATH:theeasiestwaytodosoisbycreatinganewfilenamed/etc/profile.d/mapd-deps.shcontainingthefollowing:

PATH=/opt/cuda/bin:$PATHexportPATH
声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论