From 4c5c987b07bf8458e820750d1a515177d06e00c3 Mon Sep 17 00:00:00 2001 From: Dheepak Krishnamurthy Date: Thu, 14 Nov 2019 21:33:02 -0700 Subject: [PATCH 1/3] Update to HELICS v2.3.0 --- deps/build.jl | 2 +- deps/build_libhelicsSharedLib.v2.2.2.jl | 57 ------------------------- deps/build_libhelicsSharedLib.v2.3.0.jl | 57 +++++++++++++++++++++++++ src/HELICS.jl | 2 + src/api.jl | 8 ++++ src/lib.jl | 16 +++++-- src/manual.jl | 16 ++++--- src/wrapper.jl | 6 +-- test/runtests.jl | 4 +- 9 files changed, 96 insertions(+), 72 deletions(-) delete mode 100644 deps/build_libhelicsSharedLib.v2.2.2.jl create mode 100644 deps/build_libhelicsSharedLib.v2.3.0.jl diff --git a/deps/build.jl b/deps/build.jl index 2adb4e5..9ec405a 100644 --- a/deps/build.jl +++ b/deps/build.jl @@ -1,5 +1,5 @@ # Build the dependencies Mod = @eval module Anon end Mod.include("build_ZMQ.v4.3.1.jl") -Mod.include("build_libhelicsSharedLib.v2.2.2.jl") +Mod.include("build_libhelicsSharedLib.v2.3.0.jl") diff --git a/deps/build_libhelicsSharedLib.v2.2.2.jl b/deps/build_libhelicsSharedLib.v2.2.2.jl deleted file mode 100644 index 1e5db8f..0000000 --- a/deps/build_libhelicsSharedLib.v2.2.2.jl +++ /dev/null @@ -1,57 +0,0 @@ -using BinaryProvider # requires BinaryProvider 0.3.0 or later - -# Parse some basic command-line arguments -const verbose = "--verbose" in ARGS -const prefix = Prefix(get([a for a in ARGS if a != "--verbose"], 1, joinpath(@__DIR__, "usr"))) -products = [ - LibraryProduct(prefix, ["libhelicsSharedLib"], :libhelicsSharedLib), -] - -# Download binaries from hosted location -bin_prefix = "https://github.com/GMLC-TDC/HELICSBuilder/releases/download/v2.2.2" - -# Listing of files generated by BinaryBuilder: -download_info = Dict( - Linux(:aarch64, libc=:glibc, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/libhelicsSharedLib.v2.2.2.aarch64-linux-gnu-gcc7.tar.gz", "15c47aceed714e7a8ab90a69d26722c45a4e6e65bcfc187efde7af76fc417197"), - Linux(:aarch64, libc=:glibc, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/libhelicsSharedLib.v2.2.2.aarch64-linux-gnu-gcc8.tar.gz", "5c328bbe5d997269b2546c6315d2d6e962cf82243ec7b6a64838f6c25414efc7"), - Linux(:aarch64, libc=:musl, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/libhelicsSharedLib.v2.2.2.aarch64-linux-musl-gcc7.tar.gz", "ed705af0d2d1ce65a76d5c65ce957c865502dad2de6983d97eca78c363873cbc"), - Linux(:aarch64, libc=:musl, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/libhelicsSharedLib.v2.2.2.aarch64-linux-musl-gcc8.tar.gz", "356328877d0f4eb08197f371a15659ef1c580ddcda2a09af8a6bd79faffb6537"), - Linux(:armv7l, libc=:glibc, call_abi=:eabihf, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/libhelicsSharedLib.v2.2.2.arm-linux-gnueabihf-gcc7.tar.gz", "fb3da5f6f2ef6bc6b1a0e87cf6ebf44776ed82ea1bc1c2d745aaad24d6940640"), - Linux(:armv7l, libc=:glibc, call_abi=:eabihf, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/libhelicsSharedLib.v2.2.2.arm-linux-gnueabihf-gcc8.tar.gz", "c058c2c2f6df40aa092034b25ea250663f5c11d67c3e6e9b444f6ed128fae72d"), - Linux(:armv7l, libc=:musl, call_abi=:eabihf, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/libhelicsSharedLib.v2.2.2.arm-linux-musleabihf-gcc7.tar.gz", "2cd0f1ef9c35c513372fb3faa949c25fe096ec1cf45e45d9f8aab373be05aa37"), - Linux(:armv7l, libc=:musl, call_abi=:eabihf, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/libhelicsSharedLib.v2.2.2.arm-linux-musleabihf-gcc8.tar.gz", "855bb3cf1676ab95b0685a4d35354b0c48aa179b73730b1a1b609872f68f48bd"), - Linux(:i686, libc=:glibc, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/libhelicsSharedLib.v2.2.2.i686-linux-gnu-gcc7.tar.gz", "e8e531782ef2bb86194acda277d3727bf3562652651ec3bfb865e53bf18539c5"), - Linux(:i686, libc=:glibc, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/libhelicsSharedLib.v2.2.2.i686-linux-gnu-gcc8.tar.gz", "7e6599b7ee336c6bfcba2d516d3cb48af89ae82f14e69bc517dc82365a57cf46"), - Linux(:i686, libc=:musl, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/libhelicsSharedLib.v2.2.2.i686-linux-musl-gcc7.tar.gz", "9f65e52cff4ca87b303f6a21e793f996f9bfc0de982864f53d6b5c21778618ff"), - Linux(:i686, libc=:musl, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/libhelicsSharedLib.v2.2.2.i686-linux-musl-gcc8.tar.gz", "1eda15a82ff85ac52373a70fbf735456e96c5cde8adad1e67ba1caa358f3c64a"), - Linux(:powerpc64le, libc=:glibc, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/libhelicsSharedLib.v2.2.2.powerpc64le-linux-gnu-gcc7.tar.gz", "aaef816c6c3192a87798da199c0fdf7fc10b6e2c654822b627114b3cc5986964"), - Linux(:powerpc64le, libc=:glibc, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/libhelicsSharedLib.v2.2.2.powerpc64le-linux-gnu-gcc8.tar.gz", "55aebc727e759faf910c164eff43c1e19fd1d1ef57c65129067ee4c9ebd55994"), - MacOS(:x86_64, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/libhelicsSharedLib.v2.2.2.x86_64-apple-darwin14-gcc7.tar.gz", "ffed05dc9c1eb682af5e3ed6ab9071af24399c62ae361c154365ea53dffc6a2d"), - MacOS(:x86_64, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/libhelicsSharedLib.v2.2.2.x86_64-apple-darwin14-gcc8.tar.gz", "9207535989f384e288e2cea1e1c38a174a954d912e50a6cbd0f83ba862f84452"), - Linux(:x86_64, libc=:glibc, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/libhelicsSharedLib.v2.2.2.x86_64-linux-gnu-gcc7.tar.gz", "d94350bda0811a3db440192797d43c43b22facf879bf7a33598fbf80bdaf34e7"), - Linux(:x86_64, libc=:glibc, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/libhelicsSharedLib.v2.2.2.x86_64-linux-gnu-gcc8.tar.gz", "8664ee3e54b3d8bc6afcf21ecd0bd7eb7a0ff5533689a50d0ead3c5e532d0537"), - Linux(:x86_64, libc=:musl, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/libhelicsSharedLib.v2.2.2.x86_64-linux-musl-gcc7.tar.gz", "ca1bc4c30b14194209f11a7c95c2bc05a5bfe9dc9e98d0ed4741a50c8c09b7b1"), - Linux(:x86_64, libc=:musl, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/libhelicsSharedLib.v2.2.2.x86_64-linux-musl-gcc8.tar.gz", "ce80abf381ad515aa80e071c00547255336229c1c5ad12e2f27b1c3d75aa6d00"), - Windows(:x86_64, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/libhelicsSharedLib.v2.2.2.x86_64-w64-mingw32-gcc7.tar.gz", "2f601b6890f910697da85f6a895bb6c893691fc0a324932ac8a04dd7d2479cfa"), - Windows(:x86_64, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/libhelicsSharedLib.v2.2.2.x86_64-w64-mingw32-gcc8.tar.gz", "3d9e65c9b9af7c49f102bad0b29f597f21c55b3888dda5c0333674d3bc6d348d"), -) - -# Install unsatisfied or updated dependencies: -unsatisfied = any(!satisfied(p; verbose=verbose) for p in products) -dl_info = choose_download(download_info, platform_key_abi()) -if dl_info === nothing && unsatisfied - # If we don't have a compatible .tar.gz to download, complain. - # Alternatively, you could attempt to install from a separate provider, - # build from source or something even more ambitious here. - error("Your platform (\"$(Sys.MACHINE)\", parsed as \"$(triplet(platform_key_abi()))\") is not supported by this package!") -end - -# If we have a download, and we are unsatisfied (or the version we're -# trying to install is not itself installed) then load it up! -if unsatisfied || !isinstalled(dl_info...; prefix=prefix) - # Download and install binaries - install(dl_info...; prefix=prefix, force=true, verbose=verbose) -end - -# Write out a deps.jl file that will contain mappings for our products -write_deps_file(joinpath(@__DIR__, "deps.jl"), products, verbose=verbose) diff --git a/deps/build_libhelicsSharedLib.v2.3.0.jl b/deps/build_libhelicsSharedLib.v2.3.0.jl new file mode 100644 index 0000000..43b91b3 --- /dev/null +++ b/deps/build_libhelicsSharedLib.v2.3.0.jl @@ -0,0 +1,57 @@ +using BinaryProvider # requires BinaryProvider 0.3.0 or later + +# Parse some basic command-line arguments +const verbose = "--verbose" in ARGS +const prefix = Prefix(get([a for a in ARGS if a != "--verbose"], 1, joinpath(@__DIR__, "usr"))) +products = [ + LibraryProduct(prefix, ["libhelicsSharedLib"], :libhelicsSharedLib), +] + +# Download binaries from hosted location +bin_prefix = "https://github.com/GMLC-TDC/HELICSBuilder/releases/download/v2.3.0" + +# Listing of files generated by BinaryBuilder: +download_info = Dict( + Linux(:aarch64, libc=:glibc, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/libhelicsSharedLib.v2.3.0.aarch64-linux-gnu-gcc7.tar.gz", "2479213ebdf0dec96912bb7ab67f3fc451be5c01657d5d04725e178245b813c4"), + Linux(:aarch64, libc=:glibc, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/libhelicsSharedLib.v2.3.0.aarch64-linux-gnu-gcc8.tar.gz", "9e71d255f654eb0a1202214268eee4effd248706287f6372daf71690e6e96ad7"), + Linux(:aarch64, libc=:musl, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/libhelicsSharedLib.v2.3.0.aarch64-linux-musl-gcc7.tar.gz", "9f683ab8f01168011ed191ad34e915043048d5f1dc4cddd1d58f564523cfcd86"), + Linux(:aarch64, libc=:musl, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/libhelicsSharedLib.v2.3.0.aarch64-linux-musl-gcc8.tar.gz", "3226531ddf33d7993de8a94efebf3d4b27d4cb573520b03ab7db3909dccd02e9"), + Linux(:armv7l, libc=:glibc, call_abi=:eabihf, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/libhelicsSharedLib.v2.3.0.arm-linux-gnueabihf-gcc7.tar.gz", "2a24a02a238b98d9deb92d328224d1033d604ccc45207cce1425e034de203df9"), + Linux(:armv7l, libc=:glibc, call_abi=:eabihf, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/libhelicsSharedLib.v2.3.0.arm-linux-gnueabihf-gcc8.tar.gz", "f00aa104df7a2519c9cf0ebc05d55c05b276e8c5a02c890c2c2696edc21dada0"), + Linux(:armv7l, libc=:musl, call_abi=:eabihf, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/libhelicsSharedLib.v2.3.0.arm-linux-musleabihf-gcc7.tar.gz", "421aaeb0267a2803ac002520ab682fe4ee9687a2a2d92e844e711d44f881c3cf"), + Linux(:armv7l, libc=:musl, call_abi=:eabihf, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/libhelicsSharedLib.v2.3.0.arm-linux-musleabihf-gcc8.tar.gz", "259d2f68689ea096c424b55b88222d96bd36aad5289ba0f9cc73706ee5d9c856"), + Linux(:i686, libc=:glibc, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/libhelicsSharedLib.v2.3.0.i686-linux-gnu-gcc7.tar.gz", "66820dd0eaacdd6e90e7c45cac5d20b6b1298bb22c6a33ca6ca635071b4f50db"), + Linux(:i686, libc=:glibc, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/libhelicsSharedLib.v2.3.0.i686-linux-gnu-gcc8.tar.gz", "9b976365906c47e47094094a373a43a54c78903e92293298d07f1e617be4ffd6"), + Linux(:i686, libc=:musl, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/libhelicsSharedLib.v2.3.0.i686-linux-musl-gcc7.tar.gz", "49614b1a32db889bff71463e4420167b46e662749f612439cb3ced5e6d1d6ebe"), + Linux(:i686, libc=:musl, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/libhelicsSharedLib.v2.3.0.i686-linux-musl-gcc8.tar.gz", "80c8e6c5b800bba8e6a9868db98e818895ac6a5b6738a892b3c28a3304120973"), + Linux(:powerpc64le, libc=:glibc, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/libhelicsSharedLib.v2.3.0.powerpc64le-linux-gnu-gcc7.tar.gz", "9d63e2344141fc37e007c7d63fd93c97a4c97453625ec2462ba594db1bc7f495"), + Linux(:powerpc64le, libc=:glibc, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/libhelicsSharedLib.v2.3.0.powerpc64le-linux-gnu-gcc8.tar.gz", "b884bc78954ce102f8828b43c4112ced7d22fefa514a7c3f709a0036bd993103"), + MacOS(:x86_64, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/libhelicsSharedLib.v2.3.0.x86_64-apple-darwin14-gcc7.tar.gz", "bad98d9bee1fb87b2d5df2db34ac3461e2fb555eb713e9a87f236c48fa17bd60"), + MacOS(:x86_64, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/libhelicsSharedLib.v2.3.0.x86_64-apple-darwin14-gcc8.tar.gz", "ae0f1597e9906e8f024a4ae503c43dd24ec39ce8af25c6e449b2d65eb1d915db"), + Linux(:x86_64, libc=:glibc, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/libhelicsSharedLib.v2.3.0.x86_64-linux-gnu-gcc7.tar.gz", "0c2728c7a4635244b7c24ecd0cbcc6739ecdabb712307ee89a8fbb3da48276be"), + Linux(:x86_64, libc=:glibc, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/libhelicsSharedLib.v2.3.0.x86_64-linux-gnu-gcc8.tar.gz", "39b1ac0b0e6ff9848c8497144f2fe83f96cff0054073198e92c9d9f5237038d6"), + Linux(:x86_64, libc=:musl, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/libhelicsSharedLib.v2.3.0.x86_64-linux-musl-gcc7.tar.gz", "9593958ade5e0e689fcce19cd0436e61d65f2db2cab4d40ed30d423db96ef012"), + Linux(:x86_64, libc=:musl, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/libhelicsSharedLib.v2.3.0.x86_64-linux-musl-gcc8.tar.gz", "dea3206779ccb310dc4f674dba568791945083bad8ef5f9cd91ffb7bc8ccbddb"), + Windows(:x86_64, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/libhelicsSharedLib.v2.3.0.x86_64-w64-mingw32-gcc7.tar.gz", "f74f0fe20116b76502e50bce47885d230d1b501a4c9817653e7286b35719c8dd"), + Windows(:x86_64, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/libhelicsSharedLib.v2.3.0.x86_64-w64-mingw32-gcc8.tar.gz", "fb3264a7e92497f5dee0607765031672e8ae0ca5b7393729b281f83eb02893dc"), +) + +# Install unsatisfied or updated dependencies: +unsatisfied = any(!satisfied(p; verbose=verbose) for p in products) +dl_info = choose_download(download_info, platform_key_abi()) +if dl_info === nothing && unsatisfied + # If we don't have a compatible .tar.gz to download, complain. + # Alternatively, you could attempt to install from a separate provider, + # build from source or something even more ambitious here. + error("Your platform (\"$(Sys.MACHINE)\", parsed as \"$(triplet(platform_key_abi()))\") is not supported by this package!") +end + +# If we have a download, and we are unsatisfied (or the version we're +# trying to install is not itself installed) then load it up! +if unsatisfied || !isinstalled(dl_info...; prefix=prefix) + # Download and install binaries + install(dl_info...; prefix=prefix, force=true, verbose=verbose) +end + +# Write out a deps.jl file that will contain mappings for our products +write_deps_file(joinpath(@__DIR__, "deps.jl"), products, verbose=verbose) diff --git a/src/HELICS.jl b/src/HELICS.jl index 25dfaa6..3dd6579 100644 --- a/src/HELICS.jl +++ b/src/HELICS.jl @@ -39,6 +39,8 @@ module Lib end +const HELICS_VERSION = VersionNumber(split(Lib.HELICS_VERSION_STRING)[1]) + include("wrapper.jl") include("utils.jl") diff --git a/src/api.jl b/src/api.jl index fef32d5..6fbc826 100644 --- a/src/api.jl +++ b/src/api.jl @@ -2516,3 +2516,11 @@ function helicsFederateInfoSetBrokerInitString(fi::FederateInfo, brokerInit::Str Utils.@invoke_and_check Lib.helicsFederateInfoSetBrokerInitString(fi::FederateInfo, brokerInit) end +function helicsBrokerMakeConnections(broker::Broker, file::String) + Utils.@invoke_and_check Lib.helicsBrokerMakeConnections(broker, file) +end + +function helicsCoreMakeConnections(core::Core, file::String) + Utils.@invoke_and_check Lib.helicsCoreMakeConnections(core, file) +end + diff --git a/src/lib.jl b/src/lib.jl index 5ff6b83..fbd251a 100644 --- a/src/lib.jl +++ b/src/lib.jl @@ -154,8 +154,8 @@ function helicsMessageGetRawDataSize(message) ccall((:helicsMessageGetRawDataSize, libhelicsSharedLib), Cint, (helics_message_object,), message) end -function helicsMessageGetRawData(message, data, maxlen, actualSize, err) - ccall((:helicsMessageGetRawData, libhelicsSharedLib), Cvoid, (helics_message_object, Ptr{Cvoid}, Cint, Ptr{Cint}, Ptr{helics_error}), message, data, maxlen, actualSize, err) +function helicsMessageGetRawData(message, data, maxMessagelen, actualSize, err) + ccall((:helicsMessageGetRawData, libhelicsSharedLib), Cvoid, (helics_message_object, Ptr{Cvoid}, Cint, Ptr{Cint}, Ptr{helics_error}), message, data, maxMessagelen, actualSize, err) end function helicsMessageGetRawDataPointer(message) @@ -428,8 +428,8 @@ function helicsInputGetRawValueSize(ipt) ccall((:helicsInputGetRawValueSize, libhelicsSharedLib), Cint, (helics_input,), ipt) end -function helicsInputGetRawValue(ipt, data, maxlen, actualSize, err) - ccall((:helicsInputGetRawValue, libhelicsSharedLib), Cvoid, (helics_input, Ptr{Cvoid}, Cint, Ptr{Cint}, Ptr{helics_error}), ipt, data, maxlen, actualSize, err) +function helicsInputGetRawValue(ipt, data, maxDatalen, actualSize, err) + ccall((:helicsInputGetRawValue, libhelicsSharedLib), Cvoid, (helics_input, Ptr{Cvoid}, Cint, Ptr{Cint}, Ptr{helics_error}), ipt, data, maxDatalen, actualSize, err) end function helicsInputGetStringSize(ipt) @@ -682,6 +682,10 @@ function helicsBrokerAddDestinationFilterToEndpoint(broker, filter, endpoint, er ccall((:helicsBrokerAddDestinationFilterToEndpoint, libhelicsSharedLib), Cvoid, (helics_broker, Cstring, Cstring, Ptr{helics_error}), broker, filter, endpoint, err) end +function helicsBrokerMakeConnections(broker, file, err) + ccall((:helicsBrokerMakeConnections, libhelicsSharedLib), Cvoid, (helics_broker, Cstring, Ptr{helics_error}), broker, file, err) +end + function helicsCoreWaitForDisconnect(core, msToWait, err) ccall((:helicsCoreWaitForDisconnect, libhelicsSharedLib), helics_bool, (helics_core, Cint, Ptr{helics_error}), core, msToWait, err) end @@ -706,6 +710,10 @@ function helicsCoreAddDestinationFilterToEndpoint(core, filter, endpoint, err) ccall((:helicsCoreAddDestinationFilterToEndpoint, libhelicsSharedLib), Cvoid, (helics_core, Cstring, Cstring, Ptr{helics_error}), core, filter, endpoint, err) end +function helicsCoreMakeConnections(core, file, err) + ccall((:helicsCoreMakeConnections, libhelicsSharedLib), Cvoid, (helics_core, Cstring, Ptr{helics_error}), core, file, err) +end + function helicsBrokerGetIdentifier(broker) ccall((:helicsBrokerGetIdentifier, libhelicsSharedLib), Cstring, (helics_broker,), broker) end diff --git a/src/manual.jl b/src/manual.jl index b55f449..7fb5d31 100644 --- a/src/manual.jl +++ b/src/manual.jl @@ -2,12 +2,12 @@ const HELICS_HAVE_MPI = 0 const HELICS_HAVE_ZEROMQ = 1 const BOOST_VERSION_LEVEL = 67 const HELICS_VERSION_MAJOR = 2 -const HELICS_VERSION_MINOR = 2 -const HELICS_VERSION_PATCH = 2 -const HELICS_VERSION = "2.2.2" +const HELICS_VERSION_MINOR = 3 +const HELICS_VERSION_PATCH = 0 +const HELICS_VERSION = "2.3.0" const HELICS_VERSION_BUILD = "" -const HELICS_VERSION_STRING = "2.2.2 (10-27-19)" -const HELICS_DATE = "10-27-19" +const HELICS_VERSION_STRING = "2.3.0 (2019-11-13)" +const HELICS_DATE = "2019-11-13" @cenum helics_data_type::UInt32 begin helics_data_type_string = 0 @@ -38,6 +38,8 @@ const helics_data_type_char = helics_data_type_string helics_core_type_nng = 9 helics_core_type_tcp_ss = 11 helics_core_type_http = 12 + helics_core_type_websocket = 14 + helics_core_type_inproc = 18 end @cenum helics_federate_flags::UInt32 begin @@ -81,6 +83,7 @@ end helics_error_invalid_state_transition = -9 helics_error_invalid_function_call = -10 helics_error_execution_failure = -14 + helics_error_insufficient_space = -18 helics_error_other = -101 other_error_type = -203 end @@ -96,6 +99,8 @@ end helics_property_time_output_delay = 150 helics_property_int_max_iterations = 259 helics_property_int_log_level = 271 + helics_property_int_file_log_level = 272 + helics_property_int_console_log_level = 274 end @cenum helics_handle_options::UInt32 begin @@ -105,6 +110,7 @@ end helics_handle_option_multiple_connections_allowed = 409 helics_handle_option_buffer_data = 411 helics_handle_option_strict_type_checking = 414 + helics_handle_option_ignore_unit_mismatch = 447 helics_handle_option_only_transmit_on_change = 6 helics_handle_option_only_update_on_change = 8 helics_handle_option_ignore_interrupts = 475 diff --git a/src/wrapper.jl b/src/wrapper.jl index 555912a..d371dfd 100644 --- a/src/wrapper.jl +++ b/src/wrapper.jl @@ -34,16 +34,16 @@ macro define(subtype, supertype) struct [`HELICS.$subtype`](@ref) <: [`HELICS.$supertype`](@ref) """ - quote + esc(quote struct $subtype <: $supertype ptr::Ptr{Nothing} function $subtype(ptr::Ptr{Nothing}) - ptr == C_NULL && error("Failed to create $subtype. Received null pointer from HELICS C interface.") + ptr == C_NULL && error("Failed to create $($subtype). Received null pointer from HELICS C interface.") new(ptr) end end @doc $docstring $subtype - end + end) end @define Broker CWrapper diff --git a/test/runtests.jl b/test/runtests.jl index d8ee1ff..45cc787 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -5,8 +5,8 @@ const h = HELICS @testset "Versions" begin -@test h.helicsGetVersion() isa String -@test h.helicsGetVersion() == "2.2.2 (10-27-19)" + @test h.helicsGetVersion() isa String + @test VersionNumber(split(h.helicsGetVersion())[1]) == h.HELICS_VERSION end From a7d08040d5441bed659eb667dca3f8d994ea400b Mon Sep 17 00:00:00 2001 From: Dheepak Krishnamurthy Date: Thu, 14 Nov 2019 21:58:08 -0700 Subject: [PATCH 2/3] Update scripts/generate.jl --- scripts/generate.jl | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/scripts/generate.jl b/scripts/generate.jl index 82f35ff..eba6bd7 100644 --- a/scripts/generate.jl +++ b/scripts/generate.jl @@ -1,14 +1,29 @@ using Clang # LIBCLANG_HEADERS are those headers to be wrapped. -const LIBCLANG_INCLUDE = joinpath(@__DIR__, "../deps/usr/include/helics/shared_api_library") |> normpath -const LIBCLANG_HEADERS = [joinpath(LIBCLANG_INCLUDE, header) for header in readdir(LIBCLANG_INCLUDE) if endswith(header, ".h")] +const LIBHELICS_INCLUDE = [ + joinpath(@__DIR__, "../deps/usr/include/helics/shared_api_library") |> normpath, + joinpath(@__DIR__, "../deps/usr/include/helics") |> normpath + ] -wc = init(; headers = LIBCLANG_HEADERS, +const LIBHELICS_HEADERS = String[] + +for folder in LIBHELICS_INCLUDE + for header in readdir(folder) + if endswith(header, ".h") + push!(LIBHELICS_HEADERS, joinpath(folder, header)) + end + end +end + +wc = init(; headers = LIBHELICS_HEADERS, output_file = joinpath(@__DIR__, "../src/lib.jl"), common_file = joinpath(@__DIR__, "../src/common.jl"), - clang_includes = vcat(LIBCLANG_INCLUDE, CLANG_INCLUDE), - clang_args = ["-I", joinpath(LIBCLANG_INCLUDE, "..")], + clang_includes = vcat(LIBHELICS_INCLUDE..., CLANG_INCLUDE), + clang_args = [ + "-I", joinpath(LIBHELICS_INCLUDE[1], ".."), + "-I", joinpath(LIBHELICS_INCLUDE[2], ".."), + ], header_wrapped = (root, current)->root == current, header_library = x->"libhelicsSharedLib", clang_diagnostics = true, From fd500c451b809a5efa98031dffaa3867e957b1b9 Mon Sep 17 00:00:00 2001 From: Dheepak Krishnamurthy Date: Thu, 14 Nov 2019 21:58:22 -0700 Subject: [PATCH 3/3] Update generated files --- src/common.jl | 120 ++++++++++++++++++++++++++++++++++++++++++++++++++ src/lib.jl | 6 +++ src/manual.jl | 118 +------------------------------------------------ 3 files changed, 127 insertions(+), 117 deletions(-) diff --git a/src/common.jl b/src/common.jl index e17fea6..203e666 100644 --- a/src/common.jl +++ b/src/common.jl @@ -69,3 +69,123 @@ end const HELICS_DEPRECATED_EXPORT = HELICS_EXPORT const HELICS_DEPRECATED_NO_EXPORT = HELICS_NO_EXPORT + +@cenum helics_data_type::UInt32 begin + helics_data_type_string = 0 + helics_data_type_double = 1 + helics_data_type_int = 2 + helics_data_type_complex = 3 + helics_data_type_vector = 4 + helics_data_type_complex_vector = 5 + helics_data_type_named_point = 6 + helics_data_type_boolean = 7 + helics_data_type_time = 8 + helics_data_type_raw = 25 + helics_data_type_any = 25262 +end + + +const helics_data_type_char = helics_data_type_string + +@cenum helics_core_type::UInt32 begin + helics_core_type_default = 0 + helics_core_type_zmq = 1 + helics_core_type_mpi = 2 + helics_core_type_test = 3 + helics_core_type_interprocess = 4 + helics_core_type_ipc = 5 + helics_core_type_tcp = 6 + helics_core_type_udp = 7 + helics_core_type_zmq_test = 10 + helics_core_type_nng = 9 + helics_core_type_tcp_ss = 11 + helics_core_type_http = 12 + helics_core_type_websocket = 14 + helics_core_type_inproc = 18 +end + +@cenum helics_federate_flags::UInt32 begin + helics_flag_observer = 0 + helics_flag_uninterruptible = 1 + helics_flag_interruptible = 2 + helics_flag_source_only = 4 + helics_flag_only_transmit_on_change = 6 + helics_flag_only_update_on_change = 8 + helics_flag_wait_for_current_time_update = 10 + helics_flag_restrictive_time_policy = 11 + helics_flag_rollback = 12 + helics_flag_forward_compute = 14 + helics_flag_realtime = 16 + helics_flag_single_thread_federate = 27 + helics_flag_delay_init_entry = 45 + helics_flag_enable_init_entry = 47 + helics_flag_ignore_time_mismatch_warnings = 67 +end + +@cenum helics_log_levels::Int32 begin + helics_log_level_no_print = -1 + helics_log_level_error = 0 + helics_log_level_warning = 1 + helics_log_level_summary = 2 + helics_log_level_connections = 3 + helics_log_level_interfaces = 4 + helics_log_level_timing = 5 + helics_log_level_data = 6 + helics_log_level_trace = 7 +end + +@cenum helics_error_types::Int32 begin + helics_ok = 0 + helics_error_registration_failure = -1 + helics_error_connection_failure = -2 + helics_error_invalid_object = -3 + helics_error_invalid_argument = -4 + helics_error_discard = -5 + helics_error_system_failure = -6 + helics_warning = -8 + helics_error_invalid_state_transition = -9 + helics_error_invalid_function_call = -10 + helics_error_execution_failure = -14 + helics_error_insufficient_space = -18 + helics_error_other = -101 + helics_error_external_type = -203 +end + +@cenum helics_properties::UInt32 begin + helics_property_time_delta = 137 + helics_property_time_period = 140 + helics_property_time_offset = 141 + helics_property_time_rt_lag = 143 + helics_property_time_rt_lead = 144 + helics_property_time_rt_tolerance = 145 + helics_property_time_input_delay = 148 + helics_property_time_output_delay = 150 + helics_property_int_max_iterations = 259 + helics_property_int_log_level = 271 + helics_property_int_file_log_level = 272 + helics_property_int_console_log_level = 274 +end + +@cenum helics_handle_options::UInt32 begin + helics_handle_option_connection_required = 397 + helics_handle_option_connection_optional = 402 + helics_handle_option_single_connection_only = 407 + helics_handle_option_multiple_connections_allowed = 409 + helics_handle_option_buffer_data = 411 + helics_handle_option_strict_type_checking = 414 + helics_handle_option_ignore_unit_mismatch = 447 + helics_handle_option_only_transmit_on_change = 6 + helics_handle_option_only_update_on_change = 8 + helics_handle_option_ignore_interrupts = 475 +end + +@cenum helics_filter_type::UInt32 begin + helics_filter_type_custom = 0 + helics_filter_type_delay = 1 + helics_filter_type_random_delay = 2 + helics_filter_type_random_drop = 3 + helics_filter_type_reroute = 4 + helics_filter_type_clone = 5 + helics_filter_type_firewall = 6 +end + diff --git a/src/lib.jl b/src/lib.jl index fbd251a..18a625d 100644 --- a/src/lib.jl +++ b/src/lib.jl @@ -1111,3 +1111,9 @@ end # Julia wrapper for header: helics_export.h # Automatically generated using Clang.jl +# Julia wrapper for header: chelics.h +# Automatically generated using Clang.jl + +# Julia wrapper for header: helics_enums.h +# Automatically generated using Clang.jl + diff --git a/src/manual.jl b/src/manual.jl index 7fb5d31..186d5fc 100644 --- a/src/manual.jl +++ b/src/manual.jl @@ -1,6 +1,6 @@ const HELICS_HAVE_MPI = 0 const HELICS_HAVE_ZEROMQ = 1 -const BOOST_VERSION_LEVEL = 67 +const BOOST_VERSION_LEVEL = 71 const HELICS_VERSION_MAJOR = 2 const HELICS_VERSION_MINOR = 3 const HELICS_VERSION_PATCH = 0 @@ -9,119 +9,3 @@ const HELICS_VERSION_BUILD = "" const HELICS_VERSION_STRING = "2.3.0 (2019-11-13)" const HELICS_DATE = "2019-11-13" -@cenum helics_data_type::UInt32 begin - helics_data_type_string = 0 - helics_data_type_double = 1 - helics_data_type_int = 2 - helics_data_type_complex = 3 - helics_data_type_vector = 4 - helics_data_type_complex_vector = 5 - helics_data_type_named_point = 6 - helics_data_type_boolean = 7 - helics_data_type_time = 8 - helics_data_type_raw = 25 - helics_data_type_any = 25262 -end - -const helics_data_type_char = helics_data_type_string - -@cenum helics_core_type::UInt32 begin - helics_core_type_default = 0 - helics_core_type_zmq = 1 - helics_core_type_mpi = 2 - helics_core_type_test = 3 - helics_core_type_interprocess = 4 - helics_core_type_ipc = 5 - helics_core_type_tcp = 6 - helics_core_type_udp = 7 - helics_core_type_zmq_test = 10 - helics_core_type_nng = 9 - helics_core_type_tcp_ss = 11 - helics_core_type_http = 12 - helics_core_type_websocket = 14 - helics_core_type_inproc = 18 -end - -@cenum helics_federate_flags::UInt32 begin - helics_flag_observer = 0 - helics_flag_uninterruptible = 1 - helics_flag_interruptible = 2 - helics_flag_source_only = 4 - helics_flag_only_transmit_on_change = 6 - helics_flag_only_update_on_change = 8 - helics_flag_wait_for_current_time_update = 10 - helics_flag_rollback = 12 - helics_flag_forward_compute = 14 - helics_flag_realtime = 16 - helics_flag_single_thread_federate = 27 - helics_flag_delay_init_entry = 45 - helics_flag_enable_init_entry = 47 - helics_flag_ignore_time_mismatch_warnings = 67 -end - -@cenum helics_log_levels::Int32 begin - helics_log_level_no_print = -1 - helics_log_level_error = 0 - helics_log_level_warning = 1 - helics_log_level_summary = 2 - helics_log_level_connections = 3 - helics_log_level_interfaces = 4 - helics_log_level_timing = 5 - helics_log_level_data = 6 - helics_log_level_trace = 7 -end - -@cenum helics_error_types::Int32 begin - helics_ok = 0 - helics_error_registration_failure = -1 - helics_error_connection_failure = -2 - helics_error_invalid_object = -3 - helics_error_invalid_argument = -4 - helics_error_discard = -5 - helics_error_system_failure = -6 - helics_warning = -8 - helics_error_invalid_state_transition = -9 - helics_error_invalid_function_call = -10 - helics_error_execution_failure = -14 - helics_error_insufficient_space = -18 - helics_error_other = -101 - other_error_type = -203 -end - -@cenum helics_properties::Int32 begin - helics_property_time_delta = 137 - helics_property_time_period = 140 - helics_property_time_offset = 141 - helics_property_time_rt_lag = 143 - helics_property_time_rt_lead = 144 - helics_property_time_rt_tolerance = 145 - helics_property_time_input_delay = 148 - helics_property_time_output_delay = 150 - helics_property_int_max_iterations = 259 - helics_property_int_log_level = 271 - helics_property_int_file_log_level = 272 - helics_property_int_console_log_level = 274 -end - -@cenum helics_handle_options::UInt32 begin - helics_handle_option_connection_required = 397 - helics_handle_option_connection_optional = 402 - helics_handle_option_single_connection_only = 407 - helics_handle_option_multiple_connections_allowed = 409 - helics_handle_option_buffer_data = 411 - helics_handle_option_strict_type_checking = 414 - helics_handle_option_ignore_unit_mismatch = 447 - helics_handle_option_only_transmit_on_change = 6 - helics_handle_option_only_update_on_change = 8 - helics_handle_option_ignore_interrupts = 475 -end - -@cenum helics_filter_type::UInt32 begin - helics_filter_type_custom = 0 - helics_filter_type_delay = 1 - helics_filter_type_random_delay = 2 - helics_filter_type_random_drop = 3 - helics_filter_type_reroute = 4 - helics_filter_type_clone = 5 - helics_filter_type_firewall = 6 -end