From f5cf15723ac4a8599a4d955145014fb4b7e7abbc Mon Sep 17 00:00:00 2001 From: Ian Watson Date: Wed, 11 Dec 2024 00:35:28 -0500 Subject: [PATCH] svmfp and WORKSPACE cleanup --- contrib/bin/Lilly_Medchem_Rules.sh | 8 +- contrib/bin/calibrate_svmfp_client.rb | 6 +- contrib/bin/hydrophobic_sections.sh | 2 +- contrib/bin/model_calibrate.rb | 96 +++-- contrib/bin/svmfp/svmfp_make.rb | 2 +- contrib/bin/svmfp_summarise_results.rb | 2 +- data/BUILD | 15 + data/MODULE.bazel | 4 + src/BerkeleyDB/BUILD | 20 +- src/MODULE.bazel | 23 +- src/Molecule_Lib/BUILD | 4 +- src/Molecule_Lib/donor_acceptor_test.cc | 4 +- src/Molecule_Tools/BUILD | 4 +- src/Molecule_Tools/jwcats.cc | 6 - src/Molecule_Tools_Bdb/BUILD | 40 +-- src/Utilities/GFP_Tools/BUILD | 4 +- src/Utilities/GFP_Tools/bit_subset.cc | 12 +- src/Utilities/GFP_Tools/bit_subset.h | 12 +- src/Utilities/GFP_Tools/gfp_svmfp_score_v2.cc | 34 +- src/Utilities/GFP_Tools/gfp_to_svm_lite_v3.cc | 8 +- src/Utilities/General/iwcut.cc | 67 ++-- src/WORKSPACE | 328 +++++++++--------- src/pybind/BUILD | 5 +- src/xgboost/BUILD | 22 +- third_party/BUILD.bazel | 105 ++++++ third_party/MODULE.bazel | 4 + 26 files changed, 517 insertions(+), 320 deletions(-) create mode 100644 data/BUILD create mode 100644 data/MODULE.bazel create mode 100644 third_party/BUILD.bazel create mode 100644 third_party/MODULE.bazel diff --git a/contrib/bin/Lilly_Medchem_Rules.sh b/contrib/bin/Lilly_Medchem_Rules.sh index eb4ba16b..cc629a9b 100755 --- a/contrib/bin/Lilly_Medchem_Rules.sh +++ b/contrib/bin/Lilly_Medchem_Rules.sh @@ -1,9 +1,5 @@ #!/usr/bin/env bash -if [[ ! -v LILLYMOL_HOME ]] ; then - here=$(readlink -f $0) - echo ${here} - export LILLYMOL_HOME=$(dirname $(dirname $(dirname ${here}))) -fi +here=$(readlink -f $(dirname $0)); -exec ruby $(dirname ${here})/Lilly_Medchem_Rules.rb "$@" +exec ruby ${here}/Lilly_Medchem_Rules.rb "$@" diff --git a/contrib/bin/calibrate_svmfp_client.rb b/contrib/bin/calibrate_svmfp_client.rb index 1866ef00..4f7dff21 100755 --- a/contrib/bin/calibrate_svmfp_client.rb +++ b/contrib/bin/calibrate_svmfp_client.rb @@ -13,7 +13,7 @@ def usage(rc) end def main - cl = IWCmdline.new("-v-gfp=close-TRSMI=sfile-TESMI=sfile-TRactivity=sfile-TEactivity=sfile-PRED=s-STATS=s-TMPDIR=s-uid=s") + cl = IWCmdline.new("-v-gfp=close-TRSMI=sfile-TESMI=sfile-TRactivity=sfile-TEactivity=sfile-PRED=s-STATS=s-TMPDIR=s-uid=s-keep") unless cl.option_present('gfp') $stderr << "Must specify fingerprints via the -gfp option\n" @@ -76,7 +76,7 @@ def main mdir = File.join(tmpdir, 'MODEL') - cmd = "#{svmfp_make} --mdir #{mdir} -gfp #{gfp} -gfp -A #{train_activity} #{trsmi}" + cmd = "#{svmfp_make} -v --mdir #{mdir} -gfp #{gfp} -gfp -A #{train_activity} #{trsmi}" system(cmd) cmd = "#{svmfp_evaluate} -mdir #{mdir} #{tesmi} > #{predicted}" @@ -85,7 +85,7 @@ def main cmd = "iwstats -w -Y allequals -E #{test_activity} -p 2 #{predicted} > #{results}" system(cmd) - FileUtils.rm_rf(tmpdir) + FileUtils.rm_rf(tmpdir) unless cl.option_present('keep') end main diff --git a/contrib/bin/hydrophobic_sections.sh b/contrib/bin/hydrophobic_sections.sh index 2725bdeb..3aa0ba31 100755 --- a/contrib/bin/hydrophobic_sections.sh +++ b/contrib/bin/hydrophobic_sections.sh @@ -6,4 +6,4 @@ else export LILLYMOL_HOME=$(dirname $(dirname $(dirname $(readlink -e $0)))) fi -exec ${LILLYMOL_HOME}/bin/Linux/hydrophobic_sections -E autocreate -G def -L def -i smi "$@" +exec ${LILLYMOL_HOME}/bin/Linux/hydrophobic_sections -E autocreate -G def -L def "$@" diff --git a/contrib/bin/model_calibrate.rb b/contrib/bin/model_calibrate.rb index 31a78742..4eaf1088 100644 --- a/contrib/bin/model_calibrate.rb +++ b/contrib/bin/model_calibrate.rb @@ -16,6 +16,34 @@ def initialize(trs, tra, tes, tea) end end +class Makefile + def initialize(fname) + @file = File.open(fname, "w") + @targets = [] + @dependencies = [] + @commands = [] + end + def another_target(target, dependency, cmd) + @targets << target.gsub(/:/, "\\:") + @dependencies << dependency + @commands << cmd + end + def write + @file << "all:\n" + @file << " " + @targets.each_with_index do |target, ndx| + @file << ' ' if ndx > 0 + @file << "#{target}" + end + @file << "\n" + + @targets.each_with_index do |target, ndx| + @file << "#{target}: #{@dependencies[ndx]}\n" + @file << " #{@commands[ndx]}" + end + end +end + def read_fingerprints(fnames) result = [] fnames.each do |fname| @@ -33,7 +61,11 @@ def read_fingerprints(fnames) # For each of `niter` splits, look for the appropriate train/test and # smi/activity files and if present, create a TTSplit object. # Return an Array of the TTSplit objects found +# If niter is set, we look for that many files. +# If niter comes in as zero, we search for files def gather_split_files(train_stem, test_stem, niter) + niter = 100000 if niter.zero? + result = [] (0...niter).each do |i| train_smi = "#{train_stem}#{i}.smi" @@ -61,7 +93,7 @@ def make_splits(smiles, activity, niter, trpct) end def main - cl = IWCmdline.new("-v-A=sfile-S=s-niter=ipos-TRpct=ipos--fp=sfile-appendfp=sfile-DESC=s-PRED=s") + cl = IWCmdline.new("-v-A=sfile-S=s-niter=ipos-TRpct=ipos--fp=sfile-appendfp=sfile-DESC=s-PRED=s-PS=s") if cl.unrecognised_options_encountered $stderr << "Unrecognised options encountered\n" @@ -84,7 +116,7 @@ def main fingerprints = read_fingerprints(cl.values('fp')) - $stderr << "Read #{fingerprints.size} fingerprints\n" + $stderr << "Read #{fingerprints.size} fingerprints\n" if verbose if ARGV.empty? $stderr << "No smiles specified\n" @@ -98,13 +130,31 @@ def main smiles = ARGV[0] - niter = if cl.option_present('niter') - cl.value('niter') - else - 10 - end - - $stderr << "Will generate #{niter} splits\n" if verbose + if cl.option_present('PS') + if cl.option_present('TRpct') + $stderr << "Warning, training set percent -TRpct not meaningful with previously split files\n" + end + splits = gather_split_files('TRAIN', 'TEST', 0) # 0 arg means look for files already there. + if splits.empty? + $stderr << "Did not find any pre-split files (-PS)\n" + return 1 + end + niter = splits.size + $stderr << "Found #{niter} pre split splits\n" if verbose + else + niter = if cl.option_present('niter') + niter = cl.value('niter') + else + niter = 10 + end + + $stderr << "Will generate #{niter} splits\n" if verbose + + splits = make_splits(smiles, activity_fname, niter, trpct) + if splits.empty? + $stderr << "Split generation failed\n"; + end + end trpct = if cl.option_present('TRpct') cl.value('TRpct') @@ -120,14 +170,9 @@ def main 'PRED' end - splits = make_splits(smiles, activity_fname, niter, trpct) - if splits.empty? - $stderr << "Split generation failed\n"; - end - descriptor_files = [] cl.values('DESC').each do |desc| - g = Dir.glob(desc) + g = Dir.glob(desc.split(',')) if g.empty? $stderr << "Descriptor file glob #{desc} no matches\n" return 1 @@ -138,25 +183,34 @@ def main $stderr << "Processing #{descriptor_files.size} descriptor files\n" if verbose $stderr << descriptor_files << "\n" + makefile = Makefile.new("Makefile.calibrate") + command_file = "model_calibrate.txt" - write_command_file(splits, descriptor_files, fingerprints, predicted_stem, stats_stem, command_file) + write_command_file(splits, descriptor_files, fingerprints, predicted_stem, stats_stem, makefile, command_file) + + makefile.write 0 end -def write_command_file(splits, descriptor_files, fingerprints, predicted_stem, stats_stem, command_file) +def write_command_file(splits, descriptor_files, fingerprints, predicted_stem, + stats_stem, makefile, command_file) $stderr << "Writing #{splits.size} splits with #{fingerprints.size} fingerprints\n" file = File.open(command_file, "w") fingerprints.each do |fp| fptxt = fp.gsub(' ', "") + $stderr << "Writing #{fp}\n" splits.each_with_index do |split, ndx| - file << "calibrate_svmfp_client.sh -gfp #{fp} -gfp " + + stats_file = "#{stats_stem}.#{fptxt}.#{ndx}" + cmd = "" + cmd << "calibrate_svmfp_client.sh -gfp #{fp} -gfp " + "-TRSMI #{split.train_smi} -TRactivity #{split.train_activity} " + "-TESMI #{split.test_smi} -TEactivity #{split.test_activity} " + - "-PRED #{predicted_stem}.#{fptxt}.#{ndx} -STATS #{stats_stem}.#{fptxt}.#{ndx} " + - "-uid SVMFP#{fptxt}" + + "-PRED #{predicted_stem}.#{fptxt}.#{ndx} -STATS #{stats_file} " + + "-uid SVMFP#{fptxt}.#{ndx}" + "\n" - $stderr << "Wrote #{fp} split #{ndx}\n" + file << cmd + makefile.another_target(stats_file, "#{split.train_smi}", cmd) end end diff --git a/contrib/bin/svmfp/svmfp_make.rb b/contrib/bin/svmfp/svmfp_make.rb index e8acb92d..44957242 100644 --- a/contrib/bin/svmfp/svmfp_make.rb +++ b/contrib/bin/svmfp/svmfp_make.rb @@ -332,7 +332,7 @@ def populate_metadata(model, fingerprints, response_name, classification, flatte populate_metadata(model, fingerprints, response_name, cmdline.option_present('C'), flatten_sparse_fingerprints) model.threshold_b = get_threshold_b(model_file) - model.bit_subset = 'bit_xref.dat' + model.bit_subset = 'bit_subset.dat' model.bit_xref = bit_xref model.train_gfp = 'train.gfp' model.support_vectors = 'support_vectors.gfp' diff --git a/contrib/bin/svmfp_summarise_results.rb b/contrib/bin/svmfp_summarise_results.rb index 0c3db697..ffca8df0 100755 --- a/contrib/bin/svmfp_summarise_results.rb +++ b/contrib/bin/svmfp_summarise_results.rb @@ -596,7 +596,7 @@ def looks_like_fingerprint s outp = File.open(dfile, mode='w') raise "Cannot open raw results file '#{dfile}'" unless outp - outp << rx[i].source << "\n" +# outp << rx[i].source << "\n" predictors.each do |k, v| next unless (v.n(i) == nsplit) diff --git a/data/BUILD b/data/BUILD new file mode 100644 index 00000000..93bec983 --- /dev/null +++ b/data/BUILD @@ -0,0 +1,15 @@ +filegroup( + name = "charge_assigner_data", + srcs = glob(["queries/charges/**"]), + visibility = [ + "//visibility:public", + ], +) + +filegroup( + name = "donor_acceptor_data", + srcs = glob(["queries/hbonds/**"]), + visibility = [ + "//visibility:public", + ], +) diff --git a/data/MODULE.bazel b/data/MODULE.bazel new file mode 100644 index 00000000..66593e05 --- /dev/null +++ b/data/MODULE.bazel @@ -0,0 +1,4 @@ +module( + name = "data", + version = "1.0.0" +) diff --git a/src/BerkeleyDB/BUILD b/src/BerkeleyDB/BUILD index b83ed163..2b830a9c 100644 --- a/src/BerkeleyDB/BUILD +++ b/src/BerkeleyDB/BUILD @@ -28,7 +28,7 @@ cc_binary( "//Foundational/data_source:iwstring_data_source", "//Foundational/iw_tdt", "//Foundational/iwmisc", - "@berkeleydb", + "@third_party//:berkeley_static", ], ) @@ -43,7 +43,7 @@ cc_binary( "//Foundational/cmdline:iwcmdline", "//Foundational/data_source:iwstring_data_source", "//Foundational/iwmisc", - "@berkeleydb", + "@third_party//:berkeley_static", ], ) @@ -59,7 +59,7 @@ cc_binary( "//Foundational/cmdline:iwcmdline", "//Foundational/data_source:iwstring_data_source", "//Foundational/iwmisc", - "@berkeleydb", + "@third_party//:berkeley_static", ], ) @@ -74,7 +74,7 @@ cc_binary( "//Foundational/cmdline:iwcmdline", "//Foundational/data_source:iwstring_data_source", "//Foundational/iwmisc", - "@berkeleydb", + "@third_party//:berkeley_static", ], ) @@ -89,7 +89,7 @@ cc_binary( "//Foundational/cmdline:iwcmdline", "//Foundational/data_source:iwstring_data_source", "//Foundational/iwmisc", - "@berkeleydb", + "@third_party//:berkeley_static", ], ) @@ -105,7 +105,7 @@ cc_binary( "//Foundational/data_source:iwstring_data_source", "//Foundational/iwbits", "//Foundational/iwmisc", - "@berkeleydb", + "@third_party//:berkeley_static", ], ) @@ -121,7 +121,7 @@ cc_binary( "//Foundational/data_source:iwstring_data_source", "//Foundational/iw_tdt", "//Foundational/iwmisc", - "@berkeleydb", + "@third_party//:berkeley_static", "@re2", "@zlib", ], @@ -139,7 +139,7 @@ cc_binary( "//Foundational/cmdline:iwcmdline", "//Foundational/data_source:iwstring_data_source", "//Foundational/iwmisc", - "@berkeleydb", + "@third_party//:berkeley_static", ], ) @@ -154,7 +154,7 @@ cc_binary( "//Foundational/cmdline:iwcmdline", "//Foundational/data_source:iwstring_data_source", "//Foundational/iwmisc", - "@berkeleydb", + "@third_party//:berkeley_static", ], ) @@ -170,7 +170,7 @@ cc_binary( "//Foundational/data_source:iwstring_data_source", "//Foundational/iw_tdt", "//Foundational/iwmisc", - "@berkeleydb", + "@third_party//:berkeley_static", "@re2", ], ) diff --git a/src/MODULE.bazel b/src/MODULE.bazel index ee00c3ab..f04d41b7 100644 --- a/src/MODULE.bazel +++ b/src/MODULE.bazel @@ -40,11 +40,28 @@ bazel_dep(name = "rules_go", version = "0.49.0") # bazel_dep(name = "rules_proto_grpc_go", version = "5.0.1") bazel_dep(name = "rules_pkg", version = "0.10.1") bazel_dep(name = "rules_proto", version = "6.0.2") -bazel_dep(name = "rules_python", version = "0.39.0") +bazel_dep(name = "rules_proto_grpc_go", version = "5.0.1") +# Beware, adding this version will cause a bump in the +# protoc version to an incompatible version. +# We are getting py_proto_library from "protobuf" so this +# is not really needed. +# bazel_dep(name = "rules_python", version = "0.39.0") -#bazel_dep(name = "rules_proto_grpc", version = "5.0.0") -#bazel_dep(name = "rules_proto_grpc_cpp", version = "5.0.0") +# bazel_dep(name = "rules_proto_grpc", version = "5.0.0") +# bazel_dep(name = "rules_proto_grpc_cpp", version = "5.0.0") bazel_dep(name = "rules_ruby", version = "0.12.0") bazel_dep(name = "tomlplusplus", version = "3.4.0") bazel_dep(name = "zlib", version = "1.3.1") + +bazel_dep(name = "data", version = "1.0.0") +local_path_override( + module_name = "data", + path = "../data" +) + +bazel_dep(name = "third_party", version = "1.0.0") +local_path_override( + module_name = "third_party", + path = "../third_party" +) diff --git a/src/Molecule_Lib/BUILD b/src/Molecule_Lib/BUILD index 824d626f..a95ac1c4 100644 --- a/src/Molecule_Lib/BUILD +++ b/src/Molecule_Lib/BUILD @@ -517,7 +517,7 @@ cc_library( ":iwmolecule", ] + select({ - "inchi_yes": ["@inchi//:inchi"], + "inchi_yes": ["@third_party//:inchi"], "inchi_no": [], "//conditions:default": [], }), @@ -697,7 +697,7 @@ cc_test( "donor_acceptor_test.cc", ], data = [ - "@donor_acceptor//:donor_acceptor_data", + "@data//:donor_acceptor_data", ], deps = [ ":iwmolecule", diff --git a/src/Molecule_Lib/donor_acceptor_test.cc b/src/Molecule_Lib/donor_acceptor_test.cc index 537d5ec9..4d081e7a 100644 --- a/src/Molecule_Lib/donor_acceptor_test.cc +++ b/src/Molecule_Lib/donor_acceptor_test.cc @@ -78,11 +78,11 @@ void TestHbonds::SetUp() { const char* test_srcdir = getenv("TEST_SRCDIR"); IWString queries_dir(test_srcdir); - queries_dir << "/../donor_acceptor_test.runfiles/donor_acceptor/"; + queries_dir << "/../donor_acceptor_test.runfiles/data+/queries/hbonds/"; #ifdef LIST_DIRECTORY std::string qq(test_srcdir); - qq += "/../donor_acceptor_test.runfiles/donor_acceptor/"; + qq += "/../donor_acceptor_test.runfiles/data+/queries/hbonds"; for (auto const& dir_entry : std::filesystem::directory_iterator{qq}) { std::cerr << dir_entry << '\n'; } diff --git a/src/Molecule_Tools/BUILD b/src/Molecule_Tools/BUILD index 0d7e57f7..ed3e7e41 100644 --- a/src/Molecule_Tools/BUILD +++ b/src/Molecule_Tools/BUILD @@ -3219,7 +3219,7 @@ cc_library( deps = [ "//Molecule_Lib:iw_vdw", "//Molecule_Lib:iwmolecule", - "@local_f2c//:f2c", + "@third_party//:f2c", ], ) @@ -3308,7 +3308,7 @@ cc_test( timeout = "short", srcs = ["alogp_test.cc"], data = [ - "@charge_assigner//:charge_assigner_data", + "@data//:charge_assigner_data", ], deps = [ ":alogp_lib", diff --git a/src/Molecule_Tools/jwcats.cc b/src/Molecule_Tools/jwcats.cc index 3dbf01ca..5926df29 100644 --- a/src/Molecule_Tools/jwcats.cc +++ b/src/Molecule_Tools/jwcats.cc @@ -513,12 +513,6 @@ jw_cat_search(Molecule& m, IWString_and_File_Descriptor& output, int donor_accep if (fingerprint_tag.length() > 0) { do_fingerprint_output(m, array_size, scaled_counts, output); - if (function_as_gfp_filter) { - ; - } else { - output << "|\n"; - } - if (flush_after_every_molecule) { output.flush(); } diff --git a/src/Molecule_Tools_Bdb/BUILD b/src/Molecule_Tools_Bdb/BUILD index bb16680b..02bd36c5 100644 --- a/src/Molecule_Tools_Bdb/BUILD +++ b/src/Molecule_Tools_Bdb/BUILD @@ -56,7 +56,7 @@ cc_binary( "//Foundational/cmdline:iwcmdline", "//Molecule_Lib:iwmolecule", "//Molecule_Lib:moleculeio", - "@berkeleydb", + "@third_party//:berkeley_static", "@com_google_protobuf//:protobuf", ], ) @@ -73,7 +73,7 @@ cc_binary( "//Molecule_Lib:iwmolecule", "//Molecule_Lib:moleculeio", "//Molecule_Tools:dicer_fragments_cc_proto", - "@berkeleydb", + "@third_party//:berkeley_static", "@com_google_protobuf//:protobuf", ], ) @@ -90,7 +90,7 @@ cc_binary( "//Molecule_Lib:iwmolecule", "//Molecule_Lib:molecular_formula_lib", "//Molecule_Tools:dicer_fragments_cc_proto", - "@berkeleydb", + "@third_party//:berkeley_static", "@com_google_protobuf//:protobuf", ], ) @@ -107,7 +107,7 @@ cc_binary( "//Foundational/data_source:iwtfdata_record", "//Foundational/iwmisc", "//Molecule_Tools:dicer_fragments_cc_proto", - "@berkeleydb", + "@third_party//:berkeley_static", "@com_google_protobuf//:protobuf", ], ) @@ -124,7 +124,7 @@ cc_binary( "//Molecule_Lib:iwmolecule", "//Molecule_Lib:iwreaction", "//Molecule_Lib:moleculeio", - "@berkeleydb", + "@third_party//:berkeley_static", ], ) @@ -139,7 +139,7 @@ cc_binary( "//Foundational/cmdline:iwcmdline", "//Molecule_Lib:iwmolecule", "//Molecule_Lib:moleculeio", - "@berkeleydb", + "@third_party//:berkeley_static", ], ) @@ -155,7 +155,7 @@ cc_binary( "//Foundational/iwmisc", "//Molecule_Lib:iwmolecule", "//Molecule_Lib:moleculeio", - "@berkeleydb", + "@third_party//:berkeley_static", ], ) @@ -171,7 +171,7 @@ cc_binary( "//Foundational/cmdline:iwcmdline", "//Molecule_Lib:iwmolecule", "//Molecule_Lib:moleculeio", - "@berkeleydb", + "@third_party//:berkeley_static", ], ) @@ -188,7 +188,7 @@ cc_binary( "//Foundational/iwstring:absl_hash", "//Molecule_Lib:iwmolecule", "//Molecule_Lib:moleculeio", - "@berkeleydb", + "@third_party//:berkeley_static", ], ) @@ -204,7 +204,7 @@ cc_binary( "//Foundational/iwmisc", "//Molecule_Lib:iwmolecule", "//Molecule_Lib:moleculeio", - "@berkeleydb", + "@third_party//:berkeley_static", ], ) @@ -220,7 +220,7 @@ cc_binary( "//Foundational/iwmisc", "//Molecule_Lib:iwmolecule", "//Molecule_Lib:moleculeio", - "@berkeleydb", + "@third_party//:berkeley_static", ], ) @@ -236,7 +236,7 @@ cc_binary( "//Foundational/iwmisc", "//Molecule_Lib:iwmolecule", "//Molecule_Lib:moleculeio", - "@berkeleydb", + "@third_party//:berkeley_static", "@com_google_absl//absl/container:flat_hash_set", "@com_google_protobuf//:protobuf", ], @@ -254,7 +254,7 @@ cc_library( deps = [ "//Foundational/cmdline:iwcmdline", "//Molecule_Lib:iwmolecule", - "@berkeleydb", + "@third_party//:berkeley_static", ], ) @@ -270,7 +270,7 @@ cc_library( deps = [ "//Foundational/cmdline:iwcmdline", "//Molecule_Lib:iwmolecule", - "@berkeleydbshared//:berkeleydb", + "@third_party//:berkeley_shared", ], ) @@ -287,7 +287,7 @@ cc_library( "iwecfp_database", "//Foundational/cmdline:iwcmdline", "//Molecule_Lib:iwmolecule", - "@berkeleydb", + "@third_party//:berkeley_static", ], ) @@ -304,7 +304,7 @@ cc_library( ":iwecfp_database_shared", "//Foundational/cmdline:iwcmdline", "//Molecule_Lib:iwmolecule", - "@berkeleydbshared//:berkeleydb", + "@third_party//:berkeley_shared", ], ) @@ -320,7 +320,7 @@ cc_library( deps = [ "//Foundational/cmdline:iwcmdline", "//Molecule_Lib:iwmolecule", - "@berkeleydb", + "@third_party//:berkeley_static", ], ) @@ -334,7 +334,7 @@ cc_library( ], deps = [ "//Molecule_Lib:iwmolecule", - "@berkeleydbshared//:berkeleydb", + "@third_party//:berkeley_shared", ], ) @@ -350,7 +350,7 @@ cc_library( deps = [ "//Foundational/cmdline:iwcmdline", "//Molecule_Lib:iwmolecule", - "@berkeleydb", + "@third_party//:berkeley_static", ], ) @@ -366,6 +366,6 @@ cc_library( deps = [ "//Foundational/cmdline:iwcmdline", "//Molecule_Lib:iwmolecule", - "@berkeleydbshared//:berkeleydb", + "@third_party//:berkeley_shared", ], ) diff --git a/src/Utilities/GFP_Tools/BUILD b/src/Utilities/GFP_Tools/BUILD index a514e6f8..470021b1 100644 --- a/src/Utilities/GFP_Tools/BUILD +++ b/src/Utilities/GFP_Tools/BUILD @@ -460,8 +460,8 @@ cc_binary( "//Utilities/GFP_Tools:gfp_standard", "//Utilities/GFP_Tools:nearneighbours_cc_proto", "@com_google_protobuf//:protobuf", - "@cppzmq", - "@libzmq", + "@third_party//:cppzmq", + "@third_party//:libzmq", ], ) diff --git a/src/Utilities/GFP_Tools/bit_subset.cc b/src/Utilities/GFP_Tools/bit_subset.cc index 921f4632..4da07654 100644 --- a/src/Utilities/GFP_Tools/bit_subset.cc +++ b/src/Utilities/GFP_Tools/bit_subset.cc @@ -211,6 +211,8 @@ BitXref::WriteSvmlFeatures(const IW_General_Fingerprint& gfp, return -1; // Special return value indicating fatal error. } +//cerr << "BitXref::WriteSvmlFeatures writing " << _nfixed << " fixed and " << _nsparse << " sparse fingerprints\n"; + // The maximum number of features. const int nfeatures = NumberFeatures(gfp); @@ -314,14 +316,12 @@ BitXref::PopulateFeatureVector(const IW_General_Fingerprint& gfp, std::vector& features) const { std::fill(features.begin(), features.end(), 0.0); int rc = 0; - cerr << "PopulateFeatureVector: _nfixed " << _nfixed << " sparse " << _nsparse << '\n'; for (int i = 0; i < _nfixed; ++i) { IWDYFP& fp = gfp[i]; int j = 0; int bit; while ((bit = fp.next_on_bit(j)) >= 0) { const auto iter = _fixed[i]->find(bit); - cerr << "Checking fixed bit " << bit << " missing " << (iter == _fixed[i]->end()) << '\n'; if (iter == _fixed[i]->end()) { continue; } @@ -338,7 +338,6 @@ BitXref::PopulateFeatureVector(const IW_General_Fingerprint& gfp, int count; while (sfp.next_bit_set(j, bit, count)) { const auto iter = _sparse[i]->find(bit); - cerr << "Checking bit " << bit << " missing " << (iter == _sparse[i]->end()) << '\n'; if (iter == _sparse[i]->end()) { continue; } @@ -376,4 +375,11 @@ BitXref::WriteDsv(const IW_General_Fingerprint& gfp, char output_separator, return rc; } +int +BitSubset::DebugPrint(std::ostream& output) const { + output << "BitXref::DebugPrint: _nfixed " << _nfixed << " _nsparse " << _nsparse << "\n"; + + return 1; +} + } // namespace bit_subset diff --git a/src/Utilities/GFP_Tools/bit_subset.h b/src/Utilities/GFP_Tools/bit_subset.h index ca51eaf3..72ff9194 100644 --- a/src/Utilities/GFP_Tools/bit_subset.h +++ b/src/Utilities/GFP_Tools/bit_subset.h @@ -7,10 +7,15 @@ #include "Foundational/iwstring/iwstring.h" #include "Foundational/iwstring/iw_stl_hash_map.h" #include "Foundational/iwstring/iw_stl_hash_set.h" -#include "Utilities/GFP_Tools/gfp_to_svm_lite.pb.h" #include "Utilities/GFP_Tools/dyfp.h" #include "Utilities/GFP_Tools/gfp.h" +#ifdef BUILD_BAZEL +#include "Utilities/GFP_Tools/gfp_to_svm_lite.pb.h" +#else +#include "gfp_to_svm_lite.pb.h" +#endif + namespace bit_subset { // THe type of the bits in a .gfp @@ -24,7 +29,7 @@ using gfp_bit_type = uint32_t; // is not necessarily known when this is constructed. class BitSubset { private: - // Makking from tag to subset of bits. + // Mapping from tag to subset of bits. using Subset = std::unordered_set; IW_STL_Hash_Map _tag_to_bit_subset; @@ -65,6 +70,9 @@ class BitSubset { // If that fails, it will return -1. // Otherwise returns the number of features now in `gfp`. int MakeSubset(IW_General_Fingerprint& gfp); + + // For debugging + int DebugPrint(std::ostream& output) const; }; // The BitXref class is used to support conversion of .gfp data diff --git a/src/Utilities/GFP_Tools/gfp_svmfp_score_v2.cc b/src/Utilities/GFP_Tools/gfp_svmfp_score_v2.cc index b0a1b313..cac5bd23 100644 --- a/src/Utilities/GFP_Tools/gfp_svmfp_score_v2.cc +++ b/src/Utilities/GFP_Tools/gfp_svmfp_score_v2.cc @@ -31,6 +31,7 @@ #include "Utilities/GFP_Tools/bit_subset.h" #include "Utilities/GFP_Tools/gfp.h" + #ifdef BUILD_BAZEL #include "Utilities/GFP_Tools/gfp_model.pb.h" #include "Utilities/GFP_Tools/gfp_to_svm_lite.pb.h" @@ -40,6 +41,7 @@ #endif namespace gfp_svmfp_evaluate { + using std::cerr; int verbose = 0; @@ -61,11 +63,20 @@ Fraction_as_String fraction_as_string; void Usage(int rc) { - cerr << "Evaluates svmfp model(s)\n"; +// clang-format off +#if defined(GIT_HASH) && defined(TODAY) + cerr << __FILE__ << " compiled " << TODAY << " git hash " << GIT_HASH << '\n'; +#else + cerr << __FILE__ << " compiled " << __DATE__ << " " << __TIME__ << '\n'; +#endif + // clang-format on + // clang-format off + cerr << "Evaluates svmfp model(s) built with svmfp_make\n"; cerr << " -mdir one or more model directories\n"; cerr << " -cwrite ... what to write for classification models, '-cwrite help' for info\n"; cerr << " -sas write the score as string with digits of accuracy\n"; cerr << " -v verbose output\n"; + // clang-format on exit(rc); } @@ -153,26 +164,6 @@ ReadBinaryProto(const IWString& dirname, const std::string& fname) { return iwmisc::ReadBinaryProto(path_name); } -#ifdef NOT_NEEDED -std::optional -CreateSubset(const IW_General_Fingerprint& gfp, - const GfpBitToFeatureMap::GfpBitXref& bit_xref) { - IW_General_Fingerprint result; - - for (int i = 0; i < number_sparse_fingerprints(); ++i) { - const IWString& tag = sparse_fingerprint_tag(i); - const std::string as_string(tag.data(), tag.length()); - auto iter = bit_xref.xref().find(as_string); - if (iter == bit_xref.xref().end()) { - cerr << "CreateSubset:no cross reference for " << tag << "'\n"; - return std::nullopt; - } - } - - return result; -} -#endif - // The support vectors are stored in gfp form with a weight. class WeightedFingerprint { private: @@ -447,6 +438,7 @@ SvmModel::PreProcess(IW_General_Fingerprint& gfp) { if (_flatten_counts) { FlattenSparseFingerprint(gfp); } + return rc; } diff --git a/src/Utilities/GFP_Tools/gfp_to_svm_lite_v3.cc b/src/Utilities/GFP_Tools/gfp_to_svm_lite_v3.cc index 8185b09a..f73bc67a 100644 --- a/src/Utilities/GFP_Tools/gfp_to_svm_lite_v3.cc +++ b/src/Utilities/GFP_Tools/gfp_to_svm_lite_v3.cc @@ -206,10 +206,8 @@ class GfpBitsRetained int& ndx); // Convert to proto form. - GfpBitSubset::GfpBitSubset - ToBitSubsetProto() const; - GfpBitSubset::GfpBitToFeature - ToBitXrefProto() const; + GfpBitSubset::GfpBitSubset ToBitSubsetProto() const; + GfpBitSubset::GfpBitToFeature ToBitXrefProto() const; // Write the bit cross reference and bit subset data in proto form. int @@ -1147,7 +1145,6 @@ GfpToSvmLite(int argc, char** argv) if (cl.option_present('C')) { IWString fname = cl.string_value('C'); for (const char* fname : cl) { - cerr << "Profiling " << fname << '\n'; if (!ProfileBits(fname, bit_xref)) { cerr << "Cannot profile bits in " << fname << '\n'; return 1; @@ -1158,7 +1155,6 @@ GfpToSvmLite(int argc, char** argv) // Generate both protos, even if only one needed. Should be cheap. args.bit_subset.Build(bit_xref.ToBitSubsetProto()); args.bit_xref.Build(bit_xref.ToBitXrefProto()); - // args.bit_xref.DebugPrint(cerr); } else if (cl.option_present('U')) { IWString fname = cl.string_value('U'); if (!args.bit_subset.Build(fname)) { diff --git a/src/Utilities/General/iwcut.cc b/src/Utilities/General/iwcut.cc index dc17cd6d..f6457160 100644 --- a/src/Utilities/General/iwcut.cc +++ b/src/Utilities/General/iwcut.cc @@ -111,10 +111,19 @@ static int records_discarded_for_zero_field = 0; static char gsub_spaces_in_tokens = ' '; +// #define DEBUG_IWCUT + static int -invert_selections(resizable_array & columns_requested, int ncol, - int is_descriptor_file, int * tmp) +invert_selections(resizable_array & columns_requested, + int ncol, + int is_descriptor_file) { +#ifdef DEBUG_IWCUT + cerr << "Inverting selections, input contains " << ncol << " columns\n"; +#endif + + int * tmp = new_int(ncol, 1); std::unique_ptr free_tmp(tmp); + int nr = columns_requested.number_elements(); for (int i = 0; i < nr; i++) @@ -128,7 +137,7 @@ invert_selections(resizable_array & columns_requested, int ncol, tmp[0] = 1; columns_requested.resize(0); - columns_requested.resize(ncol); + columns_requested.resize(ncol + 1); for (int i = 0; i < ncol; i++) { @@ -139,22 +148,6 @@ invert_selections(resizable_array & columns_requested, int ncol, return 1; } -//#define DEBUG_IWCUT - -static int -invert_selections(resizable_array & columns_requested, - int ncol, - int is_descriptor_file) -{ -#ifdef DEBUG_IWCUT - cerr << "Inverting selections, input contains " << ncol << " columns\n"; -#endif - - int * tmp = new_int(ncol, 1); std::unique_ptr free_tmp(tmp); - - return invert_selections(columns_requested, ncol, is_descriptor_file, tmp); -} - static int parse_dash_D_option_multiple_lines(iwstring_data_source & input, resizable_array_p & descriptors_to_get) @@ -706,6 +699,7 @@ iwcut(const const_IWSubstring & buffer, int nr = columns_requested.number_elements(); #ifdef DEBUG_IWCUT + cerr << "Processing " << word_beginnings.number_elements() << " word beginnings\n"; for (int i = 0; i < word_beginnings.number_elements(); i++) { cerr << ' ' << word_beginnings[i]; @@ -717,8 +711,9 @@ iwcut(const const_IWSubstring & buffer, { int c = columns_requested[i]; - if (c < 0) + if (c < 0) { c = word_beginnings.number_elements() + c; + } int j; @@ -825,8 +820,9 @@ iwcut(const const_IWSubstring & buffer, resizable_array word_beginnings; - if (columns_in_input > 0) + if (columns_in_input > 0) { word_beginnings.resize(columns_in_input); + } //cerr << "Line " << __LINE__ << " iqt " << input_is_quoted_tokens << '\n'; @@ -843,8 +839,17 @@ iwcut(const const_IWSubstring & buffer, cerr << "ncol " << ncol << " count " << buffer.ccount(input_token_separator) << '\n'; #endif - if (ncol > columns_in_input) + if (ncol > columns_in_input) { columns_in_input = ncol; + } + + for (int col : columns_requested) { + if ((col + 1) > columns_in_input) { + cerr << "iwcut:request column " << (col + 1) << " but only " << columns_in_input << + "columns in input\n"; + return 0; + } + } return iwcut(buffer, word_beginnings, columns_requested, output); } @@ -1374,15 +1379,15 @@ iwcut (int argc, char ** argv) usage(3); } -// if (verbose) -// { -// cerr << "Will extract these columns\n"; -// for (int i = 0; i < columns_requested.number_elements(); i++) -// { -// cerr << ' ' << (columns_requested[i] + 1); -// } -// cerr << '\n'; -// } + if (verbose) + { + cerr << "Will extract these columns\n"; + for (int i = 0; i < columns_requested.number_elements(); i++) + { + cerr << ' ' << (columns_requested[i] + 1); + } + cerr << '\n'; + } } if (cl.option_present('E')) diff --git a/src/WORKSPACE b/src/WORKSPACE index 6abf78a1..dc2d6532 100644 --- a/src/WORKSPACE +++ b/src/WORKSPACE @@ -4,74 +4,74 @@ load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") # These external dependencies will have been built by build_third_party.sh -new_local_repository( - name = "berkeleydb", - path = "../third_party/BDB", - build_file_content = """ -cc_library( - name = "berkeleydb", - srcs = ["lib/libdb_cxx.a", "lib/libdb.a"], - hdrs = ["include/db_cxx.h", "include/db.h" ], - strip_include_prefix = "include", - visibility = ["//visibility:public"], -) -""", -) +## new_local_repository( +## name = "berkeleydb", +## path = "../third_party/BDB", +## build_file_content = """ +## cc_library( +## name = "berkeleydb", +## srcs = ["lib/libdb_cxx.a", "lib/libdb.a"], +## hdrs = ["include/db_cxx.h", "include/db.h" ], +## strip_include_prefix = "include", +## visibility = ["//visibility:public"], +## ) +## """, +## ) +## +## new_local_repository( +## name = "berkeleydbshared", +## path = "../third_party/BDB", +## build_file_content = """ +## cc_library( +## name = "berkeleydb", +## srcs = ["lib/libdb_cxx.so", "lib/libdb.so"], +## hdrs = ["include/db_cxx.h", "include/db.h" ], +## strip_include_prefix = "include", +## visibility = ["//visibility:public"], +## ) +## """, +## ) +## +## new_local_repository( +## name = "local_f2c", +## path = "../third_party/libf2c", +## build_file_content = """ +## cc_library( +## name = "f2c", +## srcs = ["libf2c.a"], +## hdrs = ["f2c.h"], +## visibility = ["//visibility:public"], +## ) +## """, +## ) -new_local_repository( - name = "berkeleydbshared", - path = "../third_party/BDB", - build_file_content = """ -cc_library( - name = "berkeleydb", - srcs = ["lib/libdb_cxx.so", "lib/libdb.so"], - hdrs = ["include/db_cxx.h", "include/db.h" ], - strip_include_prefix = "include", - visibility = ["//visibility:public"], -) -""", -) - -new_local_repository( - name = "local_f2c", - path = "../third_party/libf2c", - build_file_content = """ -cc_library( - name = "f2c", - srcs = ["libf2c.a"], - hdrs = ["f2c.h"], - visibility = ["//visibility:public"], -) -""", -) - -new_local_repository( - name = "charge_assigner", - path = "../data/queries/charges", - build_file_content = """ -filegroup( - name = "charge_assigner_data", - srcs = glob(["**"]), - visibility = [ - "//visibility:public", - ], -) -""" -) - -new_local_repository( - name = "donor_acceptor", - path = "../data/queries/hbonds", - build_file_content = """ -filegroup( - name = "donor_acceptor_data", - srcs = glob(["**"]), - visibility = [ - "//visibility:public", - ], -) -""" -) +## new_local_repository( +## name = "charge_assigner", +## path = "../data/queries/charges", +## build_file_content = """ +## filegroup( +## name = "charge_assigner_data", +## srcs = glob(["**"]), +## visibility = [ +## "//visibility:public", +## ], +## ) +## """ +## ) +## +## new_local_repository( +## name = "donor_acceptor", +## path = "../data/queries/hbonds", +## build_file_content = """ +## filegroup( +## name = "donor_acceptor_data", +## srcs = glob(["**"]), +## visibility = [ +## "//visibility:public", +## ], +## ) +## """ +## ) #local_repository( @@ -170,104 +170,104 @@ cc_library( """, ) -new_local_repository( - name = "libzmq", - path = "../third_party", - build_file_content = """ -cc_library ( - name = "libzmq", - srcs = [ - "lib/libzmq.a", - ], - hdrs = [ - "include/zmq.h", - ], - strip_include_prefix = "include", - visibility = ["//visibility:public"], -) -""" -) +## new_local_repository( +## name = "libzmq", +## path = "../third_party", +## build_file_content = """ +## cc_library ( +## name = "libzmq", +## srcs = [ +## "lib/libzmq.a", +## ], +## hdrs = [ +## "include/zmq.h", +## ], +## strip_include_prefix = "include", +## visibility = ["//visibility:public"], +## ) +## """ +## ) +## +## new_local_repository( +## name = "cppzmq", +## path = "../third_party", +## build_file_content = """ +## cc_library( +## name = "cppzmq", +## srcs = [ +## ], +## hdrs = [ +## "include/zmq.hpp", +## ], +## deps = [ +## "@libzmq", +## ], +## strip_include_prefix = "include", +## visibility = ["//visibility:public"], +## ) +## """ +## ) +## +## new_local_repository( +## name = "xgboost", +## path="../third_party", +## build_file_content = """ +## cc_library( +## name = "xgboost", +## srcs = [ +## "lib/libxgboost.so", +## ], +## hdrs = +## glob( +## ["include/xgboost/**"], +## ), +## deps = [ +## ], +## strip_include_prefix = "include", +## visibility = ["//visibility:public"], +## ) +## """ +## ) +## +## # Needed for xgboost +## new_local_repository( +## name = "dlmc", +## path="../third_party", +## build_file_content = """ +## cc_library( +## name = "dlmc", +## srcs = [ +## ], +## hdrs = +## glob( +## ["include/dmlc/**"], +## ), +## deps = [ +## ], +## strip_include_prefix = "include", +## visibility = ["//visibility:public"], +## ) +## """ +## ) +## ### -new_local_repository( - name = "cppzmq", - path = "../third_party", - build_file_content = """ -cc_library( - name = "cppzmq", - srcs = [ - ], - hdrs = [ - "include/zmq.hpp", - ], - deps = [ - "@libzmq", - ], - strip_include_prefix = "include", - visibility = ["//visibility:public"], -) -""" -) - -new_local_repository( - name = "xgboost", - path="../third_party", - build_file_content = """ -cc_library( - name = "xgboost", - srcs = [ - "lib/libxgboost.so", - ], - hdrs = - glob( - ["include/xgboost/**"], - ), - deps = [ - ], - strip_include_prefix = "include", - visibility = ["//visibility:public"], -) -""" -) - -# Needed for xgboost -new_local_repository( - name = "dlmc", - path="../third_party", - build_file_content = """ -cc_library( - name = "dlmc", - srcs = [ - ], - hdrs = - glob( - ["include/dmlc/**"], - ), - deps = [ - ], - strip_include_prefix = "include", - visibility = ["//visibility:public"], -) -""" -) -### - -new_local_repository( - name = "inchi", - path = "../third_party", - build_file_content = """ -cc_library( - name = "inchi", - srcs = glob( - ["InChI/INCHI-1-SRC/INCHI_API/bin/Linux/libinchi.so*"], - ), - hdrs = glob ( - ["InChI/INCHI-1-SRC/INCHI_BASE/src/*.h"] - ), - strip_include_prefix = "InChI/INCHI-1-SRC/INCHI_BASE/src", - visibility = ["//visibility:public"], -) -""" -) +# new_local_repository( +# name = "inchi", +# path = "../third_party", +# build_file_content = """ +## cc_library( +## name = "inchi", +## srcs = glob( +## ["InChI/INCHI-1-SRC/INCHI_API/bin/Linux/libinchi.so*"], +## ), +## hdrs = glob ( +## ["InChI/INCHI-1-SRC/INCHI_BASE/src/*.h"] +## ), +## strip_include_prefix = "InChI/INCHI-1-SRC/INCHI_BASE/src", +## visibility = ["//visibility:public"], +## ) +## """ +## ) diff --git a/src/pybind/BUILD b/src/pybind/BUILD index 3ede884d..af0e07a9 100644 --- a/src/pybind/BUILD +++ b/src/pybind/BUILD @@ -1,5 +1,5 @@ # load("@rules_python_pytest//python_pytest:defs.bzl", "py_pytest_test") -load("@rules_python//python:py_test.bzl", "py_test") +# load("@rules_python//python:py_test.bzl", "py_test") package(default_visibility = ["//visibility:public"]) @@ -19,6 +19,7 @@ cc_library( "//Molecule_Tools:xlogp_lib", "@pybind11", "@python", +# "@third_party//:python", ], ) @@ -314,7 +315,7 @@ cc_library( "//Molecule_Tools_Bdb:iwecfp_database_lookup_lib_shared", "//Molecule_Tools_Bdb:selimsteg", "//Molecule_Tools_Bdb:structure_database_shared", - "@berkeleydbshared//:berkeleydb", + "@third_party//:berkeley_shared", "@pybind11", "@python", ], diff --git a/src/xgboost/BUILD b/src/xgboost/BUILD index 9a482d16..460a44e2 100644 --- a/src/xgboost/BUILD +++ b/src/xgboost/BUILD @@ -1,6 +1,6 @@ load("@com_google_protobuf//:protobuf.bzl", "py_proto_library") load("@rules_proto//proto:defs.bzl", "proto_library") -#load("@rules_proto_grpc_go//:defs.bzl", "go_proto_compile", "go_proto_library") +load("@rules_proto_grpc_go//:defs.bzl", "go_proto_compile", "go_proto_library") load("//build_deps:install.bzl", "local_install") local_install( @@ -50,14 +50,14 @@ py_proto_library( # ], #) -#go_proto_library( -# name = "xgboost_model_go_proto", -# importpath = "xgboost_lib", -# protos = [ -# ":xgboost_model_proto", -# ], -# visibility = ["//visibility:public"], -#) +go_proto_library( + name = "xgboost_model_go_proto", + importpath = "xgboost_lib", + protos = [ + ":xgboost_model_proto", + ], + visibility = ["//visibility:public"], +) proto_library( name = "random_forest_model_proto", @@ -93,7 +93,7 @@ cc_binary( "//Foundational/cmdline_v2", "//Foundational/data_source:iwstring_data_source", "//Foundational/iwmisc", - "@dlmc", - "@xgboost", + "@third_party//:dlmc", + "@third_party//:xgboost", ], ) diff --git a/third_party/BUILD.bazel b/third_party/BUILD.bazel new file mode 100644 index 00000000..c2c9818e --- /dev/null +++ b/third_party/BUILD.bazel @@ -0,0 +1,105 @@ +# load("@rules_cc//cc:defs.bzl", "cc_binary") + +cc_library( + name = "berkeley_static", + srcs = ["BDB/lib/libdb_cxx.a", "BDB/lib/libdb.a"], + hdrs = ["BDB/include/db_cxx.h", "BDB/include/db.h" ], + strip_include_prefix = "BDB/include", + visibility = ["//visibility:public"], +) + +cc_library( + name = "berkeley_shared", + srcs = ["BDB/lib/libdb_cxx.so", "BDB/lib/libdb.so"], + hdrs = ["BDB/include/db_cxx.h", "BDB/include/db.h" ], + strip_include_prefix = "BDB/include", + visibility = ["//visibility:public"], +) + +# THis is needed for xgboost +cc_library( + name = "dlmc", + srcs = [ + ], + hdrs = + glob( + ["include/dmlc/**"], + ), + deps = [ + ], + strip_include_prefix = "include", + visibility = ["//visibility:public"], +) + +cc_library( + name = "xgboost", + srcs = [ + "lib/libxgboost.so", + ], + hdrs = + glob( + ["include/xgboost/**"], + ), + deps = [ + ], + strip_include_prefix = "include", + visibility = ["//visibility:public"], +) + +cc_library( + name = "f2c", + srcs = ["libf2c/libf2c.a"], + hdrs = ["libf2c/f2c.h"], + strip_include_prefix = "libf2c", + visibility = ["//visibility:public"], +) + +#cc_library( +# name = "python", +# hdrs = glob( +# [ "/home/ian/third_party/PYTHON3.11/include/python3.11/**/*.h"] +# ), +# includes = [ +# ".", +# ], +# strip_include_prefix = "/home/ian/third_party/PYTHON3.11/include/python3.11/", +# visibility = ["//visibility:public"], +#) + +cc_library( + name = "cppzmq", + srcs = [ + ], + hdrs = [ + "include/zmq.hpp", + ], + deps = [ + ":libzmq", + ], + strip_include_prefix = "include", + visibility = ["//visibility:public"], +) + +cc_library ( + name = "libzmq", + srcs = [ + "lib/libzmq.a", + ], + hdrs = [ + "include/zmq.h", + ], + strip_include_prefix = "include", + visibility = ["//visibility:public"], +) + +cc_library( + name = "inchi", + srcs = glob( + ["InChI/INCHI-1-SRC/INCHI_API/bin/Linux/libinchi.so*"], + ), + hdrs = glob ( + ["InChI/INCHI-1-SRC/INCHI_BASE/src/*.h"] + ), + strip_include_prefix = "InChI/INCHI-1-SRC/INCHI_BASE/src", + visibility = ["//visibility:public"], +) diff --git a/third_party/MODULE.bazel b/third_party/MODULE.bazel new file mode 100644 index 00000000..a9ba0990 --- /dev/null +++ b/third_party/MODULE.bazel @@ -0,0 +1,4 @@ +module( + name = "third_party", + version = "1.0.0" +)