Skip to content

Commit

Permalink
Fix some build issues - supporess MPI (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
IanAWatson authored Oct 10, 2023
1 parent 7a98292 commit 9f37473
Show file tree
Hide file tree
Showing 7 changed files with 111 additions and 227 deletions.
147 changes: 0 additions & 147 deletions Makefile

This file was deleted.

15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ There is an install run target built into the BUILD files, and you must
decide upon the directory to which that target should copy executables.
See previous section.

While there is a script that should do the build for you, underneath these
are the commands being issued. Skip to the next section unless interested.

A typical build command might be (change the path for test_env)

```
Expand Down Expand Up @@ -212,6 +215,8 @@ version will be allowed to float via bazelisk.

## Targets to Test and Build

First run `build_third_party.sh` to ensure dependencies are built.

Actual tests, builds and installs can be handled by the `build_from_src.sh` script.

The script `build_from_src.sh` will
Expand All @@ -221,9 +226,9 @@ The script `build_from_src.sh` will
3. install executables into the `bin/Linux` directory (build_deps/install.bzl)

## cmake
There is `cmake` infrasture
There is `cmake` infrastructure
included, but that may, or may not, work - within Lilly we have not
been able to make that work, usually as a result of conflicting protcol buffer
been able to make it work, usually as a result of conflicting protcol buffer
versions on the system, but externally it often works, although it has not
been tested recently.

Expand All @@ -240,7 +245,11 @@ cd ./src
# cp /tmp/WORKSPACE WORKSPACE
# Examine /tmp/install.bzl
# cp /tmp/install.bzl build_deps
./build_from_src.sh

# Rebuild Molecule_Tools any time
bazelisk --output_user_root=/node/scratch/$USER build --jobs=8 --enable_bzlmod --experimental_cc_shared_library -c opt --cxxopt=-DGIT_HASH=\"$(git rev-parse --short --verify HEAD)\" --cxxopt=-DTODAY=\"$(date +%Y-%b-%d)\" //Molecule_Tools:all --test_env=C3TK_DATA_PERSISTENT=/full/path/to/LillyMol/queries
```
```
Note that because the date is included with cxxopt, this _will_ cause a daily
recompile. While this is hardly desirable, knowing when an executable was compiled
can be useful.
10 changes: 5 additions & 5 deletions docs/python/LillyMolPython.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ This works because the LillyMol Molecule is a very lazy object. It never compute
things like fragment membership, ring membership, aromaticity or canononical
ordering unless requested. So if you remove an atom, or bond, it will destroy any
information it has about those derived quantities. Only if requested will any
be computed.
be recomputed.

This has many advantages. For example if a molecle is built from a smiles
and then the only thing ever requested is the number of atoms, that will be
Expand Down Expand Up @@ -593,13 +593,13 @@ m = MolFromSmiles('C(=N)(C1=C(O)C(=C(O)C=C1O)OC)CC1=CC=C(O)C=C1 CHEMBL503634')
query.substructure_search(m)
```
The number of matches will be returned. In this case it will frequently be 2 since
the query will mactch two times in a benzene like ring.
the query will match two times in a benzene like ring.

To get the matched atoms, as a List of List's,
```
matches = q.substructure_search_matches(m)
```
and then the matches can be iterated.
and then the matches object (type SubstructureResults) can be iterated.

For example if you wanted to place an isotope on each set of matched atoms that might look like
```
Expand All @@ -608,7 +608,7 @@ for match in query.substructure_search_matches(m):
m.set_isotopes(match, 1)
print(m)
```
Omit the `remove_isotopes` call to accumulate the results.
Omit the `remove_isotopes` call to add the new isotopes to whatever might have already been there.

On the other hand if you need to know which matched atom is which, that might look like
```
Expand Down Expand Up @@ -660,7 +660,7 @@ or
```
If the reaction is a simple form that has either no sidechains,
or all sidechains have a single, already specified, reagent, then
the `in_place_transformations1 method can be used.
the `in_place_transformations` method can be used.
```
rxn.in_place_transformations(m)
```
Expand Down
49 changes: 16 additions & 33 deletions src/Molecule_Tools/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -353,23 +353,6 @@ cc_proto_library(
],
)

proto_library(
name = "tsubstructure_proto",
srcs = [
"tsubstructure.proto",
],
deps = [
"//Molecule_Lib:substructure_proto",
],
)

cc_proto_library(
name = "tsubstructure_cc_proto",
deps = [
"tsubstructure_proto",
],
)

proto_library(
name = "xlogp_proto",
srcs = [
Expand Down Expand Up @@ -2852,22 +2835,22 @@ cc_library(
# ],
#)

cc_library(
name = "unique_molecules_api",
srcs = [
"unique_molecules_api.cc",
],
hdrs = [
"unique_molecules_api.h",
],
deps = [
"//Molecule_Lib:iwmolecule",
"@com_google_absl//absl/container:btree",
],
visibility = [
"//visibility:public",
],
)
# cc_library(
# name = "unique_molecules_api",
# srcs = [
# "unique_molecules_api.cc",
# ],
# hdrs = [
# "unique_molecules_api.h",
# ],
# deps = [
# "//Molecule_Lib:iwmolecule",
# "@com_google_absl//absl/container:btree",
# ],
# visibility = [
# "//visibility:public",
# ],
# )

cc_library(
name = "xlogp_lib",
Expand Down
35 changes: 18 additions & 17 deletions src/Utilities/GFP_Tools/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -315,23 +315,24 @@ cc_binary(
],
)

cc_binary(
name = "gfp_leader_threaded_mpi",
srcs = [
"gfp_leader_threaded_mpi.cc",
],
tags = [
"mpi",
],
deps = [
"//Foundational/accumulator",
"//Foundational/cmdline:iwcmdline",
"//Foundational/data_source:iwstring_data_source",
"//Foundational/iwmisc",
"//Utilities/GFP_Tools:gfp",
"@mpich",
],
)
# Enable if MPI is enabled in the current environment.
# cc_binary(
# name = "gfp_leader_threaded_mpi",
# srcs = [
# "gfp_leader_threaded_mpi.cc",
# ],
# tags = [
# "mpi",
# ],
# deps = [
# "//Foundational/accumulator",
# "//Foundational/cmdline:iwcmdline",
# "//Foundational/data_source:iwstring_data_source",
# "//Foundational/iwmisc",
# "//Utilities/GFP_Tools:gfp",
# "@mpich",
# ],
# )

cc_binary(
name = "gfp_mcs",
Expand Down
6 changes: 5 additions & 1 deletion src/build_from_src.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ jobs='8'
# bazel will not work on an NFS mounted file system. So if you are on an NFS
# file system, you must specify a value for --output_user_root that is
# locally mounted.
bazel_options="--output_user_root=/node/scratch/ian"
# If your local file system is suitable for the bazel cache.
bazel_options=""
# If inside Lilly, some local scratch storage
# bazel_options="--output_user_root=/node/scratch/ian"

build_options="--cxxopt=-DGIT_HASH=\"$(git rev-parse --short --verify HEAD)\" --cxxopt=-DTODAY=\"$(date +%Y-%b-%d)\" --jobs=${jobs} -c opt --enable_bzlmod --experimental_cc_shared_library"

echo ${common_options}
Expand Down
Loading

0 comments on commit 9f37473

Please sign in to comment.