From 141a29a6582f35ba03b6e65351ec7f844ab72f43 Mon Sep 17 00:00:00 2001 From: jml985 <44065529+jml985@users.noreply.github.com> Date: Thu, 1 Feb 2024 20:40:06 -0500 Subject: [PATCH 1/6] Disable logging outside of local domain, with no other changes (#644) Clean version of the pull request disabling DAQ logging when compiling outside of the local domain. --- StRoot/RTS/include/rtsLog.h | 45 +++++++-------------------------- StRoot/RTS/src/LOG/Makefile | 3 ++- StRoot/RTS/src/LOG/rtsLog.C | 2 +- StRoot/RTS/src/LOG/rtsLogUnix.c | 33 +++++++++++++++++++++--- StRoot/RTS/src/rtsmakefile.def | 43 +++++++++++++++++++++++++++++-- 5 files changed, 82 insertions(+), 44 deletions(-) diff --git a/StRoot/RTS/include/rtsLog.h b/StRoot/RTS/include/rtsLog.h index cb5d5749ca0..87fc4d9e7a4 100755 --- a/StRoot/RTS/include/rtsLog.h +++ b/StRoot/RTS/include/rtsLog.h @@ -93,41 +93,14 @@ void rtsLogAddJmlFile (char *fname); -/*Tonko: not used Special (mis)handling for STAR Offline Code -#ifdef __ROOT__ -#define RTS_DISABLE_LOG -#endif -*/ -#ifdef RTS_DISABLE_LOG - -#define RTS_ASSERT(expr) assert(expr) - - - #define LOG(SEV,STRING,ARGS...) \ - do { \ - const char *const yada = SEV ; \ - if((*yada == 'E')) { \ - fprintf(stderr,"" ANSI_RED "RTS_" SEV ": " __FILE__ " [line %d]: " STRING "" ANSI_RESET "\n" , __LINE__ , ##ARGS) ;\ - } \ - else if((*yada == 'C')) { \ - fprintf(stderr,"" ANSI_RED "" ANSI_REVERSE "RTS_" SEV ": " __FILE__ " [line %d]: " STRING "" ANSI_RESET "\n" , __LINE__ , ##ARGS) ;\ - } \ - else if((*yada == 'I')) { \ - fprintf(stderr,"" ANSI_BLUE "" ANSI_BOLD "RTS_" SEV ": " __FILE__ " [line %d]: " STRING "" ANSI_RESET "\n" , __LINE__ , ##ARGS) ;\ - } \ - else if((*yada == 'T')) { \ - fprintf(stderr,"" ANSI_GREEN "" ANSI_BOLD "RTS_" SEV ": " __FILE__ " [line %d]: " STRING "" ANSI_RESET "\n" , __LINE__ , ##ARGS) ;\ - } \ - else if((*yada == 'W')) { \ - fprintf(stderr,"" ANSI_CYAN "" ANSI_BOLD "RTS_" SEV ": " __FILE__ " [line %d]: " STRING "" ANSI_RESET "\n" , __LINE__ , ##ARGS) ;\ - } \ - else if((*yada == 'O')) { \ - fprintf(stderr,"" ANSI_BLUE "" ANSI_REVERSE "RTS_" SEV ": " __FILE__ " [line %d]: " STRING "" ANSI_RESET "\n" , __LINE__ , ##ARGS) ;\ - } \ - } while(0) \ +#ifndef RTS_ENABLE_LOG +#define RTS_ASSERT(expr) assert(expr) +#define LOG(SEV,STRING,ARGS...) +#define rtsLogUnix_v(str, ...) +#define rtsLogAddCmd(x) // the following become noops... @@ -136,7 +109,7 @@ void rtsLogAddJmlFile (char *fname); #define rtsLogLevelInt(x) #define rtsLogOutput(x) -#else /* RTS_DISABLE_LOG */ +#else /* RTS_ENABLE_LOG */ #ifdef __GNUC__ @@ -270,12 +243,12 @@ INLINE_HACK void rtsLogLevel(const char *level) -#endif +#endif /* RTS_LOG_COLORED */ -#endif +#endif /* __vxworks */ -#endif /* RTS_DISABLE_LOG */ +#endif /* RTS_ENABLE_LOG */ #ifdef __cplusplus } diff --git a/StRoot/RTS/src/LOG/Makefile b/StRoot/RTS/src/LOG/Makefile index 8107ebe358f..c1447ead38a 100755 --- a/StRoot/RTS/src/LOG/Makefile +++ b/StRoot/RTS/src/LOG/Makefile @@ -2,6 +2,7 @@ include ../rtsmakefile.def include ../rtsplus.def + # zap LDLIBS LDLIBS = @@ -28,7 +29,7 @@ rtsLog.o : rtsLog.C rtsLog: rtsLog.o rtsLogUnix.o $(CXX) $(CXXFLAGS) rtsLogUnix.o rtsLog.o -o rtsLog - + #operDisplay.sh: diff --git a/StRoot/RTS/src/LOG/rtsLog.C b/StRoot/RTS/src/LOG/rtsLog.C index 481ebdfe1b6..b9aa11ed557 100644 --- a/StRoot/RTS/src/LOG/rtsLog.C +++ b/StRoot/RTS/src/LOG/rtsLog.C @@ -35,7 +35,7 @@ int main(int argc, char *argv[]) use_stdin = 0 ; rtsLogLevel(DBG) ; - rtsLogOutput(RTS_LOG_NET) ; + //rtsLogOutput(RTS_LOG_NET) ; memset(logstr,0,sizeof(logstr)) ; diff --git a/StRoot/RTS/src/LOG/rtsLogUnix.c b/StRoot/RTS/src/LOG/rtsLogUnix.c index c48799c7d8d..5f331b5ce05 100755 --- a/StRoot/RTS/src/LOG/rtsLogUnix.c +++ b/StRoot/RTS/src/LOG/rtsLogUnix.c @@ -29,7 +29,28 @@ extern "C" { volatile int tonkoLogLevel = 2 ; -static char *getCmd(void) ; +#ifdef RTS_ENABLE_LOG +#warning "DAQ logging is enabled" +#ifdef RTS_LOG_DEFAULT_NET +#warning "DAQ logging defaults to daqman" +#else +#warning "DAQ logging defaults to STDERR" +#endif /* RTS_LOG_DEFAULT_NET */ +#else +#warning "DAQ logging is disabled" +#endif /* RTS_ENABLE_LOG */ + + +#ifdef RTS_ENABLE_LOG + +#ifdef RTS_LOG_DEFAULT_NET +static int output_flag = RTS_LOG_NET ; +#else +static int output_flag = RTS_LOG_STDERR ; +#endif + +static const char *getCmd(void) ; + static int odesc = -1 ; static int handchange ; static FILE *fdesc = 0 ; @@ -42,7 +63,7 @@ static char servER[80] = RTS_LOG_HOST ; #endif static int port = RTS_LOG_PORT ; -static int output_flag = RTS_LOG_NET ; + static char cmd[1024] ; /* @@ -113,7 +134,6 @@ void rtsLogAddJmlFile (char *fname) jml_fname = _g_fname; } - int rtsLogUnix_v(const char *str, ...) { /* common to all threads */ @@ -330,7 +350,7 @@ int rtsLogUnix_v(const char *str, ...) -static char *getCmd(void) +static const char *getCmd(void) { @@ -370,6 +390,11 @@ static char *getCmd(void) #endif } + +#endif + + + #ifdef __cplusplus } #endif diff --git a/StRoot/RTS/src/rtsmakefile.def b/StRoot/RTS/src/rtsmakefile.def index b22ce170a78..7f0b82f740c 100755 --- a/StRoot/RTS/src/rtsmakefile.def +++ b/StRoot/RTS/src/rtsmakefile.def @@ -17,6 +17,8 @@ ifeq ($(HOST_NAME),daqman.starp.bnl.gov) endif +HOSTDOMAIN = $(shell hostname -d) + # jml... TARGET_CPU_STRING to mean the full string... # go from "uname" to gcc -mcpu=TARGET_CPU variant @@ -372,8 +374,41 @@ endif DEFINES = -D_REENTRANT ${RTS_DAQMAN_FLAGS} -DRTS_HOST_NAME=\"${HOST_NAME}\" -DTARGET_SYSTEM=\"${TARGET_SYSTEM}\" -DPROJDIR=\"${PROJDIR}\" -DINSTALL_SUFFIX=\"${INSTALL_SUFFIX}\" -D${RTS_TYPE} ${HOW} ${HOSTDEFINES} -DRTS_ONLINE -BASEFLAGS = -O3 -Wall -pipe -fverbose-asm ${HOSTFLAGS} -#BASEFLAGS= -Wall -pipe -fverbose-asm ${HOSTFLAGS} +# Set strict errors in LINUX +BASEFLAGS = -O3 -Wall -Wno-error=strict-overflow -Wno-error=maybe-uninitialized -Wno-error=unused-label -Wno-error=unused-value -Wno-error=unused-variable -Wno-error=unused-function -Wno-unused-but-set-variable -pipe -fverbose-asm ${HOSTFLAGS} + + +#-O3 +ifneq (${TARGET_SYSTEM}, LINUX) + BASEFLAGS = -Wall -pipe -fverbose-asm ${HOSTFLAGS} +endif + +ifeq (${HOST_NAME},xvme01.daq.bnl.local) + BASEFLAGS = -O3 -Wall -Wno-error=strict-overflow -Wno-error=unused-label -Wno-error=unused-value -Wno-error=unused-variable -Wno-error=unused-function -Wno-unused-but-set-variable -pipe -fverbose-asm ${HOSTFLAGS} +endif + +# if not compiling on one of the standard domains, then +# use the default log destination of std_err +# if compiling on local domain, write to daqman +# +# if compiling somewhere else for writing to daqman these defines +ifeq (${HOSTDOMAIN},starp.bnl.gov) + DEFINES += -DRTS_LOG_DEFAULT_NET + DEFINES += -DRTS_ENABLE_LOG +else ifeq (${HOSTDOMAIN},daq.bnl.local) + DEFINES += -DRTS_LOG_DEFAULT_NET + DEFINES += -DRTS_ENABLE_LOG +else ifeq (${HOSTDOMAIN},daq2.bnl.local) + DEFINES += -DRTS_LOG_DEFAULT_NET + DEFINES += -DRTS_ENABLE_LOG +else ifeq (${HOSTDOMAIN},trg.bnl.local) + DEFINES += -DRTS_LOG_DEFAULT_NET + DEFINES += -DRTS_ENABLE_LOG +else ifeq (${HOSTDOMAIN},l4.bnl.local) + DEFINES += -DRTS_LOG_DEFAULT_NET + DEFINES += -DRTS_ENABLE_LOG +endif + CCFLAGS = ${BASEFLAGS} ${USRCCFLAGS} ${DEFINES} ${INCLUDES} CXXFLAGS = ${BASEFLAGS} ${USRCXXFLAGS} ${DEFINES} ${INCLUDES} CFLAGS = ${BASEFLAGS} ${USRCFLAGS} ${DEFINES} ${INCLUDES} @@ -387,6 +422,10 @@ ifeq ($(RTS_PROJECT),PP2PP) endif endif + + + + # noticed problems on Linux where the default linker gcc doesn't work well for g++ compiled # files LINK.o = $(CXX) $(LDFLAGS) $(TARGET_ARCH) From d3c9d751b34ce92944d2d21e6d7fbe47c71d9a1b Mon Sep 17 00:00:00 2001 From: Dmitri Smirnov Date: Tue, 13 Feb 2024 18:39:04 -0500 Subject: [PATCH 2/6] build: sync CI machinery with SL23f_2 --- .github/workflows/build-containers.yml | 101 +++++++++---------- .github/workflows/build-pull-request.yml | 118 +++++++++++++++++++++++ .github/workflows/ci-build.yml | 102 -------------------- .github/workflows/delete_untagged.py | 25 +++++ 4 files changed, 189 insertions(+), 157 deletions(-) create mode 100644 .github/workflows/build-pull-request.yml delete mode 100644 .github/workflows/ci-build.yml create mode 100755 .github/workflows/delete_untagged.py diff --git a/.github/workflows/build-containers.yml b/.github/workflows/build-containers.yml index e9f441db5b7..cb5aaf35d52 100644 --- a/.github/workflows/build-containers.yml +++ b/.github/workflows/build-containers.yml @@ -9,78 +9,69 @@ on: - '*' jobs: - ROOT5: + build: if: github.repository_owner == 'star-bnl' runs-on: ubuntu-latest + strategy: + matrix: + starenv: [root5] + compiler: [gcc485] + env: + STARENV: ${{ matrix.starenv }}-${{ matrix.compiler }} steps: - name: Get branch name id: branch-name - uses: tj-actions/branch-names@v4.8 + uses: tj-actions/branch-names@v6 + + - name: Define complete image tag + run: | + echo "TAG=${{ steps.branch-name.outputs.current_branch || steps.branch-name.outputs.tag }}-${{ env.STARENV }}" >> $GITHUB_ENV - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v2 - name: Login to GitHub Container Registry - uses: docker/login-action@v1 + uses: docker/login-action@v2 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Rebuild up to base-stage - uses: docker/build-push-action@v2 + - name: Build a release container + uses: docker/build-push-action@v3 with: - cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/star-sw-root5-base:cache - file: docker/Dockerfile.root5 - target: base-stage - push: true - tags: ghcr.io/${{ github.repository_owner }}/star-sw-root5-base:${{ steps.branch-name.outputs.current_branch }}_latest - cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/star-sw-root5-base:cache,mode=max + build-args: | + starenv=${{ matrix.starenv }} + compiler=${{ matrix.compiler }} + load: true + tags: ghcr.io/${{ github.repository_owner }}/star-sw:${{ env.TAG }} - - name: Build release container - if: steps.branch-name.outputs.is_tag == 'true' - uses: docker/build-push-action@v2 - with: - cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/star-sw-root5-base:cache - file: docker/Dockerfile.root5 - target: build-stage - push: true - tags: ghcr.io/${{ github.repository_owner }}/star-sw-root5-build:${{ steps.branch-name.outputs.tag }} + - name: Push container image + run: | + docker push ghcr.io/${{ github.repository_owner }}/star-sw:${{ env.TAG }} - ROOT6: - if: github.repository_owner == 'star-bnl' - runs-on: ubuntu-latest - steps: - - name: Get branch name - id: branch-name - uses: tj-actions/branch-names@v4.8 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + - name: Create latest tag for default branch + if: ${{ steps.branch-name.outputs.is_tag == 'false' && steps.branch-name.outputs.is_default == 'true' && env.STARENV == 'root5-gcc485' }} + run: | + docker tag ghcr.io/${{ github.repository_owner }}/star-sw:${{ env.TAG }} ghcr.io/${{ github.repository_owner }}/star-sw:latest + docker push ghcr.io/${{ github.repository_owner }}/star-sw:latest - - name: Login to GitHub Container Registry - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + - name: Create latest tag for SL* branches + if: ${{ steps.branch-name.outputs.is_tag == 'false' && steps.branch-name.outputs.is_default == 'false' && env.STARENV == 'root5-gcc485' }} + run: | + docker tag ghcr.io/${{ github.repository_owner }}/star-sw:${{ env.TAG }} ghcr.io/${{ github.repository_owner }}/star-sw:${{ steps.branch-name.outputs.current_branch }} + docker push ghcr.io/${{ github.repository_owner }}/star-sw:${{ steps.branch-name.outputs.current_branch }} - - name: Rebuild up to base-stage - uses: docker/build-push-action@v2 - with: - cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/star-sw-root6-base:cache - file: docker/Dockerfile.root6 - target: base-stage - push: true - tags: ghcr.io/${{ github.repository_owner }}/star-sw-root6-base:${{ steps.branch-name.outputs.current_branch }}_latest - cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/star-sw-root6-base:cache,mode=max + - name: Create image tag based on pushed tag + if: ${{ steps.branch-name.outputs.is_tag == 'true' && env.STARENV == 'root5-gcc485' }} + run: | + docker tag ghcr.io/${{ github.repository_owner }}/star-sw:${{ env.TAG }} ghcr.io/${{ github.repository_owner }}/star-sw:${{ steps.branch-name.outputs.tag }} + docker push ghcr.io/${{ github.repository_owner }}/star-sw:${{ steps.branch-name.outputs.tag }} - - name: Build release container - if: steps.branch-name.outputs.is_tag == 'true' - uses: docker/build-push-action@v2 - with: - cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/star-sw-root6-base:cache - file: docker/Dockerfile.root6 - target: build-stage - push: true - tags: ghcr.io/${{ github.repository_owner }}/star-sw-root6-build:${{ steps.branch-name.outputs.tag }} + build-cleanup: + runs-on: ubuntu-latest + needs: build + steps: + - name: Checkout + uses: actions/checkout@v3 + - run: .github/workflows/delete_untagged.py ${{ secrets.STAR_BNL_STAR_SW_TOKEN }} diff --git a/.github/workflows/build-pull-request.yml b/.github/workflows/build-pull-request.yml new file mode 100644 index 00000000000..bf46bc9bf95 --- /dev/null +++ b/.github/workflows/build-pull-request.yml @@ -0,0 +1,118 @@ +name: Build Pull Request + +on: + pull_request: + paths-ignore: + - '.github/**' + - 'docs/**' + - '!.github/workflows/**' + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + starenv: [root5] + compiler: [gcc485] + env: + STARENV: ${{ matrix.starenv }}-${{ matrix.compiler }} + steps: + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + with: + driver-opts: env.BUILDKIT_STEP_LOG_MAX_SIZE=10000000 + + - name: Build with Docker + uses: docker/build-push-action@v3 + with: + build-args: | + starenv=${{ matrix.starenv }} + compiler=${{ matrix.compiler }} + tags: ghcr.io/star-bnl/star-sw-${{ env.STARENV }} + outputs: type=docker,dest=/tmp/star-sw-${{ env.STARENV }}.tar + + - name: Save built image for test jobs + uses: actions/upload-artifact@v3 + with: + name: star-sw-${{ env.STARENV }} + path: /tmp/star-sw-${{ env.STARENV }}.tar + + test: + runs-on: ubuntu-latest + needs: build + strategy: + fail-fast: false + matrix: + test_id: [10, 11, 22, 23, 24, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 59, 60, 76, 77, 78, 90, 91, 92, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121] + starenv: [root5] + compiler: [gcc485] + env: + STARENV: ${{ matrix.starenv }}-${{ matrix.compiler }} + steps: + - name: Download artifact + uses: actions/download-artifact@v3 + with: + name: star-sw-${{ env.STARENV }} + path: /tmp + + - run: docker load --input /tmp/star-sw-${{ env.STARENV }}.tar + - run: docker run --name star-test-data --volume /star ghcr.io/star-bnl/star-test-data:v7 + - run: | + TEST_CMD=$(docker run --rm ghcr.io/star-bnl/star-sw-${{ env.STARENV }} tests/executest.py -c ${{ matrix.test_id }}) + # Workaround https://sft.its.cern.ch/jira/browse/ROOT-7660 in ROOT 5 by checking the output log + docker run --volumes-from star-test-data ghcr.io/star-bnl/star-sw-${{ env.STARENV }} \ + sh -c "set -e; MALLOC_CHECK_=3 $TEST_CMD 2>&1 | tee log; grep 'Run completed' log" + + ROOT5_test_doEvents: + runs-on: ubuntu-latest + needs: build + strategy: + fail-fast: false + matrix: + test_id: [121, 122] + compiler: [gcc485] + env: + STARENV: root5-${{ matrix.compiler }} + steps: + - name: Download artifact + uses: actions/download-artifact@v3 + with: + name: star-sw-${{ env.STARENV }} + path: /tmp + + - run: docker load --input /tmp/star-sw-${{ env.STARENV }}.tar + - run: docker run --name star-test-data --volume /star ghcr.io/star-bnl/star-test-data:v7 + - run: | + TEST_FILE=$(echo "$(docker run --rm ghcr.io/star-bnl/star-sw-${{ env.STARENV }} tests/executest.py ${{ matrix.test_id }} -a fullpath)" | sed -E 's/\.(daq|fzd)$/.event.root/') + TEST_CMD="root4star -b -q -l 'StRoot/macros/analysis/doEvents.C(100, \"$TEST_FILE\")'" + docker run --volumes-from star-test-data ghcr.io/star-bnl/star-sw-${{ env.STARENV }} \ + sh -c "set -e; $TEST_CMD 2>&1 | tee log; grep ' IO:' log" + + ROOT5_test_find_vertex: + runs-on: ubuntu-latest + needs: build + strategy: + fail-fast: false + matrix: + test_id: [102, 121, 122] + compiler: [gcc485] + env: + STARENV: root5-${{ matrix.compiler }} + steps: + - name: Download artifact + uses: actions/download-artifact@v3 + with: + name: star-sw-${{ env.STARENV }} + path: /tmp + + - run: docker load --input /tmp/star-sw-${{ env.STARENV }}.tar + - run: docker run --name star-test-data --volume /star ghcr.io/star-bnl/star-test-data:v7 + - run: | + TEST_FILE=$(echo "$(docker run --rm ghcr.io/star-bnl/star-sw-${{ env.STARENV }} tests/executest.py ${{ matrix.test_id }} -a fullpath)" | sed -E 's/\.(daq|fzd)$/.event.root/') + TEST_CMD="root4star -b -q -l 'StRoot/macros/analysis/find_vertex.C(\"$TEST_FILE\")'" + docker run --volumes-from star-test-data ghcr.io/star-bnl/star-sw-${{ env.STARENV }} \ + sh -c "set -e; $TEST_CMD 2>&1 | tee log; grep ' StIO:' log" diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml deleted file mode 100644 index 09084c9d74b..00000000000 --- a/.github/workflows/ci-build.yml +++ /dev/null @@ -1,102 +0,0 @@ -name: CI Build - -on: [pull_request] - -jobs: - ROOT5: - runs-on: ubuntu-latest - steps: - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - with: - driver-opts: env.BUILDKIT_STEP_LOG_MAX_SIZE=10000000 - - - name: Build with Docker - uses: docker/build-push-action@v2 - with: - cache-from: type=registry,ref=ghcr.io/star-bnl/star-sw-root5-base@sha256:4bed8a8b729fa9e6c8e92b2bdecd6b73869e67a07bfbde969936f921123d4c3e - push: false - tags: ghcr.io/star-bnl/star-sw-root5-build - file: docker/Dockerfile.root5 - outputs: type=docker,dest=/tmp/star-sw-root5-build.tar - - - name: Save built image for test jobs - uses: actions/upload-artifact@v2 - with: - name: star-sw-root5-build - path: /tmp/star-sw-root5-build.tar - - ROOT6: - runs-on: ubuntu-latest - steps: - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - with: - driver-opts: env.BUILDKIT_STEP_LOG_MAX_SIZE=10000000 - - - name: Build with Docker - uses: docker/build-push-action@v2 - with: - cache-from: type=registry,ref=ghcr.io/star-bnl/star-sw-root6-base@sha256:107736be0e111ef9eaac37281f9bcad95769ab3ce75a4c9624d8cea98b1eb966 - push: false - tags: ghcr.io/star-bnl/star-sw-root6-build - file: docker/Dockerfile.root6 - outputs: type=docker,dest=/tmp/star-sw-root6-build.tar - - - name: Save built image for test jobs - uses: actions/upload-artifact@v2 - with: - name: star-sw-root6-build - path: /tmp/star-sw-root6-build.tar - - ROOT5_test_setup: - runs-on: ubuntu-latest - needs: ROOT5 - outputs: - matrix: ${{ steps.set-matrix.outputs.matrix }} - steps: - - uses: actions/checkout@v2 - - run: echo "::set-output name=matrix::" $(cat tests/joblist_ci.json) - id: set-matrix - - ROOT5_test: - runs-on: ubuntu-latest - needs: ROOT5_test_setup - strategy: - matrix: - test_id: ${{ fromJSON(needs.ROOT5_test_setup.outputs.matrix) }} - steps: - - name: Download artifact - uses: actions/download-artifact@v2 - with: - name: star-sw-root5-build - path: /tmp - - - run: docker load --input /tmp/star-sw-root5-build.tar - - run: docker run --name star-test-data --volume /star ghcr.io/star-bnl/star-test-data:v2 - - run: | - TEST_CMD=$(docker run --rm ghcr.io/star-bnl/star-sw-root5-build star-sw/tests/executest.py -c ${{ matrix.test_id }}) - # Workaround https://sft.its.cern.ch/jira/browse/ROOT-7660 in ROOT 5 by checking the output log - docker run --volumes-from star-test-data ghcr.io/star-bnl/star-sw-root5-build \ - sh -c "set -e; MALLOC_CHECK_=3 $TEST_CMD 2>&1 | tee log; grep 'Run completed' log" - - ROOT6_test_ignore_fail: - runs-on: ubuntu-latest - needs: ROOT6 - continue-on-error: ${{ matrix.experimental }} - strategy: - matrix: - test_id: [50, 52, 54, 90, 91, 92, 119, 120] - experimental: [true] - steps: - - name: Download artifact - uses: actions/download-artifact@v2 - with: - name: star-sw-root6-build - path: /tmp - - - run: docker load --input /tmp/star-sw-root6-build.tar - - run: docker run --name star-test-data --volume /star ghcr.io/star-bnl/star-test-data:v2 - - run: | - TEST_CMD=$(docker run --rm ghcr.io/star-bnl/star-sw-root6-build star-sw/tests/executest.py -c ${{ matrix.test_id }}) - docker run --volumes-from star-test-data ghcr.io/star-bnl/star-sw-root6-build sh -c "MALLOC_CHECK_=3 $TEST_CMD || echo 'Failed with an exit code: '\$?" diff --git a/.github/workflows/delete_untagged.py b/.github/workflows/delete_untagged.py new file mode 100755 index 00000000000..f5a5f98096b --- /dev/null +++ b/.github/workflows/delete_untagged.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python3 + +import argparse +import json +import requests +import types + +parser = argparse.ArgumentParser() +parser.add_argument("token", help="GitHub token") +args = parser.parse_args() + +domain = "api.github.com" +org = "star-bnl" +package_type = "container" +package_name = "star-sw" + +api_url = f"https://{domain}/orgs/{org}/packages/{package_type}/{package_name}/versions" + +respjson = requests.get(api_url, auth=("token", args.token)) +entries = json.loads(respjson.text, object_hook=lambda d: types.SimpleNamespace(**d)) + +for e in entries: + if not e.metadata.container.tags: + response = requests.delete(api_url + f"/{e.id}", auth=("token", args.token)) + print("delete", e.id, e.html_url, e.name, response.url, response.status_code) From c10a34714240939e7c26debbdfd6731888d5b537 Mon Sep 17 00:00:00 2001 From: Dmitri Smirnov Date: Tue, 13 Feb 2024 19:01:30 -0500 Subject: [PATCH 3/6] build: sync Dockerfile and mgr/ with SL23f_2 --- Dockerfile | 40 ++++ docker/Dockerfile.root5 | 139 ------------- docker/Dockerfile.root6 | 143 ------------- mgr/ConsDefs.pm | 230 +++++++-------------- mgr/Conscript-standard | 42 ++-- mgr/Construct | 36 +++- mgr/config/v0.2.3-rhel7-root5.34.38.config | 17 ++ mgr/config/v0.2.3-rhel7-root6.16.00.config | 18 ++ mgr/config/v0.2.3-rhel7-root6.24.06.config | 18 ++ mgr/config/v0.3.0-rhel7-root5.34.38.config | 16 ++ mgr/config/v0.3.0-rhel7-root6.16.00.config | 16 ++ mgr/config/v0.3.0-rhel7-root6.24.06.config | 16 ++ mgr/default.config | 16 ++ mgr/warnoff_dirs.txt | 126 +++++++++++ 14 files changed, 405 insertions(+), 468 deletions(-) create mode 100644 Dockerfile delete mode 100644 docker/Dockerfile.root5 delete mode 100644 docker/Dockerfile.root6 create mode 100644 mgr/config/v0.2.3-rhel7-root5.34.38.config create mode 100644 mgr/config/v0.2.3-rhel7-root6.16.00.config create mode 100644 mgr/config/v0.2.3-rhel7-root6.24.06.config create mode 100644 mgr/config/v0.3.0-rhel7-root5.34.38.config create mode 100644 mgr/config/v0.3.0-rhel7-root6.16.00.config create mode 100644 mgr/config/v0.3.0-rhel7-root6.24.06.config create mode 100644 mgr/default.config create mode 100644 mgr/warnoff_dirs.txt diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000000..1aee302f9d0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,40 @@ +# syntax=docker/dockerfile:latest + +ARG starenv=root5 + +# Pick one from [gcc485, gcc11] +ARG compiler=gcc485 + +FROM ghcr.io/star-bnl/star-spack:v0.3.0-${starenv}-${compiler} + +ARG compiler + +ENV NODEBUG=yes +ENV STAR=/star-sw +ENV STAR_LIB=$STAR/.${STAR_HOST_SYS}/LIB +ENV STAR_BIN=$STAR/.${STAR_HOST_SYS}/BIN +ENV STAR_SYS=x8664_sl7 +ENV PATH=$STAR_BIN:$STAR/mgr:$PATH +ENV LD_LIBRARY_PATH=$STAR_LIB:$LD_LIBRARY_PATH +ENV ROOT_INCLUDE_PATH=$STAR/.${STAR_HOST_SYS}/include + +WORKDIR ${STAR} +COPY . ${STAR} + +SHELL ["/bin/bash", "-l", "-c"] + +RUN < root4star_cons.patch <<<$'\ -diff --git a/asps/rexe/Conscript b/asps/rexe/Conscript \n\ ---- a/asps/rexe/Conscript \n\ -+++ b/asps/rexe/Conscript \n\ -@@ -79,9 +79,7 @@ \n\ - } \n\ - $LIBS .= " -lgeant321 -lgcalor"; \n\ - $LIBS .= " " . $env->{CERNLIBS};\n\ --$LIBS .= $env->{LDALL};\n\ - $LIBS .= " " . $env->{Packages}->{MYSQL}->{LIBS};\n\ --$LIBS .= $env->{LDNONE};\n\ - $LIBS .= " " . $FLIBS . " " . $env->{CLIBS};# " " . $env->{SYSLIBS} ;\n\ - if ($STAR_SYS =~ /^sun4x_5.$/) {\n\ - if ($LIBPATH) { $LIBPATH .= $main::PATH_SEPARATOR; }\n' \ - && patch -p1 < root4star_cons.patch - -RUN source /etc/profile \ - && cd /star-sw \ - && cons \ - && find /star-sw/.$STAR_HOST_SYS -name *.o -exec rm '{}' \; - -RUN install /star-sw/StRoot/macros/.rootrc . - -# One might expect the single ENTRYPOINT command below to work but for some -# reason it chokes on a complex command such as -# -# docker run image root4star -b 'bfc.C(10, "opt1", "infile.root")' -# -#ENTRYPOINT ["/bin/bash", "--rcfile", "/etc/profile", "-l", "-c"] - -RUN install -m 755 <(echo $'#!/bin/sh\n . /etc/profile; exec "$@"') entrypoint.sh -ENTRYPOINT ["./entrypoint.sh"] -CMD ["/bin/bash"] diff --git a/docker/Dockerfile.root6 b/docker/Dockerfile.root6 deleted file mode 100644 index c210de17b56..00000000000 --- a/docker/Dockerfile.root6 +++ /dev/null @@ -1,143 +0,0 @@ -# Pull SL7 image by digest (immutable identifier) -FROM scientificlinux/sl@sha256:437d3402c454319a5443bb5a99844c8d6f454828c59dcfb2730f1bdff8f2f48c AS prep-stage - -SHELL ["/bin/bash", "-c"] -ENV LC_ALL=en_US.UTF-8 - -RUN yum update -q -y \ - && yum install -y \ - gcc gcc-c++ gcc-gfortran \ - git bzip2 unzip file which make imake patch \ - flex-devel libcurl-devel \ - perl perl-Data-Dumper \ - lapack-static blas-static \ - libX11-devel libXext-devel libXpm-devel openmotif-devel \ - && yum clean all - -# Install cernlib -RUN mkdir /cern && cd /cern \ - && curl -sL https://github.com/psilib/cernlib/archive/centos7.tar.gz | tar -xz --strip-components 1 \ - && ./build_cernlib.sh \ - && mv /usr/lib64/libblas.a /cern/2006/lib/libblas.a \ - && mv /usr/lib64/liblapack.a /cern/2006/lib/liblapack3.a \ - && ln -s 2006 /cern/pro \ - && rm -fr /cern/2006/src /cern/2006/build - -RUN mkdir -p star-spack \ - && curl -sL https://github.com/star-bnl/star-spack/archive/fba3a3ffbafc0c77fa46085d807b717ca807f345.tar.gz | tar -xz --strip-components 1 -C star-spack \ - && curl -sL https://github.com/spack/spack/archive/010e5761d6631eae102d1eec87e5e74a0e16ed82.tar.gz | tar -xz --strip-components 1 -C star-spack/spack - -RUN source star-spack/setup.sh \ - && spack env create star-env-root star-spack/environments/star-x86_64-root-6.16.00-container.yaml \ - && spack env activate star-env-root \ - && spack install -j 5 --fail-fast \ - && spack gc -y \ - && spack clean --all \ - && spack uninstall --force -y llvm \ - # Create star-spack/spack/var/spack/environments/star-env-root/loads - && spack -e star-env-root env loads - -# Strip all the binaries -RUN find -L /opt/software/* -type f -exec readlink -f '{}' \; | \ - xargs file -i | \ - grep 'charset=binary' | \ - grep 'x-executable\|x-archive\|x-sharedlib' | \ - awk -F: '{print $1}' | xargs strip -S - - -FROM scientificlinux/sl@sha256:437d3402c454319a5443bb5a99844c8d6f454828c59dcfb2730f1bdff8f2f48c AS base-stage - -SHELL ["/bin/bash", "-c"] -ENV LC_ALL=en_US.UTF-8 - -COPY --from=prep-stage /opt/software /opt/software -COPY --from=prep-stage /cern /cern -COPY --from=prep-stage /star-spack/spack/var/spack/environments/star-env-root/loads /etc/profile.d/z10_load_spack_env_modules.sh -COPY --from=prep-stage /star-spack/spack/share/spack/modules/linux-scientific7-x86_64 /opt/linux-scientific7-x86_64 - -# epel repo is for python-pip only -RUN yum update -q -y \ - && yum install -y epel-release \ - && yum install -y \ - binutils gcc gcc-c++ gcc-gfortran \ - git bzip2 file which make patch \ - bison byacc flex flex-devel libcurl-devel \ - perl perl-Env perl-Digest-MD5 \ - libX11-devel libXext-devel libXpm-devel libXt-devel \ - python python-pip \ - environment-modules \ - && yum clean all - -# Install extra python modules used by the STAR software -RUN pip install pyparsing - -ENV MODULEPATH=/opt/linux-scientific7-x86_64 - -ENV STAR=/star-sw -ENV USE_64BITS=1 -ENV CERN=/cern -ENV CERN_LEVEL=pro -ENV CERN_ROOT=$CERN/$CERN_LEVEL -ENV OPTSTAR=/opt/software -ENV STAR_HOST_SYS=sl79_gcc485 -ENV NODEBUG=yes -ENV STAR_LIB=$STAR/.${STAR_HOST_SYS}/LIB -ENV STAR_BIN=$STAR/.${STAR_HOST_SYS}/BIN -ENV STAR_SYS=x8664_sl7 -ENV PATH=$CERN_ROOT/bin:$STAR_BIN:$STAR/mgr:$PATH -ENV LD_LIBRARY_PATH=$STAR_LIB:$LD_LIBRARY_PATH -ENV LIBPATH+=:/lib64:/lib -ENV ROOT_INCLUDE_PATH=$STAR/.${STAR_HOST_SYS}/include - -ENV MYSQL=/opt/software/linux-scientific7-x86_64/gcc-4.8.5/mysql-5.7.27-pfyt3fwtkubcc5eazmoqfick3lgp67mf -ENV LIBXML2_DIR=/opt/software/linux-scientific7-x86_64/gcc-4.8.5/libxml2-2.9.10-4lxsmpa57bm3xs2cs3xapk3qccxflkfl -ENV Vc_DIR=/opt/software/linux-scientific7-x86_64/gcc-4.8.5/vc-1.4.1-xdb5jhivtn2rejvvfs2whrf4nx4lxwbi -ENV FASTJET_DIR=/opt/software/linux-scientific7-x86_64/gcc-4.8.5/fastjet-3.3.3-xj22tput5pd5atejy4igsrtgdtygi74u -ENV GSL_DIR=/opt/software/linux-scientific7-x86_64/gcc-4.8.5/gsl-2.6-ao26bt7pm6xxywo2q7dcmhhg2lp2inx7 - -# Dummy directories checked by cons -RUN mkdir $OPTSTAR/lib && mkdir $OPTSTAR/include -RUN ln -s $MYSQL/include /usr/include/mysql - - -FROM base-stage AS build-stage - -COPY . /star-sw - -# XXX TEMP XXX: Don't force mysql static libraries to be linked into root4star -RUN cd /star-sw \ - && cat > root4star_cons.patch <<<$'\ -diff --git a/asps/rexe/Conscript b/asps/rexe/Conscript \n\ ---- a/asps/rexe/Conscript \n\ -+++ b/asps/rexe/Conscript \n\ -@@ -79,9 +79,7 @@ \n\ - } \n\ - $LIBS .= " -lgeant321 -lgcalor"; \n\ - $LIBS .= " " . $env->{CERNLIBS};\n\ --$LIBS .= $env->{LDALL};\n\ - $LIBS .= " " . $env->{Packages}->{MYSQL}->{LIBS};\n\ --$LIBS .= $env->{LDNONE};\n\ - $LIBS .= " " . $FLIBS . " " . $env->{CLIBS};# " " . $env->{SYSLIBS} ;\n\ - if ($STAR_SYS =~ /^sun4x_5.$/) {\n\ - if ($LIBPATH) { $LIBPATH .= $main::PATH_SEPARATOR; }\n' \ - && patch -p1 < root4star_cons.patch - -RUN source /etc/profile \ - # Override default Vc version - && export Vc_DIR=/opt/software/linux-scientific7-x86_64/gcc-4.8.5/vc_-0.7.4-gqbhzu2x5u2dbe5tafxnl36xj5qbwov4 \ - && cd /star-sw \ - && cons \ - && find /star-sw/.$STAR_HOST_SYS -name *.o -exec rm '{}' \; - -RUN install /star-sw/StRoot/macros/.rootrc . - -# One might expect the single ENTRYPOINT command below to work but for some -# reason it chokes on a complex command such as -# -# docker run image root4star -b 'bfc.C(10, "opt1", "infile.root")' -# -#ENTRYPOINT ["/bin/bash", "--rcfile", "/etc/profile", "-l", "-c"] - -RUN install -m 755 <(echo $'#!/bin/sh\n . /etc/profile; exec "$@"') entrypoint.sh -ENTRYPOINT ["./entrypoint.sh"] -CMD ["/bin/bash"] diff --git a/mgr/ConsDefs.pm b/mgr/ConsDefs.pm index 6b64f4d8c99..b48db30bef4 100644 --- a/mgr/ConsDefs.pm +++ b/mgr/ConsDefs.pm @@ -156,7 +156,7 @@ $G77FLAGS .= " -std=legacy -fno-second-underscore -w -fno-automatic -Wall -W -Wsurprising -fPIC"; $FFLAGS = $G77FLAGS; # will be overwritten below, ignore - $FLIBS = "-lgfortran"; + $FLIBS = "-lgfortran -lquadmath"; } else { $G77 = "g77"; @@ -210,7 +210,7 @@ $STIC = "stic"; $STICFLAGS = ""; $AGETOF = "agetof"; - $AGETOFLAGS = "-V 1"; + $AGETOFLAGS = "-V 1 -d $STAR_BIN/agetof.def"; $LIBSTDC = `$CC $CFLAGS -print-file-name=libstdc++.a | awk '{ if (\$1 != "libstdc++.a") print \$1}'`; chomp($LIBSTDC); @@ -837,110 +837,31 @@ # # *** Standard package first, then MYSTAR *** # - my ($MYSQLINCDIR,$mysqlheader); - if ( defined($ENV{USE_LOCAL_MYSQL}) ){ - ($MYSQLINCDIR,$mysqlheader) = - script::find_lib( $MYSTAR . "/include " . $MYSTAR . "/include/mysql ". - $MYSQL . " " . - $MYSQL . "/include " . - "/sw/include/mysql ". - "/include /usr/include ". - "/usr/include/mysql ". - "/usr/mysql/include ". - "/usr/mysql ", - "mysql.h"); - } else { - ($MYSQLINCDIR,$mysqlheader) = - script::find_lib( $MYSQL . " " . - $MYSQL . "/include " . - "/sw/include/mysql ". - "/include /usr/include ". - "/usr/include/mysql ". - "/usr/mysql/include ". - "/usr/mysql ". - $MYSTAR . "/include " . $MYSTAR . "/include/mysql " , - "mysql.h"); - } - if (! $MYSQLINCDIR) { - die "Can't find mysql.h in standard path and $MYSTAR/include $MYSTAR/include/mysql\n"; - } # search for the config - my ($MYSQLCONFIG,$mysqlconf); - # if ( defined($ENV{USE_LOCAL_MYSQL}) ){ - ($MYSQLCONFIG,$mysqlconf) = - script::find_lib($MYSTAR . "/bin " . $MYSTAR . "/bin/mysql ". - $MYSQL . " ". - $MYSQL . "/bin ". - "/usr/$LLIB/mysql /usr/bin/mysql /usr/bin ", - "mysql_config"); - # } else { - # ($MYSQLCONFIG,$mysqlconf) = - # script::find_lib($MYSQL . " ". - # "/usr/$LLIB/mysql /usr/bin/mysql /usr/bin ". - # $MYSTAR . "/bin " . $MYSTAR . "/bin/mysql ", - # "mysql_config"); - # } - - - # Associate the proper lib with where the inc was found - my ($mysqllibdir)=$MYSQLINCDIR; - $mysqllibdir =~ s/include/$LLIB/; - - # print "DEBUG :: $mysqllibdir\n"; - # Note - there is a trick here - the first element uses mysqllibdir - # which is dreived from where the INC is found hence subject to - # USE_LOCAL_MYSQL switch. This may not have been obvious. - # my ($MYSQLLIBDIR,$MYSQLLIB) = - # script::find_lib($mysqllibdir . " /usr/$LLIB/mysql ". - # $MYSTAR . "/lib " . $MYSTAR . "/lib/mysql ", - # "libmysqlclient"); - # # "libmysqlclient_r libmysqlclient"); - # # die "*** $MYSQLLIBDIR,$MYSQLLIB\n"; - - # if ($STAR_HOST_SYS =~ /^rh/ or $STAR_HOST_SYS =~ /^sl/) { - if ( $mysqlconf ){ - $mysqlconf = "$MYSQLCONFIG/$mysqlconf"; - # if ( 1==1 ){ - # Do not guess, just take it - this leads to a cons error though TBC - chomp($MYSQLLIB = `$mysqlconf --libs`); - # but remove -L which are treated separately by cons - my(@libs) = split(" ", $MYSQLLIB); - my($test) = shift(@libs); - if ( $test =~ /-L/){ - $MYSQLLIBDIR = $test; $MYSQLLIBDIR =~ s/-L//; - $MYSQLLIB = ""; - foreach my $el (@libs){ - $MYSQLLIB .= " ".$el if ($el !~ m/-L/); - } - } - - # here is a check for libmysqlclient - - - # die "DEBUG got $MYSQLLIBDIR $MYSQLLIB\n"; - - # mysqlconf returns (on SL5, 64 bits) - # -L/usr/lib64/mysql -lmysqlclient -lz -lcrypt -lnsl -lm -L/usr/lib64 -lssl -lcrypto - # } else { - # $MYSQLLIB .= " -L/usr/$LLIB"; - # if (-r "/usr/$LLIB/libmystrings.a") {$MYSQLLIB .= " -lmystrings";} - # if (-r "/usr/$LLIB/libssl.a" ) {$MYSQLLIB .= " -lssl";} - # if (-r "/usr/$LLIB/libcrypto.a" ) {$MYSQLLIB .= " -lcrypto";} - # if ( $MYSQLLIB =~ m/client_r/ ) {$MYSQLLIB .= " -lpthread";} - # # if (-r "/usr/$LLIB/libk5crypto.a" ) {$MYSQLLIB .= " -lcrypto";} - # $MYSQLLIB .= " -lz"; - # # $MYSQLLIB .= " -lz -lcrypt -lnsl"; - # } - } else { - die "No mysql_config found\n"; + chomp(my $mysqlconf = `which mysql_config`); + + if ($?) { + die "No mysql_config found\n"; } - print "Using $mysqlconf\n\tMYSQLINCDIR = $MYSQLINCDIR MYSQLLIBDIR = $MYSQLLIBDIR \tMYSQLLIB = $MYSQLLIB\n" - if ! $param::quiet; - # die "\n"; + chomp(my $MYSQLINCDIR = `mysql_config --variable=pkgincludedir`); + chomp(my $MYSQLLIBDIR = `mysql_config --variable=pkglibdir`); + + chomp(my $MYSQLLIB = `$mysqlconf --libs`); + # Remove -L which are treated separately by cons + my(@libs) = split(" ", $MYSQLLIB); + my($test) = shift(@libs); + if ( $test =~ /-L/) { + $MYSQLLIBDIR = $test; $MYSQLLIBDIR =~ s/-L//; + $MYSQLLIB = ""; + foreach my $el (@libs) { + $MYSQLLIB .= " ".$el if ($el !~ m/-L/); + } + } + print "Using $mysqlconf\n\tMYSQLINCDIR = $MYSQLINCDIR\n\tMYSQLLIBDIR = $MYSQLLIBDIR\n\tMYSQLLIB = $MYSQLLIB\n" if !$param::quiet; # QT @@ -1038,65 +959,63 @@ } # Logger - $LoggerDir = $MYSTAR . "/include/log4cxx"; - - if (-d $LoggerDir) { - $LoggerINCDIR = $MYSTAR . "/include"; - $LoggerLIBDIR = $MYSTAR . "/lib"; - $LoggerLIBS = "-llog4cxx"; - print - "Use Logger ", - "LIBDIR = $LoggerLIBDIR \tLoggerINCDIR = $LoggerINCDIR \tLoggerLIBS = $LoggerLIBS\n" - if $LoggerLIBDIR && ! $param::quiet; + chomp($LoggerDir = `pkg-config --variable=prefix liblog4cxx`); + $LoggerDir = $MYSTAR unless $LoggerDir; + + if (not -d $LoggerDir."/include/log4cxx") { + die "No log4cxx found\n"; } + + $LoggerINCDIR = $LoggerDir . "/include"; + $LoggerLIBDIR = $LoggerDir . "/lib"; + $LoggerLIBS = "-llog4cxx"; + + print "Using $LoggerDir\n\tLoggerLIBDIR = $LoggerLIBDIR\n\tLoggerINCDIR = $LoggerINCDIR\n\tLoggerLIBS = $LoggerLIBS\n" unless $param::quiet; + # xml2 - my ($XMLINCDIR,$XMLLIBDIR,$XMLLIBS) = ("","",""); - my ($xml) = script::find_lib($MYSTAR . "/bin /usr/bin " . $LIBXML2_DIR . "/bin", - "xml2-config"); - if ($xml) { - $xml .= "/xml2-config"; - $XMLINCDIR = `$xml --cflags`; - chomp($XMLINCDIR); - $XMLINCDIR =~ s/-I//; - my $XML = `$xml --libs`; # die "$XML\n"; - my(@libs)= split(" ", $XML); - - $XMLLIBDIR = shift(@libs); - if ($XMLLIBDIR =~ /-L/){ - $XMLLIBDIR =~ s/-L//; - $XMLLIBS = join(" ",@libs); - } else { - # no -L, assume all were LIBS - $XMLLIBS = $XMLLIBDIR ." ".join(" ",@libs); - # and fix -L / should work for both 32 and 64 - $XMLLIBDIR = "/usr/$LLIB"; - } + chomp(my $xml = `which xml2-config`); + if ($?) { + die "No xml2-config found\n"; + } - # ($XMLLIBDIR,$XMLLIBS) = split(' ', $XML); - # if ($XMLLIBDIR =~ /-L/){ - # $XMLLIBDIR =~ s/-L//; - # } else { - # # may not have any -L - # if ($XMLLIBS - # } + my ($XMLINCDIR,$XMLLIBDIR,$XMLLIBS) = ("","",""); - my $XMLVersion = `$xml --version`; # print "XMLVersion = $XMLVersion\n"; - my ($major,$minor) = split '\.', $XMLVersion; # print "major = $major,minor = $minor\n"; - $XMLCPPFlag = "";#-DXmlTreeReader"; - if ($major < 2 or $major == 2 and $minor < 5) { - $XMLCPPFlag = "-DNoXmlTreeReader"; - } - if ( ! $param::quiet ){ - if ( $XMLLIBDIR ){ - print "Use xml $xml XMLLIBDIR = $XMLLIBDIR \tXMLINCDIR = $XMLINCDIR \tXMLLIBS = $XMLLIBS XMLCPPFlag =$XMLCPPFlag\n"; - } else { - print "Use xml -> WARNING ** Could not define XMLLIBDIR, XMLINCDIR, XMLLIBS\n"; - } - } + $XMLINCDIR = `$xml --cflags`; + chomp($XMLINCDIR); + $XMLINCDIR =~ s/ -I/:/g; + $XMLINCDIR =~ s/-I//g; + my $XML = `$xml --libs`; # die "$XML\n"; + my(@libs)= split(" ", $XML); + + $XMLLIBDIR = shift(@libs); + if ($XMLLIBDIR =~ /-L/){ + $XMLLIBDIR =~ s/-L//; + $XMLLIBS = join(" ",@libs); } else { - print "Could not find xml libs\n" if (! $param::quiet); + # no -L, assume all were LIBS + $XMLLIBS = $XMLLIBDIR ." ".join(" ",@libs); + # and fix -L / should work for both 32 and 64 + $XMLLIBDIR = "/usr/$LLIB"; + } + + my $XMLVersion = `$xml --version`; # print "XMLVersion = $XMLVersion\n"; + my ($major,$minor) = split '\.', $XMLVersion; # print "major = $major,minor = $minor\n"; + $XMLCPPFlag = "";#-DXmlTreeReader"; + if ($major < 2 or $major == 2 and $minor < 5) { + $XMLCPPFlag = "-DNoXmlTreeReader"; + } + if ( ! $param::quiet ){ + if ( $XMLLIBDIR ){ + print "Using $xml\n\tXMLLIBDIR = $XMLLIBDIR\n\tXMLINCDIR = $XMLINCDIR\n\tXMLLIBS = $XMLLIBS\n\tXMLCPPFlag = $XMLCPPFlag\n" if !$param::quiet; + } else { + print "Use xml -> WARNING ** Could not define XMLLIBDIR, XMLINCDIR, XMLLIBS\n"; + } } + + chomp($FASTJET_PREFIX = `fastjet-config --prefix`); + chomp($GSL_PREFIX = `gsl-config --prefix`); + #Vc check SSE support my $cmd = "touch temp_gccflags.c; $CXX -E -dM -o - temp_gccflags.c | grep -q SSE"; my $VcCPPFLAGS = " -DVC_IMPL=SSE"; @@ -1212,6 +1131,7 @@ 'ENV' => { 'CPATH' => $CPATH, 'PATH' => $PATH, + 'PYTHONPATH' => $PYTHONPATH, 'LM_LICENSE_FILE' => $LM_LICENSE_FILE, 'INCLUDE' => $INCLUDE_PATH, 'ROOT' => $ROOT, @@ -1256,6 +1176,12 @@ 'CPPFLAGS' => $CERNLIB_CPPFLAGS, 'CERNLIBS' => $CERNLIBS }, + 'FASTJET' => { + 'INCDIR'=> "$FASTJET_PREFIX/include" + }, + 'GSL' => { + 'INCDIR'=> "$GSL_PREFIX/include" + }, 'MYSQL' => { 'LIBDIR'=> $MYSQLLIBDIR, 'INCDIR'=> $MYSQLINCDIR, diff --git a/mgr/Conscript-standard b/mgr/Conscript-standard index 674b2357834..0df341f33a7 100644 --- a/mgr/Conscript-standard +++ b/mgr/Conscript-standard @@ -1,5 +1,5 @@ #!/usr/bin/env perl -Import qw ( env CWD INCLUDE LIB BIN BUILD OBJ); +Import qw ( env CWD INCLUDE LIB BIN BUILD OBJ warnoff_dirs); ( my $build = $OBJ ) =~ s/\#//g; $build =~ s/\\/\//g; # print "OBJ = $OBJ build = $build\n"; # print "MAIN = $MAIN\n"; @@ -11,12 +11,8 @@ my $STAR_SYS = $env->{ENV}->{STAR_SYS}; my $STAR_VERSION = $env->{ENV}->{STAR_VERSION}; # print "##### $STAR_VER\n"; my $AFS_RHIC = $env->{ENV}->{AFS_RHIC}; -my $ROOT_FEATURES = `root-config --features`; - @Repo = Repository_List unless $param::noRepository;# print "Repositories = |@Repo|\n"; - - print "+-+-+- STAR=".$env->{ENV}->{STAR}."\n" if $param::debug; print "+-+-+- cwd=".$CWD."\n" if $param::debug; my $IsDotDev = 0; @@ -94,6 +90,7 @@ my $SOFLAGS = $env1->{SOFLAGS}; my $LIBPATH = $env1->{LIBPATH}; my $STIC = $env1->{STIC}; my $EXTRA_CPPFLAGS = $env1->{EXTRA_CPPFLAGS}; +my $EXTRA_CXXFLAGS = $env1->{EXTRA_CXXFLAGS}; my $CPPFLAGS = $env1->{CPPFLAGS}; my $ROOTCINT_CPPFLAGS = ""; @@ -248,6 +245,13 @@ if ($FC =~ m/g77/ || $FC =~ m/gfortran/ ){ #} } +# Disable all compiler warnings if $Dir matches any value from @$warnoff_dirs +if ( index($EXTRA_CXXFLAGS, "-Werror") != -1 ) { + if ( grep($Dir =~ m/^$_$/, @$warnoff_dirs) ) { + $EXTRA_CXXFLAGS =~ s/-Werror//; + } +} + #+ # Now we treat anything which is neither sim nor gen # This will include all makers @@ -255,14 +259,6 @@ if ($FC =~ m/g77/ || $FC =~ m/gfortran/ ){ if ( $pkg !~ /^sim$/ && $pkg !~ /^gen$/ ) { print "\t--- Regular case treatment (not gen not sim) ---\n" if $param::debug; - - - if ( $Dir =~ m/Table$/ ) { - if ( $ROOT_FEATURES =~ m/table/ ){ print "[ROOT has table support]\n";@srcL=();@h_filesL = (); } - else { print "[ROOT has no table support, compile Table] \n"; } - } - - # if user requested debug, print some info on what was found if ($param::debug) { $i = 0; @@ -572,11 +568,7 @@ if ( $pkg !~ /^sim$/ && $pkg !~ /^gen$/ ) { # Package FILT is transformed to StarGeneratorFilt by StarGenerator directory rules # We cannot narrow down futher..., so all filters will be built with the # following dependencies... - if ( defined($ENV{FASTJET_DIR}) ) { - $CPPPATH = $ENV{FASTJET_DIR}."/include".$main::PATH_SEPARATOR.$CPPPATH; - } else { - $CPPPATH = $env1->{ENV}->{OPTSTAR}."/include".$main::PATH_SEPARATOR.$CPPPATH; - } + $CPPPATH = $env1->{Packages}->{FASTJET}->{INCDIR}.$main::PATH_SEPARATOR.$CPPPATH; } elsif ( $pkg =~ m/^Pythia8/ and $Dir =~ m/StarGenerator/ ){ # Append pythia 8 include path and define version @@ -713,11 +705,7 @@ if ( $pkg !~ /^sim$/ && $pkg !~ /^gen$/ ) { } if ( $env1->{CPPPATH} ) { $CPPPATH .= $main::PATH_SEPARATOR . $env1->{CPPPATH};} - if ( defined($ENV{GSL_DIR}) ) { - $CPPPATH = $ENV{GSL_DIR}."/include".$main::PATH_SEPARATOR.$CPPPATH; - } else { - $CPPPATH = $env1->{ENV}->{OPTSTAR}."/include".$main::PATH_SEPARATOR.$CPPPATH; - } + $CPPPATH = $env1->{Packages}->{GSL}->{INCDIR}.$main::PATH_SEPARATOR.$CPPPATH; print "CPPPATH = $CPPPATH\n" if $param::debug; # According to description, all client requirering this @@ -774,11 +762,7 @@ if ( $pkg !~ /^sim$/ && $pkg !~ /^gen$/ ) { } elsif ( $pkg =~ m/^StJetFinder$/ ){ - if ( defined($ENV{FASTJET_DIR}) ) { - $CPPPATH = $ENV{FASTJET_DIR}."/include".$main::PATH_SEPARATOR.$CPPPATH; - } else { - $CPPPATH = $env1->{ENV}->{OPTSTAR}."/include".$main::PATH_SEPARATOR.$CPPPATH; - } + $CPPPATH = $env1->{Packages}->{FASTJET}->{INCDIR}.$main::PATH_SEPARATOR.$CPPPATH; } elsif ( $pkg =~ m/^StFwdTrackMaker$/ ){ $CXXFLAGS .= " -I".$env1->{ENV}->{OPTSTAR}."/include"; @@ -994,6 +978,7 @@ if ( $pkg !~ /^sim$/ && $pkg !~ /^gen$/ ) { #print "DEBUG Passing $ROOTCINT_CPPFLAGS\n"; $env2 = $env1->clone('Package' => $pkg, 'EXTRA_CPPFLAGS' => $EXTRA_CPPFLAGS, + 'EXTRA_CXXFLAGS' => $EXTRA_CXXFLAGS, 'CPPPATH' => $CPPPATH, 'CFLAGS' => $CFLAGS, 'CXXFLAGS' => $CXXFLAGS, @@ -1023,6 +1008,7 @@ if ( $pkg !~ /^sim$/ && $pkg !~ /^gen$/ ) { $envCint = $env2->clone('DEBUG' => $env2->{NOOPT}, 'CPPPATH' => $Cint_CPPPATH, 'CPPFLAGS' => $CPPFLAGS, + 'EXTRA_CXXFLAGS' => $EXTRA_CXXFLAGS, 'EXTRA_CPPFLAGS' => $EXTRA_CPPFLAGS); print "LIBPATH = |", $env2->{LIBPATH}, "|\n LIBS = |", $env2->{LIBS}, diff --git a/mgr/Construct b/mgr/Construct index 6a86284e091..60cab6f79c4 100644 --- a/mgr/Construct +++ b/mgr/Construct @@ -4,8 +4,6 @@ use Env; use lib qw(./mgr $STAR/mgr);#$ENV{ConstructLocation}; # Modify perl include path use ConsDefs; -my $ROOT_FEATURES = `root-config --features`; - #my $xx=$ENV{ConstructLocation}; #print "Path used for ConsDefs is $xx\n" unless ($param::quiet); @@ -167,7 +165,8 @@ foreach my $dir (@DirsWithIncludes, @DirsIdlInc) { print "---> looking for include in $dir\n" if ($param::debug); next if ! -r $dir; - next if ( ($ROOT_FEATURES=~/table/) && ($dir =~ /Table$/) ); # Do not export Table headers if ROOT provides table support + # Do not export StRoot/Table headers if ROOT_VERSION < 6 + next if ($dir =~ /StRoot\/Table$/ and $def->{ENV}->{ROOT_VERSION_MAJOR} < 6); opendir( DIR, $dir ) or die "Can't open $dir\n"; my @incs = readdir DIR; print "incs = @incs\n" if ($param::debug); @@ -265,11 +264,11 @@ my $items = "";# print "items $#items = @items\n"; if ( defined($SKIP_DIRS) ) { $items = join("|", split(" ", $SKIP_DIRS)); } else { - $items = "StShadowMaker"; + $items = "StShadowMaker|PWGTools"; } if ( $#items > -1){ - if (! $item) {$items = join("|",@items);} + if (!$items) {$items = join("|",@items);} else {$items .= "|" . join("|",@items);} print "SKIP_DIRS is now: $#items $items\n"; } @@ -286,6 +285,10 @@ foreach my $dir( "pams", "StRoot", "StPiD", "StarVMC" ) { next if ( $sub_dir =~ $excludeDirList); my $sub_Dir = $dir . "/" . $sub_dir; next if !-d $sub_Dir and !-l $sub_Dir; + + # Do not build StRoot/Table if ROOT_VERSION < 6 + next if ($sub_Dir =~ m/StRoot\/Table$/ and $def->{ENV}->{ROOT_VERSION_MAJOR} < 6); + print "dir = $dir \t sub_dir = $sub_dir sub_Dir = $sub_Dir\n" if ($param::debug); # print "$sub_dir => $items\n"; # if ($items and $sub_dir =~ /$items/) {print "skip dir: $sub_dir \t=> $items\n"; next;} @@ -345,6 +348,22 @@ foreach my $dir( "pams", "StRoot", "StPiD", "StarVMC" ) { } } print "subdirs = @subdirs\n" if $param::debug; + +if ( index($env->{EXTRA_CXXFLAGS}, "-Werror") != -1 ) { + # Read regex expressions from the file into an array. The patterns are matched against the names + # of source directories in order to disable compiler warnings + open(warnoff_dirs_file, "mgr/warnoff_dirs.txt") or print "Warning: Can't open mgr/warnoff_dirs.txt\n"; + chomp(@warnoff_dirs = ); + close(warnoff_dirs_file); + + if (@warnoff_dirs) { + print "Compiler warnings will be inhibited for directories matching the following patterns:\n"; + foreach $dir (@warnoff_dirs) { + print "\t$dir\n"; + } + } +} + my @Targets = (); # List of targets @@ -380,12 +399,15 @@ if ($STAR_SYS !~ /x86_darwin/) { #print "sysdirlist = @sysdirlist \n subdirs = @subdirs\n"; +@skip_dirs = split(/\|/, $items); + foreach $dir(@sysdirlist , @subdirs ) { if ( -d $dir or -l $dir ) { # next if $param::include && $dir !~ /$param::include/o; # next if $param::exclude && $dir =~ /$param::exclude/o; print "Add dir : $dir\n" if $param::debug; #push @Targets, $OBJ . "/" . $dir . "/Conscript"; + next if grep($dir =~ m/$_/, @skip_dirs); push @packages, $dir; } } @@ -405,7 +427,9 @@ if ($param::debug){ print "Packages $#packages : @packages\n"; print "Targets $#Targets : @Targets\n" ; } -Export qw( env CWD INCLUDE LIB BIN BUILD OBJ); + +$warnoff_dirs = \@warnoff_dirs; +Export qw( env CWD INCLUDE LIB BIN BUILD OBJ warnoff_dirs); Default qw ( . ); Depends $env $STAR . "/mgr/RootCint.pl", $env->{ENV}->{ROOTSYS} . "/bin/rootcint"; diff --git a/mgr/config/v0.2.3-rhel7-root5.34.38.config b/mgr/config/v0.2.3-rhel7-root5.34.38.config new file mode 100644 index 00000000000..e172257917a --- /dev/null +++ b/mgr/config/v0.2.3-rhel7-root5.34.38.config @@ -0,0 +1,17 @@ +#!/usr/bin/env csh + +# this is in place of buggy `module clear` (module VERSION=3.2.10 DATE=2012-12-21) +unsetenv _LMFILES_* + +if ( $USE_64BITS == 1 ) then + module purge + module unuse /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86/ + module use /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86_64/ +else + module purge + module unuse /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86_64/ + module use /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86/ +endif + +module load star-env-0.2.3-root-5.34.38 +module load libiconv-1.16 diff --git a/mgr/config/v0.2.3-rhel7-root6.16.00.config b/mgr/config/v0.2.3-rhel7-root6.16.00.config new file mode 100644 index 00000000000..d79f4e7fe0d --- /dev/null +++ b/mgr/config/v0.2.3-rhel7-root6.16.00.config @@ -0,0 +1,18 @@ +#!/usr/bin/env csh + +# this is in place of buggy `module clear` (module VERSION=3.2.10 DATE=2012-12-21) +unsetenv _LMFILES_* + +if ( $USE_64BITS == 1 ) then + module purge + module unuse /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86/ + module use /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86_64/ +else + module purge + module unuse /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86_64/ + module use /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86/ +endif + +module load star-env-0.2.3-root-6.16.00 +module load libiconv-1.16 +module load vc-0.7.4 diff --git a/mgr/config/v0.2.3-rhel7-root6.24.06.config b/mgr/config/v0.2.3-rhel7-root6.24.06.config new file mode 100644 index 00000000000..1eb0d7e4d4b --- /dev/null +++ b/mgr/config/v0.2.3-rhel7-root6.24.06.config @@ -0,0 +1,18 @@ +#!/usr/bin/env csh + +# this is in place of buggy `module clear` (module VERSION=3.2.10 DATE=2012-12-21) +unsetenv _LMFILES_* + +if ( $USE_64BITS == 1 ) then + module purge + module unuse /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86/ + module use /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86_64/ +else + module purge + module unuse /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86_64/ + module use /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86/ +endif + +module load star-env-0.2.3-root-6.24.06 +module load libiconv-1.16 +module load vc-0.7.4 diff --git a/mgr/config/v0.3.0-rhel7-root5.34.38.config b/mgr/config/v0.3.0-rhel7-root5.34.38.config new file mode 100644 index 00000000000..bfb649b306d --- /dev/null +++ b/mgr/config/v0.3.0-rhel7-root5.34.38.config @@ -0,0 +1,16 @@ +#!/usr/bin/env csh + +# this is in place of buggy `module clear` (module VERSION=3.2.10 DATE=2012-12-21) +unsetenv _LMFILES_* + +if ( $USE_64BITS == 1 ) then + module purge + module unuse /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86/ + module use /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86_64/ +else + module purge + module unuse /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86_64/ + module use /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86/ +endif + +module load star-env-0.3.0-root-5.34.38 diff --git a/mgr/config/v0.3.0-rhel7-root6.16.00.config b/mgr/config/v0.3.0-rhel7-root6.16.00.config new file mode 100644 index 00000000000..b33b1856c90 --- /dev/null +++ b/mgr/config/v0.3.0-rhel7-root6.16.00.config @@ -0,0 +1,16 @@ +#!/usr/bin/env csh + +# this is in place of buggy `module clear` (module VERSION=3.2.10 DATE=2012-12-21) +unsetenv _LMFILES_* + +if ( $USE_64BITS == 1 ) then + module purge + module unuse /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86/ + module use /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86_64/ +else + module purge + module unuse /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86_64/ + module use /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86/ +endif + +module load star-env-0.3.0-root-6.16.00 diff --git a/mgr/config/v0.3.0-rhel7-root6.24.06.config b/mgr/config/v0.3.0-rhel7-root6.24.06.config new file mode 100644 index 00000000000..80efe1ef9cb --- /dev/null +++ b/mgr/config/v0.3.0-rhel7-root6.24.06.config @@ -0,0 +1,16 @@ +#!/usr/bin/env csh + +# this is in place of buggy `module clear` (module VERSION=3.2.10 DATE=2012-12-21) +unsetenv _LMFILES_* + +if ( $USE_64BITS == 1 ) then + module purge + module unuse /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86/ + module use /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86_64/ +else + module purge + module unuse /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86_64/ + module use /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86/ +endif + +module load star-env-0.3.0-root-6.24.06 diff --git a/mgr/default.config b/mgr/default.config new file mode 100644 index 00000000000..bfb649b306d --- /dev/null +++ b/mgr/default.config @@ -0,0 +1,16 @@ +#!/usr/bin/env csh + +# this is in place of buggy `module clear` (module VERSION=3.2.10 DATE=2012-12-21) +unsetenv _LMFILES_* + +if ( $USE_64BITS == 1 ) then + module purge + module unuse /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86/ + module use /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86_64/ +else + module purge + module unuse /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86_64/ + module use /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86/ +endif + +module load star-env-0.3.0-root-5.34.38 diff --git a/mgr/warnoff_dirs.txt b/mgr/warnoff_dirs.txt new file mode 100644 index 00000000000..74a46211c86 --- /dev/null +++ b/mgr/warnoff_dirs.txt @@ -0,0 +1,126 @@ +OnlTools/Jevp +StRoot/RTS +StRoot/StAnalysisMaker +StRoot/StAssociationMaker +StRoot/StBTofPool.* +StRoot/StBTofSimMaker +StRoot/StChain +StRoot/StDaqLib +StRoot/StDbLib +StRoot/StDbUtilities +StRoot/StEEmcDbMaker +StRoot/StEEmcPool.* +StRoot/StEEmcSimulatorMaker +StRoot/StEEmcUtil +StRoot/StEStructPool.* +StRoot/StEmbeddingUtilities +StRoot/StEmcADCtoEMaker +StRoot/StEmcCalibrationMaker +StRoot/StEmcMixerMaker +StRoot/StEmcPool.* +StRoot/StEmcRawMaker +StRoot/StEmcSimulatorMaker +StRoot/StEmcTriggerMaker +StRoot/StEmcUtil +StRoot/StEpcMaker +StRoot/StEpdUtil +StRoot/StEvent +StRoot/StEventUtilities +StRoot/StFcsClusterMaker +StRoot/StFcsDbMaker +StRoot/StFcsRawHitMaker +StRoot/StFcsWaveformFitMaker +StRoot/StFgtA2CMaker +StRoot/StFgtClusterMaker +StRoot/StFgtPool.* +StRoot/StFgtSimulatorMaker +StRoot/StFgtUtil +StRoot/StFilterMaker +StRoot/StFlowAnalysisMaker +StRoot/StFlowMaker +StRoot/StFmsHitMaker +StRoot/StFmsPointMaker +StRoot/StFmsUtil +StRoot/StFtpcClusterMaker +StRoot/StFtpcDriftMapMaker +StRoot/StFtpcSlowSimMaker +StRoot/StFtpcTrackMaker +StRoot/StFttClusterMaker +StRoot/StFttDbMaker +StRoot/StFttHitCalibMaker +StRoot/StFttPointMaker +StRoot/StFttRawHitMaker +StRoot/StFwdTrackMaker +StRoot/StGammaMaker +StRoot/StGenericVertexMaker +StRoot/StHbtMaker +StRoot/StHeavyTagMaker +StRoot/StHighptPool.* +StRoot/StJetMaker +StRoot/StMCFilter +StRoot/StMcAnalysisMaker +StRoot/StMcEventMaker +StRoot/StMiniMcEvent +StRoot/StMtdEvtFilterMaker +StRoot/StMtdUtil +StRoot/StMuDSTMaker +StRoot/StPass0CalibMaker +StRoot/StPeCMaker +StRoot/StPidAmpMaker +StRoot/StPmdCalibrationMaker +StRoot/StPmdClusterMaker +StRoot/StPmdDiscriminatorMaker +StRoot/StPmdReadMaker +StRoot/StPmdSimulatorMaker +StRoot/StPmdUtil +StRoot/StPreEclMaker +StRoot/StPxlClusterMaker +StRoot/StPxlDbMaker +StRoot/StPxlSimMaker +StRoot/StRefMultCorr +StRoot/StSpectraPool.* +StRoot/StSpinPool.* +StRoot/StStarLogger +StRoot/StStrangeMuDstMaker +StRoot/StStrangeTagsMaker +StRoot/StSvtCalibMaker +StRoot/StSvtClassLibrary +StRoot/StSvtClusterMaker +StRoot/StSvtDaqMaker +StRoot/StSvtPool.* +StRoot/StSvtSeqAdjMaker +StRoot/StSvtSimulationMaker +StRoot/StTofCalibMaker +StRoot/StTofHitMaker +StRoot/StTofMaker +StRoot/StTofPool.* +StRoot/StTofSimMaker +StRoot/StTofUtil +StRoot/StTofpMatchMaker +StRoot/StTofrMatchMaker +StRoot/StTpcHitMaker +StRoot/StTpcHitMoverMaker +StRoot/StTpcRSMaker +StRoot/StTreeMaker +StRoot/StTriggerUtilities +StRoot/StTrsMaker +StRoot/StUtilities +StRoot/St_QA_Maker +StRoot/St_base +StRoot/St_ctf_Maker +StRoot/St_emc_Maker +StRoot/St_trg_Maker +StRoot/StarClassLibrary +StRoot/StarGenerator.* +StRoot/StarRoot +StRoot/StdEdxY2Maker +StRoot/Sti +StRoot/StiCA +StRoot/StiMaker +StRoot/StiTpc +StRoot/StiUtilities +StarVMC/StarAgmlLib +StarVMC/StarBASE +StarVMC/StarGeometry +StarVMC/geant3 +pams/ctf From fbf05f0fc775b84957df5635d29f4c3d62ef5ce7 Mon Sep 17 00:00:00 2001 From: Dmitri Smirnov Date: Tue, 13 Feb 2024 19:44:43 -0500 Subject: [PATCH 4/6] build: sync StRoot/macros with SL23f_2 --- StRoot/macros/analysis/doEvents.C | 1 + StRoot/macros/analysis/find_vertex.C | 4 ++++ StRoot/macros/rootlogon.C | 7 ++++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/StRoot/macros/analysis/doEvents.C b/StRoot/macros/analysis/doEvents.C index b18d2df0953..47fd8f8bc1c 100644 --- a/StRoot/macros/analysis/doEvents.C +++ b/StRoot/macros/analysis/doEvents.C @@ -356,6 +356,7 @@ void loadLibs(const char *opt) gSystem->Load("StTriggerDataMaker"); // new starting from April 2003 gSystem->Load("StBichsel"); gSystem->Load("StEvent"); + gSystem->Load("StTpcDb"); gSystem->Load("StEventUtilities"); gSystem->Load("StEmcUtil"); gSystem->Load("StTofUtil"); diff --git a/StRoot/macros/analysis/find_vertex.C b/StRoot/macros/analysis/find_vertex.C index 2c02dd0dd4d..703e8956862 100644 --- a/StRoot/macros/analysis/find_vertex.C +++ b/StRoot/macros/analysis/find_vertex.C @@ -23,6 +23,8 @@ class StChain; class StMinuitVertexFinder; class StGenericVertexFinder; class StGenericVertexMaker; +class StEvent; +class StPrimaryVertex; StChain *chain=0; TH1F *dca_z_h=0; @@ -97,6 +99,7 @@ void find_vertex(char * fname="high_053/st_physics_6053108_raw_2020002.event.roo gSystem->Load("StTriggerDataMaker"); // new starting from April 2003 gSystem->Load("StBichsel"); gSystem->Load("StEvent"); + gSystem->Load("StTpcDb"); gSystem->Load("StEventUtilities"); gSystem->Load("StEmcUtil"); gSystem->Load("StTofUtil"); @@ -122,6 +125,7 @@ void find_vertex(char * fname="high_053/st_physics_6053108_raw_2020002.event.roo gSystem->Load("Sti"); gSystem->Load("libStEEmcUtil"); + gSystem->Load("libMinuit"); gSystem->Load("StGenericVertexMaker"); TFile *fout = new TFile("vtx_tree.root","RECREATE"); diff --git a/StRoot/macros/rootlogon.C b/StRoot/macros/rootlogon.C index 3edf950a6c0..16c3b1623f9 100644 --- a/StRoot/macros/rootlogon.C +++ b/StRoot/macros/rootlogon.C @@ -30,5 +30,10 @@ std::cout << " *** Start at Date : " << TDatime().AsString() << std::endl; - gSystem->AddIncludePath(" -I. -I./.$STAR_HOST_SYS/include -I./StRoot -I$STAR/.$STAR_HOST_SYS/include -I$STAR/StRoot -I/usr/include/mysql"); + gInterpreter->AddIncludePath("."); + gInterpreter->AddIncludePath("./.$STAR_HOST_SYS/include"); + gInterpreter->AddIncludePath("./StRoot"); + gInterpreter->AddIncludePath("$STAR/.$STAR_HOST_SYS/include"); + gInterpreter->AddIncludePath("$STAR/StRoot"); + gInterpreter->AddIncludePath("/usr/include/mysql"); } From f7156c17876496426ea38594b388860a2a252aff Mon Sep 17 00:00:00 2001 From: Dmitri Smirnov Date: Wed, 14 Feb 2024 10:55:39 -0500 Subject: [PATCH 5/6] build: sync asps/ with SL23f_2 --- asps/Simulation/starsim/Conscript | 2 +- asps/rexe/Conscript | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/asps/Simulation/starsim/Conscript b/asps/Simulation/starsim/Conscript index 0da6aafb1df..5100171907f 100644 --- a/asps/Simulation/starsim/Conscript +++ b/asps/Simulation/starsim/Conscript @@ -123,10 +123,10 @@ $env2 = $env->clone('FC' => $FC, 'FCPATH' => $FCPATH, 'FEXTEND' => "", 'FDEBUG' => $FDEBUG, + 'CFLAGS' => "$env->{CFLAGS} -fcommon", 'CPPFLAGS' => $CPPFLAGS, 'CPPPATH' => $CPPPATH, 'DEBUG' => $DEBUG, - 'AGETOFLAGS' => "", 'LIBS' => $LIBS, 'ObjDir' => $obj_dir, 'Libraries' => $Libraries diff --git a/asps/rexe/Conscript b/asps/rexe/Conscript index 1c87ae344f2..4f23f7a4317 100644 --- a/asps/rexe/Conscript +++ b/asps/rexe/Conscript @@ -79,9 +79,7 @@ if ($FC =~ /^pgf/) { } $LIBS .= " -lgeant321 -lgcalor"; $LIBS .= " " . $env->{CERNLIBS}; -$LIBS .= $env->{LDALL}; $LIBS .= " " . $env->{Packages}->{MYSQL}->{LIBS}; -$LIBS .= $env->{LDNONE}; $LIBS .= " " . $FLIBS . " " . $env->{CLIBS};# " " . $env->{SYSLIBS} ; if ($STAR_SYS =~ /^sun4x_5.$/) { if ($LIBPATH) { $LIBPATH .= $main::PATH_SEPARATOR; } From 50a7ab3b0d19b7bc21a8d11ae5352cce20a1b306 Mon Sep 17 00:00:00 2001 From: Dmitri Smirnov Date: Thu, 3 Nov 2022 09:43:33 -0400 Subject: [PATCH 6/6] Avoid pointer cast to time_t from incompatible type (#427) Resolves #426 cherry-pick 235a2676 --- StRoot/StDaqLib/SC/SC_Reader.cxx | 5 +++-- StRoot/StDaqLib/SSD/SSD_Reader.cxx | 5 +++-- StRoot/StEEmcUtil/EEfeeRaw/RootWrapper.cxx | 4 +++- StRoot/St_trg_Maker/year2003.cxx | 4 ++-- StRoot/StarRoot/TUnixTime.cxx | 23 +++++++++++----------- 5 files changed, 22 insertions(+), 19 deletions(-) diff --git a/StRoot/StDaqLib/SC/SC_Reader.cxx b/StRoot/StDaqLib/SC/SC_Reader.cxx index 582fbaedeb4..055dafbd51b 100644 --- a/StRoot/StDaqLib/SC/SC_Reader.cxx +++ b/StRoot/StDaqLib/SC/SC_Reader.cxx @@ -9,6 +9,7 @@ #include #include +#include using namespace OLDEVP; @@ -97,8 +98,8 @@ SC_Reader::SC_Reader(EventReader *er) { //Keep BBCBkg scalers flipped as theyStRoot/StDaqLib/SC/SC_Reader.cxx were historically before 2009 //Note that new DAQ reader leads to UTime = 0, or tm_year=70 (1970) //but new DAQ reader only gets used for 2009+ anyhow - unsigned int UTime = er->getEventInfo().UnixTime; - struct tm *time=gmtime((time_t*) &UTime); + std::time_t utime = er->getEventInfo().UnixTime; + std::tm *time = gmtime(&utime); flipBBCBkg = (time->tm_year > 95 && time->tm_year < 109 ? 1 : 0) ; // LDate = (((1900+time->tm_year)*100 + 1 + time->tm_mon)*100 + time->tm_mday)*100; diff --git a/StRoot/StDaqLib/SSD/SSD_Reader.cxx b/StRoot/StDaqLib/SSD/SSD_Reader.cxx index 5e4bd5a3c88..2db2251b6b7 100644 --- a/StRoot/StDaqLib/SSD/SSD_Reader.cxx +++ b/StRoot/StDaqLib/SSD/SSD_Reader.cxx @@ -3,6 +3,7 @@ #include #include +#include static unsigned short log8to10_table[256] = { 0, 1, 2, 3, 4, 5, 6, 7, @@ -118,8 +119,8 @@ SSD_Reader::SSD_Reader(EventReader *er) { datap=er->getDATAP(); if (datap) { - unsigned int UTime = er->getEventInfo().UnixTime; - struct tm *time=gmtime((time_t*) &UTime); + std::time_t utime = er->getEventInfo().UnixTime; + std::tm *time = gmtime(&utime); //LDate = (((1900+time->tm_year)*100 + 1 + time->tm_mon)*100 + time->tm_mday)*100; //LDate = yyyymmdd diff --git a/StRoot/StEEmcUtil/EEfeeRaw/RootWrapper.cxx b/StRoot/StEEmcUtil/EEfeeRaw/RootWrapper.cxx index 718eecc6594..40185c99d8f 100644 --- a/StRoot/StEEmcUtil/EEfeeRaw/RootWrapper.cxx +++ b/StRoot/StEEmcUtil/EEfeeRaw/RootWrapper.cxx @@ -1,5 +1,6 @@ #include #include +#include #include "TROOT.h" #include "TFile.h" @@ -57,7 +58,8 @@ eemcfeerootopen_(long& run, long& runtime, char *chfile, int &nAuto, int len) char *idt = strchr(basefile,'.'); *idt = 0x00; // locate first dot } sprintf(filename,"%s/%s.ez.root",rootdir,basefile); - sprintf(comment,"run:%05ld, time:%s ",run,ctime((time_t *)&runtime)); + std::time_t utime = runtime; + sprintf(comment,"run:%05ld, time:%s ",run,ctime(&utime)); file = new TFile(filename,"RECREATE"); tree = new TTree("ezstar","A tree with FEE events"); diff --git a/StRoot/St_trg_Maker/year2003.cxx b/StRoot/St_trg_Maker/year2003.cxx index d80fb30a13d..f57df7ebaeb 100644 --- a/StRoot/St_trg_Maker/year2003.cxx +++ b/StRoot/St_trg_Maker/year2003.cxx @@ -101,8 +101,8 @@ void St_trg_Maker::Emc2003(St_dst_TrgDet *dst1) { //pp_dsm_to_patch[7] for after 01-Dec-2001, AA_dsm_to_patch[5] for before that date EventReader *er=fVictorPrelim->getEventReader(); EventInfo info=er->getEventInfo(); - unsigned int UnixTime=info.UnixTime; - struct tm *time=gmtime((time_t*) &UnixTime); + std::time_t utime = info.UnixTime; + std::tm *time = gmtime(&utime); int year=1900+time->tm_year; int month=1+time->tm_mon; int day=time->tm_mday; diff --git a/StRoot/StarRoot/TUnixTime.cxx b/StRoot/StarRoot/TUnixTime.cxx index 64b1e4c892a..395282dfa19 100644 --- a/StRoot/StarRoot/TUnixTime.cxx +++ b/StRoot/StarRoot/TUnixTime.cxx @@ -8,9 +8,9 @@ * *************************************************************************** **************************************************************************/ +#include #include #include -#include #include #include "TUnixTime.h" #include "TDatime.h" @@ -111,30 +111,29 @@ void TUnixTime::SetLTime(Int_t idate, Int_t itime) //______________________________________________________________________________ void TUnixTime::GetGTime(Int_t &idate, Int_t &itime) { - struct tm gt; - gt = *gmtime((time_t*)&fUTime); - tm2DateTime(idate,itime,>); + std::time_t utime = fUTime; + std::tm *gt = gmtime(&utime); + tm2DateTime(idate, itime, gt); } //______________________________________________________________________________ void TUnixTime::GetLTime(Int_t &idate, Int_t &itime) { - struct tm gt; - gt = *localtime((time_t*)&fUTime); - tm2DateTime(idate,itime,>); - + std::time_t utime = fUTime; + std::tm *gt = localtime(&utime); + tm2DateTime(idate, itime, gt); } //______________________________________________________________________________ TString TUnixTime::GetLString() { - TString ts(ctime((time_t*)&fUTime)); - return ts; + std::time_t utime = fUTime; + return TString(ctime(&utime)); } //______________________________________________________________________________ TString TUnixTime::GetGString() { - TString ts(asctime(gmtime((time_t*)&fUTime))); - return ts; + std::time_t utime = fUTime; + return TString(asctime(gmtime(&utime))); } //______________________________________________________________________________ void TUnixTime::SetLTime(const TDatime &loc)