Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SKETCH-2181. Sketcher/rdkit_extensions build infrastructure; macOS runner works #6

Merged
merged 6 commits into from
Mar 14, 2024

Conversation

cdvonbargen
Copy link
Collaborator

Description

Added a pair of CMakeLIsts.txt and github runner yaml files for building:

  • all dependencies as described in external/
  • all the rdkit_extensions/sketcher library with a toy set of C++ files exercising the above dependencies

The cmake file in external/ uses ExternalProject_Add to pulls dependencies down from github, apply patches if necessary, and configure/build/install the dependency as static libs using cmake itself. The build-external/action.yml action will build one dependency library target in that cmake file if the requested version/os has not been built before, using actions/cache@v4. (Should I also cache on a SHA of the cmake file? a SHA of all of external?)

NOTE: the point of using ExternalProject_Add is to hopefully streamline a WASM build since everything is built with CMake.

There are two patches to the dependency libraries:

  • RDKit: a patch Ricardo gave me which allows RDKit to build static libraries
  • Qt: a patch that updates the QSvg repo dependency to the current name of the qtbase repository -- this goes away when we use a newer version of Qt

The toplevel cmake file builds the rdkit_extensions and sketcher libraries, tests for both libraries, and the sketcher_app executable. The interesting/different bit here is that because we compile static libs in the runners, both libraries require a define that clear out the declspec (LIBNAME_STATIC_DEFINE) which is the only small, necessary departure from our existing definition.h files (which are always used to build shared libraries).

I also have a script that will build this toy system using /software/lib/, but it sadly doesn't work for our installed RDKit builds (see SHARED-10015) so that will have to wait for another day.

List of things I didn't figure out:

  • build-external/action.yml's cache path and return value violate DRY but I don't know how to dedupe
  • CMAKE_ARGS does shenaigans with ; forcing me to use $<SEMICOLON> in a couple places
  • I omitted adding -fvisibility=hidden to mac/linux because I got ld: warning: direct access in function to global weak symbol from file means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings. when building against RDKit. I assume I need to pass that to RDK too, but we can spin that out as a separate ticket.

I can spin those out a cleanup case, but would be happy for any pointers!

Testing Done

Verified that the macOS runner succeeds; kicked out subtasks for linux, windows, and WASM

@cdvonbargen
Copy link
Collaborator Author

Just for reference, I abandoned #5 which uses FetchContent_Declare for this setup using ExternalProject_Add -- annoyingly, many projects don't adhere to CMake conventions that would make FetchContent_Declare friendly, so I just gave up.

.github/actions/build-external/action.yml Outdated Show resolved Hide resolved
.github/workflows/sketcher-builder.yml Outdated Show resolved Hide resolved
external/CMakeLists.txt Show resolved Hide resolved
.github/workflows/sketcher-builder.yml Outdated Show resolved Hide resolved
.github/workflows/sketcher-builder.yml Outdated Show resolved Hide resolved
Copy link

@ricrogz ricrogz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cdvonbargen cdvonbargen merged commit a58cdaf into schrodinger:main Mar 14, 2024
1 check passed
@cdvonbargen cdvonbargen deleted the ExternalProject_Add branch March 14, 2024 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants