Skip to content

Commit

Permalink
fix: use CMake for CCDB build
Browse files Browse the repository at this point in the history
@baltzell's fork of CCDB no longer uses `scons`; instead, CMake is now
used.
  • Loading branch information
c-dilks committed Dec 5, 2024
1 parent e87b57b commit 0a268b1
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 18 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
apt -y update
apt -y upgrade
apt -y install git python3-pip
python -m pip install scons meson ninja
python -m pip install meson ninja
- name: checkout repository
uses: actions/checkout@v4
Expand All @@ -31,7 +31,7 @@ jobs:
run: |
echo "CLAS12ROOT=$GITHUB_WORKSPACE" >> $GITHUB_ENV
echo "HIPO=$GITHUB_WORKSPACE/hipo" >> $GITHUB_ENV
echo "CCDB_HOME=$GITHUB_WORKSPACE/ccdb" >> $GITHUB_ENV
echo "CCDB_HOME=$GITHUB_WORKSPACE/ccdb_install" >> $GITHUB_ENV
echo "RCDB_HOME=$GITHUB_WORKSPACE/rcdb" >> $GITHUB_ENV
echo "QADB=$GITHUB_WORKSPACE/clas12-qadb" >> $GITHUB_ENV
Expand All @@ -50,9 +50,9 @@ jobs:

- name: build ccdb
run: |
cd $CCDB_HOME
source environment.bash
python $(which scons)
cmake -S ccdb -B ccdb_build --install-prefix $CCDB_HOME
cmake --build ccdb_build -j4
cmake --install ccdb_build
- name: build clas12root
run: |
Expand Down
19 changes: 9 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@ clas12root provides an interface to the clas12-qadb c++ code to allow skimming o

To simplify installation of the dependencies, ccdb, rcdb, qadb are now includes as submodules tagged to specific releases. Now when you clone with --recurse-submodules all 3 plus lz4 will also be downloaded into your clas12root directory. If you already have your own versions of these you may ignore these and just set the required paths to your own installation.

It is still required to build ccdb with scons after you have cloned it (before running installC12Root). You will need to make sure you have the necessary depndencies for ccdb on your system. If you do not and do not want to use ccdb in anycase you may just not set the CCDB_HOME enviroment variable. [https://github.com/JeffersonLab/ccdb]

cd ccdb
source environment.csh
scons
It is still required to build ccdb with CMake after you have cloned it (before running installC12Root); see below for example CMake commands. You will need to make sure you have the necessary depndencies for ccdb on your system. If you do not and do not want to use ccdb in anycase you may just not set the CCDB_HOME enviroment variable. [https://github.com/JeffersonLab/ccdb]

ccdb is prone to giving warnings when you try and compile ROOT scripts via macros. To get rid of these wanrings you may need to copy the Directory.h file from ccdb_patch.

Expand Down Expand Up @@ -111,14 +107,17 @@ setenv CXX /myz/c++
```
Or just set the paths to CC and CXX directly.

Remember to build ccdb with scons if you are using it before installing clas12root. If you alredy have CCDB_HOME set to somewhere else on your system then you will not need to do this.
Remember to build ccdb with CMake if you are using it before installing clas12root. If you alredy have CCDB_HOME set to somewhere else on your system then you will not need to do this. For example,

```bash
cd ccdb
source environment.csh
scons
cd..
cmake -S ccdb -B ccdb_build --install-prefix $CCDB_HOME # where CCDB_HOME is your preferred installation location for CCDB
cmake --build ccdb_build
cmake --install ccdb_build
```

Then build clas12root:

```bash
installC12Root
```

Expand Down
2 changes: 1 addition & 1 deletion ccdb
4 changes: 2 additions & 2 deletions installDBs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ setenv RCDB_HOME $PWD/rcdb
cd ccdb
source environment.csh

scons
scons ## FIXME: use CMake

cd $CLAS12ROOT
cd $CLAS12ROOT

0 comments on commit 0a268b1

Please sign in to comment.